Bug 91807

Summary: [chromium] Make all compositor screen space transforms operate on content rects
Product: WebKit Reporter: Adrienne Walker <enne>
Component: New BugsAssignee: Adrienne Walker <enne>
Status: RESOLVED FIXED    
Severity: Normal CC: cc-bugs, danakj, enne, jamesr, kbr, senorblanco, shawnsingh, vollick, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 91417    
Bug Blocks: 91815    
Attachments:
Description Flags
Patch
none
Rebased onto patch sequence
none
Rebased
none
Rebased
none
Patch for landing webkit.review.bot: commit-queue-

Description Adrienne Walker 2012-07-19 20:57:39 PDT
[chromium] Make all compositor screen space transforms operate on content rects
Comment 1 Adrienne Walker 2012-07-19 21:00:15 PDT
Created attachment 153388 [details]
Patch
Comment 2 Dana Jansens 2012-07-20 13:37:50 PDT
Comment on attachment 153388 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=153388&action=review

This LGTM!

> Source/WebCore/platform/graphics/chromium/cc/CCDebugRectHistory.cpp:77
> +        updateContentRect.scale(layer->contentBounds().width() / static_cast<float>(layer->bounds().width()), layer->contentBounds().height() / static_cast<float>(layer->bounds().height()));

want updateRect in content space again..

> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:737
> -        WebTransformationMatrix screenSpaceTransform = layer->screenSpaceTransform();
> -        // FIXME: These should be consistent.
> -        // The layer's screen space transform operates on layer rects, but the surfaces
> -        // screen space transform operates on surface rects, which are in physical pixels,
> -        // so we have to 'undo' the scale here.
> -        screenSpaceTransform.scale(1 / contentsScale);
> -        renderSurface->setScreenSpaceTransform(screenSpaceTransform);
> +        renderSurface->setScreenSpaceTransform(layer->screenSpaceTransform());

yayyy. this makes me super happy.
Comment 3 Adrienne Walker 2012-07-20 23:58:25 PDT
Created attachment 153656 [details]
Rebased onto patch sequence
Comment 4 Adrienne Walker 2012-07-21 00:23:37 PDT
Comment on attachment 153656 [details]
Rebased onto patch sequence

View in context: https://bugs.webkit.org/attachment.cgi?id=153656&action=review

> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:588
> +        nextHierarchyMatrix.scale(1 / contentsScale);

Other than test changes, this is the difference between this patch and the previous.  Without this, the duplicateChildNonOwner case in CCLayerTreeHostCommonTest.verifyRenderSurfaceTransformsInHighDPI gets a double-scaled screen space matrix.

Since originTransform (i.e. layer->drawTransform) includes a content scale, but nextHierarchyMatrix already included a content scale, then this is a double-scale and we need to undo one of them.  I think this just happened to cancel out previously because screen space transforms were dealing with layer rects.
Comment 5 Adrienne Walker 2012-07-21 18:42:57 PDT
Created attachment 153683 [details]
Rebased
Comment 6 Adrienne Walker 2012-07-21 18:44:12 PDT
I sorted it out.  The 1 / contentsScale line needed to be there because of the change to drawTransform and is now a part of the patch in bug 91417.  Everything now is explained.

This patch is now equivalent to patch 1, except for some extra test changes.
Comment 7 Dana Jansens 2012-07-23 17:28:42 PDT
Comment on attachment 153683 [details]
Rebased

View in context: https://bugs.webkit.org/attachment.cgi?id=153683&action=review

ok still lgtm (with nit similar to that other cl)

> Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp:3688
> +    EXPECT_TRANSFORMATION_MATRIX_EQ(parent->screenSpaceTransform(), expectedParentTransform);

nit: expected result should come first.
Comment 8 Adrienne Walker 2012-07-25 10:46:51 PDT
Created attachment 154392 [details]
Rebased
Comment 9 Dana Jansens 2012-07-25 11:12:17 PDT
@kbr or @senorblanco for review
Comment 10 Kenneth Russell 2012-07-25 14:08:56 PDT
Comment on attachment 154392 [details]
Rebased

rs=me based on danakj's review.
Comment 11 WebKit Review Bot 2012-07-25 16:16:17 PDT
Comment on attachment 154392 [details]
Rebased

Rejecting attachment 154392 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
CLayerTreeHostCommonTest.cpp
Hunk #1 succeeded at 2806 (offset -100 lines).
Hunk #2 succeeded at 3303 (offset -110 lines).
Hunk #3 succeeded at 3319 (offset -110 lines).
Hunk #4 succeeded at 3338 (offset -110 lines).
Hunk #5 succeeded at 3385 (offset -117 lines).
patching file Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'Kenneth Ru..." exit_code: 1 cwd: /mnt/git/webkit-commit-queue/

Full output: http://queues.webkit.org/results/13342420
Comment 12 Adrienne Walker 2012-07-25 16:47:36 PDT
Created attachment 154485 [details]
Patch for landing
Comment 13 WebKit Review Bot 2012-07-25 17:26:34 PDT
Comment on attachment 154485 [details]
Patch for landing

Rejecting attachment 154485 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 1

ERROR: /mnt/git/webkit-commit-queue/Source/WebCore/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).

Full output: http://queues.webkit.org/results/13342445
Comment 14 Adrienne Walker 2012-07-25 17:54:10 PDT
Committed r123685: <http://trac.webkit.org/changeset/123685>