Bug 131521 - Pipe initial scale factor to TileController
Summary: Pipe initial scale factor to TileController
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-10 18:02 PDT by Antti Koivisto
Modified: 2014-04-11 11:59 PDT (History)
10 users (show)

See Also:


Attachments
patch (12.07 KB, patch)
2014-04-10 18:10 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff
renamed to zoomedOutScale (13.18 KB, patch)
2014-04-11 11:34 PDT, Antti Koivisto
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2014-04-10 18:02:16 PDT
We need it to support caching multiple scales.
Comment 1 Antti Koivisto 2014-04-10 18:10:47 PDT
Created attachment 229097 [details]
patch
Comment 2 Simon Fraser (smfr) 2014-04-10 18:21:08 PDT
Comment on attachment 229097 [details]
patch

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

> Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:2989
> +    if (tiledBacking()) {
> +        float initialScale = (m_client ? m_client->initialPageScaleFactor() : 1) * deviceScaleFactor();
> +        tiledBacking()->setInitialContentsScale(initialScale);
> +    }

This seems like an odd way to get initial scale, and could easily have timing issues. I think we should explicitly get the initial scale from viewport-related information.
Comment 3 Antti Koivisto 2014-04-10 18:31:29 PDT
> This seems like an odd way to get initial scale, and could easily have timing issues. I think we should explicitly get the initial scale from viewport-related information.

It is done the same way as the content scale is passed and is fully analogous. Are you a suggesting we refactor that too?
Comment 4 Antti Koivisto 2014-04-10 19:11:14 PDT
What do you mean by timing issues? This is specifically done on layer commit to avoid timing issues.
Comment 5 Antti Koivisto 2014-04-11 11:34:59 PDT
Created attachment 229143 [details]
renamed to zoomedOutScale
Comment 6 Tim Horton 2014-04-11 11:42:45 PDT
Comment on attachment 229143 [details]
renamed to zoomedOutScale

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

> Source/WebCore/platform/graphics/GraphicsLayerClient.h:89
> +    virtual float zoomedOutPageScaleFactor() const { return 0; }

Would getting a zero cause trouble anywhere? (divide-by-zero, etc.)

> Source/WebCore/platform/graphics/TiledBacking.h:92
> +    virtual void setZoomedOutContentsScale(float) = 0;
> +    virtual float zoomedOutContentsScale() const = 0;

Every 'push' property we've had on TileController has caused trouble (and we have since made many 'pull' via PlatformCALayerClient), but I think this one is OK because it's called from updateContentsScale. That said, I would not be opposed to inverting it.

> Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:75
> +typedef int AVPlayerViewControllerExitFullScreenReason;

?
Comment 7 Antti Koivisto 2014-04-11 11:46:32 PDT
(In reply to comment #6)
> (From update of attachment 229143 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=229143&action=review
> 
> > Source/WebCore/platform/graphics/GraphicsLayerClient.h:89
> > +    virtual float zoomedOutPageScaleFactor() const { return 0; }
> 
> Would getting a zero cause trouble anywhere? (divide-by-zero, etc.)

The plan is to use it to mean "disabled". Might change it later.

> Every 'push' property we've had on TileController has caused trouble (and we have since made many 'pull' via PlatformCALayerClient), but I think this one is OK because it's called from updateContentsScale. That said, I would not be opposed to inverting it.

Yeah, push is right thing to do for things that go via layer commits

> > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:75
> > +typedef int AVPlayerViewControllerExitFullScreenReason;
> 
> ?

Oops, build fix.
Comment 8 Antti Koivisto 2014-04-11 11:59:07 PDT
https://trac.webkit.org/r167138