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"
9 TestLayerAnimationDelegate::TestLayerAnimationDelegate()
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
) {
34 void TestLayerAnimationDelegate::SetTransformFromAnimation(
35 const gfx::Transform
& transform
) {
36 transform_
= transform
;
39 void TestLayerAnimationDelegate::SetOpacityFromAnimation(float 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
) {
59 void TestLayerAnimationDelegate::ScheduleDrawForAnimation() {
62 const gfx::Rect
& TestLayerAnimationDelegate::GetBoundsForAnimation() const {
66 gfx::Transform
TestLayerAnimationDelegate::GetTransformForAnimation() const {
70 float TestLayerAnimationDelegate::GetOpacityForAnimation() const {
74 bool TestLayerAnimationDelegate::GetVisibilityForAnimation() const {
78 float TestLayerAnimationDelegate::GetBrightnessForAnimation() const {
82 float TestLayerAnimationDelegate::GetGrayscaleForAnimation() const {
86 SkColor
TestLayerAnimationDelegate::GetColorForAnimation() const {
90 float TestLayerAnimationDelegate::GetDeviceScaleFactor() const {
94 void TestLayerAnimationDelegate::AddThreadedAnimation(
95 scoped_ptr
<cc::Animation
> animation
) {
98 void TestLayerAnimationDelegate::RemoveThreadedAnimation(int animation_id
) {
101 LayerAnimatorCollection
*
102 TestLayerAnimationDelegate::GetLayerAnimatorCollection() {