OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |