@@ -89,13 +89,14 @@ static Color ToColor(const SkColor& color) {
89
89
}
90
90
91
91
// |flutter::Dispatcher|
92
- void DisplayListDispatcher::setColorSource (const flutter::DlColorSource* source) {
92
+ void DisplayListDispatcher::setColorSource (
93
+ const flutter::DlColorSource* source) {
93
94
if (!source) {
94
95
paint_.contents = nullptr ;
95
96
return ;
96
97
}
97
98
98
- switch (source->type ()) {
99
+ switch (source->type ()) {
99
100
case flutter::DlColorSourceType::kColor : {
100
101
const flutter::DlColorColorSource* color = source->asColor ();
101
102
paint_.contents = nullptr ;
@@ -104,7 +105,8 @@ void DisplayListDispatcher::setColorSource(const flutter::DlColorSource* source)
104
105
return ;
105
106
}
106
107
case flutter::DlColorSourceType::kLinearGradient : {
107
- const flutter::DlLinearGradientColorSource* linear = source->asLinearGradient ();
108
+ const flutter::DlLinearGradientColorSource* linear =
109
+ source->asLinearGradient ();
108
110
FML_DCHECK (linear);
109
111
auto contents = std::make_shared<LinearGradientContents>();
110
112
contents->SetEndPoints (ToPoint (linear->start_point ()),
@@ -327,13 +329,13 @@ static Path ToPath(const SkPath& path) {
327
329
builder.MoveTo (ToPoint (data.points [0 ]));
328
330
break ;
329
331
case SkPath::kLine_Verb :
330
- builder.AddLine (ToPoint (data.points [0 ]), ToPoint (data.points [1 ]));
332
+ builder.LineTo (ToPoint (data.points [0 ]));
333
+ builder.LineTo (ToPoint (data.points [1 ]));
331
334
break ;
332
335
case SkPath::kQuad_Verb :
333
- builder.AddQuadraticCurve (ToPoint (data.points [0 ]), // p1
334
- ToPoint (data.points [1 ]), // cp
335
- ToPoint (data.points [2 ]) // p2
336
- );
336
+ builder.LineTo (ToPoint (data.points [0 ]));
337
+ builder.QuadraticCurveTo (ToPoint (data.points [1 ]),
338
+ ToPoint (data.points [2 ]));
337
339
break ;
338
340
case SkPath::kConic_Verb : {
339
341
constexpr auto kPow2 = 1 ; // Only works for sweeps up to 90 degrees.
@@ -352,18 +354,15 @@ static Path ToPath(const SkPath& path) {
352
354
curve_index < curve_count; //
353
355
curve_index++, point_index += 2 //
354
356
) {
355
- builder.AddQuadraticCurve (ToPoint (points[point_index + 0 ]), // p1
356
- ToPoint (points[point_index + 1 ]), // cp
357
- ToPoint (points[point_index + 2 ]) // p2
358
- );
357
+ builder.LineTo (ToPoint (points[point_index + 0 ]));
358
+ builder.QuadraticCurveTo (ToPoint (points[point_index + 1 ]),
359
+ ToPoint (points[point_index + 2 ]));
359
360
}
360
361
} break ;
361
362
case SkPath::kCubic_Verb :
362
- builder.AddCubicCurve (ToPoint (data.points [0 ]), // p1
363
- ToPoint (data.points [1 ]), // cp1
364
- ToPoint (data.points [2 ]), // cp2
365
- ToPoint (data.points [3 ]) // p2
366
- );
363
+ builder.LineTo (ToPoint (data.points [0 ]));
364
+ builder.CubicCurveTo (ToPoint (data.points [1 ]), ToPoint (data.points [2 ]),
365
+ ToPoint (data.points [3 ]));
367
366
break ;
368
367
case SkPath::kClose_Verb :
369
368
builder.Close ();
0 commit comments