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

Unified Diff: cc/layers/layer_impl.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_impl.h ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 0e305b30b0cc28b7cddb4d610bcc7bef3be343f9..354481c1848e501c3ff281d0f378edf4139e26bf 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -63,6 +63,7 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, int id)
draws_content_(false),
hide_layer_and_subtree_(false),
force_render_surface_(false),
+ transform_is_invertible_(true),
is_container_for_fixed_position_layers_(false),
is_3d_sorted_(false),
background_color_(0),
@@ -519,7 +520,7 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
layer->SetShouldFlattenTransform(should_flatten_transform_);
layer->SetIs3dSorted(is_3d_sorted_);
layer->SetUseParentBackfaceVisibility(use_parent_backface_visibility_);
- layer->SetTransform(transform_);
+ layer->SetTransformAndInvertibility(transform_, transform_is_invertible_);
layer->SetScrollClipLayer(scroll_clip_layer_ ? scroll_clip_layer_->id()
: Layer::INVALID_ID);
@@ -999,6 +1000,19 @@ void LayerImpl::SetTransform(const gfx::Transform& transform) {
return;
transform_ = transform;
+ transform_is_invertible_ = transform_.IsInvertible();
+ NoteLayerPropertyChangedForSubtree();
+}
+
+void LayerImpl::SetTransformAndInvertibility(const gfx::Transform& transform,
+ bool transform_is_invertible) {
+ if (transform_ == transform) {
+ DCHECK(transform_is_invertible_ == transform_is_invertible)
+ << "Can't change invertibility if transform is unchanged";
+ return;
+ }
+ transform_ = transform;
+ transform_is_invertible_ = transform_is_invertible;
NoteLayerPropertyChangedForSubtree();
}
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698