Drive: Add BatchableRequest subclass.
[chromium-blink-merge.git] / ui / compositor / test / test_layer_animation_delegate.cc
blobe6053d6765d04c90f5fa4a36023978500ae18610
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.
5 #include "ui/compositor/test/test_layer_animation_delegate.h"
7 namespace ui {
9 TestLayerAnimationDelegate::TestLayerAnimationDelegate()
10 : opacity_(1.0f),
11 visibility_(true),
12 brightness_(0.0f),
13 grayscale_(0.0f),
14 color_(SK_ColorBLACK) {
17 TestLayerAnimationDelegate::TestLayerAnimationDelegate(
18 const LayerAnimationDelegate& other)
19 : bounds_(other.GetBoundsForAnimation()),
20 transform_(other.GetTransformForAnimation()),
21 opacity_(other.GetOpacityForAnimation()),
22 visibility_(other.GetVisibilityForAnimation()),
23 color_(SK_ColorBLACK) {
26 TestLayerAnimationDelegate::~TestLayerAnimationDelegate() {
29 void TestLayerAnimationDelegate::SetBoundsFromAnimation(
30 const gfx::Rect& bounds) {
31 bounds_ = bounds;
34 void TestLayerAnimationDelegate::SetTransformFromAnimation(
35 const gfx::Transform& transform) {
36 transform_ = transform;
39 void TestLayerAnimationDelegate::SetOpacityFromAnimation(float opacity) {
40 opacity_ = opacity;
43 void TestLayerAnimationDelegate::SetVisibilityFromAnimation(bool visibility) {
44 visibility_ = visibility;
47 void TestLayerAnimationDelegate::SetBrightnessFromAnimation(float brightness) {
48 brightness_ = brightness;
51 void TestLayerAnimationDelegate::SetGrayscaleFromAnimation(float grayscale) {
52 grayscale_ = grayscale;
55 void TestLayerAnimationDelegate::SetColorFromAnimation(SkColor color) {
56 color_ = color;
59 void TestLayerAnimationDelegate::ScheduleDrawForAnimation() {
62 const gfx::Rect& TestLayerAnimationDelegate::GetBoundsForAnimation() const {
63 return bounds_;
66 gfx::Transform TestLayerAnimationDelegate::GetTransformForAnimation() const {
67 return transform_;
70 float TestLayerAnimationDelegate::GetOpacityForAnimation() const {
71 return opacity_;
74 bool TestLayerAnimationDelegate::GetVisibilityForAnimation() const {
75 return visibility_;
78 float TestLayerAnimationDelegate::GetBrightnessForAnimation() const {
79 return brightness_;
82 float TestLayerAnimationDelegate::GetGrayscaleForAnimation() const {
83 return grayscale_;
86 SkColor TestLayerAnimationDelegate::GetColorForAnimation() const {
87 return color_;
90 float TestLayerAnimationDelegate::GetDeviceScaleFactor() const {
91 return 1.0f;
94 void TestLayerAnimationDelegate::AddThreadedAnimation(
95 scoped_ptr<cc::Animation> animation) {
98 void TestLayerAnimationDelegate::RemoveThreadedAnimation(int animation_id) {
101 LayerAnimatorCollection*
102 TestLayerAnimationDelegate::GetLayerAnimatorCollection() {
103 return NULL;
106 } // namespace ui