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 #if defined(USE_X11) | 5 #if defined(USE_X11) |
6 #include <X11/Xlib.h> | 6 #include <X11/Xlib.h> |
7 #endif | 7 #endif |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "ui/aura/env.h" | 22 #include "ui/aura/env.h" |
23 #include "ui/aura/test/test_focus_client.h" | 23 #include "ui/aura/test/test_focus_client.h" |
24 #include "ui/aura/test/test_screen.h" | 24 #include "ui/aura/test/test_screen.h" |
25 #include "ui/aura/window.h" | 25 #include "ui/aura/window.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/compositor.h" | 28 #include "ui/compositor/compositor.h" |
29 #include "ui/compositor/compositor_observer.h" | 29 #include "ui/compositor/compositor_observer.h" |
30 #include "ui/compositor/debug_utils.h" | 30 #include "ui/compositor/debug_utils.h" |
31 #include "ui/compositor/layer.h" | 31 #include "ui/compositor/layer.h" |
| 32 #include "ui/compositor/paint_context.h" |
32 #include "ui/compositor/test/in_process_context_factory.h" | 33 #include "ui/compositor/test/in_process_context_factory.h" |
33 #include "ui/gfx/canvas.h" | 34 #include "ui/gfx/canvas.h" |
34 #include "ui/gfx/geometry/rect.h" | 35 #include "ui/gfx/geometry/rect.h" |
35 #include "ui/gfx/skia_util.h" | 36 #include "ui/gfx/skia_util.h" |
36 #include "ui/gfx/x/x11_connection.h" | 37 #include "ui/gfx/x/x11_connection.h" |
37 #include "ui/gl/gl_surface.h" | 38 #include "ui/gl/gl_surface.h" |
38 | 39 |
39 #ifndef GL_GLEXT_PROTOTYPES | 40 #ifndef GL_GLEXT_PROTOTYPES |
40 #define GL_GLEXT_PROTOTYPES 1 | 41 #define GL_GLEXT_PROTOTYPES 1 |
41 #endif | 42 #endif |
(...skipping 11 matching lines...) Expand all Loading... |
53 explicit ColoredLayer(SkColor color) | 54 explicit ColoredLayer(SkColor color) |
54 : Layer(ui::LAYER_TEXTURED), | 55 : Layer(ui::LAYER_TEXTURED), |
55 color_(color), | 56 color_(color), |
56 draw_(true) { | 57 draw_(true) { |
57 set_delegate(this); | 58 set_delegate(this); |
58 } | 59 } |
59 | 60 |
60 ~ColoredLayer() override {} | 61 ~ColoredLayer() override {} |
61 | 62 |
62 // Overridden from LayerDelegate: | 63 // Overridden from LayerDelegate: |
63 void OnPaintLayer(gfx::Canvas* canvas) override { | 64 void OnPaintLayer(const ui::PaintContext& context) override { |
64 if (draw_) { | 65 if (draw_) { |
65 canvas->DrawColor(color_); | 66 context.canvas()->DrawColor(color_); |
66 } | 67 } |
67 } | 68 } |
68 | 69 |
69 void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) override {} | 70 void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) override {} |
70 | 71 |
71 void OnDeviceScaleFactorChanged(float device_scale_factor) override {} | 72 void OnDeviceScaleFactorChanged(float device_scale_factor) override {} |
72 | 73 |
73 base::Closure PrepareForLayerBoundsChange() override { | 74 base::Closure PrepareForLayerBoundsChange() override { |
74 return base::Closure(); | 75 return base::Closure(); |
75 } | 76 } |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 ui::PrintLayerHierarchy(host->window()->layer(), gfx::Point(100, 100)); | 364 ui::PrintLayerHierarchy(host->window()->layer(), gfx::Point(100, 100)); |
364 #endif | 365 #endif |
365 | 366 |
366 host->Show(); | 367 host->Show(); |
367 base::MessageLoopForUI::current()->Run(); | 368 base::MessageLoopForUI::current()->Run(); |
368 focus_client.reset(); | 369 focus_client.reset(); |
369 host.reset(); | 370 host.reset(); |
370 | 371 |
371 return 0; | 372 return 0; |
372 } | 373 } |
OLD | NEW |