Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(739)

Side by Side Diff: webkit/compositor_bindings/web_compositor_support_impl.cc

Issue 11369071: A speculative Revert for r165872 - Remove static thread pointers from CC, attempt 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "config.h" 5 #include "config.h"
6 #include "webkit/compositor_bindings/web_compositor_support_impl.h" 6 #include "webkit/compositor_bindings/web_compositor_support_impl.h"
7 7
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop_proxy.h"
11 #include "cc/settings.h" 10 #include "cc/settings.h"
12 #include "cc/thread_impl.h"
13 #include "webkit/compositor_bindings/web_animation_impl.h" 11 #include "webkit/compositor_bindings/web_animation_impl.h"
12 #include "webkit/compositor_bindings/web_compositor_impl.h"
14 #include "webkit/compositor_bindings/web_content_layer_impl.h" 13 #include "webkit/compositor_bindings/web_content_layer_impl.h"
15 #include "webkit/compositor_bindings/web_delegated_renderer_layer_impl.h" 14 #include "webkit/compositor_bindings/web_delegated_renderer_layer_impl.h"
16 #include "webkit/compositor_bindings/web_external_texture_layer_impl.h" 15 #include "webkit/compositor_bindings/web_external_texture_layer_impl.h"
17 #include "webkit/compositor_bindings/web_float_animation_curve_impl.h" 16 #include "webkit/compositor_bindings/web_float_animation_curve_impl.h"
18 #include "webkit/compositor_bindings/web_image_layer_impl.h" 17 #include "webkit/compositor_bindings/web_image_layer_impl.h"
19 #include "webkit/compositor_bindings/web_io_surface_layer_impl.h" 18 #include "webkit/compositor_bindings/web_io_surface_layer_impl.h"
20 #include "webkit/compositor_bindings/web_layer_impl.h" 19 #include "webkit/compositor_bindings/web_layer_impl.h"
21 #include "webkit/compositor_bindings/web_layer_tree_view_impl.h" 20 #include "webkit/compositor_bindings/web_layer_tree_view_impl.h"
22 #include "webkit/compositor_bindings/web_scrollbar_layer_impl.h" 21 #include "webkit/compositor_bindings/web_scrollbar_layer_impl.h"
23 #include "webkit/compositor_bindings/web_solid_color_layer_impl.h" 22 #include "webkit/compositor_bindings/web_solid_color_layer_impl.h"
24 #include "webkit/compositor_bindings/web_transform_animation_curve_impl.h" 23 #include "webkit/compositor_bindings/web_transform_animation_curve_impl.h"
25 #include "webkit/compositor_bindings/web_video_layer_impl.h" 24 #include "webkit/compositor_bindings/web_video_layer_impl.h"
26 #include "webkit/glue/webthread_impl.h"
27 25
28 using WebKit::WebAnimation; 26 using WebKit::WebAnimation;
29 using WebKit::WebAnimationCurve; 27 using WebKit::WebAnimationCurve;
30 using WebKit::WebContentLayer; 28 using WebKit::WebContentLayer;
31 using WebKit::WebContentLayerClient; 29 using WebKit::WebContentLayerClient;
32 using WebKit::WebDelegatedRendererLayer; 30 using WebKit::WebDelegatedRendererLayer;
33 using WebKit::WebExternalTextureLayer; 31 using WebKit::WebExternalTextureLayer;
34 using WebKit::WebExternalTextureLayerClient; 32 using WebKit::WebExternalTextureLayerClient;
35 using WebKit::WebFloatAnimationCurve; 33 using WebKit::WebFloatAnimationCurve;
36 using WebKit::WebIOSurfaceLayer; 34 using WebKit::WebIOSurfaceLayer;
37 using WebKit::WebImageLayer; 35 using WebKit::WebImageLayer;
38 using WebKit::WebImageLayer; 36 using WebKit::WebImageLayer;
39 using WebKit::WebLayer; 37 using WebKit::WebLayer;
40 using WebKit::WebLayerTreeView; 38 using WebKit::WebLayerTreeView;
41 using WebKit::WebLayerTreeViewClient; 39 using WebKit::WebLayerTreeViewClient;
42 using WebKit::WebScrollbar; 40 using WebKit::WebScrollbar;
43 using WebKit::WebScrollbarLayer; 41 using WebKit::WebScrollbarLayer;
44 using WebKit::WebScrollbarThemeGeometry; 42 using WebKit::WebScrollbarThemeGeometry;
45 using WebKit::WebScrollbarThemePainter; 43 using WebKit::WebScrollbarThemePainter;
46 using WebKit::WebSolidColorLayer; 44 using WebKit::WebSolidColorLayer;
47 using WebKit::WebTransformAnimationCurve; 45 using WebKit::WebTransformAnimationCurve;
48 using WebKit::WebVideoFrameProvider; 46 using WebKit::WebVideoFrameProvider;
49 using WebKit::WebVideoLayer; 47 using WebKit::WebVideoLayer;
50 48
49 using WebKit::WebCompositorImpl;
50
51 namespace webkit { 51 namespace webkit {
52 52
53 WebCompositorSupportImpl::WebCompositorSupportImpl() { 53 WebCompositorSupportImpl::WebCompositorSupportImpl() {
54 } 54 }
55 55
56 WebCompositorSupportImpl::~WebCompositorSupportImpl() { 56 WebCompositorSupportImpl::~WebCompositorSupportImpl() {
57 } 57 }
58 58
59 void WebCompositorSupportImpl::initialize(WebKit::WebThread* impl_thread) { 59 void WebCompositorSupportImpl::initialize(WebKit::WebThread* thread) {
60 if (impl_thread) { 60 if (thread) {
61 TRACE_EVENT_INSTANT0("test_gpu", "ThreadedCompositingInitialization"); 61 TRACE_EVENT_INSTANT0("test_gpu", "ThreadedCompositingInitialization");
62 } 62 }
63 if (impl_thread) 63 WebCompositorImpl::initialize(thread);
64 impl_thread_message_loop_proxy_ =
65 static_cast<webkit_glue::WebThreadImpl*>(impl_thread)->
66 message_loop()->message_loop_proxy();
67 } 64 }
68 65
69 bool WebCompositorSupportImpl::isThreadingEnabled() { 66 bool WebCompositorSupportImpl::isThreadingEnabled() {
70 return impl_thread_message_loop_proxy_; 67 return WebCompositorImpl::isThreadingEnabled();
71 } 68 }
72 69
73 void WebCompositorSupportImpl::shutdown() { 70 void WebCompositorSupportImpl::shutdown() {
74 impl_thread_message_loop_proxy_ = NULL; 71 WebCompositorImpl::shutdown();
75 } 72 }
76 73
77 void WebCompositorSupportImpl::setPerTilePaintingEnabled(bool enabled) { 74 void WebCompositorSupportImpl::setPerTilePaintingEnabled(bool enabled) {
78 cc::Settings::setPerTilePaintingEnabled(enabled); 75 cc::Settings::setPerTilePaintingEnabled(enabled);
79 } 76 }
80 77
81 void WebCompositorSupportImpl::setPartialSwapEnabled(bool enabled) { 78 void WebCompositorSupportImpl::setPartialSwapEnabled(bool enabled) {
82 cc::Settings::setPartialSwapEnabled(enabled); 79 cc::Settings::setPartialSwapEnabled(enabled);
83 } 80 }
84 81
85 void WebCompositorSupportImpl::setAcceleratedAnimationEnabled(bool enabled) { 82 void WebCompositorSupportImpl::setAcceleratedAnimationEnabled(bool enabled) {
86 cc::Settings::setAcceleratedAnimationEnabled(enabled); 83 cc::Settings::setAcceleratedAnimationEnabled(enabled);
87 } 84 }
88 85
89 void WebCompositorSupportImpl::setPageScalePinchZoomEnabled(bool enabled) { 86 void WebCompositorSupportImpl::setPageScalePinchZoomEnabled(bool enabled) {
90 cc::Settings::setPageScalePinchZoomEnabled(enabled); 87 cc::Settings::setPageScalePinchZoomEnabled(enabled);
91 } 88 }
92 89
93 WebLayerTreeView* WebCompositorSupportImpl::createLayerTreeView( 90 WebLayerTreeView* WebCompositorSupportImpl::createLayerTreeView(
94 WebLayerTreeViewClient* client, const WebLayer& root, 91 WebLayerTreeViewClient* client, const WebLayer& root,
95 const WebLayerTreeView::Settings& settings) { 92 const WebLayerTreeView::Settings& settings) {
96 scoped_ptr<WebKit::WebLayerTreeViewImpl> layerTreeViewImpl( 93 scoped_ptr<WebKit::WebLayerTreeViewImpl> layerTreeViewImpl(
97 new WebKit::WebLayerTreeViewImpl(client)); 94 new WebKit::WebLayerTreeViewImpl(client));
98 scoped_ptr<cc::Thread> impl_thread(NULL); 95 if (!layerTreeViewImpl->initialize(settings))
99 if (impl_thread_message_loop_proxy_)
100 impl_thread = cc::ThreadImpl::createForDifferentThread(
101 impl_thread_message_loop_proxy_);
102 if (!layerTreeViewImpl->initialize(settings, impl_thread.Pass()))
103 return NULL; 96 return NULL;
104 layerTreeViewImpl->setRootLayer(root); 97 layerTreeViewImpl->setRootLayer(root);
105 return layerTreeViewImpl.release(); 98 return layerTreeViewImpl.release();
106 } 99 }
107 100
108 WebLayer* WebCompositorSupportImpl::createLayer() { 101 WebLayer* WebCompositorSupportImpl::createLayer() {
109 return new WebKit::WebLayerImpl(); 102 return new WebKit::WebLayerImpl();
110 } 103 }
111 104
112 WebContentLayer* WebCompositorSupportImpl::createContentLayer( 105 WebContentLayer* WebCompositorSupportImpl::createContentLayer(
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 WebFloatAnimationCurve* WebCompositorSupportImpl::createFloatAnimationCurve() { 152 WebFloatAnimationCurve* WebCompositorSupportImpl::createFloatAnimationCurve() {
160 return new WebKit::WebFloatAnimationCurveImpl(); 153 return new WebKit::WebFloatAnimationCurveImpl();
161 } 154 }
162 155
163 WebTransformAnimationCurve* 156 WebTransformAnimationCurve*
164 WebCompositorSupportImpl::createTransformAnimationCurve() { 157 WebCompositorSupportImpl::createTransformAnimationCurve() {
165 return new WebKit::WebTransformAnimationCurveImpl(); 158 return new WebKit::WebTransformAnimationCurveImpl();
166 } 159 }
167 160
168 } // namespace webkit 161 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/compositor_bindings/web_compositor_support_impl.h ('k') | webkit/compositor_bindings/web_layer_tree_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698