| Index: ui/gfx/color_utils_unittest.cc
|
| diff --git a/ui/gfx/color_utils_unittest.cc b/ui/gfx/color_utils_unittest.cc
|
| index 2993fe45a5d122e19f60b796c9bb7dfd5eec5691..584790a3fb7d01a631e30d35a518ea9ce009cd22 100644
|
| --- a/ui/gfx/color_utils_unittest.cc
|
| +++ b/ui/gfx/color_utils_unittest.cc
|
| @@ -165,4 +165,31 @@ TEST(ColorUtils, AlphaBlend) {
|
| EXPECT_EQ(0U, SkColorGetA(AlphaBlend(fore, back, 255)));
|
| }
|
|
|
| +TEST(ColorUtils, Matrix4x3) {
|
| + Matrix4x3 tmp;
|
| + EXPECT_EQ(tmp.lookup(3, 3), 1.0f);
|
| + tmp.rows[0][2] = 4.0f;
|
| + tmp.rows[2][1] = 8.0f;
|
| + Matrix4x3 copy = tmp.Invert().Invert();
|
| + EXPECT_EQ(tmp.rows[0][2], 4.0f);
|
| + EXPECT_EQ(tmp.rows[2][1], 8.0f);
|
| + for (int row = 0; row < 3; row++) {
|
| + for (int col = 0; col < 4; col++) {
|
| + copy.rows[row][col] = 0.0f;
|
| + }
|
| + }
|
| + copy = copy * tmp;
|
| + for (int row = 0; row < 3; row++) {
|
| + for (int col = 0; col < 4; col++) {
|
| + EXPECT_EQ(copy.lookup(row, col), 0.0f);
|
| + }
|
| + }
|
| +
|
| + TriStim tmp2(1.0f, 2.0f, 3.0f);
|
| + tmp2 = copy * tmp2;
|
| + EXPECT_EQ(tmp2.values[0], 0.0f);
|
| + EXPECT_EQ(tmp2.values[1], 0.0f);
|
| + EXPECT_EQ(tmp2.values[2], 0.0f);
|
| +}
|
| +
|
| } // namespace color_utils
|
|
|