Chromium Code Reviews| Index: webkit/compositor_bindings/web_compositor_support_impl.cc |
| diff --git a/webkit/compositor_bindings/web_compositor_support_impl.cc b/webkit/compositor_bindings/web_compositor_support_impl.cc |
| index 32a18408180f2ff163223c1aac85fcc6eec1549f..3669ff1816ccd45b499e0f04fb0ad4bba38577a5 100644 |
| --- a/webkit/compositor_bindings/web_compositor_support_impl.cc |
| +++ b/webkit/compositor_bindings/web_compositor_support_impl.cc |
| @@ -7,8 +7,8 @@ |
| #include "base/memory/scoped_ptr.h" |
| #include "cc/settings.h" |
| +#include "cc/thread_impl.h" |
| #include "webkit/compositor_bindings/web_animation_impl.h" |
| -#include "webkit/compositor_bindings/web_compositor_impl.h" |
| #include "webkit/compositor_bindings/web_content_layer_impl.h" |
| #include "webkit/compositor_bindings/web_delegated_renderer_layer_impl.h" |
| #include "webkit/compositor_bindings/web_external_texture_layer_impl.h" |
| @@ -21,6 +21,7 @@ |
| #include "webkit/compositor_bindings/web_solid_color_layer_impl.h" |
| #include "webkit/compositor_bindings/web_transform_animation_curve_impl.h" |
| #include "webkit/compositor_bindings/web_video_layer_impl.h" |
| +#include "webkit/glue/webthread_impl.h" |
| using WebKit::WebAnimation; |
| using WebKit::WebAnimationCurve; |
| @@ -45,26 +46,28 @@ using WebKit::WebTransformAnimationCurve; |
| using WebKit::WebVideoFrameProvider; |
| using WebKit::WebVideoLayer; |
| -using WebKit::WebCompositorImpl; |
| - |
| namespace webkit { |
| -WebCompositorSupportImpl::WebCompositorSupportImpl() { |
| +WebCompositorSupportImpl::WebCompositorSupportImpl() |
| + : impl_thread_(NULL) { |
| } |
| WebCompositorSupportImpl::~WebCompositorSupportImpl() { |
| } |
| -void WebCompositorSupportImpl::initialize(WebKit::WebThread* thread) { |
| - WebCompositorImpl::initialize(thread); |
| +void WebCompositorSupportImpl::initialize(WebKit::WebThread* impl_thread) { |
| + if (impl_thread) { |
| + webkit_glue::WebThreadImpl* web_thread_impl = static_cast<webkit_glue::WebThreadImpl*>(impl_thread); |
| + MessageLoop* impl_message_loop = web_thread_impl->message_loop(); |
| + impl_thread_ = cc::ThreadImpl::createForDifferentThread(impl_message_loop->message_loop_proxy()).release(); |
| + } |
| } |
| bool WebCompositorSupportImpl::isThreadingEnabled() { |
| - return WebCompositorImpl::isThreadingEnabled(); |
| + return !!impl_thread_; |
| } |
| void WebCompositorSupportImpl::shutdown() { |
| - WebCompositorImpl::shutdown(); |
| } |
| void WebCompositorSupportImpl::setPerTilePaintingEnabled(bool enabled) { |
| @@ -88,7 +91,7 @@ WebLayerTreeView* WebCompositorSupportImpl::createLayerTreeView( |
| const WebLayerTreeView::Settings& settings) { |
| scoped_ptr<WebKit::WebLayerTreeViewImpl> layerTreeViewImpl( |
| new WebKit::WebLayerTreeViewImpl(client)); |
| - if (!layerTreeViewImpl->initialize(settings)) |
| + if (!layerTreeViewImpl->initialize(settings, impl_thread_)) |
|
jamesr
2012/10/31 04:42:13
this passes ownership of impl_thread_ to the cc::L
|
| return NULL; |
| layerTreeViewImpl->setRootLayer(root); |
| return layerTreeViewImpl.release(); |