Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/i18n/icu_util.h" | 7 #include "base/i18n/icu_util.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/power_monitor/power_monitor.h" | 10 #include "base/power_monitor/power_monitor.h" |
| 11 #include "base/power_monitor/power_monitor_device_source.h" | 11 #include "base/power_monitor/power_monitor_device_source.h" |
| 12 #include "third_party/skia/include/core/SkXfermode.h" | 12 #include "third_party/skia/include/core/SkXfermode.h" |
| 13 #include "ui/aura/client/default_capture_client.h" | 13 #include "ui/aura/client/default_capture_client.h" |
| 14 #include "ui/aura/client/window_tree_client.h" | 14 #include "ui/aura/client/window_tree_client.h" |
| 15 #include "ui/aura/env.h" | 15 #include "ui/aura/env.h" |
| 16 #include "ui/aura/test/test_focus_client.h" | 16 #include "ui/aura/test/test_focus_client.h" |
| 17 #include "ui/aura/test/test_screen.h" | 17 #include "ui/aura/test/test_screen.h" |
| 18 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
| 19 #include "ui/aura/window_delegate.h" | 19 #include "ui/aura/window_delegate.h" |
| 20 #include "ui/aura/window_tree_host.h" | 20 #include "ui/aura/window_tree_host.h" |
| 21 #include "ui/base/hit_test.h" | 21 #include "ui/base/hit_test.h" |
| 22 #include "ui/compositor/test/in_process_context_factory.h" | 22 #include "ui/compositor/test/in_process_context_factory.h" |
| 23 #include "ui/events/event.h" | 23 #include "ui/events/event.h" |
| 24 #include "ui/gfx/canvas.h" | 24 #include "ui/gfx/canvas.h" |
| 25 #include "ui/gfx/geometry/rect.h" | 25 #include "ui/gfx/geometry/rect.h" |
| 26 #include "ui/gfx/skia_util.h" | |
| 26 #include "ui/gl/gl_surface.h" | 27 #include "ui/gl/gl_surface.h" |
| 27 | 28 |
| 28 #if defined(USE_X11) | 29 #if defined(USE_X11) |
| 29 #include "ui/gfx/x/x11_connection.h" | 30 #include "ui/gfx/x/x11_connection.h" |
| 30 #endif | 31 #endif |
| 31 | 32 |
| 32 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
| 33 #include "ui/gfx/win/dpi.h" | 34 #include "ui/gfx/win/dpi.h" |
| 34 #endif | 35 #endif |
| 35 | 36 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 56 } | 57 } |
| 57 bool ShouldDescendIntoChildForEventHandling( | 58 bool ShouldDescendIntoChildForEventHandling( |
| 58 aura::Window* child, | 59 aura::Window* child, |
| 59 const gfx::Point& location) override { | 60 const gfx::Point& location) override { |
| 60 return true; | 61 return true; |
| 61 } | 62 } |
| 62 bool CanFocus() override { return true; } | 63 bool CanFocus() override { return true; } |
| 63 void OnCaptureLost() override {} | 64 void OnCaptureLost() override {} |
| 64 void OnPaint(gfx::Canvas* canvas) override { | 65 void OnPaint(gfx::Canvas* canvas) override { |
| 65 canvas->DrawColor(color_, SkXfermode::kSrc_Mode); | 66 canvas->DrawColor(color_, SkXfermode::kSrc_Mode); |
| 67 gfx::Rect r; | |
| 68 canvas->GetClipBounds(&r); | |
| 69 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
| |
| 70 r.Inset(2, 2); | |
| 71 canvas->FillRect(r, color_, SkXfermode::kXor_Mode); | |
| 72 } | |
| 66 } | 73 } |
| 67 void OnDeviceScaleFactorChanged(float device_scale_factor) override {} | 74 void OnDeviceScaleFactorChanged(float device_scale_factor) override {} |
| 68 void OnWindowDestroying(aura::Window* window) override {} | 75 void OnWindowDestroying(aura::Window* window) override {} |
| 69 void OnWindowDestroyed(aura::Window* window) override {} | 76 void OnWindowDestroyed(aura::Window* window) override {} |
| 70 void OnWindowTargetVisibilityChanged(bool visible) override {} | 77 void OnWindowTargetVisibilityChanged(bool visible) override {} |
| 71 bool HasHitTestMask() const override { return false; } | 78 bool HasHitTestMask() const override { return false; } |
| 72 void GetHitTestMask(gfx::Path* mask) const override {} | 79 void GetHitTestMask(gfx::Path* mask) const override {} |
| 73 | 80 |
| 74 private: | 81 private: |
| 75 SkColor color_; | 82 SkColor color_; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 int main(int argc, char** argv) { | 186 int main(int argc, char** argv) { |
| 180 base::CommandLine::Init(argc, argv); | 187 base::CommandLine::Init(argc, argv); |
| 181 | 188 |
| 182 // The exit manager is in charge of calling the dtors of singleton objects. | 189 // The exit manager is in charge of calling the dtors of singleton objects. |
| 183 base::AtExitManager exit_manager; | 190 base::AtExitManager exit_manager; |
| 184 | 191 |
| 185 base::i18n::InitializeICU(); | 192 base::i18n::InitializeICU(); |
| 186 | 193 |
| 187 return DemoMain(); | 194 return DemoMain(); |
| 188 } | 195 } |
| OLD | NEW |