Index: cc/output/filter_operations_unittest.cc |
diff --git a/cc/output/filter_operations_unittest.cc b/cc/output/filter_operations_unittest.cc |
index 7f439b9f15c102469eb9ee2b1f41067baeec7b19..329601fd7260aabc89f5b693203ce5071d09bb11 100644 |
--- a/cc/output/filter_operations_unittest.cc |
+++ b/cc/output/filter_operations_unittest.cc |
@@ -644,8 +644,7 @@ TEST(FilterOperationsTest, BlendEmptySequences) { |
EXPECT_EQ(blended, empty); |
} |
-// Tests blending non-empty sequences that either have different lengths or |
-// have non-matching operations. |
+// Tests blending non-empty sequences that have non-matching operations. |
TEST(FilterOperationsTest, BlendNonMatchingSequences) { |
FilterOperations from; |
FilterOperations to; |
@@ -653,6 +652,7 @@ TEST(FilterOperationsTest, BlendNonMatchingSequences) { |
from.Append(FilterOperation::CreateSaturateFilter(3.f)); |
from.Append(FilterOperation::CreateBlurFilter(2.f)); |
to.Append(FilterOperation::CreateSaturateFilter(4.f)); |
+ to.Append(FilterOperation::CreateHueRotateFilter(0.5f)); |
FilterOperations blended = to.Blend(from, -0.75); |
EXPECT_EQ(to, blended); |
@@ -660,8 +660,37 @@ TEST(FilterOperationsTest, BlendNonMatchingSequences) { |
EXPECT_EQ(to, blended); |
blended = to.Blend(from, 1.5); |
EXPECT_EQ(to, blended); |
+} |
- to.Append(FilterOperation::CreateHueRotateFilter(0.5f)); |
+// Tests blending non-empty sequences of different sizes. |
+TEST(FilterOperationsTest, BlendRaggedSequences) { |
+ FilterOperations from; |
+ FilterOperations to; |
+ |
+ from.Append(FilterOperation::CreateSaturateFilter(3.f)); |
+ from.Append(FilterOperation::CreateBlurFilter(2.f)); |
+ to.Append(FilterOperation::CreateSaturateFilter(4.f)); |
+ |
+ FilterOperations blended = to.Blend(from, -0.75); |
+ FilterOperations expected; |
+ expected.Append(FilterOperation::CreateSaturateFilter(2.25f)); |
+ expected.Append(FilterOperation::CreateBlurFilter(3.5f)); |
+ EXPECT_EQ(expected, blended); |
+ |
+ blended = to.Blend(from, 0.75); |
+ expected.Clear(); |
+ expected.Append(FilterOperation::CreateSaturateFilter(3.75f)); |
+ expected.Append(FilterOperation::CreateBlurFilter(0.5f)); |
+ EXPECT_EQ(expected, blended); |
+ |
+ blended = to.Blend(from, 1.5); |
+ expected.Clear(); |
+ expected.Append(FilterOperation::CreateSaturateFilter(4.5f)); |
+ expected.Append(FilterOperation::CreateBlurFilter(0.f)); |
+ EXPECT_EQ(expected, blended); |
+ |
+ from.Append(FilterOperation::CreateOpacityFilter(1.f)); |
+ to.Append(FilterOperation::CreateOpacityFilter(1.f)); |
blended = to.Blend(from, -0.75); |
EXPECT_EQ(to, blended); |
blended = to.Blend(from, 0.75); |