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

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: democolor: comment 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..e7ed3680c17ea8293161d63e8d3ce7202432afca 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,14 @@ 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);
+ // Fill with a non-solid color so that the compositor will exercise its
+ // texture upload path.
+ while (!r.IsEmpty()) {
+ 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