Commit c9631120 authored by danakj's avatar danakj Committed by Commit bot

ui: Make the aura_demo not have solid colors in its layers.

This forces the compositor to use textures and allows us to verify the
texture upload path is working, instead of just testing solid color
layers work.

R=sadrul

Review URL: https://codereview.chromium.org/963303003

Cr-Commit-Position: refs/heads/master@{#318802}
parent d4f6a0b4
......@@ -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 {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment