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 "cc/animation/transform_operations.h"
9 #include "cc/blink/web_animation_impl.h"
10 #include "cc/blink/web_compositor_animation_player_impl.h"
11 #include "cc/blink/web_compositor_animation_timeline_impl.h"
12 #include "cc/blink/web_content_layer_impl.h"
13 #include "cc/blink/web_display_item_list_impl.h"
14 #include "cc/blink/web_external_texture_layer_impl.h"
15 #include "cc/blink/web_filter_animation_curve_impl.h"
16 #include "cc/blink/web_filter_operations_impl.h"
17 #include "cc/blink/web_float_animation_curve_impl.h"
18 #include "cc/blink/web_image_layer_impl.h"
19 #include "cc/blink/web_layer_impl.h"
20 #include "cc/blink/web_scroll_offset_animation_curve_impl.h"
21 #include "cc/blink/web_scrollbar_layer_impl.h"
22 #include "cc/blink/web_transform_animation_curve_impl.h"
23 #include "cc/blink/web_transform_operations_impl.h"
24 #include "cc/output/output_surface.h"
25 #include "cc/output/software_output_device.h"
27 using blink::WebCompositorAnimation
;
28 using blink::WebCompositorAnimationCurve
;
29 using blink::WebCompositorAnimationPlayer
;
30 using blink::WebCompositorAnimationTimeline
;
31 using blink::WebContentLayer
;
32 using blink::WebContentLayerClient
;
33 using blink::WebDisplayItemList
;
34 using blink::WebExternalTextureLayer
;
35 using blink::WebExternalTextureLayerClient
;
36 using blink::WebFilterAnimationCurve
;
37 using blink::WebFilterOperations
;
38 using blink::WebFloatAnimationCurve
;
39 using blink::WebImageLayer
;
40 using blink::WebLayer
;
41 using blink::WebScrollbar
;
42 using blink::WebScrollbarLayer
;
43 using blink::WebScrollbarThemeGeometry
;
44 using blink::WebScrollbarThemePainter
;
45 using blink::WebScrollOffsetAnimationCurve
;
46 using blink::WebTransformAnimationCurve
;
47 using blink::WebTransformOperations
;
51 WebCompositorSupportImpl::WebCompositorSupportImpl() {
54 WebCompositorSupportImpl::~WebCompositorSupportImpl() {
57 WebLayer
* WebCompositorSupportImpl::createLayer() {
58 return new WebLayerImpl();
61 WebContentLayer
* WebCompositorSupportImpl::createContentLayer(
62 WebContentLayerClient
* client
) {
63 return new WebContentLayerImpl(client
);
66 WebExternalTextureLayer
* WebCompositorSupportImpl::createExternalTextureLayer(
67 WebExternalTextureLayerClient
* client
) {
68 return new WebExternalTextureLayerImpl(client
);
71 blink::WebImageLayer
* WebCompositorSupportImpl::createImageLayer() {
72 return new WebImageLayerImpl();
75 WebScrollbarLayer
* WebCompositorSupportImpl::createScrollbarLayer(
76 WebScrollbar
* scrollbar
,
77 WebScrollbarThemePainter painter
,
78 WebScrollbarThemeGeometry
* geometry
) {
79 return new WebScrollbarLayerImpl(scrollbar
, painter
, geometry
);
82 WebScrollbarLayer
* WebCompositorSupportImpl::createSolidColorScrollbarLayer(
83 WebScrollbar::Orientation orientation
,
86 bool is_left_side_vertical_scrollbar
) {
87 return new WebScrollbarLayerImpl(orientation
,
90 is_left_side_vertical_scrollbar
);
93 WebCompositorAnimation
* WebCompositorSupportImpl::createAnimation(
94 const blink::WebCompositorAnimationCurve
& curve
,
95 blink::WebCompositorAnimation::TargetProperty target
,
98 return new WebCompositorAnimationImpl(curve
, target
, animation_id
, group_id
);
101 WebFilterAnimationCurve
*
102 WebCompositorSupportImpl::createFilterAnimationCurve() {
103 return new WebFilterAnimationCurveImpl();
106 WebFloatAnimationCurve
* WebCompositorSupportImpl::createFloatAnimationCurve() {
107 return new WebFloatAnimationCurveImpl();
110 WebScrollOffsetAnimationCurve
*
111 WebCompositorSupportImpl::createScrollOffsetAnimationCurve(
112 blink::WebFloatPoint target_value
,
113 blink::WebCompositorAnimationCurve::TimingFunctionType timing_function
) {
114 return new WebScrollOffsetAnimationCurveImpl(target_value
, timing_function
);
117 WebTransformAnimationCurve
*
118 WebCompositorSupportImpl::createTransformAnimationCurve() {
119 return new WebTransformAnimationCurveImpl();
122 WebTransformOperations
* WebCompositorSupportImpl::createTransformOperations() {
123 return new WebTransformOperationsImpl();
126 WebFilterOperations
* WebCompositorSupportImpl::createFilterOperations() {
127 return new WebFilterOperationsImpl();
130 WebDisplayItemList
* WebCompositorSupportImpl::createDisplayItemList() {
131 return new WebDisplayItemListImpl();
134 WebCompositorAnimationPlayer
*
135 WebCompositorSupportImpl::createAnimationPlayer() {
136 return new WebCompositorAnimationPlayerImpl();
139 WebCompositorAnimationTimeline
*
140 WebCompositorSupportImpl::createAnimationTimeline() {
141 return new WebCompositorAnimationTimelineImpl();
144 } // namespace cc_blink