- add sources.
[platform/framework/web/crosswalk.git] / src / webkit / renderer / compositor_bindings / web_compositor_support_impl.cc
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_animation_curve_impl.h"
17 #include "webkit/renderer/compositor_bindings/web_filter_operations_impl.h"
18 #include "webkit/renderer/compositor_bindings/web_float_animation_curve_impl.h"
19 #include "webkit/renderer/compositor_bindings/web_image_layer_impl.h"
20 #include "webkit/renderer/compositor_bindings/web_layer_impl.h"
21 #include "webkit/renderer/compositor_bindings/web_nine_patch_layer_impl.h"
22 #include "webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.h"
23 #include "webkit/renderer/compositor_bindings/web_solid_color_layer_impl.h"
24 #include "webkit/renderer/compositor_bindings/web_transform_animation_curve_impl.h"
25 #include "webkit/renderer/compositor_bindings/web_transform_operations_impl.h"
26
27 using WebKit::WebAnimation;
28 using WebKit::WebAnimationCurve;
29 using WebKit::WebContentLayer;
30 using WebKit::WebContentLayerClient;
31 using WebKit::WebExternalTextureLayer;
32 using WebKit::WebExternalTextureLayerClient;
33 using WebKit::WebFilterAnimationCurve;
34 using WebKit::WebFilterOperations;
35 using WebKit::WebFloatAnimationCurve;
36 using WebKit::WebImageLayer;
37 using WebKit::WebNinePatchLayer;
38 using WebKit::WebLayer;
39 using WebKit::WebScrollbar;
40 using WebKit::WebScrollbarLayer;
41 using WebKit::WebScrollbarThemeGeometry;
42 using WebKit::WebScrollbarThemePainter;
43 using WebKit::WebSolidColorLayer;
44 using WebKit::WebTransformAnimationCurve;
45 using WebKit::WebTransformOperations;
46
47 namespace webkit {
48
49 WebCompositorSupportImpl::WebCompositorSupportImpl() {}
50
51 WebCompositorSupportImpl::~WebCompositorSupportImpl() {}
52
53 WebLayer* WebCompositorSupportImpl::createLayer() {
54   return new WebLayerImpl();
55 }
56
57 WebContentLayer* WebCompositorSupportImpl::createContentLayer(
58     WebContentLayerClient* client) {
59   return new WebContentLayerImpl(client);
60 }
61
62 WebExternalTextureLayer* WebCompositorSupportImpl::createExternalTextureLayer(
63     WebExternalTextureLayerClient* client) {
64   return new WebExternalTextureLayerImpl(client);
65 }
66
67 WebKit::WebImageLayer* WebCompositorSupportImpl::createImageLayer() {
68   return new WebImageLayerImpl();
69 }
70
71 WebKit::WebNinePatchLayer* WebCompositorSupportImpl::createNinePatchLayer() {
72   return new WebNinePatchLayerImpl();
73 }
74
75 WebSolidColorLayer* WebCompositorSupportImpl::createSolidColorLayer() {
76   return new WebSolidColorLayerImpl();
77 }
78
79 WebScrollbarLayer* WebCompositorSupportImpl::createScrollbarLayer(
80     WebScrollbar* scrollbar,
81     WebScrollbarThemePainter painter,
82     WebScrollbarThemeGeometry* geometry) {
83   return new WebScrollbarLayerImpl(scrollbar, painter, geometry);
84 }
85
86 WebScrollbarLayer* WebCompositorSupportImpl::createSolidColorScrollbarLayer(
87       WebScrollbar::Orientation orientation, int thumb_thickness,
88       bool is_left_side_vertical_scrollbar) {
89   return new WebScrollbarLayerImpl(orientation, thumb_thickness,
90       is_left_side_vertical_scrollbar);
91 }
92
93 WebAnimation* WebCompositorSupportImpl::createAnimation(
94     const WebKit::WebAnimationCurve& curve,
95     WebKit::WebAnimation::TargetProperty target,
96     int animation_id) {
97   return new WebAnimationImpl(curve, target, animation_id, 0);
98 }
99
100 WebFilterAnimationCurve*
101 WebCompositorSupportImpl::createFilterAnimationCurve() {
102   return new WebFilterAnimationCurveImpl();
103 }
104
105 WebFloatAnimationCurve* WebCompositorSupportImpl::createFloatAnimationCurve() {
106   return new WebFloatAnimationCurveImpl();
107 }
108
109 WebTransformAnimationCurve*
110 WebCompositorSupportImpl::createTransformAnimationCurve() {
111   return new WebTransformAnimationCurveImpl();
112 }
113
114 WebTransformOperations* WebCompositorSupportImpl::createTransformOperations() {
115   return new WebTransformOperationsImpl();
116 }
117
118 WebFilterOperations* WebCompositorSupportImpl::createFilterOperations() {
119   return new WebFilterOperationsImpl();
120 }
121
122 }  // namespace webkit