Bug 55984 - [chromium] Allow "large" composited layers to have complex draw transforms
Summary: [chromium] Allow "large" composited layers to have complex draw transforms
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Vangelis Kokkevis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-08 16:58 PST by Vangelis Kokkevis
Modified: 2011-03-11 12:19 PST (History)
4 users (show)

See Also:


Attachments
Patch (2.69 KB, patch)
2011-03-08 17:17 PST, Vangelis Kokkevis
no flags Details | Formatted Diff | Diff
Patch (244.04 KB, patch)
2011-03-11 09:57 PST, Vangelis Kokkevis
jamesr: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vangelis Kokkevis 2011-03-08 16:58:30 PST
The compositor currently skips drawing "large" layers whose draw transform isn't a pure translation.  This restriction is unnecessary as long as the visible portion of the layer still fits within the max texture size.
Comment 1 Vangelis Kokkevis 2011-03-08 17:17:36 PST
Created attachment 85113 [details]
Patch
Comment 2 James Robinson 2011-03-08 17:19:51 PST
Comment on attachment 85113 [details]
Patch

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

Can we get a test for a layer that is large, has a transform, but is still renderable?

> Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp:105
> +        // If we cannot invert the layer matrix then we cannot compute how large the visible
> +        // area is. This shouldn't be an issue unless the surface of the layer is aligned
> +        // with the Z axis in which case the layer contents won't be visible anyway.
> +        if (!layerOriginTransform.isInvertible()) {

I don't quite get what the relationship is between the comment and the code - the comment seems to say that we don't care if the matrix is invertible, but the code definitely does.
Comment 3 James Robinson 2011-03-08 18:10:12 PST
Comment on attachment 85113 [details]
Patch

R- for lack of test
Comment 4 Vangelis Kokkevis 2011-03-08 18:33:28 PST
(In reply to comment #2)
> (From update of attachment 85113 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=85113&action=review
> 
> Can we get a test for a layer that is large, has a transform, but is still renderable?
> 
> > Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp:105
> > +        // If we cannot invert the layer matrix then we cannot compute how large the visible
> > +        // area is. This shouldn't be an issue unless the surface of the layer is aligned
> > +        // with the Z axis in which case the layer contents won't be visible anyway.
> > +        if (!layerOriginTransform.isInvertible()) {
> 
> I don't quite get what the relationship is between the comment and the code - the comment seems to say that we don't care if the matrix is invertible, but the code definitely does.

Need to work on the wording of the comment I guess.  What I'm trying to say is that if the transform is not invertible then we cannot figure out which parts of the layer contents are visible and therefore we have to bail.  The most common case of a non-invertible matrix in this case is if the layer is perpendicular to the "page" (or containing rendersurface) in which case it really doesn't matter if we don't render it.
Comment 5 Vangelis Kokkevis 2011-03-11 09:57:22 PST
Created attachment 85485 [details]
Patch
Comment 6 Vangelis Kokkevis 2011-03-11 09:59:07 PST
(In reply to comment #3)
> (From update of attachment 85113 [details])
> R- for lack of test

Please have another look.  I had to tweak the math for computing the visible part of the large layer as what we had previously didn't work for arbitrary transformations. Also added a layout test.
Comment 7 James Robinson 2011-03-11 10:53:48 PST
Comment on attachment 85485 [details]
Patch

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

R=me. hurray for tests finding bugs

> LayoutTests/platform/chromium/compositing/huge-layer-rotated.html:18
> +<body>

please set overflow:hidden on the <body> so it doesn't have a visible scrollbar - that way we'll be able to share pixel results across platforms.
Comment 8 Vangelis Kokkevis 2011-03-11 11:51:24 PST
Committed r80867: <http://trac.webkit.org/changeset/80867>
Comment 9 WebKit Review Bot 2011-03-11 12:19:04 PST
http://trac.webkit.org/changeset/80867 might have broken Windows Release (Build) and Windows Debug (Build)