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

Unified Diff: ui/compositor/layer.cc

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Fix applist_unittest and sync with ToT Created 3 years, 5 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: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 358310bf15e207a0904cc605ff688e7dd257677d..19de4da7ff7c8faa5595d986df18fecaa6c3ddd5 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);
}
}
@@ -933,8 +937,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.

Powered by Google App Engine
This is Rietveld 408576698