Fix solid stroke bindings in GLES (flutter/engine#33908)
This commit is contained in:
@@ -182,10 +182,8 @@ bool SolidStrokeContents::Render(const ContentContext& renderer,
|
|||||||
VS::FrameInfo frame_info;
|
VS::FrameInfo frame_info;
|
||||||
frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) *
|
frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) *
|
||||||
entity.GetTransformation();
|
entity.GetTransformation();
|
||||||
|
frame_info.color = color_.Premultiply();
|
||||||
VS::StrokeInfo stroke_info;
|
frame_info.size = stroke_size_;
|
||||||
stroke_info.color = color_.Premultiply();
|
|
||||||
stroke_info.size = stroke_size_;
|
|
||||||
|
|
||||||
Command cmd;
|
Command cmd;
|
||||||
cmd.primitive_type = PrimitiveType::kTriangleStrip;
|
cmd.primitive_type = PrimitiveType::kTriangleStrip;
|
||||||
@@ -205,8 +203,6 @@ bool SolidStrokeContents::Render(const ContentContext& renderer,
|
|||||||
cap_proc_, join_proc_,
|
cap_proc_, join_proc_,
|
||||||
miter_limit_, smoothing));
|
miter_limit_, smoothing));
|
||||||
VS::BindFrameInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frame_info));
|
VS::BindFrameInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frame_info));
|
||||||
VS::BindStrokeInfo(cmd,
|
|
||||||
pass.GetTransientsBuffer().EmplaceUniform(stroke_info));
|
|
||||||
|
|
||||||
pass.AddCommand(cmd);
|
pass.AddCommand(cmd);
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,9 @@
|
|||||||
|
|
||||||
uniform FrameInfo {
|
uniform FrameInfo {
|
||||||
mat4 mvp;
|
mat4 mvp;
|
||||||
} frame_info;
|
|
||||||
|
|
||||||
uniform StrokeInfo {
|
|
||||||
vec4 color;
|
vec4 color;
|
||||||
float size;
|
float size;
|
||||||
} stroke_info;
|
} frame_info;
|
||||||
|
|
||||||
in vec2 vertex_position;
|
in vec2 vertex_position;
|
||||||
in vec2 vertex_normal;
|
in vec2 vertex_normal;
|
||||||
@@ -20,8 +17,8 @@ out float v_pen_down;
|
|||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
// Push one vertex by the half stroke size along the normal vector.
|
// Push one vertex by the half stroke size along the normal vector.
|
||||||
vec2 offset = vertex_normal * vec2(stroke_info.size * 0.5);
|
vec2 offset = vertex_normal * vec2(frame_info.size * 0.5);
|
||||||
gl_Position = frame_info.mvp * vec4(vertex_position + offset, 0.0, 1.0);
|
gl_Position = frame_info.mvp * vec4(vertex_position + offset, 0.0, 1.0);
|
||||||
stroke_color = stroke_info.color;
|
stroke_color = frame_info.color;
|
||||||
v_pen_down = pen_down;
|
v_pen_down = pen_down;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user