summaryrefslogtreecommitdiffstats
path: root/cc/animation
diff options
context:
space:
mode:
authornainar <nainar@chromium.org>2015-09-02 18:04:10 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-03 01:04:59 +0000
commit8ca8ee6d5165acb571a5f9d298ca3d80310e5f15 (patch)
tree9fe0309b79367e3af3c12c4dc6b0e05706e40ab6 /cc/animation
parent81937dc4a4fae2028c3c70f9c1c3f3414448f6de (diff)
downloadchromium_src-8ca8ee6d5165acb571a5f9d298ca3d80310e5f15.zip
chromium_src-8ca8ee6d5165acb571a5f9d298ca3d80310e5f15.tar.gz
chromium_src-8ca8ee6d5165acb571a5f9d298ca3d80310e5f15.tar.bz2
Apply skew on both axes together rather than sequentially on Compositor
thread. Currently skew is not implemented correctly on the Compositor thread. Instead of calling skew(angle_x, angle_y), the implementation calls skewX(angle_x) followed by skewY(angle_y). This leads to a different result. This patch applied skew on both axes together rather than calling skewX(angle_x) and skewX(angle_Y) sequentially. FF and IE correctly call skew(angle_x, angle_y). BUG=268468 Review URL: https://codereview.chromium.org/1325803002 Cr-Commit-Position: refs/heads/master@{#347089}
Diffstat (limited to 'cc/animation')
-rw-r--r--cc/animation/transform_operation.cc4
-rw-r--r--cc/animation/transform_operations.cc3
-rw-r--r--cc/animation/transform_operations_unittest.cc15
3 files changed, 8 insertions, 14 deletions
diff --git a/cc/animation/transform_operation.cc b/cc/animation/transform_operation.cc
index 7421924..465429d 100644
--- a/cc/animation/transform_operation.cc
+++ b/cc/animation/transform_operation.cc
@@ -157,8 +157,8 @@ bool TransformOperation::BlendTransformOperations(
SkMScalar from_y = IsOperationIdentity(from) ? 0 : from->skew.y;
SkMScalar to_x = IsOperationIdentity(to) ? 0 : to->skew.x;
SkMScalar to_y = IsOperationIdentity(to) ? 0 : to->skew.y;
- result->SkewX(BlendSkMScalars(from_x, to_x, progress));
- result->SkewY(BlendSkMScalars(from_y, to_y, progress));
+ result->Skew(BlendSkMScalars(from_x, to_x, progress),
+ BlendSkMScalars(from_y, to_y, progress));
break;
}
case TransformOperation::TRANSFORM_OPERATION_PERSPECTIVE: {
diff --git a/cc/animation/transform_operations.cc b/cc/animation/transform_operations.cc
index fb1c17d..29a3d90 100644
--- a/cc/animation/transform_operations.cc
+++ b/cc/animation/transform_operations.cc
@@ -224,8 +224,7 @@ void TransformOperations::AppendScale(SkMScalar x, SkMScalar y, SkMScalar z) {
void TransformOperations::AppendSkew(SkMScalar x, SkMScalar y) {
TransformOperation to_add;
- to_add.matrix.SkewX(x);
- to_add.matrix.SkewY(y);
+ to_add.matrix.Skew(x, y);
to_add.type = TransformOperation::TRANSFORM_OPERATION_SKEW;
to_add.skew.x = x;
to_add.skew.y = y;
diff --git a/cc/animation/transform_operations_unittest.cc b/cc/animation/transform_operations_unittest.cc
index c5fb3c6..5a195227 100644
--- a/cc/animation/transform_operations_unittest.cc
+++ b/cc/animation/transform_operations_unittest.cc
@@ -209,8 +209,7 @@ TEST(TransformOperationTest, ApplySkew) {
TransformOperations operations;
operations.AppendSkew(x, y);
gfx::Transform expected;
- expected.SkewX(x);
- expected.SkewY(y);
+ expected.Skew(x, y);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected, operations.Apply());
}
@@ -552,8 +551,7 @@ TEST(TransformOperationTest, BlendSkewFromEmpty) {
SkMScalar progress = 0.5f;
gfx::Transform expected;
- expected.SkewX(1);
- expected.SkewY(1);
+ expected.Skew(1, 1);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected,
operations.Blend(empty_operation, progress));
@@ -561,8 +559,7 @@ TEST(TransformOperationTest, BlendSkewFromEmpty) {
progress = -0.5f;
expected.MakeIdentity();
- expected.SkewX(-1);
- expected.SkewY(-1);
+ expected.Skew(-1, -1);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected,
operations.Blend(empty_operation, progress));
@@ -570,8 +567,7 @@ TEST(TransformOperationTest, BlendSkewFromEmpty) {
progress = 1.5f;
expected.MakeIdentity();
- expected.SkewX(3);
- expected.SkewY(3);
+ expected.Skew(3, 3);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected,
operations.Blend(empty_operation, progress));
@@ -658,8 +654,7 @@ TEST(TransformOperationTest, BlendSkewToEmpty) {
SkMScalar progress = 0.5f;
gfx::Transform expected;
- expected.SkewX(1);
- expected.SkewY(1);
+ expected.Skew(1, 1);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected,
empty_operation.Blend(operations, progress));