diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-11 04:07:20 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-11 04:07:20 +0000 |
commit | 2f0d92f42bf494a62bd41309d888348f17340b6d (patch) | |
tree | d4347382c7324f2c8e7ecff2b77349c58e50f504 /cc/test | |
parent | 1744b847111fb1ac0b27bca76b55cd823cc1a09c (diff) | |
download | chromium_src-2f0d92f42bf494a62bd41309d888348f17340b6d.zip chromium_src-2f0d92f42bf494a62bd41309d888348f17340b6d.tar.gz chromium_src-2f0d92f42bf494a62bd41309d888348f17340b6d.tar.bz2 |
cc: Don't add low res tilings during animation/pinch
R=danakj@chromium.org
BUG=247465
Review URL: https://chromiumcodereview.appspot.com/16674004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205399 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test')
-rw-r--r-- | cc/test/fake_layer_tree_host_impl.cc | 8 | ||||
-rw-r--r-- | cc/test/fake_layer_tree_host_impl.h | 2 | ||||
-rw-r--r-- | cc/test/fake_picture_layer_impl.cc | 26 | ||||
-rw-r--r-- | cc/test/fake_picture_layer_impl.h | 4 |
4 files changed, 40 insertions, 0 deletions
diff --git a/cc/test/fake_layer_tree_host_impl.cc b/cc/test/fake_layer_tree_host_impl.cc index 5755e98..cc07041 100644 --- a/cc/test/fake_layer_tree_host_impl.cc +++ b/cc/test/fake_layer_tree_host_impl.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "cc/test/fake_layer_tree_host_impl.h" +#include "cc/trees/layer_tree_impl.h" namespace cc { @@ -28,4 +29,11 @@ FakeLayerTreeHostImpl::FakeLayerTreeHostImpl( FakeLayerTreeHostImpl::~FakeLayerTreeHostImpl() {} +void FakeLayerTreeHostImpl::CreatePendingTree() { + LayerTreeHostImpl::CreatePendingTree(); + float arbitrary_large_page_scale = 100000.f; + pending_tree()->SetPageScaleFactorAndLimits( + 1.f, 1.f / arbitrary_large_page_scale, arbitrary_large_page_scale); +} + } // namespace cc diff --git a/cc/test/fake_layer_tree_host_impl.h b/cc/test/fake_layer_tree_host_impl.h index 5f8e0a4..da6ec41 100644 --- a/cc/test/fake_layer_tree_host_impl.h +++ b/cc/test/fake_layer_tree_host_impl.h @@ -24,6 +24,8 @@ class FakeLayerTreeHostImpl : public LayerTreeHostImpl { DidDrawAllLayers(frame_data); } + virtual void CreatePendingTree() OVERRIDE; + using LayerTreeHostImpl::ActivatePendingTree; private: diff --git a/cc/test/fake_picture_layer_impl.cc b/cc/test/fake_picture_layer_impl.cc index 4b30bd7..0bd16c6 100644 --- a/cc/test/fake_picture_layer_impl.cc +++ b/cc/test/fake_picture_layer_impl.cc @@ -40,4 +40,30 @@ gfx::Size FakePictureLayerImpl::CalculateTileSize(gfx::Size content_bounds) { return fixed_tile_size_; } +PictureLayerTiling* FakePictureLayerImpl::HighResTiling() const { + PictureLayerTiling* result = NULL; + for (size_t i = 0; i < tilings_->num_tilings(); ++i) { + PictureLayerTiling* tiling = tilings_->tiling_at(i); + if (tiling->resolution() == HIGH_RESOLUTION) { + // There should be only one high res tiling. + CHECK(!result); + result = tiling; + } + } + return result; +} + +PictureLayerTiling* FakePictureLayerImpl::LowResTiling() const { + PictureLayerTiling* result = NULL; + for (size_t i = 0; i < tilings_->num_tilings(); ++i) { + PictureLayerTiling* tiling = tilings_->tiling_at(i); + if (tiling->resolution() == LOW_RESOLUTION) { + // There should be only one low res tiling. + CHECK(!result); + result = tiling; + } + } + return result; +} + } // namespace cc diff --git a/cc/test/fake_picture_layer_impl.h b/cc/test/fake_picture_layer_impl.h index 37d9645..6ac1126 100644 --- a/cc/test/fake_picture_layer_impl.h +++ b/cc/test/fake_picture_layer_impl.h @@ -33,6 +33,10 @@ class FakePictureLayerImpl : public PictureLayerImpl { using PictureLayerImpl::CanHaveTilings; using PictureLayerImpl::MarkVisibleResourcesAsRequired; + PictureLayerTiling* HighResTiling() const; + PictureLayerTiling* LowResTiling() const; + size_t num_tilings() const { return tilings_->num_tilings(); } + PictureLayerImpl* twin_layer() { return twin_layer_; } PictureLayerTilingSet* tilings() { return tilings_.get(); } size_t append_quads_count() { return append_quads_count_; } |