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. 4 5#include "ui/compositor/test/test_layer_animation_delegate.h" 6 7namespace ui { 8 9TestLayerAnimationDelegate::TestLayerAnimationDelegate() 10 : opacity_(1.0f), 11 visibility_(true), 12 brightness_(0.0f), 13 grayscale_(0.0f), 14 color_(SK_ColorBLACK) { 15} 16 17TestLayerAnimationDelegate::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) { 24} 25 26TestLayerAnimationDelegate::~TestLayerAnimationDelegate() { 27} 28 29void TestLayerAnimationDelegate::SetBoundsFromAnimation( 30 const gfx::Rect& bounds) { 31 bounds_ = bounds; 32} 33 34void TestLayerAnimationDelegate::SetTransformFromAnimation( 35 const gfx::Transform& transform) { 36 transform_ = transform; 37} 38 39void TestLayerAnimationDelegate::SetOpacityFromAnimation(float opacity) { 40 opacity_ = opacity; 41} 42 43void TestLayerAnimationDelegate::SetVisibilityFromAnimation(bool visibility) { 44 visibility_ = visibility; 45} 46 47void TestLayerAnimationDelegate::SetBrightnessFromAnimation(float brightness) { 48 brightness_ = brightness; 49} 50 51void TestLayerAnimationDelegate::SetGrayscaleFromAnimation(float grayscale) { 52 grayscale_ = grayscale; 53} 54 55void TestLayerAnimationDelegate::SetColorFromAnimation(SkColor color) { 56 color_ = color; 57} 58 59void TestLayerAnimationDelegate::ScheduleDrawForAnimation() { 60} 61 62const gfx::Rect& TestLayerAnimationDelegate::GetBoundsForAnimation() const { 63 return bounds_; 64} 65 66gfx::Transform TestLayerAnimationDelegate::GetTransformForAnimation() const { 67 return transform_; 68} 69 70float TestLayerAnimationDelegate::GetOpacityForAnimation() const { 71 return opacity_; 72} 73 74bool TestLayerAnimationDelegate::GetVisibilityForAnimation() const { 75 return visibility_; 76} 77 78float TestLayerAnimationDelegate::GetBrightnessForAnimation() const { 79 return brightness_; 80} 81 82float TestLayerAnimationDelegate::GetGrayscaleForAnimation() const { 83 return grayscale_; 84} 85 86SkColor TestLayerAnimationDelegate::GetColorForAnimation() const { 87 return color_; 88} 89 90float TestLayerAnimationDelegate::GetDeviceScaleFactor() const { 91 return 1.0f; 92} 93 94void TestLayerAnimationDelegate::AddThreadedAnimation( 95 scoped_ptr<cc::Animation> animation) { 96} 97 98void TestLayerAnimationDelegate::RemoveThreadedAnimation(int animation_id) { 99} 100 101LayerAnimatorCollection* 102TestLayerAnimationDelegate::GetLayerAnimatorCollection() { 103 return NULL; 104} 105 106} // namespace ui 107