RESOLVED FIXED Bug 72208
[chromium] Fix scaleDelta zoom-out visibility rect bug
https://bugs.webkit.org/show_bug.cgi?id=72208
Summary [chromium] Fix scaleDelta zoom-out visibility rect bug
Alexandre Elias
Reported 2011-11-12 00:45:00 PST
[chromium] Fix scaleDelta zoom-out visibility rect bug
Attachments
Patch (9.89 KB, patch)
2011-11-12 00:47 PST, Alexandre Elias
no flags
Patch (9.86 KB, patch)
2011-11-12 01:01 PST, Alexandre Elias
no flags
Patch (12.41 KB, patch)
2011-11-14 12:31 PST, Alexandre Elias
no flags
Patch (14.65 KB, patch)
2011-11-14 15:00 PST, Alexandre Elias
no flags
Patch (27.95 KB, patch)
2011-11-14 16:49 PST, Alexandre Elias
no flags
Alexandre Elias
Comment 1 2011-11-12 00:47:36 PST
Alexandre Elias
Comment 2 2011-11-12 01:01:59 PST
W. James MacLean
Comment 3 2011-11-14 05:13:58 PST
setDeltaScale() just seems to support a scale change, but zoomAnimatorTransform needs to support translation as well. Perhaps I'm missing something, but I don't see how that will work after this patch lands. Also, we're currently trying to test double-tap for zoom, so it's a problem if this is being disabled in the upstream repo.
Alexandre Elias
Comment 4 2011-11-14 11:05:12 PST
OK, I didn't know it required translation. From the point of view of what I'm doing, it makes the code less opaque not to have a generalized transform. By the way, zoomAnimatorTransform should already be similarly glitchy upstream due to the scrolling layer being moved down several layers (so it cannot). It does need a similar fix to what I did for pageScaleDelta.
Alexandre Elias
Comment 5 2011-11-14 12:31:34 PST
Alexandre Elias
Comment 6 2011-11-14 12:35:18 PST
OK, I added a similar fix for zoomAnimatorTransform. I kept them on different codepaths to make it easier to work separately, but zoomAnimatorTransform is now applied the same way. (Minor: I also removed the option to have a gray background when zoomAnimatorTransform is active. Now that the clip-rect is no longer buggy, we should never see the glClear color anyway, since it will draw tiles -- checkerboard if necessary -- all over the screen.)
James Robinson
Comment 7 2011-11-14 13:34:00 PST
(In reply to comment #3) > setDeltaScale() just seems to support a scale change, but zoomAnimatorTransform needs to support translation as well. Can you expand a bit on why? That seems wrong, translations should be an orthogonal concept to zoom - you typically want to change the scroll offsets when zooming but that's handled by separate code.
James Robinson
Comment 8 2011-11-14 14:51:43 PST
Comment on attachment 115006 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=115006&action=review > Source/WebCore/ChangeLog:30 > +>2011-11-14 Pavel Feldman <pfeldman@google.com> something went awry here, there's a leading > on this line > Source/WebCore/platform/graphics/chromium/LayerChromium.h:125 > + TransformationMatrix zoomAnimatorTransform() const { return TransformationMatrix(); } hmmm, so main thread layers never have a non-identify zoomAnimatorTransform? How does the test hookup work then - that used to manipulate the zoomAnimatorTransform on CCLayerTreeHost directly. > Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h:123 > + void setZoomAnimatorTransform(const TransformationMatrix&); > + const TransformationMatrix& zoomAnimatorTransform() const { return m_zoomAnimatorTransform; } can you update CCLayerImplTest for this property? > Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h:164 > + float scaleDelta() const { return m_scaleDelta; } > + void setScaleDelta(float); same here - please update CCLayerImplTest > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:199 > + // LT = Tr[origin] * M[zoomAnimator] * S[scaleDelta] * Tr[origin2anchor] the old comments grew the expression in the comment as the subsequent components were added, but this one seems to have the first three components in the comments before any modifications have taken place. I think this first comment should just be "LT = Tr[origin] * M[zoomAnimator]"
Alexandre Elias
Comment 9 2011-11-14 14:59:56 PST
Comment on attachment 115006 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=115006&action=review >> Source/WebCore/ChangeLog:30 >> +>2011-11-14 Pavel Feldman <pfeldman@google.com> > > something went awry here, there's a leading > on this line Fixed >> Source/WebCore/platform/graphics/chromium/LayerChromium.h:125 >> + TransformationMatrix zoomAnimatorTransform() const { return TransformationMatrix(); } > > hmmm, so main thread layers never have a non-identify zoomAnimatorTransform? How does the test hookup work then - that used to manipulate the zoomAnimatorTransform on CCLayerTreeHost directly. It still manipulates CCLayerTreeHost directly, and then CCLayerTreeHostImpl pushes it to the CCLayerImpl. This call is just to make the template happy. >> Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h:123 >> + const TransformationMatrix& zoomAnimatorTransform() const { return m_zoomAnimatorTransform; } > > can you update CCLayerImplTest for this property? Done >> Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h:164 >> + void setScaleDelta(float); > > same here - please update CCLayerImplTest Done >> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:199 >> + // LT = Tr[origin] * M[zoomAnimator] * S[scaleDelta] * Tr[origin2anchor] > > the old comments grew the expression in the comment as the subsequent components were added, but this one seems to have the first three components in the comments before any modifications have taken place. I think this first comment should just be "LT = Tr[origin] * M[zoomAnimator]" Fixed
Alexandre Elias
Comment 10 2011-11-14 15:00:56 PST
Alexandre Elias
Comment 11 2011-11-14 16:49:37 PST
Alexandre Elias
Comment 12 2011-11-14 16:52:01 PST
The zoom animator layout tests were causing problems, as they're covering a non-impl-thread side codepath that is never really used in practice, and the scroll layer isn't available from non-impl side. After talking it over with James, I removed the tests -- sorry about that. For testing impl-side changes, we'll have to focus more on unit tests.
James Robinson
Comment 13 2011-11-14 18:38:19 PST
Comment on attachment 115060 [details] Patch R=me.
WebKit Review Bot
Comment 14 2011-11-14 20:08:36 PST
Comment on attachment 115060 [details] Patch Clearing flags on attachment: 115060 Committed r100235: <http://trac.webkit.org/changeset/100235>
WebKit Review Bot
Comment 15 2011-11-14 20:08:41 PST
All reviewed patches have been landed. Closing bug.
W. James MacLean
Comment 16 2011-11-17 12:43:03 PST
(In reply to comment #6) > OK, I added a similar fix for zoomAnimatorTransform. I kept them on different codepaths to make it easier to work separately, but zoomAnimatorTransform is now applied the same way. > > (Minor: I also removed the option to have a gray background when zoomAnimatorTransform is active. Now that the clip-rect is no longer buggy, we should never see the glClear color anyway, since it will draw tiles -- checkerboard if necessary -- all over the screen.) Correct me if I'm wrong, but doesn't this only work if the set of tiles currently being zoomed is enough to fill the screen? For example, if we zoom out (shrink the page), there may be regions that don't have tiles, and those won't get checkerboards?
W. James MacLean
Comment 17 2011-11-17 12:45:38 PST
(In reply to comment #7) > (In reply to comment #3) > > setDeltaScale() just seems to support a scale change, but zoomAnimatorTransform needs to support translation as well. > > Can you expand a bit on why? That seems wrong, translations should be an orthogonal concept to zoom - you typically want to change the scroll offsets when zooming but that's handled by separate code. The zoom animator only redraws existing textures, so pageScale doesn't change during the animation. If I remember correctly, given the mis-match between page scale and the zoom animation, scrolling does not work correctly *during* the animation. When the final page scale is set, we use an animation-less scroll to align the content around the zoom point.
James Robinson
Comment 18 2011-11-17 12:47:18 PST
(In reply to comment #16) > (In reply to comment #6) > > OK, I added a similar fix for zoomAnimatorTransform. I kept them on different codepaths to make it easier to work separately, but zoomAnimatorTransform is now applied the same way. > > > > (Minor: I also removed the option to have a gray background when zoomAnimatorTransform is active. Now that the clip-rect is no longer buggy, we should never see the glClear color anyway, since it will draw tiles -- checkerboard if necessary -- all over the screen.) > > Correct me if I'm wrong, but doesn't this only work if the set of tiles currently being zoomed is enough to fill the screen? For example, if we zoom out (shrink the page), there may be regions that don't have tiles, and those won't get checkerboards? The entire viewport has tiles, so unless you allow the user to zoom out such that more than the viewport is visible (which you won't) this isn't an issue.
James Robinson
Comment 19 2011-11-17 12:47:46 PST
(In reply to comment #17) > (In reply to comment #7) > > (In reply to comment #3) > > > setDeltaScale() just seems to support a scale change, but zoomAnimatorTransform needs to support translation as well. > > > > Can you expand a bit on why? That seems wrong, translations should be an orthogonal concept to zoom - you typically want to change the scroll offsets when zooming but that's handled by separate code. > > The zoom animator only redraws existing textures, so pageScale doesn't change during the animation. If I remember correctly, given the mis-match between page scale and the zoom animation, scrolling does not work correctly *during* the animation. Right, that's why you need to adjust the scroll offsets when adjusting the scale during the animation.' > > When the final page scale is set, we use an animation-less scroll to align the content around the zoom point. Correct.
Alexandre Elias
Comment 20 2011-11-17 12:48:53 PST
(In reply to comment #16) > Correct me if I'm wrong, but doesn't this only work if the set of tiles currently being zoomed is enough to fill the screen? For example, if we zoom out (shrink the page), there may be regions that don't have tiles, and those won't get checkerboards? We aren't implementing checkerboards by first applying them to tiles, then painting them -- that would be wasteful of RAM as well as having the problem you mention. Checkerboarding is done by fallback "virtual" tiles that are drawn by a shader whenever no tile is available. So as long as request to draw a tile is issued for every visible area on the screen, we will fill the screen with either valid content or checkerboard.
W. James MacLean
Comment 21 2011-11-17 13:22:14 PST
(In reply to comment #20) > (In reply to comment #16) > > Correct me if I'm wrong, but doesn't this only work if the set of tiles currently being zoomed is enough to fill the screen? For example, if we zoom out (shrink the page), there may be regions that don't have tiles, and those won't get checkerboards? > > We aren't implementing checkerboards by first applying them to tiles, then painting them -- that would be wasteful of RAM as well as having the problem you mention. Checkerboarding is done by fallback "virtual" tiles that are drawn by a shader whenever no tile is available. So as long as request to draw a tile is issued for every visible area on the screen, we will fill the screen with either valid content or checkerboard. Ahh, OK. I knew it was virtual tiles, but I wasn't sure they would propagate everywhere during the zoom animation.
Note You need to log in before you can comment on or make changes to this bug.