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_compositor_host.h" | 5 #include "ui/gfx/compositor/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 "ui/base/x/x11_util.h" | 10 #include "ui/base/x/x11_util.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 break; | 83 break; |
84 } | 84 } |
85 compositor_ = ui::Compositor::Create(this, window_, bounds_.size()); | 85 compositor_ = ui::Compositor::Create(this, window_, bounds_.size()); |
86 } | 86 } |
87 | 87 |
88 ui::Compositor* TestCompositorHostLinux::GetCompositor() { | 88 ui::Compositor* TestCompositorHostLinux::GetCompositor() { |
89 return compositor_; | 89 return compositor_; |
90 } | 90 } |
91 | 91 |
92 void TestCompositorHostLinux::ScheduleDraw() { | 92 void TestCompositorHostLinux::ScheduleDraw() { |
93 if (compositor_) | 93 compositor_->Draw(false); |
94 compositor_->Draw(false); | |
95 } | 94 } |
96 | 95 |
97 #if defined(TOUCH_UI) || defined(USE_AURA) | 96 #if defined(TOUCH_UI) || defined(USE_AURA) |
98 base::MessagePumpDispatcher::DispatchStatus TestCompositorHostLinux::Dispatch( | 97 base::MessagePumpDispatcher::DispatchStatus TestCompositorHostLinux::Dispatch( |
99 XEvent* xev) { | 98 XEvent* xev) { |
100 return MessagePumpDispatcher::EVENT_IGNORED; | 99 return MessagePumpDispatcher::EVENT_IGNORED; |
101 } | 100 } |
102 #elif defined(TOOLKIT_USES_GTK) | 101 #elif defined(TOOLKIT_USES_GTK) |
103 bool TestCompositorHostLinux::Dispatch(GdkEvent*) { | 102 bool TestCompositorHostLinux::Dispatch(GdkEvent*) { |
104 return false; | 103 return false; |
105 } | 104 } |
106 #endif | 105 #endif |
107 | 106 |
108 // static | 107 // static |
109 TestCompositorHost* TestCompositorHost::Create(const gfx::Rect& bounds) { | 108 TestCompositorHost* TestCompositorHost::Create(const gfx::Rect& bounds) { |
110 return new TestCompositorHostLinux(bounds); | 109 return new TestCompositorHostLinux(bounds); |
111 } | 110 } |
112 | 111 |
113 } // namespace ui | 112 } // namespace ui |
OLD | NEW |