OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/compositor/test/test_compositor_host.h" | 5 #include "ui/compositor/test/test_compositor_host.h" |
6 | 6 |
7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 XMapWindow(display, window_); | 69 XMapWindow(display, window_); |
70 | 70 |
71 while (1) { | 71 while (1) { |
72 XEvent event; | 72 XEvent event; |
73 XNextEvent(display, &event); | 73 XNextEvent(display, &event); |
74 if (event.type == MapNotify && event.xmap.window == window_) | 74 if (event.type == MapNotify && event.xmap.window == window_) |
75 break; | 75 break; |
76 } | 76 } |
77 compositor_.SetAcceleratedWidget(window_); | 77 compositor_.SetAcceleratedWidget(window_); |
78 compositor_.SetScaleAndSize(1.0f, bounds_.size()); | 78 compositor_.SetScaleAndSize(1.0f, bounds_.size()); |
| 79 compositor_.SetVisible(true); |
79 } | 80 } |
80 | 81 |
81 ui::Compositor* TestCompositorHostX11::GetCompositor() { | 82 ui::Compositor* TestCompositorHostX11::GetCompositor() { |
82 return &compositor_; | 83 return &compositor_; |
83 } | 84 } |
84 | 85 |
85 // static | 86 // static |
86 TestCompositorHost* TestCompositorHost::Create( | 87 TestCompositorHost* TestCompositorHost::Create( |
87 const gfx::Rect& bounds, | 88 const gfx::Rect& bounds, |
88 ui::ContextFactory* context_factory) { | 89 ui::ContextFactory* context_factory) { |
89 return new TestCompositorHostX11(bounds, context_factory); | 90 return new TestCompositorHostX11(bounds, context_factory); |
90 } | 91 } |
91 | 92 |
92 } // namespace ui | 93 } // namespace ui |
OLD | NEW |