OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/animation/keyframed_animation_curve.h" | 5 #include "cc/animation/keyframed_animation_curve.h" |
6 | 6 |
7 #include "cc/animation/transform_operations.h" | 7 #include "cc/animation/transform_operations.h" |
8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "ui/gfx/animation/tween.h" | 10 #include "ui/gfx/animation/tween.h" |
11 #include "ui/gfx/box_f.h" | 11 #include "ui/gfx/geometry/box_f.h" |
12 #include "ui/gfx/test/gfx_util.h" | 12 #include "ui/gfx/test/gfx_util.h" |
13 | 13 |
14 namespace cc { | 14 namespace cc { |
15 namespace { | 15 namespace { |
16 | 16 |
17 void ExpectTranslateX(SkMScalar translate_x, const gfx::Transform& transform) { | 17 void ExpectTranslateX(SkMScalar translate_x, const gfx::Transform& transform) { |
18 EXPECT_FLOAT_EQ(translate_x, transform.matrix().get(0, 3)); | 18 EXPECT_FLOAT_EQ(translate_x, transform.matrix().get(0, 3)); |
19 } | 19 } |
20 | 20 |
21 void ExpectBrightness(double brightness, const FilterOperations& filter) { | 21 void ExpectBrightness(double brightness, const FilterOperations& filter) { |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 curve->AddKeyframe(FloatKeyframe::Create(4.0, 9.f, nullptr)); | 581 curve->AddKeyframe(FloatKeyframe::Create(4.0, 9.f, nullptr)); |
582 // Curve timing function producing outputs outside of range [0,1]. | 582 // Curve timing function producing outputs outside of range [0,1]. |
583 curve->SetTimingFunction( | 583 curve->SetTimingFunction( |
584 CubicBezierTimingFunction::Create(0.5f, -0.5f, 0.5f, 1.5f).Pass()); | 584 CubicBezierTimingFunction::Create(0.5f, -0.5f, 0.5f, 1.5f).Pass()); |
585 EXPECT_LE(curve->GetValue(1.f), 0.f); // c(.25) < 0 | 585 EXPECT_LE(curve->GetValue(1.f), 0.f); // c(.25) < 0 |
586 EXPECT_GE(curve->GetValue(3.f), 9.f); // c(.75) > 1 | 586 EXPECT_GE(curve->GetValue(3.f), 9.f); // c(.75) > 1 |
587 } | 587 } |
588 | 588 |
589 } // namespace | 589 } // namespace |
590 } // namespace cc | 590 } // namespace cc |
OLD | NEW |