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

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

Issue 11232051: Remove static thread pointers from CC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 months 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
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/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/settings.h" 9 #include "cc/settings.h"
10 #include "webkit/compositor_bindings/web_animation_impl.h" 10 #include "webkit/compositor_bindings/web_animation_impl.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 using WebKit::WebCompositorImpl; 48 using WebKit::WebCompositorImpl;
49 49
50 namespace webkit { 50 namespace webkit {
51 51
52 WebCompositorSupportImpl::WebCompositorSupportImpl() { 52 WebCompositorSupportImpl::WebCompositorSupportImpl() {
53 } 53 }
54 54
55 WebCompositorSupportImpl::~WebCompositorSupportImpl() { 55 WebCompositorSupportImpl::~WebCompositorSupportImpl() {
56 } 56 }
57 57
58 void WebCompositorSupportImpl::initialize(WebKit::WebThread* thread) { 58 void WebCompositorSupportImpl::initialize(WebKit::WebThread* implThread) {
59 WebCompositorImpl::initialize(thread); 59 ASSERT(!state_.mainThread);
60 state_.mainThread = CCThreadImpl::createForCurrentThread().release();
61 if (implThread)
62 state_.implThread = CCThreadImpl::createForDifferentThread(implThread)
63 .release();
60 } 64 }
61 65
62 bool WebCompositorSupportImpl::isThreadingEnabled() { 66 bool WebCompositorSupportImpl::isThreadingEnabled() {
63 return WebCompositorImpl::isThreadingEnabled(); 67 return WebCompositorImpl::isThreadingEnabled();
64 } 68 }
65 69
66 void WebCompositorSupportImpl::shutdown() { 70 void WebCompositorSupportImpl::shutdown() {
67 WebCompositorImpl::shutdown(); 71 WebCompositorImpl::shutdown();
68 } 72 }
69 73
(...skipping 11 matching lines...) Expand all
81 85
82 void WebCompositorSupportImpl::setPageScalePinchZoomEnabled(bool enabled) { 86 void WebCompositorSupportImpl::setPageScalePinchZoomEnabled(bool enabled) {
83 cc::Settings::setPageScalePinchZoomEnabled(enabled); 87 cc::Settings::setPageScalePinchZoomEnabled(enabled);
84 } 88 }
85 89
86 WebLayerTreeView* WebCompositorSupportImpl::createLayerTreeView( 90 WebLayerTreeView* WebCompositorSupportImpl::createLayerTreeView(
87 WebLayerTreeViewClient* client, const WebLayer& root, 91 WebLayerTreeViewClient* client, const WebLayer& root,
88 const WebLayerTreeView::Settings& settings) { 92 const WebLayerTreeView::Settings& settings) {
89 scoped_ptr<WebKit::WebLayerTreeViewImpl> layerTreeViewImpl( 93 scoped_ptr<WebKit::WebLayerTreeViewImpl> layerTreeViewImpl(
90 new WebKit::WebLayerTreeViewImpl(client)); 94 new WebKit::WebLayerTreeViewImpl(client));
91 if (!layerTreeViewImpl->initialize(settings)) 95 if (!layerTreeViewImpl->initialize(settings, &state_))
92 return NULL; 96 return NULL;
93 layerTreeViewImpl->setRootLayer(root); 97 layerTreeViewImpl->setRootLayer(root);
94 return layerTreeViewImpl.release(); 98 return layerTreeViewImpl.release();
95 } 99 }
96 100
97 WebLayer* WebCompositorSupportImpl::createLayer() { 101 WebLayer* WebCompositorSupportImpl::createLayer() {
98 return new WebKit::WebLayerImpl(); 102 return new WebKit::WebLayerImpl();
99 } 103 }
100 104
101 WebContentLayer* WebCompositorSupportImpl::createContentLayer( 105 WebContentLayer* WebCompositorSupportImpl::createContentLayer(
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 WebFloatAnimationCurve* WebCompositorSupportImpl::createFloatAnimationCurve() { 152 WebFloatAnimationCurve* WebCompositorSupportImpl::createFloatAnimationCurve() {
149 return new WebKit::WebFloatAnimationCurveImpl(); 153 return new WebKit::WebFloatAnimationCurveImpl();
150 } 154 }
151 155
152 WebTransformAnimationCurve* 156 WebTransformAnimationCurve*
153 WebCompositorSupportImpl::createTransformAnimationCurve() { 157 WebCompositorSupportImpl::createTransformAnimationCurve() {
154 return new WebKit::WebTransformAnimationCurveImpl(); 158 return new WebKit::WebTransformAnimationCurveImpl();
155 } 159 }
156 160
157 } // namespace webkit 161 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698