Skip to content

Commit

Permalink
Correct default blend mode, fix solid stroke shader to respect premul…
Browse files Browse the repository at this point in the history
…tiplied source colors (#69)
  • Loading branch information
bdero authored and dnfield committed Apr 27, 2022
1 parent 9c3cbf8 commit 1828c4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion impeller/entity/contents/content_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ using ClipPipeline = PipelineT<SolidFillVertexShader, SolidFillFragmentShader>;

struct ContentContextOptions {
SampleCount sample_count = SampleCount::kCount1;
Entity::BlendMode blend_mode = Entity::BlendMode::kSource;
Entity::BlendMode blend_mode = Entity::BlendMode::kSourceOver;

struct Hash {
constexpr std::size_t operator()(const ContentContextOptions& o) const {
Expand Down
3 changes: 1 addition & 2 deletions impeller/entity/shaders/solid_stroke.frag
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ in float v_pen_down;
out vec4 frag_color;

void main() {
frag_color = stroke_color;
frag_color.a *= floor(v_pen_down);
frag_color = stroke_color * floor(v_pen_down);
}

0 comments on commit 1828c4c

Please sign in to comment.