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 3 // found in the LICENSE file. 4 5 #include "webkit/renderer/compositor_bindings/web_compositor_support_impl.h" 6 7 #include "base/memory/scoped_ptr.h" 8 #include "base/message_loop/message_loop_proxy.h" 9 #include "cc/animation/transform_operations.h" 10 #include "cc/output/output_surface.h" 11 #include "cc/output/software_output_device.h" 12 #include "webkit/child/webthread_impl.h" 13 #include "webkit/renderer/compositor_bindings/web_animation_impl.h" 14 #include "webkit/renderer/compositor_bindings/web_content_layer_impl.h" 15 #include "webkit/renderer/compositor_bindings/web_external_texture_layer_impl.h" 16 #include "webkit/renderer/compositor_bindings/web_filter_operations_impl.h" 17 #include "webkit/renderer/compositor_bindings/web_float_animation_curve_impl.h" 18 #include "webkit/renderer/compositor_bindings/web_image_layer_impl.h" 19 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" 20 #include "webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.h" 21 #include "webkit/renderer/compositor_bindings/web_solid_color_layer_impl.h" 22 #include "webkit/renderer/compositor_bindings/web_transform_animation_curve_impl.h" 23 #include "webkit/renderer/compositor_bindings/web_transform_operations_impl.h" 24 25 using WebKit::WebAnimation; 26 using WebKit::WebAnimationCurve; 27 using WebKit::WebContentLayer; 28 using WebKit::WebContentLayerClient; 29 using WebKit::WebExternalTextureLayer; 30 using WebKit::WebExternalTextureLayerClient; 31 using WebKit::WebFilterOperations; 32 using WebKit::WebFloatAnimationCurve; 33 using WebKit::WebImageLayer; 34 using WebKit::WebLayer; 35 using WebKit::WebScrollbar; 36 using WebKit::WebScrollbarLayer; 37 using WebKit::WebScrollbarThemeGeometry; 38 using WebKit::WebScrollbarThemePainter; 39 using WebKit::WebSolidColorLayer; 40 using WebKit::WebTransformAnimationCurve; 41 using WebKit::WebTransformOperations; 42 43 namespace webkit { 44 45 WebCompositorSupportImpl::WebCompositorSupportImpl() {} 46 47 WebCompositorSupportImpl::~WebCompositorSupportImpl() {} 48 49 WebLayer* WebCompositorSupportImpl::createLayer() { 50 return new WebLayerImpl(); 51 } 52 53 WebContentLayer* WebCompositorSupportImpl::createContentLayer( 54 WebContentLayerClient* client) { 55 return new WebContentLayerImpl(client); 56 } 57 58 WebExternalTextureLayer* WebCompositorSupportImpl::createExternalTextureLayer( 59 WebExternalTextureLayerClient* client) { 60 return new WebExternalTextureLayerImpl(client); 61 } 62 63 WebKit::WebImageLayer* WebCompositorSupportImpl::createImageLayer() { 64 return new WebImageLayerImpl(); 65 } 66 67 WebSolidColorLayer* WebCompositorSupportImpl::createSolidColorLayer() { 68 return new WebSolidColorLayerImpl(); 69 } 70 71 WebScrollbarLayer* WebCompositorSupportImpl::createScrollbarLayer( 72 WebScrollbar* scrollbar, 73 WebScrollbarThemePainter painter, 74 WebScrollbarThemeGeometry* geometry) { 75 return new WebScrollbarLayerImpl(scrollbar, painter, geometry); 76 } 77 78 WebAnimation* WebCompositorSupportImpl::createAnimation( 79 const WebKit::WebAnimationCurve& curve, 80 WebKit::WebAnimation::TargetProperty target, 81 int animation_id) { 82 return new WebAnimationImpl(curve, target, animation_id, 0); 83 } 84 85 WebFloatAnimationCurve* WebCompositorSupportImpl::createFloatAnimationCurve() { 86 return new WebFloatAnimationCurveImpl(); 87 } 88 89 WebTransformAnimationCurve* 90 WebCompositorSupportImpl::createTransformAnimationCurve() { 91 return new WebTransformAnimationCurveImpl(); 92 } 93 94 WebTransformOperations* WebCompositorSupportImpl::createTransformOperations() { 95 return new WebTransformOperationsImpl(); 96 } 97 98 WebFilterOperations* WebCompositorSupportImpl::createFilterOperations() { 99 return new WebFilterOperationsImpl(); 100 } 101 102 } // namespace webkit 103