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 "webkit/compositor_bindings/web_compositor_support_impl.h" | 5 #include "webkit/compositor_bindings/web_compositor_support_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "cc/settings.h" | |
11 #include "cc/thread_impl.h" | 10 #include "cc/thread_impl.h" |
12 #include "webkit/compositor_bindings/web_animation_impl.h" | 11 #include "webkit/compositor_bindings/web_animation_impl.h" |
13 #include "webkit/compositor_bindings/web_content_layer_impl.h" | 12 #include "webkit/compositor_bindings/web_content_layer_impl.h" |
14 #include "webkit/compositor_bindings/web_delegated_renderer_layer_impl.h" | 13 #include "webkit/compositor_bindings/web_delegated_renderer_layer_impl.h" |
15 #include "webkit/compositor_bindings/web_external_texture_layer_impl.h" | 14 #include "webkit/compositor_bindings/web_external_texture_layer_impl.h" |
16 #include "webkit/compositor_bindings/web_float_animation_curve_impl.h" | 15 #include "webkit/compositor_bindings/web_float_animation_curve_impl.h" |
17 #include "webkit/compositor_bindings/web_image_layer_impl.h" | 16 #include "webkit/compositor_bindings/web_image_layer_impl.h" |
18 #include "webkit/compositor_bindings/web_io_surface_layer_impl.h" | 17 #include "webkit/compositor_bindings/web_io_surface_layer_impl.h" |
19 #include "webkit/compositor_bindings/web_layer_impl.h" | 18 #include "webkit/compositor_bindings/web_layer_impl.h" |
20 #include "webkit/compositor_bindings/web_layer_tree_view_impl.h" | 19 #include "webkit/compositor_bindings/web_layer_tree_view_impl.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 bool WebCompositorSupportImpl::isThreadingEnabled() { | 71 bool WebCompositorSupportImpl::isThreadingEnabled() { |
73 return impl_thread_message_loop_proxy_; | 72 return impl_thread_message_loop_proxy_; |
74 } | 73 } |
75 | 74 |
76 void WebCompositorSupportImpl::shutdown() { | 75 void WebCompositorSupportImpl::shutdown() { |
77 DCHECK(initialized_); | 76 DCHECK(initialized_); |
78 initialized_ = false; | 77 initialized_ = false; |
79 impl_thread_message_loop_proxy_ = NULL; | 78 impl_thread_message_loop_proxy_ = NULL; |
80 } | 79 } |
81 | 80 |
82 void WebCompositorSupportImpl::setPerTilePaintingEnabled(bool enabled) { | |
83 cc::Settings::setPerTilePaintingEnabled(enabled); | |
84 } | |
85 | |
86 void WebCompositorSupportImpl::setPartialSwapEnabled(bool enabled) { | |
87 cc::Settings::setPartialSwapEnabled(enabled); | |
88 } | |
89 | |
90 void WebCompositorSupportImpl::setAcceleratedAnimationEnabled(bool enabled) { | |
91 cc::Settings::setAcceleratedAnimationEnabled(enabled); | |
92 } | |
93 | |
94 void WebCompositorSupportImpl::setPageScalePinchZoomEnabled(bool enabled) { | |
95 cc::Settings::setPageScalePinchZoomEnabled(enabled); | |
96 } | |
97 | |
98 WebLayerTreeView* WebCompositorSupportImpl::createLayerTreeView( | 81 WebLayerTreeView* WebCompositorSupportImpl::createLayerTreeView( |
99 WebLayerTreeViewClient* client, const WebLayer& root, | 82 WebLayerTreeViewClient* client, const WebLayer& root, |
100 const WebLayerTreeView::Settings& settings) { | 83 const WebLayerTreeView::Settings& settings) { |
101 DCHECK(initialized_); | 84 DCHECK(initialized_); |
102 scoped_ptr<WebKit::WebLayerTreeViewImpl> layerTreeViewImpl( | 85 scoped_ptr<WebKit::WebLayerTreeViewImpl> layerTreeViewImpl( |
103 new WebKit::WebLayerTreeViewImpl(client)); | 86 new WebKit::WebLayerTreeViewImpl(client)); |
104 scoped_ptr<cc::Thread> impl_thread; | 87 scoped_ptr<cc::Thread> impl_thread; |
105 if (impl_thread_message_loop_proxy_) | 88 if (impl_thread_message_loop_proxy_) |
106 impl_thread = cc::ThreadImpl::createForDifferentThread( | 89 impl_thread = cc::ThreadImpl::createForDifferentThread( |
107 impl_thread_message_loop_proxy_); | 90 impl_thread_message_loop_proxy_); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 WebFloatAnimationCurve* WebCompositorSupportImpl::createFloatAnimationCurve() { | 148 WebFloatAnimationCurve* WebCompositorSupportImpl::createFloatAnimationCurve() { |
166 return new WebKit::WebFloatAnimationCurveImpl(); | 149 return new WebKit::WebFloatAnimationCurveImpl(); |
167 } | 150 } |
168 | 151 |
169 WebTransformAnimationCurve* | 152 WebTransformAnimationCurve* |
170 WebCompositorSupportImpl::createTransformAnimationCurve() { | 153 WebCompositorSupportImpl::createTransformAnimationCurve() { |
171 return new WebKit::WebTransformAnimationCurveImpl(); | 154 return new WebKit::WebTransformAnimationCurveImpl(); |
172 } | 155 } |
173 | 156 |
174 } // namespace webkit | 157 } // namespace webkit |
OLD | NEW |