| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/compositor/layer.h" | 5 #include "ui/compositor/layer.h" |
| 6 #include "ui/compositor/test/test_layer_animation_delegate.h" | 6 #include "ui/compositor/test/test_layer_animation_delegate.h" |
| 7 | 7 |
| 8 namespace ui { | 8 namespace ui { |
| 9 | 9 |
| 10 TestLayerThreadedAnimationDelegate::TestLayerThreadedAnimationDelegate() {} | 10 TestLayerThreadedAnimationDelegate::TestLayerThreadedAnimationDelegate() {} |
| 11 | 11 |
| 12 TestLayerThreadedAnimationDelegate::~TestLayerThreadedAnimationDelegate() {} | 12 TestLayerThreadedAnimationDelegate::~TestLayerThreadedAnimationDelegate() {} |
| 13 | 13 |
| 14 TestLayerAnimationDelegate::TestLayerAnimationDelegate() | 14 TestLayerAnimationDelegate::TestLayerAnimationDelegate() |
| 15 : opacity_(1.0f), | 15 : opacity_(1.0f), |
| 16 visibility_(true), | 16 visibility_(true), |
| 17 brightness_(0.0f), | 17 brightness_(0.0f), |
| 18 grayscale_(0.0f), | 18 grayscale_(0.0f), |
| 19 color_(SK_ColorBLACK) { | 19 color_(SK_ColorBLACK), |
| 20 temperature_(0.0f) { |
| 20 CreateCcLayer(); | 21 CreateCcLayer(); |
| 21 } | 22 } |
| 22 | 23 |
| 23 TestLayerAnimationDelegate::TestLayerAnimationDelegate( | 24 TestLayerAnimationDelegate::TestLayerAnimationDelegate( |
| 24 const LayerAnimationDelegate& other) | 25 const LayerAnimationDelegate& other) |
| 25 : bounds_(other.GetBoundsForAnimation()), | 26 : bounds_(other.GetBoundsForAnimation()), |
| 26 transform_(other.GetTransformForAnimation()), | 27 transform_(other.GetTransformForAnimation()), |
| 27 opacity_(other.GetOpacityForAnimation()), | 28 opacity_(other.GetOpacityForAnimation()), |
| 28 visibility_(other.GetVisibilityForAnimation()), | 29 visibility_(other.GetVisibilityForAnimation()), |
| 29 color_(SK_ColorBLACK) { | 30 color_(SK_ColorBLACK), |
| 31 temperature_(0.0f) { |
| 30 CreateCcLayer(); | 32 CreateCcLayer(); |
| 31 } | 33 } |
| 32 | 34 |
| 33 TestLayerAnimationDelegate::TestLayerAnimationDelegate( | 35 TestLayerAnimationDelegate::TestLayerAnimationDelegate( |
| 34 const TestLayerAnimationDelegate& other) = default; | 36 const TestLayerAnimationDelegate& other) = default; |
| 35 | 37 |
| 36 TestLayerAnimationDelegate::~TestLayerAnimationDelegate() { | 38 TestLayerAnimationDelegate::~TestLayerAnimationDelegate() { |
| 37 } | 39 } |
| 38 | 40 |
| 39 void TestLayerAnimationDelegate::SetBoundsFromAnimation( | 41 void TestLayerAnimationDelegate::SetBoundsFromAnimation( |
| (...skipping 19 matching lines...) Expand all Loading... |
| 59 } | 61 } |
| 60 | 62 |
| 61 void TestLayerAnimationDelegate::SetGrayscaleFromAnimation(float grayscale) { | 63 void TestLayerAnimationDelegate::SetGrayscaleFromAnimation(float grayscale) { |
| 62 grayscale_ = grayscale; | 64 grayscale_ = grayscale; |
| 63 } | 65 } |
| 64 | 66 |
| 65 void TestLayerAnimationDelegate::SetColorFromAnimation(SkColor color) { | 67 void TestLayerAnimationDelegate::SetColorFromAnimation(SkColor color) { |
| 66 color_ = color; | 68 color_ = color; |
| 67 } | 69 } |
| 68 | 70 |
| 71 void TestLayerAnimationDelegate::SetTemperatureFromAnimation( |
| 72 float temperature) { |
| 73 temperature_ = temperature; |
| 74 } |
| 75 |
| 69 void TestLayerAnimationDelegate::ScheduleDrawForAnimation() { | 76 void TestLayerAnimationDelegate::ScheduleDrawForAnimation() { |
| 70 } | 77 } |
| 71 | 78 |
| 72 const gfx::Rect& TestLayerAnimationDelegate::GetBoundsForAnimation() const { | 79 const gfx::Rect& TestLayerAnimationDelegate::GetBoundsForAnimation() const { |
| 73 return bounds_; | 80 return bounds_; |
| 74 } | 81 } |
| 75 | 82 |
| 76 gfx::Transform TestLayerAnimationDelegate::GetTransformForAnimation() const { | 83 gfx::Transform TestLayerAnimationDelegate::GetTransformForAnimation() const { |
| 77 return transform_; | 84 return transform_; |
| 78 } | 85 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 90 } | 97 } |
| 91 | 98 |
| 92 float TestLayerAnimationDelegate::GetGrayscaleForAnimation() const { | 99 float TestLayerAnimationDelegate::GetGrayscaleForAnimation() const { |
| 93 return grayscale_; | 100 return grayscale_; |
| 94 } | 101 } |
| 95 | 102 |
| 96 SkColor TestLayerAnimationDelegate::GetColorForAnimation() const { | 103 SkColor TestLayerAnimationDelegate::GetColorForAnimation() const { |
| 97 return color_; | 104 return color_; |
| 98 } | 105 } |
| 99 | 106 |
| 107 float TestLayerAnimationDelegate::GetTemperatureFromAnimation() const { |
| 108 return temperature_; |
| 109 } |
| 110 |
| 100 float TestLayerAnimationDelegate::GetDeviceScaleFactor() const { | 111 float TestLayerAnimationDelegate::GetDeviceScaleFactor() const { |
| 101 return 1.0f; | 112 return 1.0f; |
| 102 } | 113 } |
| 103 | 114 |
| 104 LayerAnimatorCollection* | 115 LayerAnimatorCollection* |
| 105 TestLayerAnimationDelegate::GetLayerAnimatorCollection() { | 116 TestLayerAnimationDelegate::GetLayerAnimatorCollection() { |
| 106 return NULL; | 117 return NULL; |
| 107 } | 118 } |
| 108 | 119 |
| 109 cc::Layer* TestLayerAnimationDelegate::GetCcLayer() const { | 120 cc::Layer* TestLayerAnimationDelegate::GetCcLayer() const { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 128 cc_layer_ = cc::Layer::Create(); | 139 cc_layer_ = cc::Layer::Create(); |
| 129 } | 140 } |
| 130 | 141 |
| 131 void TestLayerThreadedAnimationDelegate::AddThreadedAnimation( | 142 void TestLayerThreadedAnimationDelegate::AddThreadedAnimation( |
| 132 std::unique_ptr<cc::Animation> animation) {} | 143 std::unique_ptr<cc::Animation> animation) {} |
| 133 | 144 |
| 134 void TestLayerThreadedAnimationDelegate::RemoveThreadedAnimation( | 145 void TestLayerThreadedAnimationDelegate::RemoveThreadedAnimation( |
| 135 int animation_id) {} | 146 int animation_id) {} |
| 136 | 147 |
| 137 } // namespace ui | 148 } // namespace ui |
| OLD | NEW |