Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit f6508c1

Browse files
bderodnfield
authored andcommitted
Remove extra premultiply from solid stroke/fill (#124)
1 parent 3c9f0e1 commit f6508c1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

impeller/aiks/paint.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ std::shared_ptr<Contents> Paint::CreateContentsForEntity() const {
1616
switch (style) {
1717
case Style::kFill: {
1818
auto solid_color = std::make_shared<SolidColorContents>();
19-
solid_color->SetColor(color.Premultiply());
19+
solid_color->SetColor(color);
2020
return solid_color;
2121
}
2222
case Style::kStroke: {
2323
auto solid_stroke = std::make_shared<SolidStrokeContents>();
24-
solid_stroke->SetColor(color.Premultiply());
24+
solid_stroke->SetColor(color);
2525
solid_stroke->SetStrokeSize(stroke_width);
2626
solid_stroke->SetStrokeMiter(stroke_miter);
2727
solid_stroke->SetStrokeCap(stroke_cap);

impeller/entity/entity_unittests.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ TEST_F(EntityTest, ThreeStrokesInOnePath) {
5050
Entity entity;
5151
entity.SetPath(path);
5252
auto contents = std::make_unique<SolidStrokeContents>();
53-
contents->SetColor(Color::Red().Premultiply());
53+
contents->SetColor(Color::Red());
5454
contents->SetStrokeSize(5.0);
5555
entity.SetContents(std::move(contents));
5656
ASSERT_TRUE(OpenPlaygroundHere(entity));
@@ -80,7 +80,7 @@ TEST_F(EntityTest, TriangleInsideASquare) {
8080
Entity entity;
8181
entity.SetPath(path);
8282
auto contents = std::make_unique<SolidStrokeContents>();
83-
contents->SetColor(Color::Red().Premultiply());
83+
contents->SetColor(Color::Red());
8484
contents->SetStrokeSize(20.0);
8585
entity.SetContents(std::move(contents));
8686

@@ -123,7 +123,7 @@ TEST_F(EntityTest, StrokeCapAndJoinTest) {
123123
Path path, SolidStrokeContents::Cap cap,
124124
SolidStrokeContents::Join join) {
125125
auto contents = std::make_unique<SolidStrokeContents>();
126-
contents->SetColor(Color::Red().Premultiply());
126+
contents->SetColor(Color::Red());
127127
contents->SetStrokeSize(width);
128128
contents->SetStrokeCap(cap);
129129
contents->SetStrokeJoin(join);

0 commit comments

Comments
 (0)