diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-11 23:06:45 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-11 23:06:45 +0000 |
commit | e81480f1fd21a75545b1c5dda31a1e7c8abf847f (patch) | |
tree | 8d641760c07be0b750e8ab019e7849b097769774 /ui/compositor/test | |
parent | f3b63bc8ea7b4ef0aa474fde036a526c7ef68d59 (diff) | |
download | chromium_src-e81480f1fd21a75545b1c5dda31a1e7c8abf847f.zip chromium_src-e81480f1fd21a75545b1c5dda31a1e7c8abf847f.tar.gz chromium_src-e81480f1fd21a75545b1c5dda31a1e7c8abf847f.tar.bz2 |
Adds ability to animate the color of a layer.
BUG=155179
TEST=none
R=vollick@chromium.org
Review URL: https://codereview.chromium.org/11103037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161432 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/compositor/test')
-rw-r--r-- | ui/compositor/test/test_layer_animation_delegate.cc | 14 | ||||
-rw-r--r-- | ui/compositor/test/test_layer_animation_delegate.h | 3 |
2 files changed, 15 insertions, 2 deletions
diff --git a/ui/compositor/test/test_layer_animation_delegate.cc b/ui/compositor/test/test_layer_animation_delegate.cc index bb5cdc5..f5e9262 100644 --- a/ui/compositor/test/test_layer_animation_delegate.cc +++ b/ui/compositor/test/test_layer_animation_delegate.cc @@ -10,7 +10,8 @@ TestLayerAnimationDelegate::TestLayerAnimationDelegate() : opacity_(1.0f), visibility_(true), brightness_(0.0f), - grayscale_(0.0f) { + grayscale_(0.0f), + color_(SK_ColorBLACK) { } TestLayerAnimationDelegate::TestLayerAnimationDelegate( @@ -18,7 +19,8 @@ TestLayerAnimationDelegate::TestLayerAnimationDelegate( : bounds_(other.GetBoundsForAnimation()), transform_(other.GetTransformForAnimation()), opacity_(other.GetOpacityForAnimation()), - visibility_(other.GetVisibilityForAnimation()) { + visibility_(other.GetVisibilityForAnimation()), + color_(SK_ColorBLACK) { } TestLayerAnimationDelegate::~TestLayerAnimationDelegate() { @@ -50,6 +52,10 @@ void TestLayerAnimationDelegate::SetGrayscaleFromAnimation(float grayscale) { grayscale_ = grayscale; } +void TestLayerAnimationDelegate::SetColorFromAnimation(SkColor color) { + color_ = color; +} + void TestLayerAnimationDelegate::ScheduleDrawForAnimation() { } @@ -77,4 +83,8 @@ float TestLayerAnimationDelegate::GetGrayscaleForAnimation() const { return grayscale_; } +SkColor TestLayerAnimationDelegate::GetColorForAnimation() const { + return color_; +} + } // namespace ui diff --git a/ui/compositor/test/test_layer_animation_delegate.h b/ui/compositor/test/test_layer_animation_delegate.h index a17fbf3..e492d4a 100644 --- a/ui/compositor/test/test_layer_animation_delegate.h +++ b/ui/compositor/test/test_layer_animation_delegate.h @@ -25,6 +25,7 @@ class TestLayerAnimationDelegate : public LayerAnimationDelegate { virtual void SetVisibilityFromAnimation(bool visibility) OVERRIDE; virtual void SetBrightnessFromAnimation(float brightness) OVERRIDE; virtual void SetGrayscaleFromAnimation(float grayscale) OVERRIDE; + virtual void SetColorFromAnimation(SkColor color) OVERRIDE; virtual void ScheduleDrawForAnimation() OVERRIDE; virtual const gfx::Rect& GetBoundsForAnimation() const OVERRIDE; virtual const Transform& GetTransformForAnimation() const OVERRIDE; @@ -32,6 +33,7 @@ class TestLayerAnimationDelegate : public LayerAnimationDelegate { virtual bool GetVisibilityForAnimation() const OVERRIDE; virtual float GetBrightnessForAnimation() const OVERRIDE; virtual float GetGrayscaleForAnimation() const OVERRIDE; + virtual SkColor GetColorForAnimation() const OVERRIDE; private: gfx::Rect bounds_; @@ -40,6 +42,7 @@ class TestLayerAnimationDelegate : public LayerAnimationDelegate { bool visibility_; float brightness_; float grayscale_; + SkColor color_; // Allow copy and assign. }; |