Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3109)

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 1918593002: cc : Stop pushing properties not used by LayerImpl to LayerImpl (3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common.cc
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 5c3ef1d19f779f4421c6cbf3e45111098ec5b9df..d443abcafc29c1e85316aca2fd7c39c55c77c2af 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -199,12 +199,16 @@ static inline bool IsRootLayer(const Layer* layer) {
return !layer->parent();
}
-template <typename LayerType>
-static bool HasInvertibleOrAnimatedTransform(LayerType* layer) {
+static bool HasInvertibleOrAnimatedTransform(Layer* layer) {
return layer->transform_is_invertible() ||
layer->HasPotentiallyRunningTransformAnimation();
}
+static bool HasInvertibleOrAnimatedTransformForTesting(LayerImpl* layer) {
+ return layer->transform().IsInvertible() ||
+ layer->HasPotentiallyRunningTransformAnimation();
+}
+
static inline void MarkLayerWithRenderSurfaceLayerListId(
LayerImpl* layer,
int current_render_surface_layer_list_id) {
@@ -325,7 +329,7 @@ static void PreCalculateMetaInformationInternalForTesting(
if (layer->clip_parent())
recursive_data->num_unclipped_descendants++;
- if (!HasInvertibleOrAnimatedTransform(layer)) {
+ if (!HasInvertibleOrAnimatedTransformForTesting(layer)) {
// Layers with singular transforms should not be drawn, the whole subtree
// can be skipped.
return;
@@ -357,8 +361,8 @@ static void PreCalculateMetaInformationInternalForTesting(
(recursive_data->num_layer_or_descendants_with_touch_handler != 0));
// TODO(enne): this should be synced from the main thread, so is only
// for tests constructing layers on the compositor thread.
- layer->SetNumDescendantsThatDrawContent(
- recursive_data->num_descendants_that_draw_content);
+ layer->test_properties()->num_descendants_that_draw_content =
+ recursive_data->num_descendants_that_draw_content;
if (layer->DrawsContent())
recursive_data->num_descendants_that_draw_content++;
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698