Remove stale TODO in FrameTree::GetRenderViewHost.
[chromium-blink-merge.git] / cc / blink / web_compositor_support_impl.cc
blobe69abf69239c0e54fa2d51de45c7d89442dfb2cc
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_display_item_list_impl.h"
13 #include "cc/blink/web_external_texture_layer_impl.h"
14 #include "cc/blink/web_filter_animation_curve_impl.h"
15 #include "cc/blink/web_filter_operations_impl.h"
16 #include "cc/blink/web_float_animation_curve_impl.h"
17 #include "cc/blink/web_image_layer_impl.h"
18 #include "cc/blink/web_layer_impl.h"
19 #include "cc/blink/web_nine_patch_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::WebContentLayer;
30 using blink::WebContentLayerClient;
31 using blink::WebDisplayItemList;
32 using blink::WebExternalTextureLayer;
33 using blink::WebExternalTextureLayerClient;
34 using blink::WebFilterAnimationCurve;
35 using blink::WebFilterOperations;
36 using blink::WebFloatAnimationCurve;
37 using blink::WebImageLayer;
38 using blink::WebNinePatchLayer;
39 using blink::WebLayer;
40 using blink::WebScrollbar;
41 using blink::WebScrollbarLayer;
42 using blink::WebScrollbarThemeGeometry;
43 using blink::WebScrollbarThemePainter;
44 using blink::WebScrollOffsetAnimationCurve;
45 using blink::WebTransformAnimationCurve;
46 using blink::WebTransformOperations;
48 namespace cc_blink {
50 WebCompositorSupportImpl::WebCompositorSupportImpl() {
53 WebCompositorSupportImpl::~WebCompositorSupportImpl() {
56 WebLayer* WebCompositorSupportImpl::createLayer() {
57 return new WebLayerImpl();
60 WebContentLayer* WebCompositorSupportImpl::createContentLayer(
61 WebContentLayerClient* client) {
62 return new WebContentLayerImpl(client);
65 WebExternalTextureLayer* WebCompositorSupportImpl::createExternalTextureLayer(
66 WebExternalTextureLayerClient* client) {
67 return new WebExternalTextureLayerImpl(client);
70 blink::WebImageLayer* WebCompositorSupportImpl::createImageLayer() {
71 return new WebImageLayerImpl();
74 blink::WebNinePatchLayer* WebCompositorSupportImpl::createNinePatchLayer() {
75 return new WebNinePatchLayerImpl();
78 WebScrollbarLayer* WebCompositorSupportImpl::createScrollbarLayer(
79 WebScrollbar* scrollbar,
80 WebScrollbarThemePainter painter,
81 WebScrollbarThemeGeometry* geometry) {
82 return new WebScrollbarLayerImpl(scrollbar, painter, geometry);
85 WebScrollbarLayer* WebCompositorSupportImpl::createSolidColorScrollbarLayer(
86 WebScrollbar::Orientation orientation,
87 int thumb_thickness,
88 int track_start,
89 bool is_left_side_vertical_scrollbar) {
90 return new WebScrollbarLayerImpl(orientation,
91 thumb_thickness,
92 track_start,
93 is_left_side_vertical_scrollbar);
96 WebCompositorAnimation* WebCompositorSupportImpl::createAnimation(
97 const blink::WebCompositorAnimationCurve& curve,
98 blink::WebCompositorAnimation::TargetProperty target,
99 #ifdef WEB_COMPOSITOR_SUPPORT_CREATE_ANIMATION_SUPPORTS_GROUP
100 int group_id,
101 #endif
102 int animation_id) {
103 #ifdef WEB_COMPOSITOR_SUPPORT_CREATE_ANIMATION_SUPPORTS_GROUP
104 return new WebCompositorAnimationImpl(curve, target, animation_id, group_id);
105 #else
106 return new WebCompositorAnimationImpl(curve, target, animation_id, 0);
107 #endif
110 WebFilterAnimationCurve*
111 WebCompositorSupportImpl::createFilterAnimationCurve() {
112 return new WebFilterAnimationCurveImpl();
115 WebFloatAnimationCurve* WebCompositorSupportImpl::createFloatAnimationCurve() {
116 return new WebFloatAnimationCurveImpl();
119 WebScrollOffsetAnimationCurve*
120 WebCompositorSupportImpl::createScrollOffsetAnimationCurve(
121 blink::WebFloatPoint target_value,
122 blink::WebCompositorAnimationCurve::TimingFunctionType timing_function) {
123 return new WebScrollOffsetAnimationCurveImpl(target_value, timing_function);
126 WebTransformAnimationCurve*
127 WebCompositorSupportImpl::createTransformAnimationCurve() {
128 return new WebTransformAnimationCurveImpl();
131 WebTransformOperations* WebCompositorSupportImpl::createTransformOperations() {
132 return new WebTransformOperationsImpl();
135 WebFilterOperations* WebCompositorSupportImpl::createFilterOperations() {
136 return new WebFilterOperationsImpl();
139 } // namespace cc_blink