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 <memory> | 5 #include <memory> |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/i18n/icu_util.h" | 9 #include "base/i18n/icu_util.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "base/power_monitor/power_monitor.h" | 13 #include "base/power_monitor/power_monitor.h" |
14 #include "base/power_monitor/power_monitor_device_source.h" | 14 #include "base/power_monitor/power_monitor_device_source.h" |
15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "cc/surfaces/surface_manager.h" | 17 #include "cc/surfaces/surface_manager.h" |
18 #include "third_party/skia/include/core/SkXfermode.h" | 18 #include "third_party/skia/include/core/SkBlendMode.h" |
19 #include "ui/aura/client/default_capture_client.h" | 19 #include "ui/aura/client/default_capture_client.h" |
20 #include "ui/aura/client/window_parenting_client.h" | 20 #include "ui/aura/client/window_parenting_client.h" |
21 #include "ui/aura/env.h" | 21 #include "ui/aura/env.h" |
22 #include "ui/aura/test/test_focus_client.h" | 22 #include "ui/aura/test/test_focus_client.h" |
23 #include "ui/aura/test/test_screen.h" | 23 #include "ui/aura/test/test_screen.h" |
24 #include "ui/aura/window.h" | 24 #include "ui/aura/window.h" |
25 #include "ui/aura/window_delegate.h" | 25 #include "ui/aura/window_delegate.h" |
26 #include "ui/aura/window_tree_host.h" | 26 #include "ui/aura/window_tree_host.h" |
27 #include "ui/base/hit_test.h" | 27 #include "ui/base/hit_test.h" |
28 #include "ui/compositor/paint_recorder.h" | 28 #include "ui/compositor/paint_recorder.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 } | 65 } |
66 bool ShouldDescendIntoChildForEventHandling( | 66 bool ShouldDescendIntoChildForEventHandling( |
67 aura::Window* child, | 67 aura::Window* child, |
68 const gfx::Point& location) override { | 68 const gfx::Point& location) override { |
69 return true; | 69 return true; |
70 } | 70 } |
71 bool CanFocus() override { return true; } | 71 bool CanFocus() override { return true; } |
72 void OnCaptureLost() override {} | 72 void OnCaptureLost() override {} |
73 void OnPaint(const ui::PaintContext& context) override { | 73 void OnPaint(const ui::PaintContext& context) override { |
74 ui::PaintRecorder recorder(context, window_bounds_.size()); | 74 ui::PaintRecorder recorder(context, window_bounds_.size()); |
75 recorder.canvas()->DrawColor(color_, SkXfermode::kSrc_Mode); | 75 recorder.canvas()->DrawColor(color_, SkBlendMode::kSrc); |
76 gfx::Rect r; | 76 gfx::Rect r; |
77 recorder.canvas()->GetClipBounds(&r); | 77 recorder.canvas()->GetClipBounds(&r); |
78 // Fill with a non-solid color so that the compositor will exercise its | 78 // Fill with a non-solid color so that the compositor will exercise its |
79 // texture upload path. | 79 // texture upload path. |
80 while (!r.IsEmpty()) { | 80 while (!r.IsEmpty()) { |
81 r.Inset(2, 2); | 81 r.Inset(2, 2); |
82 recorder.canvas()->FillRect(r, color_, SkXfermode::kXor_Mode); | 82 recorder.canvas()->FillRect(r, color_, SkBlendMode::kXor); |
83 } | 83 } |
84 } | 84 } |
85 void OnDeviceScaleFactorChanged(float device_scale_factor) override {} | 85 void OnDeviceScaleFactorChanged(float device_scale_factor) override {} |
86 void OnWindowDestroying(aura::Window* window) override {} | 86 void OnWindowDestroying(aura::Window* window) override {} |
87 void OnWindowDestroyed(aura::Window* window) override {} | 87 void OnWindowDestroyed(aura::Window* window) override {} |
88 void OnWindowTargetVisibilityChanged(bool visible) override {} | 88 void OnWindowTargetVisibilityChanged(bool visible) override {} |
89 bool HasHitTestMask() const override { return false; } | 89 bool HasHitTestMask() const override { return false; } |
90 void GetHitTestMask(gfx::Path* mask) const override {} | 90 void GetHitTestMask(gfx::Path* mask) const override {} |
91 | 91 |
92 private: | 92 private: |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 int main(int argc, char** argv) { | 203 int main(int argc, char** argv) { |
204 base::CommandLine::Init(argc, argv); | 204 base::CommandLine::Init(argc, argv); |
205 | 205 |
206 // The exit manager is in charge of calling the dtors of singleton objects. | 206 // The exit manager is in charge of calling the dtors of singleton objects. |
207 base::AtExitManager exit_manager; | 207 base::AtExitManager exit_manager; |
208 | 208 |
209 base::i18n::InitializeICU(); | 209 base::i18n::InitializeICU(); |
210 | 210 |
211 return DemoMain(); | 211 return DemoMain(); |
212 } | 212 } |
OLD | NEW |