Bug 156050 - [iOS WK2] Avoid creating tiles that are too large for rendering
Summary: [iOS WK2] Avoid creating tiles that are too large for rendering
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-30 17:54 PDT by Simon Fraser (smfr)
Modified: 2016-03-30 19:08 PDT (History)
2 users (show)

See Also:


Attachments
Patch (4.82 KB, patch)
2016-03-30 17:58 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (4.88 KB, patch)
2016-03-30 18:31 PDT, Simon Fraser (smfr)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2016-03-30 17:54:44 PDT
[iOS WK2] Avoid creating tiles that are too large for rendering
Comment 1 Simon Fraser (smfr) 2016-03-30 17:58:47 PDT
Created attachment 275247 [details]
Patch
Comment 2 Simon Fraser (smfr) 2016-03-30 18:31:19 PDT
Created attachment 275253 [details]
Patch
Comment 3 Darin Adler 2016-03-30 18:37:39 PDT
Comment on attachment 275253 [details]
Patch

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

> Source/WebCore/platform/graphics/ca/TileController.cpp:499
> +    surfaceSizeLimit.scale(1 / m_deviceScaleFactor);

Is this always going to be correct when devices have more than a single display with different device scale factors?

> Source/WebCore/platform/graphics/ca/TileController.cpp:512
> +        tileSize.setWidth(std::min(std::max<int>(ceilf(boundsWithoutMargin().width() * tileGrid().scale()), kDefaultTileSize), maxTileSize.height()));

Surprised to see maxTileSize.height() here in a line that’s about width. Wouldn’t width() be right?
Comment 4 Simon Fraser (smfr) 2016-03-30 19:00:20 PDT
(In reply to comment #3)
> Comment on attachment 275253 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=275253&action=review
> 
> > Source/WebCore/platform/graphics/ca/TileController.cpp:499
> > +    surfaceSizeLimit.scale(1 / m_deviceScaleFactor);
> 
> Is this always going to be correct when devices have more than a single
> display with different device scale factors?

Yes, this is the m_deviceScaleFactor for the window that this TileController's view is (primarily) on.

> > Source/WebCore/platform/graphics/ca/TileController.cpp:512
> > +        tileSize.setWidth(std::min(std::max<int>(ceilf(boundsWithoutMargin().width() * tileGrid().scale()), kDefaultTileSize), maxTileSize.height()));
> 
> Surprised to see maxTileSize.height() here in a line that’s about width.
> Wouldn’t width() be right?

Yes, thanks.
Comment 5 Simon Fraser (smfr) 2016-03-30 19:08:24 PDT
https://trac.webkit.org/r198875