summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorhartmanng@chromium.org <hartmanng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-03 03:21:06 +0000
committerhartmanng@chromium.org <hartmanng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-03 03:21:06 +0000
commit8dbc85c99faa9fd6e520a28f57bbf683a9654bfa (patch)
tree9bd48a248ee6b0f04b19f6f33434edf9df21969a /cc
parent5029b9b20dbea36699abb71bc7968e9be6cc2c14 (diff)
downloadchromium_src-8dbc85c99faa9fd6e520a28f57bbf683a9654bfa.zip
chromium_src-8dbc85c99faa9fd6e520a28f57bbf683a9654bfa.tar.gz
chromium_src-8dbc85c99faa9fd6e520a28f57bbf683a9654bfa.tar.bz2
Properly reset dirty bits before early-out in PreCalculateMetaInformation.
We can early-out in this function if we have a non-invertible, non-animated transform. This causes us to not reset some dirty bits (in particular, |sorted_for_recursion|). Later, when sorting a layer's child list (_before_ we decide to early-out of CalculateDrawProperties), we skip out on sorting the layer due to the dirty state. This causes badness. We should reset the state and sort the list properly, including the layers that will be skipped later. R=vollick@chromium.org,ajuma@chromium.org,danakj@chromium.org BUG=366233 Review URL: https://codereview.chromium.org/267713011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268026 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/trees/layer_tree_host_common.cc6
-rw-r--r--cc/trees/layer_tree_host_common_unittest.cc28
2 files changed, 31 insertions, 3 deletions
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 655b405..ba92d8d 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -1174,6 +1174,9 @@ static void PreCalculateMetaInformation(
bool has_delegated_content = layer->HasDelegatedContent();
int num_descendants_that_draw_content = 0;
+ layer->draw_properties().sorted_for_recursion = false;
+ layer->draw_properties().has_child_with_a_scroll_parent = false;
+
if (!HasInvertibleOrAnimatedTransform(layer)) {
// Layers with singular transforms should not be drawn, the whole subtree
// can be skipped.
@@ -1188,9 +1191,6 @@ static void PreCalculateMetaInformation(
num_descendants_that_draw_content = 1000;
}
- layer->draw_properties().sorted_for_recursion = false;
- layer->draw_properties().has_child_with_a_scroll_parent = false;
-
if (layer->clip_parent())
recursive_data->num_unclipped_descendants++;
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index f4826de..a1210c4f 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -3027,6 +3027,34 @@ TEST_F(LayerTreeHostCommonTest,
}
TEST_F(LayerTreeHostCommonTest,
+ SingularNonAnimatingTransformDoesNotPreventClearingDrawProperties) {
+ scoped_refptr<Layer> root = Layer::Create();
+
+ scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::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::PointF(),
+ gfx::PointF(),
+ gfx::Size(100, 100),
+ true,
+ false);
+
+ root->draw_properties().sorted_for_recursion = true;
+
+ EXPECT_FALSE(root->TransformIsAnimating());
+
+ ExecuteCalculateDrawProperties(root.get());
+
+ EXPECT_FALSE(root->draw_properties().sorted_for_recursion);
+}
+
+TEST_F(LayerTreeHostCommonTest,
DrawableAndVisibleContentRectsForLayersInClippedRenderSurface) {
scoped_refptr<Layer> root = Layer::Create();
scoped_refptr<Layer> render_surface1 = Layer::Create();