Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / cc / blink / web_compositor_support_impl.cc
1 // Copyright 2014 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 "cc/blink/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/blink/web_animation_impl.h"
11 #include "cc/blink/web_content_layer_impl.h"
12 #include "cc/blink/web_external_texture_layer_impl.h"
13 #include "cc/blink/web_filter_animation_curve_impl.h"
14 #include "cc/blink/web_filter_operations_impl.h"
15 #include "cc/blink/web_float_animation_curve_impl.h"
16 #include "cc/blink/web_image_layer_impl.h"
17 #include "cc/blink/web_layer_impl.h"
18 #include "cc/blink/web_nine_patch_layer_impl.h"
19 #include "cc/blink/web_scroll_offset_animation_curve_impl.h"
20 #include "cc/blink/web_scrollbar_layer_impl.h"
21 #include "cc/blink/web_transform_animation_curve_impl.h"
22 #include "cc/blink/web_transform_operations_impl.h"
23 #include "cc/output/output_surface.h"
24 #include "cc/output/software_output_device.h"
25
26 using blink::WebCompositorAnimation;
27 using blink::WebCompositorAnimationCurve;
28 using blink::WebContentLayer;
29 using blink::WebContentLayerClient;
30 using blink::WebExternalTextureLayer;
31 using blink::WebExternalTextureLayerClient;
32 using blink::WebFilterAnimationCurve;
33 using blink::WebFilterOperations;
34 using blink::WebFloatAnimationCurve;
35 using blink::WebImageLayer;
36 using blink::WebNinePatchLayer;
37 using blink::WebLayer;
38 using blink::WebScrollbar;
39 using blink::WebScrollbarLayer;
40 using blink::WebScrollbarThemeGeometry;
41 using blink::WebScrollbarThemePainter;
42 using blink::WebScrollOffsetAnimationCurve;
43 using blink::WebTransformAnimationCurve;
44 using blink::WebTransformOperations;
45
46 namespace cc_blink {
47
48 WebCompositorSupportImpl::WebCompositorSupportImpl() {
49 }
50
51 WebCompositorSupportImpl::~WebCompositorSupportImpl() {
52 }
53
54 WebLayer* WebCompositorSupportImpl::createLayer() {
55   return new WebLayerImpl();
56 }
57
58 WebContentLayer* WebCompositorSupportImpl::createContentLayer(
59     WebContentLayerClient* client) {
60   return new WebContentLayerImpl(client);
61 }
62
63 WebExternalTextureLayer* WebCompositorSupportImpl::createExternalTextureLayer(
64     WebExternalTextureLayerClient* client) {
65   return new WebExternalTextureLayerImpl(client);
66 }
67
68 blink::WebImageLayer* WebCompositorSupportImpl::createImageLayer() {
69   return new WebImageLayerImpl();
70 }
71
72 blink::WebNinePatchLayer* WebCompositorSupportImpl::createNinePatchLayer() {
73   return new WebNinePatchLayerImpl();
74 }
75
76 WebScrollbarLayer* WebCompositorSupportImpl::createScrollbarLayer(
77     WebScrollbar* scrollbar,
78     WebScrollbarThemePainter painter,
79     WebScrollbarThemeGeometry* geometry) {
80   return new WebScrollbarLayerImpl(scrollbar, painter, geometry);
81 }
82
83 WebScrollbarLayer* WebCompositorSupportImpl::createSolidColorScrollbarLayer(
84     WebScrollbar::Orientation orientation,
85     int thumb_thickness,
86     int track_start,
87     bool is_left_side_vertical_scrollbar) {
88   return new WebScrollbarLayerImpl(orientation,
89                                    thumb_thickness,
90                                    track_start,
91                                    is_left_side_vertical_scrollbar);
92 }
93
94 WebCompositorAnimation* WebCompositorSupportImpl::createAnimation(
95     const blink::WebCompositorAnimationCurve& curve,
96     blink::WebCompositorAnimation::TargetProperty target,
97     int animation_id) {
98   return new WebCompositorAnimationImpl(curve, target, animation_id, 0);
99 }
100
101 WebFilterAnimationCurve*
102 WebCompositorSupportImpl::createFilterAnimationCurve() {
103   return new WebFilterAnimationCurveImpl();
104 }
105
106 WebFloatAnimationCurve* WebCompositorSupportImpl::createFloatAnimationCurve() {
107   return new WebFloatAnimationCurveImpl();
108 }
109
110 WebScrollOffsetAnimationCurve*
111 WebCompositorSupportImpl::createScrollOffsetAnimationCurve(
112     blink::WebFloatPoint target_value,
113     blink::WebCompositorAnimationCurve::TimingFunctionType timing_function) {
114   return new WebScrollOffsetAnimationCurveImpl(target_value, timing_function);
115 }
116
117 WebTransformAnimationCurve*
118 WebCompositorSupportImpl::createTransformAnimationCurve() {
119   return new WebTransformAnimationCurveImpl();
120 }
121
122 WebTransformOperations* WebCompositorSupportImpl::createTransformOperations() {
123   return new WebTransformOperationsImpl();
124 }
125
126 WebFilterOperations* WebCompositorSupportImpl::createFilterOperations() {
127   return new WebFilterOperationsImpl();
128 }
129
130 }  // namespace cc_blink