Bug 156860 - Subpixel rendering: Cleanup RenderLayerBacking::updateGeometry.
Summary: Subpixel rendering: Cleanup RenderLayerBacking::updateGeometry.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-04-21 12:48 PDT by zalan
Modified: 2016-08-16 20:20 PDT (History)
6 users (show)

See Also:


Attachments
WIP patch (42.15 KB, patch)
2016-04-21 13:13 PDT, zalan
no flags Details | Formatted Diff | Diff
WIP (42.09 KB, patch)
2016-05-27 13:31 PDT, zalan
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews121 for ios-simulator-wk2 (650.84 KB, application/zip)
2016-05-27 14:27 PDT, Build Bot
no flags Details
Patch (51.21 KB, patch)
2016-08-04 19:44 PDT, zalan
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews126 for ios-simulator-wk2 (702.61 KB, application/zip)
2016-08-04 20:42 PDT, Build Bot
no flags Details
UpdateGeometry layers (1.26 MB, image/jpeg)
2016-08-05 21:09 PDT, zalan
no flags Details
Patch (51.46 KB, patch)
2016-08-07 18:58 PDT, zalan
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews125 for ios-simulator-wk2 (696.29 KB, application/zip)
2016-08-07 19:55 PDT, Build Bot
no flags Details
Patch (51.63 KB, patch)
2016-08-08 21:04 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (74.44 KB, patch)
2016-08-16 11:03 PDT, zalan
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews122 for ios-simulator-elcapitan-wk2 (702.63 KB, application/zip)
2016-08-16 13:21 PDT, Build Bot
no flags Details
Patch (75.47 KB, patch)
2016-08-16 15:11 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (75.54 KB, patch)
2016-08-16 15:31 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (75.61 KB, patch)
2016-08-16 16:18 PDT, zalan
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews122 for ios-simulator-elcapitan-wk2 (703.68 KB, application/zip)
2016-08-16 18:55 PDT, Build Bot
no flags Details
Patch (75.61 KB, patch)
2016-08-16 19:09 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2016-04-21 12:48:37 PDT
nested/clipped/containment/masks etc.
Comment 1 zalan 2016-04-21 13:13:31 PDT
Created attachment 276946 [details]
WIP patch
Comment 2 zalan 2016-05-27 13:31:12 PDT
Created attachment 279987 [details]
WIP

rebaselined
Comment 3 Build Bot 2016-05-27 14:27:10 PDT
Comment on attachment 279987 [details]
WIP

Attachment 279987 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1393148

New failing tests:
fast/scrolling/ios/overflow-scrolling-ancestor-clip.html
fast/scrolling/ios/overflow-scrolling-ancestor-clip-size.html
Comment 4 Build Bot 2016-05-27 14:27:13 PDT
Created attachment 279993 [details]
Archive of layout-test-results from ews121 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews121  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.4
Comment 5 zalan 2016-08-04 19:44:57 PDT
Created attachment 285395 [details]
Patch
Comment 6 Build Bot 2016-08-04 20:42:38 PDT
Comment on attachment 285395 [details]
Patch

Attachment 285395 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1814735

New failing tests:
fast/scrolling/ios/overflow-scrolling-ancestor-clip.html
fast/scrolling/ios/overflow-scrolling-ancestor-clip-size.html
Comment 7 Build Bot 2016-08-04 20:42:41 PDT
Created attachment 285398 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.5
Comment 8 zalan 2016-08-05 21:09:16 PDT
Created attachment 285478 [details]
UpdateGeometry layers
Comment 9 zalan 2016-08-07 18:58:07 PDT
Created attachment 285553 [details]
Patch
Comment 10 Build Bot 2016-08-07 19:55:33 PDT
Comment on attachment 285553 [details]
Patch

Attachment 285553 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1832013

New failing tests:
fast/scrolling/ios/overflow-scrolling-ancestor-clip.html
fast/scrolling/ios/overflow-scrolling-ancestor-clip-size.html
Comment 11 Build Bot 2016-08-07 19:55:35 PDT
Created attachment 285555 [details]
Archive of layout-test-results from ews125 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews125  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.5
Comment 12 zalan 2016-08-08 21:04:08 PDT
Created attachment 285629 [details]
Patch
Comment 13 zalan 2016-08-08 21:05:29 PDT
RenderLayerBacking::computeParentGraphicsLayerRect() should drop ancestorClippingLayerOffset somehow.
Comment 14 zalan 2016-08-16 11:03:00 PDT
Created attachment 286186 [details]
Patch
Comment 15 Build Bot 2016-08-16 13:21:05 PDT
Comment on attachment 286186 [details]
Patch

Attachment 286186 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1882656

New failing tests:
fast/scrolling/ios/subpixel-overflow-scrolling-with-ancestor.html
Comment 16 Build Bot 2016-08-16 13:21:09 PDT
Created attachment 286197 [details]
Archive of layout-test-results from ews122 for ios-simulator-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-elcapitan-wk2  Platform: Mac OS X 10.11.5
Comment 17 zalan 2016-08-16 15:11:29 PDT
Created attachment 286212 [details]
Patch
Comment 18 zalan 2016-08-16 15:23:17 PDT
rdar://problem/25432352
Comment 19 zalan 2016-08-16 15:31:46 PDT
Created attachment 286216 [details]
Patch
Comment 20 Simon Fraser (smfr) 2016-08-16 15:40:52 PDT
Comment on attachment 286216 [details]
Patch

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

> Source/WebCore/ChangeLog:11
> +        It also subpixel jiggling with clipping layers (both ancestor and child containment layers). 

it also fixes?

> Source/WebCore/rendering/RenderLayerBacking.cpp:719
> +    LayoutSize m_subpixelOffset;
> +    LayoutSize m_devicePixelOffset;

I think logically I would put m_devicePixelOffset first, so the ordering matches SnappedRectInfo

> Source/WebCore/rendering/RenderLayerBacking.cpp:750
> +    LayoutSize ancestorRenderLayerOffsetFromAncestorGraphicsLayer = -(LayoutSize(compositedAncestor->backing()->graphicsLayer()->offsetFromRenderer())
> +        + compositedAncestor->backing()->subpixelOffsetFromRenderer());

Maybe RLB should expose a function that returns offsetFromRenderer() + subpixelOffsetFromRenderer()

> Source/WebCore/rendering/RenderLayerBacking.cpp:768
> +        if (!m_fromParentGraphicsLayer)
> +            m_fromParentGraphicsLayer = fromAncestorGraphicsLayer() - m_parentGraphicsLayerOffset;
> +        return m_fromParentGraphicsLayer.value();

Isn't there some Optional magic that allows you to do this on one line?

> Source/WebCore/rendering/RenderLayerBacking.cpp:782
> +            RenderLayer* compositedAncestor = m_renderLayer.ancestorCompositingLayer();

ancestorCompositingLayer() is an ancestor layer walk so I'm surprised we call it so much.

> Source/WebCore/rendering/RenderLayerBacking.cpp:809
> +    RenderLayer* compositedAncestor = m_owningLayer.ancestorCompositingLayer();

like here

> Source/WebCore/rendering/RenderLayerBacking.cpp:826
> +        LayoutSize clippingBoxOffset = computeOffsetFromAncestorGraphicsLayer(m_owningLayer.ancestorCompositingLayer(), clippingBox.location());

and here

> Source/WebCore/rendering/RenderLayerBacking.cpp:835
> +        LayoutRect paddingBox(renderBox.borderLeft(), renderBox.borderTop(),
> +            renderBox.width() - renderBox.borderLeft() - renderBox.borderRight(),
> +            renderBox.height() - renderBox.borderTop() - renderBox.borderBottom());

Seems like this should be a function on RenderBox

> Source/WebCore/rendering/RenderLayerBacking.cpp:919
> +    // Compute renderer offset from graphics layer. Note that primaryGraphicsLayerRect is in parentGraphicsLayer coordidate system which is not necessarily

which GraphicsLayer?
parentGraphicsLayer's coordinate system

> Source/WebCore/rendering/RenderLayerBacking.cpp:1108
> +    RenderLayer* compositedAncestor = m_owningLayer.ancestorCompositingLayer();

and here
Comment 21 zalan 2016-08-16 16:18:19 PDT
Created attachment 286229 [details]
Patch
Comment 22 zalan 2016-08-16 16:21:45 PDT
(In reply to comment #20)
> Comment on attachment 286216 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=286216&action=review
> 
> > Source/WebCore/ChangeLog:11
> > +        It also subpixel jiggling with clipping layers (both ancestor and child containment layers). 
> 
> it also fixes?
Fixed.

> 
> > Source/WebCore/rendering/RenderLayerBacking.cpp:719
> > +    LayoutSize m_subpixelOffset;
> > +    LayoutSize m_devicePixelOffset;
> 
> I think logically I would put m_devicePixelOffset first, so the ordering
> matches SnappedRectInfo
Fixed.

> 
> > Source/WebCore/rendering/RenderLayerBacking.cpp:750
> > +    LayoutSize ancestorRenderLayerOffsetFromAncestorGraphicsLayer = -(LayoutSize(compositedAncestor->backing()->graphicsLayer()->offsetFromRenderer())
> > +        + compositedAncestor->backing()->subpixelOffsetFromRenderer());
> 
> Maybe RLB should expose a function that returns offsetFromRenderer() +
> subpixelOffsetFromRenderer()
Will do in a separate patch.

> 
> > Source/WebCore/rendering/RenderLayerBacking.cpp:768
> > +        if (!m_fromParentGraphicsLayer)
> > +            m_fromParentGraphicsLayer = fromAncestorGraphicsLayer() - m_parentGraphicsLayerOffset;
> > +        return m_fromParentGraphicsLayer.value();
> 
> Isn't there some Optional magic that allows you to do this on one line?
valueOrCompute() is the closest match but it does not engage the return value.
> 
> > Source/WebCore/rendering/RenderLayerBacking.cpp:782
> > +            RenderLayer* compositedAncestor = m_renderLayer.ancestorCompositingLayer();
> 
> ancestorCompositingLayer() is an ancestor layer walk so I'm surprised we
> call it so much.
> 
> > Source/WebCore/rendering/RenderLayerBacking.cpp:809
> > +    RenderLayer* compositedAncestor = m_owningLayer.ancestorCompositingLayer();
> 
> like here
Fixed.

> 
> > Source/WebCore/rendering/RenderLayerBacking.cpp:826
> > +        LayoutSize clippingBoxOffset = computeOffsetFromAncestorGraphicsLayer(m_owningLayer.ancestorCompositingLayer(), clippingBox.location());
> 
> and here
> 
> > Source/WebCore/rendering/RenderLayerBacking.cpp:835
> > +        LayoutRect paddingBox(renderBox.borderLeft(), renderBox.borderTop(),
> > +            renderBox.width() - renderBox.borderLeft() - renderBox.borderRight(),
> > +            renderBox.height() - renderBox.borderTop() - renderBox.borderBottom());
> 
> Seems like this should be a function on RenderBox
RenderBox already has a paddingBox() function but it computes the paddings in a slightly different way. Need to figure out if it is intentional.

> 
> > Source/WebCore/rendering/RenderLayerBacking.cpp:919
> > +    // Compute renderer offset from graphics layer. Note that primaryGraphicsLayerRect is in parentGraphicsLayer coordidate system which is not necessarily
> 
> which GraphicsLayer?
> parentGraphicsLayer's coordinate system
Fixed.
Comment 23 Build Bot 2016-08-16 18:55:14 PDT
Comment on attachment 286229 [details]
Patch

Attachment 286229 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1884124

New failing tests:
fast/scrolling/ios/subpixel-overflow-scrolling-with-ancestor.html
Comment 24 Build Bot 2016-08-16 18:55:19 PDT
Created attachment 286248 [details]
Archive of layout-test-results from ews122 for ios-simulator-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-elcapitan-wk2  Platform: Mac OS X 10.11.5
Comment 25 zalan 2016-08-16 19:09:24 PDT
Created attachment 286249 [details]
Patch
Comment 26 WebKit Commit Bot 2016-08-16 20:19:57 PDT
Comment on attachment 286249 [details]
Patch

Clearing flags on attachment: 286249

Committed r204552: <http://trac.webkit.org/changeset/204552>
Comment 27 WebKit Commit Bot 2016-08-16 20:20:03 PDT
All reviewed patches have been landed.  Closing bug.