diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-16 04:52:53 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-16 04:52:53 +0000 |
commit | 344e58d0497d68437f9653fcfc3788d85f3f8450 (patch) | |
tree | 321e166fe1f3429ad8d8e5343fde1697aad88de0 /cc/test/tiled_layer_test_common.h | |
parent | 95c9d11429b11171b41e28527dc8a915949016fc (diff) | |
download | chromium_src-344e58d0497d68437f9653fcfc3788d85f3f8450.zip chromium_src-344e58d0497d68437f9653fcfc3788d85f3f8450.tar.gz chromium_src-344e58d0497d68437f9653fcfc3788d85f3f8450.tar.bz2 |
cc: Refactor content scale/bounds into draw properties
This change allows layer impls to manipulate their content scale. This will
allow PictureLayerImpl to pick some contents scale based on the scales of their
tilings, rather than being stuck at the contents scale of its PictureLayer.
This also de-virtualizes all of the content scale/bounds functions and instead
allows a layer to manipulate its draw properties in response to a bounds or
contents scale change.
BUG=155209
Review URL: https://chromiumcodereview.appspot.com/11503005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173365 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/tiled_layer_test_common.h')
-rw-r--r-- | cc/test/tiled_layer_test_common.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/cc/test/tiled_layer_test_common.h b/cc/test/tiled_layer_test_common.h index 1992824..169179a 100644 --- a/cc/test/tiled_layer_test_common.h +++ b/cc/test/tiled_layer_test_common.h @@ -99,6 +99,9 @@ public: FakeLayerUpdater* fakeLayerUpdater() { return m_fakeUpdater.get(); } gfx::RectF updateRect() { return m_updateRect; } + // Simulate calcDrawProperties. + void updateContentsScale(float idealContentsScale); + protected: virtual cc::LayerUpdater* updater() const OVERRIDE; virtual void createUpdaterIfNeeded() OVERRIDE { } @@ -114,11 +117,13 @@ class FakeTiledLayerWithScaledBounds : public FakeTiledLayer { public: explicit FakeTiledLayerWithScaledBounds(cc::PrioritizedResourceManager*); - void setContentBounds(const gfx::Size& contentBounds) { m_forcedContentBounds = contentBounds; } - virtual gfx::Size contentBounds() const OVERRIDE; - virtual float contentsScaleX() const OVERRIDE; - virtual float contentsScaleY() const OVERRIDE; - virtual void setContentsScale(float) OVERRIDE; + void setContentBounds(const gfx::Size& contentBounds); + virtual void calculateContentsScale( + float idealContentsScale, + float* contentsScaleX, + float* contentsScaleY, + gfx::Size* contentBounds) OVERRIDE; + virtual void didUpdateBounds() OVERRIDE; protected: virtual ~FakeTiledLayerWithScaledBounds(); |