summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2014-12-16 10:26:44 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-16 18:27:10 +0000
commita29f852a1c39869236f970b2f818944ab64fc8b7 (patch)
treef4c9e4a4224f25277c68c4872ad3b918899450ca /cc
parentc0411a00aebc99400e293fd9beca14d1acb6d4af (diff)
downloadchromium_src-a29f852a1c39869236f970b2f818944ab64fc8b7.zip
chromium_src-a29f852a1c39869236f970b2f818944ab64fc8b7.tar.gz
chromium_src-a29f852a1c39869236f970b2f818944ab64fc8b7.tar.bz2
cc: Remove the PostCommitInitialization from PictureLayerImpl.
This code no longer does anything at all, except track a bool that says if we should do it. So let's remove it! BUG=387116 Review URL: https://codereview.chromium.org/807193002 Cr-Commit-Position: refs/heads/master@{#308614}
Diffstat (limited to 'cc')
-rw-r--r--cc/layers/picture_image_layer_impl_unittest.cc2
-rw-r--r--cc/layers/picture_layer_impl.cc19
-rw-r--r--cc/layers/picture_layer_impl.h7
-rw-r--r--cc/layers/picture_layer_impl_perftest.cc1
-rw-r--r--cc/layers/picture_layer_impl_unittest.cc3
-rw-r--r--cc/resources/tile_manager_perftest.cc2
-rw-r--r--cc/resources/tile_manager_unittest.cc6
-rw-r--r--cc/test/fake_picture_layer_impl.h9
-rw-r--r--cc/trees/layer_tree_host_impl_unittest.cc3
9 files changed, 0 insertions, 52 deletions
diff --git a/cc/layers/picture_image_layer_impl_unittest.cc b/cc/layers/picture_image_layer_impl_unittest.cc
index dbdcf6a..cf22855 100644
--- a/cc/layers/picture_image_layer_impl_unittest.cc
+++ b/cc/layers/picture_image_layer_impl_unittest.cc
@@ -25,7 +25,6 @@ class TestablePictureImageLayerImpl : public PictureImageLayerImpl {
: PictureImageLayerImpl(tree_impl, id, false) {}
using PictureLayerImpl::UpdateIdealScales;
using PictureLayerImpl::MaximumTilingContentsScale;
- using PictureLayerImpl::DoPostCommitInitializationIfNeeded;
PictureLayerTilingSet* tilings() { return tilings_.get(); }
@@ -93,7 +92,6 @@ class PictureImageLayerImplTest : public testing::Test {
TEST_F(PictureImageLayerImplTest, CalculateContentsScale) {
scoped_ptr<TestablePictureImageLayerImpl> layer(CreateLayer(1, PENDING_TREE));
layer->SetDrawsContent(true);
- layer->DoPostCommitInitializationIfNeeded();
gfx::Rect viewport(100, 200);
SetupDrawPropertiesAndUpdateTiles(
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index c6fdbb5..d691e27 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -80,7 +80,6 @@ PictureLayerImpl::PictureLayerImpl(LayerTreeImpl* tree_impl,
low_res_raster_contents_scale_(0.f),
raster_source_scale_is_fixed_(false),
was_screen_space_transform_animating_(false),
- needs_post_commit_initialization_(true),
should_update_tile_priorities_(false),
only_used_low_res_last_append_quads_(false),
is_mask_(is_mask),
@@ -122,9 +121,6 @@ scoped_ptr<LayerImpl> PictureLayerImpl::CreateLayerImpl(
}
void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) {
- // It's possible this layer was never drawn or updated (e.g. because it was
- // a descendant of an opacity 0 layer).
- DoPostCommitInitializationIfNeeded();
PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer);
DCHECK_EQ(layer_impl->is_mask_, is_mask_);
@@ -164,9 +160,6 @@ void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) {
layer_impl->SanityCheckTilingState();
- layer_impl->needs_post_commit_initialization_ = false;
- needs_post_commit_initialization_ = true;
-
// We always need to push properties.
// See http://crbug.com/303943
// TODO(danakj): Stop always pushing properties since we don't swap tilings.
@@ -176,7 +169,6 @@ void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) {
void PictureLayerImpl::AppendQuads(RenderPass* render_pass,
const Occlusion& occlusion_in_content_space,
AppendQuadsData* append_quads_data) {
- DCHECK(!needs_post_commit_initialization_);
// The bounds and the pile size may differ if the pile wasn't updated (ie.
// PictureLayer::Update didn't happen). In that case the pile will be empty.
DCHECK_IMPLIES(!raster_source_->GetSize().IsEmpty(),
@@ -461,8 +453,6 @@ void PictureLayerImpl::UpdateTiles(const Occlusion& occlusion_in_content_space,
DCHECK_EQ(1.f, contents_scale_x());
DCHECK_EQ(1.f, contents_scale_y());
- DoPostCommitInitializationIfNeeded();
-
if (!resourceless_software_draw) {
visible_rect_for_tile_priority_ = visible_content_rect();
}
@@ -823,13 +813,6 @@ void PictureLayerImpl::SetNearestNeighbor(bool nearest_neighbor) {
NoteLayerPropertyChanged();
}
-void PictureLayerImpl::DoPostCommitInitialization() {
- // TODO(danakj): Remove this.
- DCHECK(needs_post_commit_initialization_);
- DCHECK(layer_tree_impl()->IsPendingTree());
- needs_post_commit_initialization_ = false;
-}
-
PictureLayerTiling* PictureLayerImpl::AddTiling(float contents_scale) {
DCHECK(CanHaveTilingWithScale(contents_scale)) <<
"contents_scale: " << contents_scale;
@@ -1204,7 +1187,6 @@ void PictureLayerImpl::GetAllTilesForTracing(
}
void PictureLayerImpl::AsValueInto(base::debug::TracedValue* state) const {
- const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded();
LayerImpl::AsValueInto(state);
state->SetDouble("ideal_contents_scale", ideal_contents_scale_);
state->SetDouble("geometry_contents_scale", MaximumTilingContentsScale());
@@ -1248,7 +1230,6 @@ void PictureLayerImpl::AsValueInto(base::debug::TracedValue* state) const {
}
size_t PictureLayerImpl::GPUMemoryUsageInBytes() const {
- const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded();
return tilings_->GPUMemoryUsageInBytes();
}
diff --git a/cc/layers/picture_layer_impl.h b/cc/layers/picture_layer_impl.h
index 259feea..7ad4e7e 100644
--- a/cc/layers/picture_layer_impl.h
+++ b/cc/layers/picture_layer_impl.h
@@ -125,12 +125,6 @@ class CC_EXPORT PictureLayerImpl
gfx::Rect GetViewportForTilePriorityInContentSpace() const;
PictureLayerImpl* GetRecycledTwinLayer() const;
- void DoPostCommitInitializationIfNeeded() {
- if (needs_post_commit_initialization_)
- DoPostCommitInitialization();
- }
- void DoPostCommitInitialization();
-
bool CanHaveTilingWithScale(float contents_scale) const;
void SanityCheckTilingState() const;
// Checks if all tiles required for a certain action (e.g. activation) are
@@ -168,7 +162,6 @@ class CC_EXPORT PictureLayerImpl
bool raster_source_scale_is_fixed_;
bool was_screen_space_transform_animating_;
- bool needs_post_commit_initialization_;
// A sanity state check to make sure UpdateTilePriorities only gets called
// after a CalculateContentsScale/ManageTilings.
bool should_update_tile_priorities_;
diff --git a/cc/layers/picture_layer_impl_perftest.cc b/cc/layers/picture_layer_impl_perftest.cc
index 074467f..0614fa5 100644
--- a/cc/layers/picture_layer_impl_perftest.cc
+++ b/cc/layers/picture_layer_impl_perftest.cc
@@ -64,7 +64,6 @@ class PictureLayerImplPerfTest : public testing::Test {
pending_layer_ = static_cast<FakePictureLayerImpl*>(
host_impl_.pending_tree()->LayerById(7));
- pending_layer_->DoPostCommitInitializationIfNeeded();
}
void RunRasterQueueConstructAndIterateTest(const std::string& test_name,
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index 51392a2..1e64926 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -219,7 +219,6 @@ class PictureLayerImplTest : public testing::Test {
pending_layer_ = static_cast<FakePictureLayerImpl*>(
host_impl_.pending_tree()->LayerById(id_));
- pending_layer_->DoPostCommitInitializationIfNeeded();
// Add tilings/tiles for the layer.
host_impl_.pending_tree()->UpdateDrawProperties();
@@ -2077,7 +2076,6 @@ TEST_F(PictureLayerImplTest, ActivateUninitializedLayer) {
// to sync from the active layer.
float raster_page_scale = 10.f * pending_layer_->raster_page_scale();
pending_layer_->set_raster_page_scale(raster_page_scale);
- EXPECT_TRUE(pending_layer_->needs_post_commit_initialization());
host_impl_.ActivateSyncTree();
@@ -2086,7 +2084,6 @@ TEST_F(PictureLayerImplTest, ActivateUninitializedLayer) {
EXPECT_EQ(0u, active_layer_->num_tilings());
EXPECT_EQ(raster_page_scale, active_layer_->raster_page_scale());
- EXPECT_FALSE(active_layer_->needs_post_commit_initialization());
}
TEST_F(PictureLayerImplTest, ShareTilesOnNextFrame) {
diff --git a/cc/resources/tile_manager_perftest.cc b/cc/resources/tile_manager_perftest.cc
index fe3338a..98a4fc7 100644
--- a/cc/resources/tile_manager_perftest.cc
+++ b/cc/resources/tile_manager_perftest.cc
@@ -164,7 +164,6 @@ class TileManagerPerfTest : public testing::Test {
pending_root_layer_ = static_cast<FakePictureLayerImpl*>(
host_impl_.pending_tree()->LayerById(id_));
- pending_root_layer_->DoPostCommitInitializationIfNeeded();
}
void CreateHighLowResAndSetAllTilesVisible() {
@@ -370,7 +369,6 @@ class TileManagerPerfTest : public testing::Test {
static_cast<FakePictureLayerImpl*>(layers.back());
fake_layer->SetDrawsContent(true);
- fake_layer->DoPostCommitInitializationIfNeeded();
fake_layer->CreateDefaultTilingsAndTiles();
++next_id;
}
diff --git a/cc/resources/tile_manager_unittest.cc b/cc/resources/tile_manager_unittest.cc
index eb5d737..32d174d 100644
--- a/cc/resources/tile_manager_unittest.cc
+++ b/cc/resources/tile_manager_unittest.cc
@@ -121,7 +121,6 @@ class TileManagerTilePriorityQueueTest : public testing::Test {
pending_layer_ = static_cast<FakePictureLayerImpl*>(
host_impl_.pending_tree()->LayerById(id_));
- pending_layer_->DoPostCommitInitializationIfNeeded();
}
TileManager* tile_manager() { return host_impl_.tile_manager(); }
@@ -344,7 +343,6 @@ TEST_F(TileManagerTilePriorityQueueTest, ActivationComesBeforeEventually) {
ASSERT_TRUE(pending_child_raw);
pending_child_raw->SetDrawsContent(true);
- pending_child_raw->DoPostCommitInitializationIfNeeded();
pending_child_raw->CreateDefaultTilingsAndTiles();
ASSERT_TRUE(pending_child_raw->HighResTiling());
@@ -581,7 +579,6 @@ TEST_F(TileManagerTilePriorityQueueTest,
FakePictureLayerImpl* pending_child_layer =
static_cast<FakePictureLayerImpl*>(pending_layer_->children()[0]);
pending_child_layer->SetDrawsContent(true);
- pending_child_layer->DoPostCommitInitializationIfNeeded();
pending_child_layer->CreateDefaultTilingsAndTiles();
std::set<Tile*> all_tiles;
@@ -700,7 +697,6 @@ TEST_F(TileManagerTilePriorityQueueTest,
pending_child_layer->CreateDefaultTilingsAndTiles();
pending_child_layer->SetOpacity(0.0);
pending_child_layer->layer_tree_impl()->UpdateDrawProperties();
- pending_child_layer->DoPostCommitInitializationIfNeeded();
// Renew all of the tile priorities.
gfx::Rect viewport(layer_bounds);
@@ -804,7 +800,6 @@ TEST_F(TileManagerTilePriorityQueueTest, RasterTilePriorityQueueEmptyLayers) {
scoped_ptr<FakePictureLayerImpl> pending_layer =
FakePictureLayerImpl::Create(host_impl_.pending_tree(), id_ + i);
pending_layer->SetDrawsContent(true);
- pending_layer->DoPostCommitInitializationIfNeeded();
pending_layer->set_has_valid_tile_priorities(true);
pending_layer_->AddChild(pending_layer.Pass());
}
@@ -855,7 +850,6 @@ TEST_F(TileManagerTilePriorityQueueTest, EvictionTilePriorityQueueEmptyLayers) {
scoped_ptr<FakePictureLayerImpl> pending_layer =
FakePictureLayerImpl::Create(host_impl_.pending_tree(), id_ + i);
pending_layer->SetDrawsContent(true);
- pending_layer->DoPostCommitInitializationIfNeeded();
pending_layer->set_has_valid_tile_priorities(true);
pending_layer_->AddChild(pending_layer.Pass());
}
diff --git a/cc/test/fake_picture_layer_impl.h b/cc/test/fake_picture_layer_impl.h
index d633051..007b039 100644
--- a/cc/test/fake_picture_layer_impl.h
+++ b/cc/test/fake_picture_layer_impl.h
@@ -76,7 +76,6 @@ class FakePictureLayerImpl : public PictureLayerImpl {
using PictureLayerImpl::AddTiling;
using PictureLayerImpl::CleanUpTilingsOnActiveLayer;
using PictureLayerImpl::CanHaveTilings;
- using PictureLayerImpl::DoPostCommitInitializationIfNeeded;
using PictureLayerImpl::MinimumContentsScale;
using PictureLayerImpl::GetViewportForTilePriorityInContentSpace;
using PictureLayerImpl::SanityCheckTilingState;
@@ -86,14 +85,6 @@ class FakePictureLayerImpl : public PictureLayerImpl {
using PictureLayerImpl::UpdateIdealScales;
using PictureLayerImpl::MaximumTilingContentsScale;
- void SetNeedsPostCommitInitialization() {
- needs_post_commit_initialization_ = true;
- }
-
- bool needs_post_commit_initialization() const {
- return needs_post_commit_initialization_;
- }
-
float raster_page_scale() const { return raster_page_scale_; }
void set_raster_page_scale(float scale) { raster_page_scale_ = scale; }
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index cd39eae..b536173 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -7922,7 +7922,6 @@ TEST_F(LayerTreeHostImplTest, DidBecomeActive) {
scoped_ptr<FakePictureLayerImpl> pending_layer =
FakePictureLayerImpl::Create(pending_tree, 10);
- pending_layer->DoPostCommitInitializationIfNeeded();
FakePictureLayerImpl* raw_pending_layer = pending_layer.get();
pending_tree->SetRootLayer(pending_layer.Pass());
ASSERT_EQ(raw_pending_layer, pending_tree->root_layer());
@@ -7933,7 +7932,6 @@ TEST_F(LayerTreeHostImplTest, DidBecomeActive) {
scoped_ptr<FakePictureLayerImpl> mask_layer =
FakePictureLayerImpl::Create(pending_tree, 11);
- mask_layer->DoPostCommitInitializationIfNeeded();
FakePictureLayerImpl* raw_mask_layer = mask_layer.get();
raw_pending_layer->SetMaskLayer(mask_layer.Pass());
ASSERT_EQ(raw_mask_layer, raw_pending_layer->mask_layer());
@@ -7948,7 +7946,6 @@ TEST_F(LayerTreeHostImplTest, DidBecomeActive) {
FakePictureLayerImpl::Create(pending_tree, 12);
scoped_ptr<FakePictureLayerImpl> replica_mask_layer =
FakePictureLayerImpl::Create(pending_tree, 13);
- replica_mask_layer->DoPostCommitInitializationIfNeeded();
FakePictureLayerImpl* raw_replica_mask_layer = replica_mask_layer.get();
replica_layer->SetMaskLayer(replica_mask_layer.Pass());
raw_pending_layer->SetReplicaLayer(replica_layer.Pass());