Skip to content

Commit 1828c4c

Browse files
bderodnfield
authored andcommitted
Correct default blend mode, fix solid stroke shader to respect premultiplied source colors (#69)
1 parent 9c3cbf8 commit 1828c4c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

impeller/entity/contents/content_context.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ using ClipPipeline = PipelineT<SolidFillVertexShader, SolidFillFragmentShader>;
4040

4141
struct ContentContextOptions {
4242
SampleCount sample_count = SampleCount::kCount1;
43-
Entity::BlendMode blend_mode = Entity::BlendMode::kSource;
43+
Entity::BlendMode blend_mode = Entity::BlendMode::kSourceOver;
4444

4545
struct Hash {
4646
constexpr std::size_t operator()(const ContentContextOptions& o) const {

impeller/entity/shaders/solid_stroke.frag

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ in float v_pen_down;
88
out vec4 frag_color;
99

1010
void main() {
11-
frag_color = stroke_color;
12-
frag_color.a *= floor(v_pen_down);
11+
frag_color = stroke_color * floor(v_pen_down);
1312
}

0 commit comments

Comments
 (0)