Bug 82370 - [chromium] Unknown transforms should be treated as non-axis aligned on main thread
Summary: [chromium] Unknown transforms should be treated as non-axis aligned on main t...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dana Jansens
URL:
Keywords:
Depends on: 82357
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-27 12:15 PDT by Dana Jansens
Modified: 2012-03-27 16:49 PDT (History)
8 users (show)

See Also:


Attachments
Patch (11.77 KB, patch)
2012-03-27 12:39 PDT, Dana Jansens
no flags Details | Formatted Diff | Diff
Patch (10.86 KB, patch)
2012-03-27 15:56 PDT, Dana Jansens
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dana Jansens 2012-03-27 12:15:35 PDT
[chromium] Unknown transforms should be treated as non-axis aligned on main thread
Comment 1 Dana Jansens 2012-03-27 12:39:32 PDT
Created attachment 134117 [details]
Patch
Comment 2 Shawn Singh 2012-03-27 14:20:30 PDT
(1) Does this patch mean that the renderSurfaceLayerList that is computed by the main thread would actually be different than the renderSurfaceLayerList computed by the impl thread?

(2) Until now, we were essentially guaranteed that both sides would execute calcDrawTransforms essentially in the same way, right?

At a glance I think its an unavoidable side-effect without massive impractical redesign, but I just wanted to ask, because it feels like a slippery slope.
Comment 3 Dana Jansens 2012-03-27 14:26:12 PDT
(In reply to comment #2)
> (1) Does this patch mean that the renderSurfaceLayerList that is computed by the main thread would actually be different than the renderSurfaceLayerList computed by the impl thread?

Yes, accelerated animations + threaded compositor = the two sides differ in what they know about the world with certainty.

> (2) Until now, we were essentially guaranteed that both sides would execute calcDrawTransforms essentially in the same way, right?
> 
> At a glance I think its an unavoidable side-effect without massive impractical redesign, but I just wanted to ask, because it feels like a slippery slope.

Yeh, they are slightly different, with the different cases well displayed in the various bool functions near the top. I think it's totally okay for main side to have more surfaces in its view of the world than impl. It shouldn't miss any that impl has though. From perspective of me looking at my screen, more render surfaces along the way won't have any impact, which is what this relies on.
Comment 4 Adrienne Walker 2012-03-27 15:47:38 PDT
Comment on attachment 134117 [details]
Patch

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

Can you explain why the test changes are needed?

> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:142
> +static inline bool transformToParentIsKnown(CCLayerImpl* layer, bool animatingTransformToParent)

style nit: unused variables.

> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:149
> +    return !animatingTransformToParent;

I don't understand why this function needs to take animatingTransformToParent.  Isn't this just "return !layer->transformIsAnimating();"?
Comment 5 Dana Jansens 2012-03-27 15:54:14 PDT
Comment on attachment 134117 [details]
Patch

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

>> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:142
>> +static inline bool transformToParentIsKnown(CCLayerImpl* layer, bool animatingTransformToParent)
> 
> style nit: unused variables.

oh thanks.

>> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:149
>> +    return !animatingTransformToParent;
> 
> I don't understand why this function needs to take animatingTransformToParent.  Isn't this just "return !layer->transformIsAnimating();"?

true! I'll remove the animatingTransformToParent entirely.

> Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp:-690
> -    addAnimatedTransformToController(*childOfRoot->layerAnimationController(), 10, 30, 0);

Since this isn't supposed to be a rendersurface i took the animated transform off of it.

> Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp:689
>      addAnimatedTransformToController(*renderSurface2->layerAnimationController(), 10, 30, 0);

This verifies that an animated transform (instead of animated opacity) does make it into a rendersurface now.

> Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp:745
> -    EXPECT_TRUE(renderSurface2->renderSurface()->drawOpacityIsAnimating());
> +    EXPECT_FALSE(renderSurface2->renderSurface()->drawOpacityIsAnimating());

This animates a transform now instead of opacity.

> Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp:752
> +    EXPECT_FALSE(childOfRoot->drawTransformIsAnimating());

No longer animating to prevent it from making a surface. This was testing that drawTransforms propagate to children, which is also tested by childOfRS2.

> Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp:766
> +    EXPECT_FALSE(childOfRoot->screenSpaceTransformIsAnimating());

No longer animating to prevent it from making a surface. This was testing that drawTransforms propagate to children, which is also tested by childOfRS2.
Comment 6 Dana Jansens 2012-03-27 15:56:54 PDT
Created attachment 134155 [details]
Patch
Comment 7 Adrienne Walker 2012-03-27 16:06:45 PDT
Comment on attachment 134155 [details]
Patch

Ah, thanks for the explanation.  R=me.
Comment 8 WebKit Review Bot 2012-03-27 16:49:21 PDT
Comment on attachment 134155 [details]
Patch

Clearing flags on attachment: 134155

Committed r112332: <http://trac.webkit.org/changeset/112332>
Comment 9 WebKit Review Bot 2012-03-27 16:49:25 PDT
All reviewed patches have been landed.  Closing bug.