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..6fba708869b0ab99f1b9eef3895718df01b14973 100644 |
| --- a/webkit/compositor_bindings/web_compositor_support_impl.cc |
| +++ b/webkit/compositor_bindings/web_compositor_support_impl.cc |
| @@ -5,10 +5,11 @@ |
| #include "config.h" |
| #include "webkit/compositor_bindings/web_compositor_support_impl.h" |
| +#include "base/message_loop_proxy.h" |
| #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 +22,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 +47,29 @@ using WebKit::WebTransformAnimationCurve; |
| using WebKit::WebVideoFrameProvider; |
| using WebKit::WebVideoLayer; |
| -using WebKit::WebCompositorImpl; |
| - |
| namespace webkit { |
| -WebCompositorSupportImpl::WebCompositorSupportImpl() { |
| +WebCompositorSupportImpl::WebCompositorSupportImpl() |
| + : is_threading_enabled_(false) { |
| } |
| WebCompositorSupportImpl::~WebCompositorSupportImpl() { |
| } |
| -void WebCompositorSupportImpl::initialize(WebKit::WebThread* thread) { |
| - WebCompositorImpl::initialize(thread); |
| +void WebCompositorSupportImpl::initialize(WebKit::WebThread* impl_thread) { |
| + if (impl_thread) { |
| + is_threading_enabled_ = true; |
|
jamesr
2012/10/31 06:38:19
i think the is_threading_enabled_ bool is redundan
|
| + impl_thread_message_loop_proxy_ = |
| + static_cast<webkit_glue::WebThreadImpl*>(impl_thread)-> |
| + message_loop()->message_loop_proxy(); |
|
jamesr
2012/10/31 06:38:19
indent this line another 4 spaces since it's an ad
|
| + } |
| } |
| bool WebCompositorSupportImpl::isThreadingEnabled() { |
| - return WebCompositorImpl::isThreadingEnabled(); |
| + return is_threading_enabled_; |
| } |
| void WebCompositorSupportImpl::shutdown() { |
| - WebCompositorImpl::shutdown(); |
| } |
| void WebCompositorSupportImpl::setPerTilePaintingEnabled(bool enabled) { |
| @@ -88,7 +93,9 @@ WebLayerTreeView* WebCompositorSupportImpl::createLayerTreeView( |
| const WebLayerTreeView::Settings& settings) { |
| scoped_ptr<WebKit::WebLayerTreeViewImpl> layerTreeViewImpl( |
| new WebKit::WebLayerTreeViewImpl(client)); |
| - if (!layerTreeViewImpl->initialize(settings)) |
| + scoped_ptr<cc::Thread> impl_thread(cc::ThreadImpl::createForDifferentThread( |
| + impl_thread_message_loop_proxy_)); |
| + if (!layerTreeViewImpl->initialize(settings, impl_thread.release())) |
| return NULL; |
| layerTreeViewImpl->setRootLayer(root); |
| return layerTreeViewImpl.release(); |