| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gfx/compositor/test/test_compositor_host.h" | 5 #include "ui/gfx/compositor/test/test_compositor_host.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 CopyFromParent, // visual | 73 CopyFromParent, // visual |
| 74 CWEventMask | CWOverrideRedirect, &swa); | 74 CWEventMask | CWOverrideRedirect, &swa); |
| 75 XMapWindow(display, window_); | 75 XMapWindow(display, window_); |
| 76 | 76 |
| 77 while (1) { | 77 while (1) { |
| 78 XEvent event; | 78 XEvent event; |
| 79 XNextEvent(display, &event); | 79 XNextEvent(display, &event); |
| 80 if (event.type == MapNotify && event.xmap.window == window_) | 80 if (event.type == MapNotify && event.xmap.window == window_) |
| 81 break; | 81 break; |
| 82 } | 82 } |
| 83 compositor_ = ui::Compositor::Create(this, window_, bounds_.size()); | 83 compositor_ = new ui::Compositor(this, window_, bounds_.size()); |
| 84 } | 84 } |
| 85 | 85 |
| 86 ui::Compositor* TestCompositorHostLinux::GetCompositor() { | 86 ui::Compositor* TestCompositorHostLinux::GetCompositor() { |
| 87 return compositor_; | 87 return compositor_; |
| 88 } | 88 } |
| 89 | 89 |
| 90 void TestCompositorHostLinux::ScheduleDraw() { | 90 void TestCompositorHostLinux::ScheduleDraw() { |
| 91 if (compositor_) | 91 if (compositor_) |
| 92 compositor_->Draw(false); | 92 compositor_->Draw(false); |
| 93 } | 93 } |
| 94 | 94 |
| 95 #if defined(USE_AURA) | 95 #if defined(USE_AURA) |
| 96 base::MessagePumpDispatcher::DispatchStatus TestCompositorHostLinux::Dispatch( | 96 base::MessagePumpDispatcher::DispatchStatus TestCompositorHostLinux::Dispatch( |
| 97 XEvent* xev) { | 97 XEvent* xev) { |
| 98 return MessagePumpDispatcher::EVENT_IGNORED; | 98 return MessagePumpDispatcher::EVENT_IGNORED; |
| 99 } | 99 } |
| 100 #elif defined(TOOLKIT_USES_GTK) | 100 #elif defined(TOOLKIT_USES_GTK) |
| 101 bool TestCompositorHostLinux::Dispatch(GdkEvent*) { | 101 bool TestCompositorHostLinux::Dispatch(GdkEvent*) { |
| 102 return false; | 102 return false; |
| 103 } | 103 } |
| 104 #endif | 104 #endif |
| 105 | 105 |
| 106 // static | 106 // static |
| 107 TestCompositorHost* TestCompositorHost::Create(const gfx::Rect& bounds) { | 107 TestCompositorHost* TestCompositorHost::Create(const gfx::Rect& bounds) { |
| 108 return new TestCompositorHostLinux(bounds); | 108 return new TestCompositorHostLinux(bounds); |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace ui | 111 } // namespace ui |
| OLD | NEW |