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

Unified Diff: ui/compositor/layer_unittest.cc

Issue 2126873005: [ash-md] Doesn't recreate a rounded rect mask for overview windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [ash-md] Doesn't recreate a rounded rect mask for overview windows (rebased) Created 4 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
« no previous file with comments | « ui/compositor/layer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_unittest.cc
diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc
index 6aeaec317127af93b1b8b2cc638be8381541941b..0e65b71d0a152de39400cacc6b4e39b5e901e6aa 100644
--- a/ui/compositor/layer_unittest.cc
+++ b/ui/compositor/layer_unittest.cc
@@ -633,6 +633,28 @@ TEST_F(LayerWithRealCompositorTest, DrawTree) {
EXPECT_FALSE(d3.painted());
}
+// Tests that scheduling paint on a layer with a mask updates the mask.
+TEST_F(LayerWithRealCompositorTest, SchedulePaintUpdatesMask) {
+ std::unique_ptr<Layer> layer(
+ CreateColorLayer(SK_ColorRED, gfx::Rect(20, 20, 400, 400)));
+ std::unique_ptr<Layer> mask_layer(CreateLayer(ui::LAYER_TEXTURED));
+ mask_layer->SetBounds(gfx::Rect(layer->GetTargetBounds().size()));
+ layer->SetMaskLayer(mask_layer.get());
+
+ GetCompositor()->SetRootLayer(layer.get());
+ WaitForDraw();
+
+ DrawTreeLayerDelegate d1(layer->bounds());
+ layer->set_delegate(&d1);
+ DrawTreeLayerDelegate d2(mask_layer->bounds());
+ mask_layer->set_delegate(&d2);
+
+ layer->SchedulePaint(gfx::Rect(5, 5, 5, 5));
+ WaitForDraw();
+ EXPECT_TRUE(d1.painted());
+ EXPECT_TRUE(d2.painted());
+}
+
// Tests no-texture Layers.
// Create this hierarchy:
// L1 - red
« no previous file with comments | « ui/compositor/layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698