RESOLVED FIXED 91350
[chromium] Unify compositor quad transforms into content space
https://bugs.webkit.org/show_bug.cgi?id=91350
Summary [chromium] Unify compositor quad transforms into content space
Adrienne Walker
Reported 2012-07-15 17:26:39 PDT
[chromium] Unify compositor quad transforms into content space
Attachments
Patch (13.22 KB, patch)
2012-07-15 17:42 PDT, Adrienne Walker
no flags
Patch (17.96 KB, patch)
2012-07-16 12:27 PDT, Adrienne Walker
no flags
Handle empty bounds in create quad state (17.53 KB, patch)
2012-07-16 12:55 PDT, Adrienne Walker
no flags
Adrienne Walker
Comment 1 2012-07-15 17:42:39 PDT
Adrienne Walker
Comment 2 2012-07-15 17:44:28 PDT
shawnsingh, danakj: Could one or both of y'all unofficially review this patch?
Adrienne Walker
Comment 3 2012-07-16 00:22:04 PDT
Comment on attachment 152466 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152466&action=review > Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp:160 > + if (contentBounds().isEmpty()) > + quadTransformation.scale(1 / contentsScale()); > + else { > + quadTransformation.scaleNonUniform(bounds().width() / static_cast<double>(contentBounds().width()), > + bounds().height() / static_cast<double>(contentBounds().height())); > + quadTransformation.translate(-contentBounds().width() / 2.0, -contentBounds().height() / 2.0); > + } In retrospect, I don't think this is always right, but I'm not sure how to reconcile contentsScale which is a single value and the contentBounds/bounds ratio that handles different integer rounding in width and height.
Dana Jansens
Comment 4 2012-07-16 07:57:36 PDT
Comment on attachment 152466 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152466&action=review > Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp:154 > + if (contentBounds().isEmpty()) Do we even need to return anything other than nullptr in this case?
Shawn Singh
Comment 5 2012-07-16 09:07:26 PDT
Comment on attachment 152466 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152466&action=review >> Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp:160 >> + } > > In retrospect, I don't think this is always right, but I'm not sure how to reconcile contentsScale which is a single value and the contentBounds/bounds ratio that handles different integer rounding in width and height. What's an example of a case where this isn't right? The few times I've encountered this pattern, contentsScale wasn't good enough because of ImageLayers in particular, which have different horizontal and vertical scaling. But it seemed to me like this code would handle all the cases I was aware of?
Adrienne Walker
Comment 6 2012-07-16 09:21:17 PDT
Comment on attachment 152466 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152466&action=review >> Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp:154 >> + if (contentBounds().isEmpty()) > > Do we even need to return anything other than nullptr in this case? Yeah. The gutter quads use the root layer (the real root, not the NCCH) to generate a shared quad state. Maybe we should just create that manually. >>> Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp:160 >>> + } >> >> In retrospect, I don't think this is always right, but I'm not sure how to reconcile contentsScale which is a single value and the contentBounds/bounds ratio that handles different integer rounding in width and height. > > What's an example of a case where this isn't right? The few times I've encountered this pattern, contentsScale wasn't good enough because of ImageLayers in particular, which have different horizontal and vertical scaling. But it seemed to me like this code would handle all the cases I was aware of? It may just be an issue in tests, where contentBounds is not always up to date with contentsScale. I'll take another look and see if there's something I can clean up.
Adrienne Walker
Comment 7 2012-07-16 12:27:17 PDT
Adrienne Walker
Comment 8 2012-07-16 12:55:24 PDT
Created attachment 152593 [details] Handle empty bounds in create quad state
Dana Jansens
Comment 9 2012-07-16 12:56:26 PDT
Comment on attachment 152593 [details] Handle empty bounds in create quad state lgtm!
Adrienne Walker
Comment 10 2012-07-16 15:40:11 PDT
kbr, senorblanco: Would one of you mind taking a look at this compositor patch that has an unofficial lgtm from danakj? It's just a refactoring that shouldn't cause any change in behavior. All layers other than tiled layers have bounds == contentBounds, so the extra code in createSharedQuadState generates the same quadTransform that it used to for both tiled layers and non-tiled layers.
Kenneth Russell
Comment 11 2012-07-16 15:56:07 PDT
Comment on attachment 152593 [details] Handle empty bounds in create quad state View in context: https://bugs.webkit.org/attachment.cgi?id=152593&action=review Mostly a rubber stamp, though I did look through the code. One question. Go ahead and cq+ if this isn't an issue. > Source/WebKit/chromium/tests/CCQuadCullerTest.cpp:202 > + ASSERT_EQ(quadList.size(), 12u); Will this get run in non-debug builds?
Adrienne Walker
Comment 12 2012-07-16 16:04:39 PDT
(In reply to comment #11) > (From update of attachment 152593 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=152593&action=review > > Mostly a rubber stamp, though I did look through the code. One question. Go ahead and cq+ if this isn't an issue. Thanks. :) > > Source/WebKit/chromium/tests/CCQuadCullerTest.cpp:202 > > + ASSERT_EQ(quadList.size(), 12u); > > Will this get run in non-debug builds? Yeah. ASSERT_EQ aborts the test if it doesn't pass. Since later checks reference quadList[i], if that's wrong, then those will assert. See http://code.google.com/p/googletest/wiki/Primer#Basic_Assertions
WebKit Review Bot
Comment 13 2012-07-16 16:45:50 PDT
Comment on attachment 152593 [details] Handle empty bounds in create quad state Clearing flags on attachment: 152593 Committed r122776: <http://trac.webkit.org/changeset/122776>
WebKit Review Bot
Comment 14 2012-07-16 16:45:55 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.