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.
5 #include "cc/blink/web_compositor_support_impl.h"
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"
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
;
48 WebCompositorSupportImpl::WebCompositorSupportImpl() {
51 WebCompositorSupportImpl::~WebCompositorSupportImpl() {
54 WebLayer
* WebCompositorSupportImpl::createLayer() {
55 return new WebLayerImpl();
58 WebContentLayer
* WebCompositorSupportImpl::createContentLayer(
59 WebContentLayerClient
* client
) {
60 return new WebContentLayerImpl(client
);
63 WebExternalTextureLayer
* WebCompositorSupportImpl::createExternalTextureLayer(
64 WebExternalTextureLayerClient
* client
) {
65 return new WebExternalTextureLayerImpl(client
);
68 blink::WebImageLayer
* WebCompositorSupportImpl::createImageLayer() {
69 return new WebImageLayerImpl();
72 blink::WebNinePatchLayer
* WebCompositorSupportImpl::createNinePatchLayer() {
73 return new WebNinePatchLayerImpl();
76 WebScrollbarLayer
* WebCompositorSupportImpl::createScrollbarLayer(
77 WebScrollbar
* scrollbar
,
78 WebScrollbarThemePainter painter
,
79 WebScrollbarThemeGeometry
* geometry
) {
80 return new WebScrollbarLayerImpl(scrollbar
, painter
, geometry
);
83 WebScrollbarLayer
* WebCompositorSupportImpl::createSolidColorScrollbarLayer(
84 WebScrollbar::Orientation orientation
,
87 bool is_left_side_vertical_scrollbar
) {
88 return new WebScrollbarLayerImpl(orientation
,
91 is_left_side_vertical_scrollbar
);
94 WebCompositorAnimation
* WebCompositorSupportImpl::createAnimation(
95 const blink::WebCompositorAnimationCurve
& curve
,
96 blink::WebCompositorAnimation::TargetProperty target
,
97 #ifdef WEB_COMPOSITOR_SUPPORT_CREATE_ANIMATION_SUPPORTS_GROUP
101 #ifdef WEB_COMPOSITOR_SUPPORT_CREATE_ANIMATION_SUPPORTS_GROUP
102 return new WebCompositorAnimationImpl(curve
, target
, animation_id
, group_id
);
104 return new WebCompositorAnimationImpl(curve
, target
, animation_id
, 0);
108 WebFilterAnimationCurve
*
109 WebCompositorSupportImpl::createFilterAnimationCurve() {
110 return new WebFilterAnimationCurveImpl();
113 WebFloatAnimationCurve
* WebCompositorSupportImpl::createFloatAnimationCurve() {
114 return new WebFloatAnimationCurveImpl();
117 WebScrollOffsetAnimationCurve
*
118 WebCompositorSupportImpl::createScrollOffsetAnimationCurve(
119 blink::WebFloatPoint target_value
,
120 blink::WebCompositorAnimationCurve::TimingFunctionType timing_function
) {
121 return new WebScrollOffsetAnimationCurveImpl(target_value
, timing_function
);
124 WebTransformAnimationCurve
*
125 WebCompositorSupportImpl::createTransformAnimationCurve() {
126 return new WebTransformAnimationCurveImpl();
129 WebTransformOperations
* WebCompositorSupportImpl::createTransformOperations() {
130 return new WebTransformOperationsImpl();
133 WebFilterOperations
* WebCompositorSupportImpl::createFilterOperations() {
134 return new WebFilterOperationsImpl();
137 } // namespace cc_blink