From 071350e901fdb009592fe4c232ed6bcce4c66d80 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Thu, 16 Feb 2023 13:09:21 -0800 Subject: [PATCH] Remove extraneous if (flutter/engine#39683) * Remove extraneous if * Update geometry.cc --- .../src/flutter/impeller/entity/geometry.cc | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/engine/src/flutter/impeller/entity/geometry.cc b/engine/src/flutter/impeller/entity/geometry.cc index 368cf4c06b..fa3f2011d5 100644 --- a/engine/src/flutter/impeller/entity/geometry.cc +++ b/engine/src/flutter/impeller/entity/geometry.cc @@ -385,26 +385,24 @@ VertexBuffer StrokePathGeometry::CreateSolidStrokeVertices( } // Generate contour geometry. - for (size_t point_i = contour_start_point_i; point_i < contour_end_point_i; - point_i++) { - if (point_i > contour_start_point_i) { - // Generate line rect. - vtx.position = polyline.points[point_i - 1] + offset; - vtx_builder.AppendVertex(vtx); - vtx.position = polyline.points[point_i - 1] - offset; - vtx_builder.AppendVertex(vtx); - vtx.position = polyline.points[point_i] + offset; - vtx_builder.AppendVertex(vtx); - vtx.position = polyline.points[point_i] - offset; - vtx_builder.AppendVertex(vtx); + for (size_t point_i = contour_start_point_i + 1; + point_i < contour_end_point_i; point_i++) { + // Generate line rect. + vtx.position = polyline.points[point_i - 1] + offset; + vtx_builder.AppendVertex(vtx); + vtx.position = polyline.points[point_i - 1] - offset; + vtx_builder.AppendVertex(vtx); + vtx.position = polyline.points[point_i] + offset; + vtx_builder.AppendVertex(vtx); + vtx.position = polyline.points[point_i] - offset; + vtx_builder.AppendVertex(vtx); - if (point_i < contour_end_point_i - 1) { - compute_offset(point_i + 1); + if (point_i < contour_end_point_i - 1) { + compute_offset(point_i + 1); - // Generate join from the current line to the next line. - join_proc(vtx_builder, polyline.points[point_i], previous_offset, - offset, scaled_miter_limit, tolerance); - } + // Generate join from the current line to the next line. + join_proc(vtx_builder, polyline.points[point_i], previous_offset, + offset, scaled_miter_limit, tolerance); } }