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

Unified Diff: ui/aura/demo/demo_main.cc

Issue 963303003: ui: Make the aura_demo not have solid colors in its layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/demo/demo_main.cc
diff --git a/ui/aura/demo/demo_main.cc b/ui/aura/demo/demo_main.cc
index c589824926056ec3f51bbf5da2ae9f75e53ec082..927d9eca9621d67485a09c81685158a70a2e5fa8 100644
--- a/ui/aura/demo/demo_main.cc
+++ b/ui/aura/demo/demo_main.cc
@@ -23,6 +23,7 @@
#include "ui/events/event.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/skia_util.h"
#include "ui/gl/gl_surface.h"
#if defined(USE_X11)
@@ -63,6 +64,12 @@ class DemoWindowDelegate : public aura::WindowDelegate {
void OnCaptureLost() override {}
void OnPaint(gfx::Canvas* canvas) override {
canvas->DrawColor(color_, SkXfermode::kSrc_Mode);
+ gfx::Rect r;
+ canvas->GetClipBounds(&r);
+ while (!r.IsEmpty()) {
sky 2015/02/28 17:32:16 This is worth a comment. Also, might the region be
danakj 2015/03/02 20:12:03 The demo just has 3 fixed layers, none of them is
+ r.Inset(2, 2);
+ canvas->FillRect(r, color_, SkXfermode::kXor_Mode);
+ }
}
void OnDeviceScaleFactorChanged(float device_scale_factor) override {}
void OnWindowDestroying(aura::Window* window) override {}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698