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

Unified Diff: ui/compositor/layer.cc

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Resolving comments 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 468789ae00f64bb7f64871499b96cdf62a696a50..49ff13b82d78eedd4bb51612f27e78169018eca6 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;
@@ -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