-
Notifications
You must be signed in to change notification settings - Fork 6k
Partial revert of fractional translation changes to raster cache #35918
Conversation
|
FYI @jpnurmi , I think I messed up implementing this and your fix is right. These should all be SkIRect since we're dealing with texture size and not "pixels" anymore. This fixes the jumping on my end, if I turn my display dpr from 1.25 to 1 it becomes noticeable. Not sure exactly why this isn't apparent at higher dpr |
a3518d9 to
59578eb
Compare
59578eb to
ba5f49c
Compare
|
Unfortunately, I'm still seeing some jumps with this (as I did with the retracted round-out proposal). A lot less than with the current main, though. 35918.mp4 |
|
Raster cache keys used to include the fractions. Perhaps that should be restored to avoid drawing cached images at different fractions? diff --git a/flow/raster_cache_key.h b/flow/raster_cache_key.h
index 64292b6e89..4815cb6d7d 100644
--- a/flow/raster_cache_key.h
+++ b/flow/raster_cache_key.h
@@ -83,8 +83,8 @@ class RasterCacheKey {
RasterCacheKey(RasterCacheKeyID id, const SkMatrix& ctm)
: id_(std::move(id)), matrix_(ctm) {
- matrix_[SkMatrix::kMTransX] = 0;
- matrix_[SkMatrix::kMTransY] = 0;
+ matrix_[SkMatrix::kMTransX] = SkScalarFraction(ctm.getTranslateX());
+ matrix_[SkMatrix::kMTransY] = SkScalarFraction(ctm.getTranslateY());
}
const RasterCacheKeyID& id() const { return id_; } |
|
We can change the DCHECK, that was update for fractional translation and not ever reverted.
That would be the same as disabling the raster cache for all purposes, since a translating entry would be constantly redrawn as one scrolled. |
Maybe I'm misunderstanding you here. I could try that out. We could also use whether or not the translation results in an exact pixel boundary. That wouldn't disable caching while scrolling but might help with the 1dpr case. I think I need to keep looking at this, we should be able to fix this. |
|
@jpnurmi do you have a small example that repros that hover jump? Think I have an idea for that |
|
Pushed an update that tries to make roundOut usage smarter about how much larger the texture needs to be, and to use the logical origin for drawing/offseting the RC entry. |
e2ecbf4 to
b5a964c
Compare
b5a964c to
1bc3bf2
Compare
|
actually, maybe a simpler approach is #35930 |
|
So #35930 is probably the right approach. We need to round out the bounds so we don't end up on some weird pixel boundary. But that apparently has different results depending on exactly how we cache the children. I think we can get away with tracking the amount the top corner gets offset and adjusting later on, I just need to find another example where that still happens so I can debug it. |
|
@jonahwilliams In case this helps I put together a small example in flutter/flutter#107921. |
|
With @tgucio's example, the popup borders and icons are no longer jumping but the tooltips still are:
|
|
Is there a way to get the total matrix in |
|
Yeah that makes sense, So the changes fixes the jumping if we're rasterizing a display list, but not a layer. I think the fix is to offset the layer by the texture leading edge |
|
I'm much less concerned about the tooltips moving than I am about the picture offsets changing. Ultimately that is an old issue that this patch re-introduces, wherein we need to keep animated opacity layers in the tree to stabilize the rendering. More significant changes to work around this would likely be risky for a cherry pick, but a small change to fix the jumping and a second cherry pick to the animated opacity layer should fix both of these issues |
|
Looking at this more today, and I think the ultimately we've got some rounding out that is either happening in display_list, or skia, in a way that isn't apparent to our code. We may be able to work around this but it will take more investigation |



Revert changes to raster cache entries, which must be SkiRect to accurately represent texture size
flutter/flutter#110957