|
27 | 27 | #include "absl/strings/str_cat.h"
|
28 | 28 | #include "absl/strings/string_view.h"
|
29 | 29 | #include "absl/time/time.h"
|
| 30 | +#include "ink/brush/color_function.h" |
30 | 31 | #include "ink/brush/fuzz_domains.h"
|
| 32 | +#include "ink/color/color.h" |
31 | 33 | #include "ink/geometry/angle.h"
|
32 | 34 | #include "ink/geometry/vec.h"
|
33 | 35 |
|
@@ -94,8 +96,16 @@ TEST(BrushPaintTest, BrushPaintSupportsAbslHash) {
|
94 | 96 | std::string id2 = "bar";
|
95 | 97 | EXPECT_TRUE(absl::VerifyTypeImplementsAbslHashCorrectly({
|
96 | 98 | BrushPaint{},
|
97 |
| - BrushPaint{{{.client_texture_id = id1}}}, |
98 |
| - BrushPaint{{{.client_texture_id = id1}, {.client_texture_id = id2}}}, |
| 99 | + BrushPaint{.texture_layers = {{.client_texture_id = id1}}}, |
| 100 | + BrushPaint{.texture_layers = {{.client_texture_id = id2}}}, |
| 101 | + BrushPaint{.texture_layers = {{.client_texture_id = id1}, |
| 102 | + {.client_texture_id = id2}}}, |
| 103 | + BrushPaint{.color_functions = {{ColorFunction::OpacityMultiplier{0.5}}}}, |
| 104 | + BrushPaint{ |
| 105 | + .color_functions = {{ColorFunction::ReplaceColor{Color::Red()}}}}, |
| 106 | + BrushPaint{ |
| 107 | + .texture_layers = {{.client_texture_id = id1}}, |
| 108 | + .color_functions = {{ColorFunction::ReplaceColor{Color::Red()}}}}, |
99 | 109 | }));
|
100 | 110 | }
|
101 | 111 |
|
@@ -417,7 +427,7 @@ TEST(BrushPaintTest, StringifyTextureLayer) {
|
417 | 427 | }
|
418 | 428 |
|
419 | 429 | TEST(BrushPaintTest, StringifyBrushPaint) {
|
420 |
| - EXPECT_EQ(absl::StrCat(BrushPaint{}), "BrushPaint{texture_layers={}}"); |
| 430 | + EXPECT_EQ(absl::StrCat(BrushPaint{}), "BrushPaint{}"); |
421 | 431 | EXPECT_EQ(
|
422 | 432 | absl::StrCat(BrushPaint{.texture_layers = {{}}}),
|
423 | 433 | "BrushPaint{texture_layers={TextureLayer{client_texture_id=, "
|
@@ -628,6 +638,21 @@ TEST(BrushPaintTest, StringifyBrushPaint) {
|
628 | 638 | "keyframes={TextureKeyframe{progress=0.2, size=<2, 5>, rotation=0.125π}, "
|
629 | 639 | "TextureKeyframe{progress=0.4, offset=<2, 0.2>, opacity=0.4}}, "
|
630 | 640 | "blend_mode=kDstIn}}}");
|
| 641 | + EXPECT_EQ(absl::StrCat(BrushPaint{ |
| 642 | + .color_functions = {{ColorFunction::OpacityMultiplier{0.5}}}}), |
| 643 | + "BrushPaint{color_functions={OpacityMultiplier{0.5}}}"); |
| 644 | + EXPECT_EQ(absl::StrCat(BrushPaint{ |
| 645 | + .texture_layers = {{.client_texture_id = |
| 646 | + std::string(kTestTextureId)}}, |
| 647 | + .color_functions = {{ColorFunction::OpacityMultiplier{0.5}}}}), |
| 648 | + "BrushPaint{texture_layers={TextureLayer{client_texture_id=test-" |
| 649 | + "texture, mapping=kTiling, origin=kStrokeSpaceOrigin, " |
| 650 | + "size_unit=kStrokeCoordinates, wrap_x=kRepeat, wrap_y=kRepeat, " |
| 651 | + "size=<1, 1>, offset=<0, 0>, rotation=0π, size_jitter=<0, 0>, " |
| 652 | + "offset_jitter=<0, 0>, rotation_jitter=0π, opacity=1, " |
| 653 | + "animation_frames=1, animation_rows=1, animation_columns=1, " |
| 654 | + "animation_duration=1s, keyframes={}, blend_mode=kModulate}}, " |
| 655 | + "color_functions={OpacityMultiplier{0.5}}}"); |
631 | 656 | }
|
632 | 657 |
|
633 | 658 | TEST(BrushPaintTest, InvalidTextureLayerRotation) {
|
|
0 commit comments