Skip to content

Commit

Permalink
Remove extra premultiply from solid stroke/fill (flutter#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdero authored Apr 13, 2022
1 parent aa36cee commit 21f8eb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions impeller/aiks/paint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ std::shared_ptr<Contents> Paint::CreateContentsForEntity() const {
switch (style) {
case Style::kFill: {
auto solid_color = std::make_shared<SolidColorContents>();
solid_color->SetColor(color.Premultiply());
solid_color->SetColor(color);
return solid_color;
}
case Style::kStroke: {
auto solid_stroke = std::make_shared<SolidStrokeContents>();
solid_stroke->SetColor(color.Premultiply());
solid_stroke->SetColor(color);
solid_stroke->SetStrokeSize(stroke_width);
solid_stroke->SetStrokeMiter(stroke_miter);
solid_stroke->SetStrokeCap(stroke_cap);
Expand Down
6 changes: 3 additions & 3 deletions impeller/entity/entity_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ TEST_F(EntityTest, ThreeStrokesInOnePath) {
Entity entity;
entity.SetPath(path);
auto contents = std::make_unique<SolidStrokeContents>();
contents->SetColor(Color::Red().Premultiply());
contents->SetColor(Color::Red());
contents->SetStrokeSize(5.0);
entity.SetContents(std::move(contents));
ASSERT_TRUE(OpenPlaygroundHere(entity));
Expand Down Expand Up @@ -80,7 +80,7 @@ TEST_F(EntityTest, TriangleInsideASquare) {
Entity entity;
entity.SetPath(path);
auto contents = std::make_unique<SolidStrokeContents>();
contents->SetColor(Color::Red().Premultiply());
contents->SetColor(Color::Red());
contents->SetStrokeSize(20.0);
entity.SetContents(std::move(contents));

Expand Down Expand Up @@ -123,7 +123,7 @@ TEST_F(EntityTest, StrokeCapAndJoinTest) {
Path path, SolidStrokeContents::Cap cap,
SolidStrokeContents::Join join) {
auto contents = std::make_unique<SolidStrokeContents>();
contents->SetColor(Color::Red().Premultiply());
contents->SetColor(Color::Red());
contents->SetStrokeSize(width);
contents->SetStrokeCap(cap);
contents->SetStrokeJoin(join);
Expand Down

0 comments on commit 21f8eb9

Please sign in to comment.