| Index: ui/compositor/layer.cc
|
| diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
|
| index 6f2ac6c5b6a06c625c14d91316b7f104d99d4cf6..d436259ef739df50c3f939926db82124d50d3a7f 100644
|
| --- a/ui/compositor/layer.cc
|
| +++ b/ui/compositor/layer.cc
|
| @@ -40,6 +40,10 @@
|
| namespace {
|
|
|
| const ui::Layer* GetRoot(const ui::Layer* layer) {
|
| + // Parent walk cannot be done on a layer that is being used as a mask. Get the
|
| + // layer to which this layer is a mask of.
|
| + if (layer->layer_mask_back_link())
|
| + layer = layer->layer_mask_back_link();
|
| while (layer->parent())
|
| layer = layer->parent();
|
| return layer;
|
| @@ -315,7 +319,7 @@ void Layer::SetAnimator(LayerAnimator* animator) {
|
| Compositor* compositor = GetCompositor();
|
|
|
| if (animator_) {
|
| - if (compositor)
|
| + if (compositor && !layer_mask_back_link())
|
| animator_->DetachLayerAndTimeline(compositor);
|
| animator_->SetDelegate(nullptr);
|
| }
|
| @@ -324,7 +328,7 @@ void Layer::SetAnimator(LayerAnimator* animator) {
|
|
|
| if (animator_) {
|
| animator_->SetDelegate(this);
|
| - if (compositor)
|
| + if (compositor && !layer_mask_back_link())
|
| animator_->AttachLayerAndTimeline(compositor);
|
| }
|
| }
|
| @@ -943,8 +947,9 @@ scoped_refptr<cc::DisplayItemList> Layer::PaintContentsToDisplayList(
|
| paint_region_.Clear();
|
| auto display_list = make_scoped_refptr(new cc::DisplayItemList);
|
| if (delegate_) {
|
| - delegate_->OnPaintLayer(
|
| - PaintContext(display_list.get(), device_scale_factor_, invalidation));
|
| + delegate_->OnPaintLayer(PaintContext(display_list.get(),
|
| + device_scale_factor_, invalidation,
|
| + GetCompositor()->is_pixel_canvas()));
|
| }
|
| display_list->Finalize();
|
| // TODO(domlaskowski): Move mirror invalidation to Layer::SchedulePaint.
|
|
|