| 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/paint_context.h" |
| 22 #include "ui/compositor/test/in_process_context_factory.h" | 23 #include "ui/compositor/test/in_process_context_factory.h" |
| 23 #include "ui/events/event.h" | 24 #include "ui/events/event.h" |
| 24 #include "ui/gfx/canvas.h" | 25 #include "ui/gfx/canvas.h" |
| 25 #include "ui/gfx/geometry/rect.h" | 26 #include "ui/gfx/geometry/rect.h" |
| 26 #include "ui/gfx/skia_util.h" | 27 #include "ui/gfx/skia_util.h" |
| 27 #include "ui/gl/gl_surface.h" | 28 #include "ui/gl/gl_surface.h" |
| 28 | 29 |
| 29 #if defined(USE_X11) | 30 #if defined(USE_X11) |
| 30 #include "ui/gfx/x/x11_connection.h" | 31 #include "ui/gfx/x/x11_connection.h" |
| 31 #endif | 32 #endif |
| (...skipping 23 matching lines...) Expand all Loading... |
| 55 int GetNonClientComponent(const gfx::Point& point) const override { | 56 int GetNonClientComponent(const gfx::Point& point) const override { |
| 56 return HTCAPTION; | 57 return HTCAPTION; |
| 57 } | 58 } |
| 58 bool ShouldDescendIntoChildForEventHandling( | 59 bool ShouldDescendIntoChildForEventHandling( |
| 59 aura::Window* child, | 60 aura::Window* child, |
| 60 const gfx::Point& location) override { | 61 const gfx::Point& location) override { |
| 61 return true; | 62 return true; |
| 62 } | 63 } |
| 63 bool CanFocus() override { return true; } | 64 bool CanFocus() override { return true; } |
| 64 void OnCaptureLost() override {} | 65 void OnCaptureLost() override {} |
| 65 void OnPaint(gfx::Canvas* canvas) override { | 66 void OnPaint(const ui::PaintContext& context) override { |
| 67 gfx::Canvas* canvas = context.canvas(); |
| 66 canvas->DrawColor(color_, SkXfermode::kSrc_Mode); | 68 canvas->DrawColor(color_, SkXfermode::kSrc_Mode); |
| 67 gfx::Rect r; | 69 gfx::Rect r; |
| 68 canvas->GetClipBounds(&r); | 70 canvas->GetClipBounds(&r); |
| 69 // Fill with a non-solid color so that the compositor will exercise its | 71 // Fill with a non-solid color so that the compositor will exercise its |
| 70 // texture upload path. | 72 // texture upload path. |
| 71 while (!r.IsEmpty()) { | 73 while (!r.IsEmpty()) { |
| 72 r.Inset(2, 2); | 74 r.Inset(2, 2); |
| 73 canvas->FillRect(r, color_, SkXfermode::kXor_Mode); | 75 canvas->FillRect(r, color_, SkXfermode::kXor_Mode); |
| 74 } | 76 } |
| 75 } | 77 } |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 int main(int argc, char** argv) { | 190 int main(int argc, char** argv) { |
| 189 base::CommandLine::Init(argc, argv); | 191 base::CommandLine::Init(argc, argv); |
| 190 | 192 |
| 191 // The exit manager is in charge of calling the dtors of singleton objects. | 193 // The exit manager is in charge of calling the dtors of singleton objects. |
| 192 base::AtExitManager exit_manager; | 194 base::AtExitManager exit_manager; |
| 193 | 195 |
| 194 base::i18n::InitializeICU(); | 196 base::i18n::InitializeICU(); |
| 195 | 197 |
| 196 return DemoMain(); | 198 return DemoMain(); |
| 197 } | 199 } |
| OLD | NEW |