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 "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 CopyFromParent, // visual | 66 CopyFromParent, // visual |
67 CWEventMask | CWOverrideRedirect, &swa); | 67 CWEventMask | CWOverrideRedirect, &swa); |
68 XMapWindow(display, window_); | 68 XMapWindow(display, window_); |
69 | 69 |
70 while (1) { | 70 while (1) { |
71 XEvent event; | 71 XEvent event; |
72 XNextEvent(display, &event); | 72 XNextEvent(display, &event); |
73 if (event.type == MapNotify && event.xmap.window == window_) | 73 if (event.type == MapNotify && event.xmap.window == window_) |
74 break; | 74 break; |
75 } | 75 } |
76 compositor_.SetAcceleratedWidgetAndStartCompositor(window_); | 76 compositor_.SetAcceleratedWidget(window_); |
77 compositor_.SetScaleAndSize(1.0f, bounds_.size()); | 77 compositor_.SetScaleAndSize(1.0f, bounds_.size()); |
78 } | 78 } |
79 | 79 |
80 ui::Compositor* TestCompositorHostX11::GetCompositor() { | 80 ui::Compositor* TestCompositorHostX11::GetCompositor() { |
81 return &compositor_; | 81 return &compositor_; |
82 } | 82 } |
83 | 83 |
84 // static | 84 // static |
85 TestCompositorHost* TestCompositorHost::Create( | 85 TestCompositorHost* TestCompositorHost::Create( |
86 const gfx::Rect& bounds, | 86 const gfx::Rect& bounds, |
87 ui::ContextFactory* context_factory) { | 87 ui::ContextFactory* context_factory) { |
88 return new TestCompositorHostX11(bounds, context_factory); | 88 return new TestCompositorHostX11(bounds, context_factory); |
89 } | 89 } |
90 | 90 |
91 } // namespace ui | 91 } // namespace ui |
OLD | NEW |