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