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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 217313003: Stop displaying layers with non-invertible transforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test comment for cases 2-3. Created 6 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/layers/layer_unittest.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 4dc35522a28d6ca42ad70936f73eedb5b48ac3d8..b5db2842548b539ca867f89f327431ac3787f44e 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -478,6 +478,13 @@ static bool LayerShouldBeSkipped(LayerType* layer, bool layer_is_drawn) {
static inline bool SubtreeShouldBeSkipped(LayerImpl* layer,
bool layer_is_drawn) {
+ // If the layer transform is not invertible, it should not be drawn.
+ // TODO(ajuma): Correctly process subtrees with singular transform for the
+ // case where we may animate to a non-singular transform and wish to
+ // pre-raster.
+ if (!layer->transform_is_invertible() && !layer->TransformIsAnimating())
+ return true;
+
// When we need to do a readback/copy of a layer's output, we can not skip
// it or any of its ancestors.
if (layer->draw_properties().layer_or_descendant_has_copy_request)
@@ -501,6 +508,10 @@ static inline bool SubtreeShouldBeSkipped(LayerImpl* layer,
}
static inline bool SubtreeShouldBeSkipped(Layer* layer, bool layer_is_drawn) {
+ // If the layer transform is not invertible, it should not be drawn.
+ if (!layer->transform_is_invertible() && !layer->TransformIsAnimating())
+ return true;
+
// When we need to do a readback/copy of a layer's output, we can not skip
// it or any of its ancestors.
if (layer->draw_properties().layer_or_descendant_has_copy_request)
@@ -1165,6 +1176,12 @@ static void PreCalculateMetaInformation(
bool has_delegated_content = layer->HasDelegatedContent();
int num_descendants_that_draw_content = 0;
+ if (!layer->transform_is_invertible()) {
+ // Layers with singular transforms should not be drawn, the whole subtree
+ // can be skipped.
+ return;
+ }
+
if (has_delegated_content) {
// Layers with delegated content need to be treated as if they have as
// many children as the number of layers they own delegated quads for.
« no previous file with comments | « cc/layers/layer_unittest.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