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

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: Created 6 years, 9 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
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 c1bc1a12c4dff940fccb6e5f4c4bbb2e89d79213..d16d5a734258ec661823edcaf127799c35102d3c 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -478,6 +478,10 @@ 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.
+ if (!layer->transform_is_invertible())
ajuma 2014/03/28 18:49:07 Can this early-out interact negatively with readba
avallee 2014/04/15 18:53:25 Yes, we do. The spec is all about requiring that i
ajuma 2014/04/15 19:45:10 I agree with not drawing it, but I'm worried that
avallee 2014/04/16 18:20:56 Done. Won't skip on animated transform. Fix for se
+ 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 +505,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())
ajuma 2014/03/28 18:49:07 Same questions as above about readback and animati
avallee 2014/04/15 18:53:25 See above.
+ 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)
@@ -1070,6 +1078,12 @@ static void PreCalculateMetaInformation(
bool has_delegated_content = layer->HasDelegatedContent();
int num_descendants_that_draw_content = 0;
+ if (!layer->transform_is_invertible()) {
ajuma 2014/03/28 18:49:07 Should we check if transform is animating? (e.g. S
avallee 2014/04/15 18:53:25 Yes we do.
ajuma 2014/04/15 19:45:10 We do want to skip, or we do check? (I don't see t
avallee 2014/04/16 18:20:56 Let's check for now and this will need to be chang
+ // 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.

Powered by Google App Engine
This is Rietveld 408576698