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/compositor_cc.h" | 5 #include "ui/gfx/compositor/compositor_cc.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "third_party/skia/include/images/SkImageEncoder.h" | 8 #include "third_party/skia/include/images/SkImageEncoder.h" |
9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 #else | 159 #else |
160 if (use_thread) | 160 if (use_thread) |
161 WebKit::WebCompositor::setThread(g_compositor_thread); | 161 WebKit::WebCompositor::setThread(g_compositor_thread); |
162 #endif | 162 #endif |
163 } | 163 } |
164 | 164 |
165 void CompositorCC::Terminate() { | 165 void CompositorCC::Terminate() { |
166 #ifdef WEBCOMPOSITOR_HAS_INITIALIZE | 166 #ifdef WEBCOMPOSITOR_HAS_INITIALIZE |
167 WebKit::WebCompositor::shutdown(); | 167 WebKit::WebCompositor::shutdown(); |
168 #endif | 168 #endif |
169 DCHECK(g_compositor_thread); | 169 if (g_compositor_thread) { |
170 delete g_compositor_thread; | 170 delete g_compositor_thread; |
171 g_compositor_thread = NULL; | 171 g_compositor_thread = NULL; |
| 172 } |
172 } | 173 } |
173 | 174 |
174 // static | 175 // static |
175 void CompositorCC::EnableTestContextIfNecessary() { | 176 void CompositorCC::EnableTestContextIfNecessary() { |
176 // TODO: only do this if command line param not set. | 177 // TODO: only do this if command line param not set. |
177 test_context_enabled_ = true; | 178 test_context_enabled_ = true; |
178 } | 179 } |
179 | 180 |
180 Texture* CompositorCC::CreateTexture() { | 181 Texture* CompositorCC::CreateTexture() { |
181 NOTREACHED(); | 182 NOTREACHED(); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 ScheduleDraw(); | 280 ScheduleDraw(); |
280 } | 281 } |
281 | 282 |
282 Compositor* Compositor::Create(CompositorDelegate* owner, | 283 Compositor* Compositor::Create(CompositorDelegate* owner, |
283 gfx::AcceleratedWidget widget, | 284 gfx::AcceleratedWidget widget, |
284 const gfx::Size& size) { | 285 const gfx::Size& size) { |
285 return new CompositorCC(owner, widget, size); | 286 return new CompositorCC(owner, widget, size); |
286 } | 287 } |
287 | 288 |
288 } // namespace ui | 289 } // namespace ui |
OLD | NEW |