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/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
| 9 #include "cc/output_surface.h" |
9 #include "cc/thread_impl.h" | 10 #include "cc/thread_impl.h" |
10 #include "cc/transform_operations.h" | 11 #include "cc/transform_operations.h" |
11 #include "webkit/compositor_bindings/web_animation_impl.h" | 12 #include "webkit/compositor_bindings/web_animation_impl.h" |
12 #include "webkit/compositor_bindings/web_compositor_support_output_surface.h" | |
13 #include "webkit/compositor_bindings/web_compositor_support_software_output_devi
ce.h" | 13 #include "webkit/compositor_bindings/web_compositor_support_software_output_devi
ce.h" |
14 #include "webkit/compositor_bindings/web_content_layer_impl.h" | 14 #include "webkit/compositor_bindings/web_content_layer_impl.h" |
15 #include "webkit/compositor_bindings/web_external_texture_layer_impl.h" | 15 #include "webkit/compositor_bindings/web_external_texture_layer_impl.h" |
16 #include "webkit/compositor_bindings/web_float_animation_curve_impl.h" | 16 #include "webkit/compositor_bindings/web_float_animation_curve_impl.h" |
17 #include "webkit/compositor_bindings/web_image_layer_impl.h" | 17 #include "webkit/compositor_bindings/web_image_layer_impl.h" |
18 #include "webkit/compositor_bindings/web_io_surface_layer_impl.h" | 18 #include "webkit/compositor_bindings/web_io_surface_layer_impl.h" |
19 #include "webkit/compositor_bindings/web_layer_impl.h" | 19 #include "webkit/compositor_bindings/web_layer_impl.h" |
20 #include "webkit/compositor_bindings/web_layer_tree_view_impl.h" | 20 #include "webkit/compositor_bindings/web_layer_tree_view_impl.h" |
21 #include "webkit/compositor_bindings/web_scrollbar_layer_impl.h" | 21 #include "webkit/compositor_bindings/web_scrollbar_layer_impl.h" |
22 #include "webkit/compositor_bindings/web_solid_color_layer_impl.h" | 22 #include "webkit/compositor_bindings/web_solid_color_layer_impl.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 void WebCompositorSupportImpl::shutdown() { | 77 void WebCompositorSupportImpl::shutdown() { |
78 DCHECK(initialized_); | 78 DCHECK(initialized_); |
79 initialized_ = false; | 79 initialized_ = false; |
80 impl_thread_message_loop_proxy_ = NULL; | 80 impl_thread_message_loop_proxy_ = NULL; |
81 } | 81 } |
82 | 82 |
83 WebKit::WebCompositorOutputSurface* | 83 WebKit::WebCompositorOutputSurface* |
84 WebCompositorSupportImpl::createOutputSurfaceFor3D( | 84 WebCompositorSupportImpl::createOutputSurfaceFor3D( |
85 WebKit::WebGraphicsContext3D* context) { | 85 WebKit::WebGraphicsContext3D* context) { |
86 scoped_ptr<WebKit::WebGraphicsContext3D> context3d = make_scoped_ptr(context); | 86 scoped_ptr<WebKit::WebGraphicsContext3D> context3d = make_scoped_ptr(context); |
87 return WebCompositorSupportOutputSurface::Create3d( | 87 return new cc::OutputSurface(context3d.Pass()); |
88 context3d.Pass()).release(); | |
89 } | 88 } |
90 | 89 |
91 WebKit::WebCompositorOutputSurface* | 90 WebKit::WebCompositorOutputSurface* |
92 WebCompositorSupportImpl::createOutputSurfaceForSoftware() { | 91 WebCompositorSupportImpl::createOutputSurfaceForSoftware() { |
93 scoped_ptr<WebCompositorSupportSoftwareOutputDevice> software_device = | 92 scoped_ptr<WebCompositorSupportSoftwareOutputDevice> software_device = |
94 make_scoped_ptr(new WebCompositorSupportSoftwareOutputDevice); | 93 make_scoped_ptr(new WebCompositorSupportSoftwareOutputDevice); |
95 return WebCompositorSupportOutputSurface::CreateSoftware( | 94 return new cc::OutputSurface( |
96 software_device.PassAs<cc::SoftwareOutputDevice>()).release(); | 95 software_device.PassAs<cc::SoftwareOutputDevice>()); |
97 } | 96 } |
98 | 97 |
99 WebLayer* WebCompositorSupportImpl::createLayer() { | 98 WebLayer* WebCompositorSupportImpl::createLayer() { |
100 return new WebKit::WebLayerImpl(); | 99 return new WebKit::WebLayerImpl(); |
101 } | 100 } |
102 | 101 |
103 WebContentLayer* WebCompositorSupportImpl::createContentLayer( | 102 WebContentLayer* WebCompositorSupportImpl::createContentLayer( |
104 WebContentLayerClient* client) { | 103 WebContentLayerClient* client) { |
105 return new WebKit::WebContentLayerImpl(client); | 104 return new WebKit::WebContentLayerImpl(client); |
106 } | 105 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 if (impl_thread_message_loop_proxy_) | 164 if (impl_thread_message_loop_proxy_) |
166 impl_thread = cc::ThreadImpl::createForDifferentThread( | 165 impl_thread = cc::ThreadImpl::createForDifferentThread( |
167 impl_thread_message_loop_proxy_); | 166 impl_thread_message_loop_proxy_); |
168 if (!layerTreeViewImpl->initialize(settings, impl_thread.Pass())) | 167 if (!layerTreeViewImpl->initialize(settings, impl_thread.Pass())) |
169 return NULL; | 168 return NULL; |
170 layerTreeViewImpl->setRootLayer(root); | 169 layerTreeViewImpl->setRootLayer(root); |
171 return layerTreeViewImpl.release(); | 170 return layerTreeViewImpl.release(); |
172 } | 171 } |
173 | 172 |
174 } // namespace webkit | 173 } // namespace webkit |
OLD | NEW |