Bug 129471 - [iOS][WK2] Pages with Graphics Layers cause giant tiling surfaces on zoom
Summary: [iOS][WK2] Pages with Graphics Layers cause giant tiling surfaces on zoom
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: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-27 22:57 PST by Benjamin Poulain
Modified: 2014-03-02 15:08 PST (History)
3 users (show)

See Also:


Attachments
Patch (13.69 KB, patch)
2014-02-27 23:14 PST, Benjamin Poulain
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-10 for mac-mountainlion-wk2 (465.15 KB, application/zip)
2014-02-28 00:25 PST, Build Bot
no flags Details
Patch (13.63 KB, patch)
2014-02-28 14:49 PST, Benjamin Poulain
no flags Details | Formatted Diff | Diff
Patch (13.67 KB, patch)
2014-03-01 15:29 PST, Benjamin Poulain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2014-02-27 22:57:41 PST
[iOS][WK2] Pages with Graphics Layers cause giant tiling surfaces on zoom
Comment 1 Benjamin Poulain 2014-02-27 23:14:58 PST
Created attachment 225439 [details]
Patch
Comment 2 Benjamin Poulain 2014-02-27 23:15:59 PST
Comment on attachment 225439 [details]
Patch

As simple as I could.
Comment 3 Build Bot 2014-02-28 00:25:14 PST
Comment on attachment 225439 [details]
Patch

Attachment 225439 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/6583415562305536

New failing tests:
platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles.html
Comment 4 Build Bot 2014-02-28 00:25:15 PST
Created attachment 225442 [details]
Archive of layout-test-results from webkit-ews-10 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-10  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 5 Benjamin Poulain 2014-02-28 00:26:18 PST
(In reply to comment #3)
> (From update of attachment 225439 [details])
> Attachment 225439 [details] did not pass mac-wk2-ews (mac-wk2):
> Output: http://webkit-queues.appspot.com/results/6583415562305536
> 
> New failing tests:
> platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles.html

Hum, I guess OS X needs to extends the coverage rect...odd.
Comment 6 Simon Fraser (smfr) 2014-02-28 10:15:13 PST
Comment on attachment 225439 [details]
Patch

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

Code is OK but I really want to see some comments to differentiate exposed rect from visibleContentRect. You're adding more rects; we need to document them.

> Source/WebCore/ChangeLog:18
> +        To solve this, this patch switch from the exposedRect API the generic concept

to the generic

> Source/WebCore/ChangeLog:25
> +        The case with inside frame is untested due to stability issues :(.

File a bug?

> Source/WebCore/platform/ScrollView.h:174
> +    void setVisibleExtentContentRect(const IntRect&);

This should have a comment saying that it only applies to platforms without a platform widget. Maybe it should even ASSERT that.

> Source/WebCore/platform/ios/ScrollViewIOS.mm:134
> +    IntRect rootViewExtentContentRect = rootView->visibleExtentContentRect();
> +    IntRect selfExtentContentRect = rootViewToContents(rootViewExtentContentRect);
> +    selfExtentContentRect.intersect(boundsRect());

This isn't applying the clipping from all enclosing frames, and it should I think, eventually.

> Source/WebKit2/WebProcess/WebPage/DrawingArea.h:97
> +    virtual void setVisibleExtentContentRect(const WebCore::FloatRect&) = 0;

Where is the comment saying how this differs from exposedRect()?

> Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:1649
> +    float floatBoundedScale = static_cast<float>(boundedScale);

The explicit cast doesn't seem worth it.
Comment 7 Benjamin Poulain 2014-02-28 14:49:16 PST
Created attachment 225493 [details]
Patch
Comment 8 Simon Fraser (smfr) 2014-02-28 18:07:02 PST
Comment on attachment 225493 [details]
Patch

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

> Source/WebCore/ChangeLog:3
> +        [iOS][WK2] Pages with Graphics Layers cause giant tiling surfaces on zoom

"Pages with Graphics Layer" isn't accurate. I'd say "Pages using tiled compositing layers allocate too many tiles on zoom" or something.

> Source/WebCore/platform/ScrollView.h:397
> +    // exposed rect and unobscuredRects. The two attributes should eventually be merged.

between exposed....

> Source/WebCore/platform/graphics/ca/mac/TileController.mm:504
> +    // FIXME: ViewUpdateDispatcher could do an amazing job at computing this.
> +    // In the meantime, just default to something good enough.

File a bug to track this, and reference it here.

> Source/WebCore/platform/ios/ScrollViewIOS.mm:131
> +    IntRect parentViewExtentContentRect = parent->visibleExtentContentRect();
> +    IntRect selfExtentContentRect = rootViewToContents(parentViewExtentContentRect);
> +    selfExtentContentRect.intersect(boundsRect());

Please add comment about better clipping by superviews.

> Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:1649
> +    float floatBoundedScale = boundedScale;

Why not just use the double below?
Comment 9 Benjamin Poulain 2014-03-01 15:29:54 PST
Created attachment 225572 [details]
Patch
Comment 10 Benjamin Poulain 2014-03-01 15:33:26 PST
> > Source/WebCore/platform/ios/ScrollViewIOS.mm:131
> > +    IntRect parentViewExtentContentRect = parent->visibleExtentContentRect();
> > +    IntRect selfExtentContentRect = rootViewToContents(parentViewExtentContentRect);
> > +    selfExtentContentRect.intersect(boundsRect());
> 
> Please add comment about better clipping by superviews.

Shouldn't it work now that each view query its superview?

> > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:1649
> > +    float floatBoundedScale = boundedScale;
> 
> Why not just use the double below?

I explained it in the changelog. The page's scale factor is float so all comparison double-float where failing and we where updating the scale for no good reason.
Comment 11 Benjamin Poulain 2014-03-02 15:08:13 PST
Comment on attachment 225572 [details]
Patch

Clearing flags on attachment: 225572

Committed r164952: <http://trac.webkit.org/changeset/164952>
Comment 12 Benjamin Poulain 2014-03-02 15:08:23 PST
All reviewed patches have been landed.  Closing bug.