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 compositor_->Draw(false); | 93 if (compositor_) |
| 94 compositor_->Draw(false); |
94 } | 95 } |
95 | 96 |
96 #if defined(TOUCH_UI) || defined(USE_AURA) | 97 #if defined(TOUCH_UI) || defined(USE_AURA) |
97 base::MessagePumpDispatcher::DispatchStatus TestCompositorHostLinux::Dispatch( | 98 base::MessagePumpDispatcher::DispatchStatus TestCompositorHostLinux::Dispatch( |
98 XEvent* xev) { | 99 XEvent* xev) { |
99 return MessagePumpDispatcher::EVENT_IGNORED; | 100 return MessagePumpDispatcher::EVENT_IGNORED; |
100 } | 101 } |
101 #elif defined(TOOLKIT_USES_GTK) | 102 #elif defined(TOOLKIT_USES_GTK) |
102 bool TestCompositorHostLinux::Dispatch(GdkEvent*) { | 103 bool TestCompositorHostLinux::Dispatch(GdkEvent*) { |
103 return false; | 104 return false; |
104 } | 105 } |
105 #endif | 106 #endif |
106 | 107 |
107 // static | 108 // static |
108 TestCompositorHost* TestCompositorHost::Create(const gfx::Rect& bounds) { | 109 TestCompositorHost* TestCompositorHost::Create(const gfx::Rect& bounds) { |
109 return new TestCompositorHostLinux(bounds); | 110 return new TestCompositorHostLinux(bounds); |
110 } | 111 } |
111 | 112 |
112 } // namespace ui | 113 } // namespace ui |
OLD | NEW |