summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorajuma <ajuma@chromium.org>2016-03-24 10:42:59 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-24 17:44:36 +0000
commit81e6fd7cf6c713b4a730254db6aae0721d7b5e28 (patch)
tree74ea7b0833b47e1b7dc95a999d0d9e5955e48072 /cc
parent6bf70fab1fb0d91d082f42976c990909b6a83bdd (diff)
downloadchromium_src-81e6fd7cf6c713b4a730254db6aae0721d7b5e28.zip
chromium_src-81e6fd7cf6c713b4a730254db6aae0721d7b5e28.tar.gz
chromium_src-81e6fd7cf6c713b4a730254db6aae0721d7b5e28.tar.bz2
cc: Remove more code that was only used by CDP
This removes a draw property and some setters/getters on Layer and LayerImpl that were only used by CDP. BUG=497821 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1829053002 Cr-Commit-Position: refs/heads/master@{#383091}
Diffstat (limited to 'cc')
-rw-r--r--cc/layers/draw_properties.cc1
-rw-r--r--cc/layers/draw_properties.h6
-rw-r--r--cc/layers/layer.cc38
-rw-r--r--cc/layers/layer.h15
-rw-r--r--cc/layers/layer_impl.cc4
-rw-r--r--cc/layers/layer_impl.h11
-rw-r--r--cc/trees/layer_tree_host_common.cc12
-rw-r--r--cc/trees/layer_tree_host_common_unittest.cc111
8 files changed, 1 insertions, 197 deletions
diff --git a/cc/layers/draw_properties.cc b/cc/layers/draw_properties.cc
index 7fd380a..c87fece 100644
--- a/cc/layers/draw_properties.cc
+++ b/cc/layers/draw_properties.cc
@@ -13,7 +13,6 @@ DrawProperties::DrawProperties()
is_clipped(false),
render_target(nullptr),
num_unclipped_descendants(0),
- has_child_with_a_scroll_parent(false),
last_drawn_render_surface_layer_list_id(0),
maximum_animation_contents_scale(0.f),
starting_animation_contents_scale(0.f) {}
diff --git a/cc/layers/draw_properties.h b/cc/layers/draw_properties.h
index 0c7e479..2f3ce5d 100644
--- a/cc/layers/draw_properties.h
+++ b/cc/layers/draw_properties.h
@@ -70,12 +70,6 @@ struct CC_EXPORT DrawProperties {
// does not include our clip children because they are clipped by us.
size_t num_unclipped_descendants;
- // This is true if the layer has any direct child that has a scroll parent.
- // This layer will not be the scroll parent in this case. This information
- // lets us avoid work in CalculateDrawPropertiesInternal -- if none of our
- // children have scroll parents, we will not need to recur out of order.
- bool has_child_with_a_scroll_parent;
-
// Each time we generate a new render surface layer list, an ID is used to
// identify it. |last_drawn_render_surface_layer_list_id| is set to the ID
// that marked the render surface layer list generation which last updated
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 1bd263d..35816ee 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -87,9 +87,6 @@ Layer::Layer()
blend_mode_(SkXfermode::kSrcOver_Mode),
draw_blend_mode_(SkXfermode::kSrcOver_Mode),
scroll_parent_(nullptr),
- layer_or_descendant_is_drawn_tracker_(0),
- sorted_for_recursion_tracker_(0),
- visited_tracker_(0),
clip_parent_(nullptr),
replica_layer_(nullptr),
client_(nullptr),
@@ -1842,41 +1839,6 @@ int Layer::num_copy_requests_in_target_subtree() {
->data.num_copy_requests_in_subtree;
}
-void Layer::set_visited(bool visited) {
- visited_tracker_ =
- visited ? layer_tree_host()->meta_information_sequence_number() : 0;
-}
-
-bool Layer::visited() {
- return visited_tracker_ ==
- layer_tree_host()->meta_information_sequence_number();
-}
-
-void Layer::set_layer_or_descendant_is_drawn(
- bool layer_or_descendant_is_drawn) {
- layer_or_descendant_is_drawn_tracker_ =
- layer_or_descendant_is_drawn
- ? layer_tree_host()->meta_information_sequence_number()
- : 0;
-}
-
-bool Layer::layer_or_descendant_is_drawn() {
- return layer_or_descendant_is_drawn_tracker_ ==
- layer_tree_host()->meta_information_sequence_number();
-}
-
-void Layer::set_sorted_for_recursion(bool sorted_for_recursion) {
- sorted_for_recursion_tracker_ =
- sorted_for_recursion
- ? layer_tree_host()->meta_information_sequence_number()
- : 0;
-}
-
-bool Layer::sorted_for_recursion() {
- return sorted_for_recursion_tracker_ ==
- layer_tree_host()->meta_information_sequence_number();
-}
-
gfx::Transform Layer::draw_transform() const {
DCHECK_NE(transform_tree_index_, -1);
return draw_property_utils::DrawTransform(
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index aa0d9a9..289c963 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -505,13 +505,6 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> {
void SetMutableProperties(uint32_t properties);
uint32_t mutable_properties() const { return mutable_properties_; }
- void set_visited(bool visited);
- bool visited();
- void set_layer_or_descendant_is_drawn(bool layer_or_descendant_is_drawn);
- bool layer_or_descendant_is_drawn();
- void set_sorted_for_recursion(bool sorted_for_recursion);
- bool sorted_for_recursion();
-
// Interactions with attached animations.
gfx::ScrollOffset ScrollOffsetForAnimation() const;
void OnFilterAnimated(const FilterOperations& filters);
@@ -677,14 +670,6 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> {
Layer* scroll_parent_;
scoped_ptr<std::set<Layer*>> scroll_children_;
- // The following three variables are tracker variables. They are bools
- // wrapped inside an integer variable. If true, their value equals the
- // LayerTreeHost's meta_information_sequence_number. This wrapping of bools
- // inside ints is done to avoid a layer tree treewalk to reset their values.
- int layer_or_descendant_is_drawn_tracker_;
- int sorted_for_recursion_tracker_;
- int visited_tracker_;
-
Layer* clip_parent_;
scoped_ptr<std::set<Layer*>> clip_children_;
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 5b5f50c..dfd0364 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -91,10 +91,8 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, int id)
debug_info_(nullptr),
force_render_surface_(false),
frame_timing_requests_dirty_(false),
- visited_(false),
layer_or_descendant_is_drawn_(false),
- layer_or_descendant_has_touch_handler_(false),
- sorted_for_recursion_(false) {
+ layer_or_descendant_has_touch_handler_(false) {
DCHECK_GT(layer_id_, 0);
DCHECK(layer_tree_impl_);
diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h
index 6b6d630..492a98e 100644
--- a/cc/layers/layer_impl.h
+++ b/cc/layers/layer_impl.h
@@ -560,10 +560,6 @@ class CC_EXPORT LayerImpl {
virtual gfx::Rect GetEnclosingRectInTargetSpace() const;
- void set_visited(bool visited) { visited_ = visited; }
-
- bool visited() { return visited_; }
-
void set_layer_or_descendant_is_drawn(bool layer_or_descendant_is_drawn) {
layer_or_descendant_is_drawn_ = layer_or_descendant_is_drawn;
}
@@ -580,11 +576,6 @@ class CC_EXPORT LayerImpl {
return layer_or_descendant_has_touch_handler_;
}
- void set_sorted_for_recursion(bool sorted_for_recursion) {
- sorted_for_recursion_ = sorted_for_recursion;
- }
- bool sorted_for_recursion() { return sorted_for_recursion_; }
-
int num_copy_requests_in_target_subtree();
void UpdatePropertyTreeForScrollingAndAnimationIfNeeded();
@@ -770,11 +761,9 @@ class CC_EXPORT LayerImpl {
std::vector<FrameTimingRequest> frame_timing_requests_;
bool frame_timing_requests_dirty_;
- bool visited_;
bool layer_or_descendant_is_drawn_;
// If true, the layer or one of its descendants has a touch handler.
bool layer_or_descendant_has_touch_handler_;
- bool sorted_for_recursion_;
DISALLOW_COPY_AND_ASSIGN(LayerImpl);
};
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 143969b..01875e9 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -488,10 +488,6 @@ static void PreCalculateMetaInformationInternal(
return;
}
- layer->set_sorted_for_recursion(false);
- layer->set_layer_or_descendant_is_drawn(false);
- layer->set_visited(false);
-
if (layer->clip_parent())
recursive_data->num_unclipped_descendants++;
@@ -531,11 +527,6 @@ static void PreCalculateMetaInformationInternal(
static void PreCalculateMetaInformationInternal(
LayerImpl* layer,
PreCalculateMetaInformationRecursiveData* recursive_data) {
- layer->set_sorted_for_recursion(false);
- layer->draw_properties().has_child_with_a_scroll_parent = false;
- layer->set_layer_or_descendant_is_drawn(false);
- layer->set_visited(false);
-
if (layer->clip_parent())
recursive_data->num_unclipped_descendants++;
@@ -550,9 +541,6 @@ static void PreCalculateMetaInformationInternal(
PreCalculateMetaInformationRecursiveData data_for_child;
PreCalculateMetaInformationInternal(child_layer, &data_for_child);
-
- if (child_layer->scroll_parent())
- layer->draw_properties().has_child_with_a_scroll_parent = true;
recursive_data->Merge(data_for_child);
}
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index 25bafb0..29dec1e 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -3602,79 +3602,6 @@ TEST_F(LayerTreeHostCommonTest,
}
TEST_F(LayerTreeHostCommonTest,
- SingularTransformDoesNotPreventClearingDrawProperties) {
- scoped_refptr<Layer> root = Layer::Create();
- scoped_refptr<LayerWithForcedDrawsContent> child =
- make_scoped_refptr(new LayerWithForcedDrawsContent());
- root->AddChild(child);
-
- host()->SetRootLayer(root);
-
- gfx::Transform identity_matrix;
- gfx::Transform uninvertible_matrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
- ASSERT_FALSE(uninvertible_matrix.IsInvertible());
-
- SetLayerPropertiesForTesting(root.get(),
- uninvertible_matrix,
- gfx::Point3F(),
- gfx::PointF(),
- gfx::Size(100, 100),
- true,
- false);
- SetLayerPropertiesForTesting(child.get(),
- identity_matrix,
- gfx::Point3F(),
- gfx::PointF(5.f, 5.f),
- gfx::Size(50, 50),
- true,
- false);
-
- child->set_sorted_for_recursion(true);
-
- TransformOperations start_transform_operations;
- start_transform_operations.AppendScale(1.f, 0.f, 0.f);
-
- TransformOperations end_transform_operations;
- end_transform_operations.AppendScale(1.f, 1.f, 0.f);
-
- AddAnimatedTransformToLayerWithPlayer(root->id(), timeline(), 10.0,
- start_transform_operations,
- end_transform_operations);
- EXPECT_TRUE(root->TransformIsAnimating());
-
- ExecuteCalculateDrawProperties(root.get());
-
- EXPECT_FALSE(child->sorted_for_recursion());
-}
-
-TEST_F(LayerTreeHostCommonTest,
- SingularNonAnimatingTransformDoesNotPreventClearingDrawProperties) {
- scoped_refptr<Layer> root = Layer::Create();
-
- host()->SetRootLayer(root);
-
- gfx::Transform identity_matrix;
- gfx::Transform uninvertible_matrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
- ASSERT_FALSE(uninvertible_matrix.IsInvertible());
-
- SetLayerPropertiesForTesting(root.get(),
- uninvertible_matrix,
- gfx::Point3F(),
- gfx::PointF(),
- gfx::Size(100, 100),
- true,
- false);
-
- root->set_sorted_for_recursion(true);
-
- EXPECT_FALSE(root->TransformIsAnimating());
-
- ExecuteCalculateDrawProperties(root.get());
-
- EXPECT_FALSE(root->sorted_for_recursion());
-}
-
-TEST_F(LayerTreeHostCommonTest,
DrawableAndVisibleContentRectsForLayersInClippedRenderSurface) {
LayerImpl* root = root_layer();
LayerImpl* render_surface = AddChildToRoot<LayerImpl>();
@@ -9093,44 +9020,6 @@ TEST_F(LayerTreeHostCommonTest, ResetPropertyTreeIndices) {
EXPECT_EQ(-1, child->transform_tree_index());
}
-TEST_F(LayerTreeHostCommonTest, ResetLayerDrawPropertiestest) {
- scoped_refptr<Layer> root = Layer::Create();
- scoped_refptr<Layer> child = Layer::Create();
-
- root->AddChild(child);
- gfx::Transform identity;
-
- SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(),
- gfx::PointF(), gfx::Size(100, 100), true, false);
- SetLayerPropertiesForTesting(child.get(), identity, gfx::Point3F(),
- gfx::PointF(), gfx::Size(100, 100), true, false);
-
- host()->SetRootLayer(root);
-
- EXPECT_FALSE(root->layer_or_descendant_is_drawn());
- EXPECT_FALSE(root->visited());
- EXPECT_FALSE(root->sorted_for_recursion());
- EXPECT_FALSE(child->layer_or_descendant_is_drawn());
- EXPECT_FALSE(child->visited());
- EXPECT_FALSE(child->sorted_for_recursion());
-
- root->set_layer_or_descendant_is_drawn(true);
- root->set_visited(true);
- root->set_sorted_for_recursion(true);
- child->set_layer_or_descendant_is_drawn(true);
- child->set_visited(true);
- child->set_sorted_for_recursion(true);
-
- LayerTreeHostCommon::PreCalculateMetaInformationForTesting(root.get());
-
- EXPECT_FALSE(root->layer_or_descendant_is_drawn());
- EXPECT_FALSE(root->visited());
- EXPECT_FALSE(root->sorted_for_recursion());
- EXPECT_FALSE(child->layer_or_descendant_is_drawn());
- EXPECT_FALSE(child->visited());
- EXPECT_FALSE(child->sorted_for_recursion());
-}
-
TEST_F(LayerTreeHostCommonTest, RenderSurfaceClipsSubtree) {
// Ensure that a Clip Node is added when a render surface applies clip.
LayerImpl* root = root_layer();