| Flutter Impeller |

dl_dispatcher.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "impeller/display_list/dl_dispatcher.h"
6
7 #include <algorithm>
8 #include <cstring>
9 #include <memory>
10 #include <optional>
11 #include <unordered_map>
12 #include <utility>
13 #include <vector>
14
15 #include "flutter/fml/logging.h"
16 #include "flutter/fml/trace_event.h"
17 #include "impeller/aiks/color_filter.h"
18 #include "impeller/core/formats.h"
19 #include "impeller/display_list/dl_image_impeller.h"
20 #include "impeller/display_list/dl_vertices_geometry.h"
21 #include "impeller/display_list/nine_patch_converter.h"
22 #include "impeller/display_list/skia_conversions.h"
23 #include "impeller/entity/contents/conical_gradient_contents.h"
24 #include "impeller/entity/contents/filters/filter_contents.h"
25 #include "impeller/entity/contents/filters/inputs/filter_input.h"
26 #include "impeller/entity/contents/linear_gradient_contents.h"
27 #include "impeller/entity/contents/radial_gradient_contents.h"
28 #include "impeller/entity/contents/runtime_effect_contents.h"
29 #include "impeller/entity/contents/sweep_gradient_contents.h"
30 #include "impeller/entity/contents/tiled_texture_contents.h"
31 #include "impeller/entity/entity.h"
32 #include "impeller/entity/geometry/geometry.h"
33 #include "impeller/geometry/path.h"
34 #include "impeller/geometry/path_builder.h"
35 #include "impeller/geometry/scalar.h"
36 #include "impeller/geometry/sigma.h"
37
38 #if IMPELLER_ENABLE_3D
39 #include "impeller/entity/contents/scene_contents.h"
40 #endif // IMPELLER_ENABLE_3D
41
42 namespace impeller {
43
44 #define UNIMPLEMENTED \
45 FML_DLOG(ERROR) << "Unimplemented detail in " << __FUNCTION__;
46
47 DlDispatcher::DlDispatcher() = default;
48
49 DlDispatcher::DlDispatcher(Rect cull_rect) : canvas_(cull_rect) {}
50
51 DlDispatcher::DlDispatcher(IRect cull_rect) : canvas_(cull_rect) {}
52
53 DlDispatcher::~DlDispatcher() = default;
54
55 static BlendMode ToBlendMode(flutter::DlBlendMode mode) {
56 switch (mode) {
57 case flutter::DlBlendMode::kClear:
58 return BlendMode::kClear;
59 case flutter::DlBlendMode::kSrc:
60 return BlendMode::kSource;
61 case flutter::DlBlendMode::kDst:
62 return BlendMode::kDestination;
63 case flutter::DlBlendMode::kSrcOver:
64 return BlendMode::kSourceOver;
65 case flutter::DlBlendMode::kDstOver:
66 return BlendMode::kDestinationOver;
67 case flutter::DlBlendMode::kSrcIn:
68 return BlendMode::kSourceIn;
69 case flutter::DlBlendMode::kDstIn:
70 return BlendMode::kDestinationIn;
71 case flutter::DlBlendMode::kSrcOut:
72 return BlendMode::kSourceOut;
73 case flutter::DlBlendMode::kDstOut:
74 return BlendMode::kDestinationOut;
75 case flutter::DlBlendMode::kSrcATop:
76 return BlendMode::kSourceATop;
77 case flutter::DlBlendMode::kDstATop:
78 return BlendMode::kDestinationATop;
79 case flutter::DlBlendMode::kXor:
80 return BlendMode::kXor;
81 case flutter::DlBlendMode::kPlus:
82 return BlendMode::kPlus;
83 case flutter::DlBlendMode::kModulate:
84 return BlendMode::kModulate;
85 case flutter::DlBlendMode::kScreen:
86 return BlendMode::kScreen;
87 case flutter::DlBlendMode::kOverlay:
88 return BlendMode::kOverlay;
89 case flutter::DlBlendMode::kDarken:
90 return BlendMode::kDarken;
91 case flutter::DlBlendMode::kLighten:
92 return BlendMode::kLighten;
93 case flutter::DlBlendMode::kColorDodge:
94 return BlendMode::kColorDodge;
95 case flutter::DlBlendMode::kColorBurn:
96 return BlendMode::kColorBurn;
97 case flutter::DlBlendMode::kHardLight:
98 return BlendMode::kHardLight;
99 case flutter::DlBlendMode::kSoftLight:
100 return BlendMode::kSoftLight;
101 case flutter::DlBlendMode::kDifference:
102 return BlendMode::kDifference;
103 case flutter::DlBlendMode::kExclusion:
104 return BlendMode::kExclusion;
105 case flutter::DlBlendMode::kMultiply:
106 return BlendMode::kMultiply;
107 case flutter::DlBlendMode::kHue:
108 return BlendMode::kHue;
109 case flutter::DlBlendMode::kSaturation:
110 return BlendMode::kSaturation;
111 case flutter::DlBlendMode::kColor:
112 return BlendMode::kColor;
113 case flutter::DlBlendMode::kLuminosity:
114 return BlendMode::kLuminosity;
115 }
116 FML_UNREACHABLE();
117 }
118
119 static Entity::TileMode ToTileMode(flutter::DlTileMode tile_mode) {
120 switch (tile_mode) {
121 case flutter::DlTileMode::kClamp:
122 return Entity::TileMode::kClamp;
123 case flutter::DlTileMode::kRepeat:
124 return Entity::TileMode::kRepeat;
125 case flutter::DlTileMode::kMirror:
126 return Entity::TileMode::kMirror;
127 case flutter::DlTileMode::kDecal:
128 return Entity::TileMode::kDecal;
129 }
130 }
131
132 static impeller::SamplerDescriptor ToSamplerDescriptor(
133 const flutter::DlImageSampling options) {
134 impeller::SamplerDescriptor desc;
135 switch (options) {
136 case flutter::DlImageSampling::kNearestNeighbor:
137 desc.min_filter = desc.mag_filter = impeller::MinMagFilter::kNearest;
138 desc.label = "Nearest Sampler";
139 break;
140 case flutter::DlImageSampling::kLinear:
141 // Impeller doesn't support cubic sampling, but linear is closer to correct
142 // than nearest for this case.
143 case flutter::DlImageSampling::kCubic:
144 desc.min_filter = desc.mag_filter = impeller::MinMagFilter::kLinear;
145 desc.label = "Linear Sampler";
146 break;
147 case flutter::DlImageSampling::kMipmapLinear:
148 desc.min_filter = desc.mag_filter = impeller::MinMagFilter::kLinear;
149 desc.mip_filter = impeller::MipFilter::kLinear;
150 desc.label = "Mipmap Linear Sampler";
151 break;
152 }
153 return desc;
154 }
155
156 static impeller::SamplerDescriptor ToSamplerDescriptor(
157 const flutter::DlFilterMode options) {
158 impeller::SamplerDescriptor desc;
159 switch (options) {
160 case flutter::DlFilterMode::kNearest:
161 desc.min_filter = desc.mag_filter = impeller::MinMagFilter::kNearest;
162 desc.label = "Nearest Sampler";
163 break;
164 case flutter::DlFilterMode::kLinear:
165 desc.min_filter = desc.mag_filter = impeller::MinMagFilter::kLinear;
166 desc.label = "Linear Sampler";
167 break;
168 default:
169 break;
170 }
171 return desc;
172 }
173
174 static Matrix ToMatrix(const SkMatrix& m) {
175 return Matrix{
176 // clang-format off
177 m[0], m[3], 0, m[6],
178 m[1], m[4], 0, m[7],
179 0, 0, 1, 0,
180 m[2], m[5], 0, m[8],
181 // clang-format on
182 };
183 }
184
185 // |flutter::DlOpReceiver|
186 void DlDispatcher::setAntiAlias(bool aa) {
187 // Nothing to do because AA is implicit.
188 }
189
190 // |flutter::DlOpReceiver|
191 void DlDispatcher::setDither(bool dither) {
192 paint_.dither = dither;
193 }
194
195 static Paint::Style ToStyle(flutter::DlDrawStyle style) {
196 switch (style) {
197 case flutter::DlDrawStyle::kFill:
198 return Paint::Style::kFill;
199 case flutter::DlDrawStyle::kStroke:
200 return Paint::Style::kStroke;
201 case flutter::DlDrawStyle::kStrokeAndFill:
202 UNIMPLEMENTED;
203 break;
204 }
205 return Paint::Style::kFill;
206 }
207
208 // |flutter::DlOpReceiver|
209 void DlDispatcher::setDrawStyle(flutter::DlDrawStyle style) {
210 paint_.style = ToStyle(style);
211 }
212
213 // |flutter::DlOpReceiver|
214 void DlDispatcher::setColor(flutter::DlColor color) {
215 paint_.color = {
216 color.getRedF(),
217 color.getGreenF(),
218 color.getBlueF(),
219 color.getAlphaF(),
220 };
221 }
222
223 // |flutter::DlOpReceiver|
224 void DlDispatcher::setStrokeWidth(SkScalar width) {
225 paint_.stroke_width = width;
226 }
227
228 // |flutter::DlOpReceiver|
229 void DlDispatcher::setStrokeMiter(SkScalar limit) {
230 paint_.stroke_miter = limit;
231 }
232
233 // |flutter::DlOpReceiver|
234 void DlDispatcher::setStrokeCap(flutter::DlStrokeCap cap) {
235 switch (cap) {
236 case flutter::DlStrokeCap::kButt:
237 paint_.stroke_cap = Cap::kButt;
238 break;
239 case flutter::DlStrokeCap::kRound:
240 paint_.stroke_cap = Cap::kRound;
241 break;
242 case flutter::DlStrokeCap::kSquare:
243 paint_.stroke_cap = Cap::kSquare;
244 break;
245 }
246 }
247
248 // |flutter::DlOpReceiver|
249 void DlDispatcher::setStrokeJoin(flutter::DlStrokeJoin join) {
250 switch (join) {
251 case flutter::DlStrokeJoin::kMiter:
252 paint_.stroke_join = Join::kMiter;
253 break;
254 case flutter::DlStrokeJoin::kRound:
255 paint_.stroke_join = Join::kRound;
256 break;
257 case flutter::DlStrokeJoin::kBevel:
258 paint_.stroke_join = Join::kBevel;
259 break;
260 }
261 }
262
263 static std::vector<Color> ToColors(const flutter::DlColor colors[], int count) {
264 auto result = std::vector<Color>();
265 if (colors == nullptr) {
266 return result;
267 }
268 for (int i = 0; i < count; i++) {
269 result.push_back(skia_conversions::ToColor(colors[i]));
270 }
271 return result;
272 }
273
274 static std::optional<ColorSource::Type> ToColorSourceType(
275 flutter::DlColorSourceType type) {
276 switch (type) {
277 case flutter::DlColorSourceType::kColor:
278 return ColorSource::Type::kColor;
279 case flutter::DlColorSourceType::kImage:
280 return ColorSource::Type::kImage;
281 case flutter::DlColorSourceType::kLinearGradient:
282 return ColorSource::Type::kLinearGradient;
283 case flutter::DlColorSourceType::kRadialGradient:
284 return ColorSource::Type::kRadialGradient;
285 case flutter::DlColorSourceType::kConicalGradient:
286 return ColorSource::Type::kConicalGradient;
287 case flutter::DlColorSourceType::kSweepGradient:
288 return ColorSource::Type::kSweepGradient;
289 case flutter::DlColorSourceType::kRuntimeEffect:
290 return ColorSource::Type::kRuntimeEffect;
291 #ifdef IMPELLER_ENABLE_3D
292 case flutter::DlColorSourceType::kScene:
293 return ColorSource::Type::kScene;
294 #endif // IMPELLER_ENABLE_3D
295 }
296 }
297
298 // |flutter::DlOpReceiver|
299 void DlDispatcher::setColorSource(const flutter::DlColorSource* source) {
300 if (!source) {
301 paint_.color_source = ColorSource::MakeColor();
302 return;
303 }
304
305 std::optional<ColorSource::Type> type = ToColorSourceType(source->type());
306
307 if (!type.has_value()) {
308 FML_LOG(ERROR) << "Requested ColorSourceType::kUnknown";
309 paint_.color_source = ColorSource::MakeColor();
310 return;
311 }
312
313 switch (type.value()) {
314 case ColorSource::Type::kColor: {
315 const flutter::DlColorColorSource* color = source->asColor();
316
317 paint_.color_source = ColorSource::MakeColor();
318 setColor(color->color());
319 FML_DCHECK(color);
320 return;
321 }
322 case ColorSource::Type::kLinearGradient: {
323 const flutter::DlLinearGradientColorSource* linear =
324 source->asLinearGradient();
325 FML_DCHECK(linear);
326 auto start_point = skia_conversions::ToPoint(linear->start_point());
327 auto end_point = skia_conversions::ToPoint(linear->end_point());
328 std::vector<Color> colors;
329 std::vector<float> stops;
330 skia_conversions::ConvertStops(linear, colors, stops);
331
332 auto tile_mode = ToTileMode(linear->tile_mode());
333 auto matrix = ToMatrix(linear->matrix());
334
335 paint_.color_source = ColorSource::MakeLinearGradient(
336 start_point, end_point, std::move(colors), std::move(stops),
337 tile_mode, matrix);
338 return;
339 }
340 case ColorSource::Type::kConicalGradient: {
341 const flutter::DlConicalGradientColorSource* conical_gradient =
342 source->asConicalGradient();
343 FML_DCHECK(conical_gradient);
344 Point center = skia_conversions::ToPoint(conical_gradient->end_center());
345 SkScalar radius = conical_gradient->end_radius();
346 Point focus_center =
347 skia_conversions::ToPoint(conical_gradient->start_center());
348 SkScalar focus_radius = conical_gradient->start_radius();
349 std::vector<Color> colors;
350 std::vector<float> stops;
351 skia_conversions::ConvertStops(conical_gradient, colors, stops);
352
353 auto tile_mode = ToTileMode(conical_gradient->tile_mode());
354 auto matrix = ToMatrix(conical_gradient->matrix());
355
356 paint_.color_source = ColorSource::MakeConicalGradient(
357 center, radius, std::move(colors), std::move(stops), focus_center,
358 focus_radius, tile_mode, matrix);
359 return;
360 }
361 case ColorSource::Type::kRadialGradient: {
362 const flutter::DlRadialGradientColorSource* radialGradient =
363 source->asRadialGradient();
364 FML_DCHECK(radialGradient);
365 auto center = skia_conversions::ToPoint(radialGradient->center());
366 auto radius = radialGradient->radius();
367 std::vector<Color> colors;
368 std::vector<float> stops;
369 skia_conversions::ConvertStops(radialGradient, colors, stops);
370
371 auto tile_mode = ToTileMode(radialGradient->tile_mode());
372 auto matrix = ToMatrix(radialGradient->matrix());
373 paint_.color_source =
374 ColorSource::MakeRadialGradient(center, radius, std::move(colors),
375 std::move(stops), tile_mode, matrix);
376 return;
377 }
378 case ColorSource::Type::kSweepGradient: {
379 const flutter::DlSweepGradientColorSource* sweepGradient =
380 source->asSweepGradient();
381 FML_DCHECK(sweepGradient);
382
383 auto center = skia_conversions::ToPoint(sweepGradient->center());
384 auto start_angle = Degrees(sweepGradient->start());
385 auto end_angle = Degrees(sweepGradient->end());
386 std::vector<Color> colors;
387 std::vector<float> stops;
388 skia_conversions::ConvertStops(sweepGradient, colors, stops);
389
390 auto tile_mode = ToTileMode(sweepGradient->tile_mode());
391 auto matrix = ToMatrix(sweepGradient->matrix());
392 paint_.color_source = ColorSource::MakeSweepGradient(
393 center, start_angle, end_angle, std::move(colors), std::move(stops),
394 tile_mode, matrix);
395 return;
396 }
397 case ColorSource::Type::kImage: {
398 const flutter::DlImageColorSource* image_color_source = source->asImage();
399 FML_DCHECK(image_color_source &&
400 image_color_source->image()->impeller_texture());
401 auto texture = image_color_source->image()->impeller_texture();
402 auto x_tile_mode = ToTileMode(image_color_source->horizontal_tile_mode());
403 auto y_tile_mode = ToTileMode(image_color_source->vertical_tile_mode());
404 auto desc = ToSamplerDescriptor(image_color_source->sampling());
405 auto matrix = ToMatrix(image_color_source->matrix());
406 paint_.color_source = ColorSource::MakeImage(texture, x_tile_mode,
407 y_tile_mode, desc, matrix);
408 return;
409 }
410 case ColorSource::Type::kRuntimeEffect: {
411 const flutter::DlRuntimeEffectColorSource* runtime_effect_color_source =
412 source->asRuntimeEffect();
413 auto runtime_stage =
414 runtime_effect_color_source->runtime_effect()->runtime_stage();
415 auto uniform_data = runtime_effect_color_source->uniform_data();
416 auto samplers = runtime_effect_color_source->samplers();
417
418 std::vector<RuntimeEffectContents::TextureInput> texture_inputs;
419
420 for (auto& sampler : samplers) {
421 if (sampler == nullptr) {
422 return;
423 }
424 auto* image = sampler->asImage();
425 if (!sampler->asImage()) {
426 UNIMPLEMENTED;
427 return;
428 }
429 FML_DCHECK(image->image()->impeller_texture());
430 texture_inputs.push_back({
431 .sampler_descriptor = ToSamplerDescriptor(image->sampling()),
432 .texture = image->image()->impeller_texture(),
433 });
434 }
435
436 paint_.color_source = ColorSource::MakeRuntimeEffect(
437 runtime_stage, uniform_data, texture_inputs);
438 return;
439 }
440 case ColorSource::Type::kScene: {
441 #ifdef IMPELLER_ENABLE_3D
442 const flutter::DlSceneColorSource* scene_color_source = source->asScene();
443 std::shared_ptr<scene::Node> scene_node =
444 scene_color_source->scene_node();
445 Matrix camera_transform = scene_color_source->camera_matrix();
446
447 paint_.color_source =
448 ColorSource::MakeScene(scene_node, camera_transform);
449 #else // IMPELLER_ENABLE_3D
450 FML_LOG(ERROR) << "ColorSourceType::kScene can only be used if Impeller "
451 "Scene is enabled.";
452 #endif // IMPELLER_ENABLE_3D
453 return;
454 }
455 }
456 }
457
458 static std::shared_ptr<ColorFilter> ToColorFilter(
459 const flutter::DlColorFilter* filter) {
460 if (filter == nullptr) {
461 return nullptr;
462 }
463 switch (filter->type()) {
464 case flutter::DlColorFilterType::kBlend: {
465 auto dl_blend = filter->asBlend();
466 auto blend_mode = ToBlendMode(dl_blend->mode());
467 auto color = skia_conversions::ToColor(dl_blend->color());
468 return ColorFilter::MakeBlend(blend_mode, color);
469 }
470 case flutter::DlColorFilterType::kMatrix: {
471 const flutter::DlMatrixColorFilter* dl_matrix = filter->asMatrix();
472 impeller::ColorMatrix color_matrix;
473 dl_matrix->get_matrix(color_matrix.array);
474 return ColorFilter::MakeMatrix(color_matrix);
475 }
476 case flutter::DlColorFilterType::kSrgbToLinearGamma:
477 return ColorFilter::MakeSrgbToLinear();
478 case flutter::DlColorFilterType::kLinearToSrgbGamma:
479 return ColorFilter::MakeLinearToSrgb();
480 }
481 return nullptr;
482 }
483
484 // |flutter::DlOpReceiver|
485 void DlDispatcher::setColorFilter(const flutter::DlColorFilter* filter) {
486 // Needs https://github.com/flutter/flutter/issues/95434
487 paint_.color_filter = ToColorFilter(filter);
488 }
489
490 // |flutter::DlOpReceiver|
491 void DlDispatcher::setInvertColors(bool invert) {
492 paint_.invert_colors = invert;
493 }
494
495 // |flutter::DlOpReceiver|
496 void DlDispatcher::setBlendMode(flutter::DlBlendMode dl_mode) {
497 paint_.blend_mode = ToBlendMode(dl_mode);
498 }
499
500 // |flutter::DlOpReceiver|
501 void DlDispatcher::setPathEffect(const flutter::DlPathEffect* effect) {
502 // Needs https://github.com/flutter/flutter/issues/95434
503 UNIMPLEMENTED;
504 }
505
506 static FilterContents::BlurStyle ToBlurStyle(flutter::DlBlurStyle blur_style) {
507 switch (blur_style) {
508 case flutter::DlBlurStyle::kNormal:
509 return FilterContents::BlurStyle::kNormal;
510 case flutter::DlBlurStyle::kSolid:
511 return FilterContents::BlurStyle::kSolid;
512 case flutter::DlBlurStyle::kOuter:
513 return FilterContents::BlurStyle::kOuter;
514 case flutter::DlBlurStyle::kInner:
515 return FilterContents::BlurStyle::kInner;
516 }
517 }
518
519 // |flutter::DlOpReceiver|
520 void DlDispatcher::setMaskFilter(const flutter::DlMaskFilter* filter) {
521 // Needs https://github.com/flutter/flutter/issues/95434
522 if (filter == nullptr) {
523 paint_.mask_blur_descriptor = std::nullopt;
524 return;
525 }
526 switch (filter->type()) {
527 case flutter::DlMaskFilterType::kBlur: {
528 auto blur = filter->asBlur();
529
530 paint_.mask_blur_descriptor = {
531 .style = ToBlurStyle(blur->style()),
532 .sigma = Sigma(blur->sigma()),
533 };
534 break;
535 }
536 }
537 }
538
539 static std::shared_ptr<ImageFilter> ToImageFilter(
540 const flutter::DlImageFilter* filter) {
541 if (filter == nullptr) {
542 return nullptr;
543 }
544
545 switch (filter->type()) {
546 case flutter::DlImageFilterType::kBlur: {
547 auto blur = filter->asBlur();
548 auto sigma_x = Sigma(blur->sigma_x());
549 auto sigma_y = Sigma(blur->sigma_y());
550 auto tile_mode = ToTileMode(blur->tile_mode());
551 return ImageFilter::MakeBlur(
552 sigma_x, sigma_y, FilterContents::BlurStyle::kNormal, tile_mode);
553 }
554 case flutter::DlImageFilterType::kDilate: {
555 auto dilate = filter->asDilate();
556 FML_DCHECK(dilate);
557 if (dilate->radius_x() < 0 || dilate->radius_y() < 0) {
558 return nullptr;
559 }
560 auto radius_x = Radius(dilate->radius_x());
561 auto radius_y = Radius(dilate->radius_y());
562 return ImageFilter::MakeDilate(radius_x, radius_y);
563 }
564 case flutter::DlImageFilterType::kErode: {
565 auto erode = filter->asErode();
566 FML_DCHECK(erode);
567 if (erode->radius_x() < 0 || erode->radius_y() < 0) {
568 return nullptr;
569 }
570 auto radius_x = Radius(erode->radius_x());
571 auto radius_y = Radius(erode->radius_y());
572 return ImageFilter::MakeErode(radius_x, radius_y);
573 }
574 case flutter::DlImageFilterType::kMatrix: {
575 auto matrix_filter = filter->asMatrix();
576 FML_DCHECK(matrix_filter);
577 auto matrix = ToMatrix(matrix_filter->matrix());
578 auto desc = ToSamplerDescriptor(matrix_filter->sampling());
579 return ImageFilter::MakeMatrix(matrix, desc);
580 }
581 case flutter::DlImageFilterType::kCompose: {
582 auto compose = filter->asCompose();
583 FML_DCHECK(compose);
584 auto outer_dl_filter = compose->outer();
585 auto inner_dl_filter = compose->inner();
586 auto outer_filter = ToImageFilter(outer_dl_filter.get());
587 auto inner_filter = ToImageFilter(inner_dl_filter.get());
588 if (!outer_filter) {
589 return inner_filter;
590 }
591 if (!inner_filter) {
592 return outer_filter;
593 }
594 FML_DCHECK(outer_filter && inner_filter);
595
596 return ImageFilter::MakeCompose(*inner_filter, *outer_filter);
597 }
598 case flutter::DlImageFilterType::kColorFilter: {
599 auto color_filter_image_filter = filter->asColorFilter();
600 FML_DCHECK(color_filter_image_filter);
601 auto color_filter =
602 ToColorFilter(color_filter_image_filter->color_filter().get());
603 if (!color_filter) {
604 return nullptr;
605 }
606 // When color filters are used as image filters, set the color filter's
607 // "absorb opacity" flag to false. For image filters, the snapshot
608 // opacity needs to be deferred until the result of the filter chain is
609 // being blended with the layer.
610 return ImageFilter::MakeFromColorFilter(*color_filter);
611 }
612 case flutter::DlImageFilterType::kLocalMatrix: {
613 auto local_matrix_filter = filter->asLocalMatrix();
614 FML_DCHECK(local_matrix_filter);
615 auto internal_filter = local_matrix_filter->image_filter();
616 FML_DCHECK(internal_filter);
617
618 auto image_filter = ToImageFilter(internal_filter.get());
619 if (!image_filter) {
620 return nullptr;
621 }
622
623 auto matrix = ToMatrix(local_matrix_filter->matrix());
624 return ImageFilter::MakeLocalMatrix(matrix, *image_filter);
625 }
626 }
627 }
628
629 // |flutter::DlOpReceiver|
630 void DlDispatcher::setImageFilter(const flutter::DlImageFilter* filter) {
631 paint_.image_filter = ToImageFilter(filter);
632 }
633
634 // |flutter::DlOpReceiver|
635 void DlDispatcher::save() {
636 canvas_.Save();
637 }
638
639 // |flutter::DlOpReceiver|
640 void DlDispatcher::saveLayer(const SkRect* bounds,
641 const flutter::SaveLayerOptions options,
642 const flutter::DlImageFilter* backdrop) {
643 auto paint = options.renders_with_attributes() ? paint_ : Paint{};
644 canvas_.SaveLayer(paint, skia_conversions::ToRect(bounds),
645 ToImageFilter(backdrop));
646 }
647
648 // |flutter::DlOpReceiver|
649 void DlDispatcher::restore() {
650 canvas_.Restore();
651 }
652
653 // |flutter::DlOpReceiver|
654 void DlDispatcher::translate(SkScalar tx, SkScalar ty) {
655 canvas_.Translate({tx, ty, 0.0});
656 }
657
658 // |flutter::DlOpReceiver|
659 void DlDispatcher::scale(SkScalar sx, SkScalar sy) {
660 canvas_.Scale({sx, sy, 1.0});
661 }
662
663 // |flutter::DlOpReceiver|
664 void DlDispatcher::rotate(SkScalar degrees) {
665 canvas_.Rotate(Degrees{degrees});
666 }
667
668 // |flutter::DlOpReceiver|
669 void DlDispatcher::skew(SkScalar sx, SkScalar sy) {
670 canvas_.Skew(sx, sy);
671 }
672
673 // |flutter::DlOpReceiver|
674 void DlDispatcher::transform2DAffine(SkScalar mxx,
675 SkScalar mxy,
676 SkScalar mxt,
677 SkScalar myx,
678 SkScalar myy,
679 SkScalar myt) {
680 // clang-format off
681 transformFullPerspective(
682 mxx, mxy, 0, mxt,
683 myx, myy, 0, myt,
684 0 , 0, 1, 0,
685 0 , 0, 0, 1
686 );
687 // clang-format on
688 }
689
690 // |flutter::DlOpReceiver|
691 void DlDispatcher::transformFullPerspective(SkScalar mxx,
692 SkScalar mxy,
693 SkScalar mxz,
694 SkScalar mxt,
695 SkScalar myx,
696 SkScalar myy,
697 SkScalar myz,
698 SkScalar myt,
699 SkScalar mzx,
700 SkScalar mzy,
701 SkScalar mzz,
702 SkScalar mzt,
703 SkScalar mwx,
704 SkScalar mwy,
705 SkScalar mwz,
706 SkScalar mwt) {
707 // The order of arguments is row-major but Impeller matrices are
708 // column-major.
709 // clang-format off
710 auto xformation = Matrix{
711 mxx, myx, mzx, mwx,
712 mxy, myy, mzy, mwy,
713 mxz, myz, mzz, mwz,
714 mxt, myt, mzt, mwt
715 };
716 // clang-format on
717 canvas_.Transform(xformation);
718 }
719
720 // |flutter::DlOpReceiver|
721 void DlDispatcher::transformReset() {
722 canvas_.ResetTransform();
723 canvas_.Transform(initial_matrix_);
724 }
725
726 static Entity::ClipOperation ToClipOperation(
727 flutter::DlCanvas::ClipOp clip_op) {
728 switch (clip_op) {
729 case flutter::DlCanvas::ClipOp::kDifference:
730 return Entity::ClipOperation::kDifference;
731 case flutter::DlCanvas::ClipOp::kIntersect:
732 return Entity::ClipOperation::kIntersect;
733 }
734 }
735
736 // |flutter::DlOpReceiver|
737 void DlDispatcher::clipRect(const SkRect& rect, ClipOp clip_op, bool is_aa) {
738 canvas_.ClipRect(skia_conversions::ToRect(rect), ToClipOperation(clip_op));
739 }
740
741 // |flutter::DlOpReceiver|
742 void DlDispatcher::clipRRect(const SkRRect& rrect, ClipOp clip_op, bool is_aa) {
743 if (rrect.isSimple()) {
744 canvas_.ClipRRect(skia_conversions::ToRect(rrect.rect()),
745 rrect.getSimpleRadii().fX, ToClipOperation(clip_op));
746 } else {
747 canvas_.ClipPath(skia_conversions::ToPath(rrect), ToClipOperation(clip_op));
748 }
749 }
750
751 // |flutter::DlOpReceiver|
752 void DlDispatcher::clipPath(const SkPath& path, ClipOp clip_op, bool is_aa) {
753 canvas_.ClipPath(skia_conversions::ToPath(path), ToClipOperation(clip_op));
754 }
755
756 // |flutter::DlOpReceiver|
757 void DlDispatcher::drawColor(flutter::DlColor color,
758 flutter::DlBlendMode dl_mode) {
759 Paint paint;
760 paint.color = skia_conversions::ToColor(color);
761 paint.blend_mode = ToBlendMode(dl_mode);
762 canvas_.DrawPaint(paint);
763 }
764
765 // |flutter::DlOpReceiver|
766 void DlDispatcher::drawPaint() {
767 canvas_.DrawPaint(paint_);
768 }
769
770 // |flutter::DlOpReceiver|
771 void DlDispatcher::drawLine(const SkPoint& p0, const SkPoint& p1) {
772 auto path =
773 PathBuilder{}
774 .AddLine(skia_conversions::ToPoint(p0), skia_conversions::ToPoint(p1))
775 .SetConvexity(Convexity::kConvex)
776 .TakePath();
777 Paint paint = paint_;
778 paint.style = Paint::Style::kStroke;
779 canvas_.DrawPath(path, paint);
780 }
781
782 // |flutter::DlOpReceiver|
783 void DlDispatcher::drawRect(const SkRect& rect) {
784 canvas_.DrawRect(skia_conversions::ToRect(rect), paint_);
785 }
786
787 // |flutter::DlOpReceiver|
788 void DlDispatcher::drawOval(const SkRect& bounds) {
789 if (bounds.width() == bounds.height()) {
790 canvas_.DrawCircle(skia_conversions::ToPoint(bounds.center()),
791 bounds.width() * 0.5, paint_);
792 } else {
793 auto path = PathBuilder{}
794 .AddOval(skia_conversions::ToRect(bounds))
795 .SetConvexity(Convexity::kConvex)
796 .TakePath();
797 canvas_.DrawPath(path, paint_);
798 }
799 }
800
801 // |flutter::DlOpReceiver|
802 void DlDispatcher::drawCircle(const SkPoint& center, SkScalar radius) {
803 canvas_.DrawCircle(skia_conversions::ToPoint(center), radius, paint_);
804 }
805
806 // |flutter::DlOpReceiver|
807 void DlDispatcher::drawRRect(const SkRRect& rrect) {
808 if (rrect.isSimple()) {
809 canvas_.DrawRRect(skia_conversions::ToRect(rrect.rect()),
810 rrect.getSimpleRadii().fX, paint_);
811 } else {
812 canvas_.DrawPath(skia_conversions::ToPath(rrect), paint_);
813 }
814 }
815
816 // |flutter::DlOpReceiver|
817 void DlDispatcher::drawDRRect(const SkRRect& outer, const SkRRect& inner) {
818 PathBuilder builder;
819 builder.AddPath(skia_conversions::ToPath(outer));
820 builder.AddPath(skia_conversions::ToPath(inner));
821 canvas_.DrawPath(builder.TakePath(FillType::kOdd), paint_);
822 }
823
824 // |flutter::DlOpReceiver|
825 void DlDispatcher::drawPath(const SkPath& path) {
826 SkRect rect;
827
828 // We can't "optimize" a path into a rectangle if it's open.
829 bool closed;
830 if (path.isRect(&rect, &closed) && closed) {
831 canvas_.DrawRect(skia_conversions::ToRect(rect), paint_);
832 return;
833 }
834
835 SkRRect rrect;
836 if (path.isRRect(&rrect) && rrect.isSimple()) {
837 canvas_.DrawRRect(skia_conversions::ToRect(rrect.rect()),
838 rrect.getSimpleRadii().fX, paint_);
839 return;
840 }
841
842 SkRect oval;
843 if (path.isOval(&oval) && oval.width() == oval.height()) {
844 canvas_.DrawCircle(skia_conversions::ToPoint(oval.center()),
845 oval.width() * 0.5, paint_);
846 return;
847 }
848
849 canvas_.DrawPath(skia_conversions::ToPath(path), paint_);
850 }
851
852 // |flutter::DlOpReceiver|
853 void DlDispatcher::drawArc(const SkRect& oval_bounds,
854 SkScalar start_degrees,
855 SkScalar sweep_degrees,
856 bool use_center) {
857 PathBuilder builder;
858 builder.AddArc(skia_conversions::ToRect(oval_bounds), Degrees(start_degrees),
859 Degrees(sweep_degrees), use_center);
860 canvas_.DrawPath(builder.TakePath(), paint_);
861 }
862
863 // |flutter::DlOpReceiver|
864 void DlDispatcher::drawPoints(PointMode mode,
865 uint32_t count,
866 const SkPoint points[]) {
867 Paint paint = paint_;
868 paint.style = Paint::Style::kStroke;
869 switch (mode) {
870 case flutter::DlCanvas::PointMode::kPoints: {
871 // Cap::kButt is also treated as a square.
872 auto point_style = paint.stroke_cap == Cap::kRound ? PointStyle::kRound
873 : PointStyle::kSquare;
874 auto radius = paint.stroke_width;
875 if (radius > 0) {
876 radius /= 2.0;
877 }
878 canvas_.DrawPoints(skia_conversions::ToPoints(points, count), radius,
879 paint, point_style);
880 } break;
881 case flutter::DlCanvas::PointMode::kLines:
882 for (uint32_t i = 1; i < count; i += 2) {
883 Point p0 = skia_conversions::ToPoint(points[i - 1]);
884 Point p1 = skia_conversions::ToPoint(points[i]);
885 auto path = PathBuilder{}.AddLine(p0, p1).TakePath();
886 canvas_.DrawPath(path, paint);
887 }
888 break;
889 case flutter::DlCanvas::PointMode::kPolygon:
890 if (count > 1) {
891 Point p0 = skia_conversions::ToPoint(points[0]);
892 for (uint32_t i = 1; i < count; i++) {
893 Point p1 = skia_conversions::ToPoint(points[i]);
894 auto path = PathBuilder{}.AddLine(p0, p1).TakePath();
895 canvas_.DrawPath(path, paint);
896 p0 = p1;
897 }
898 }
899 break;
900 }
901 }
902
903 // |flutter::DlOpReceiver|
904 void DlDispatcher::drawVertices(const flutter::DlVertices* vertices,
905 flutter::DlBlendMode dl_mode) {
906 canvas_.DrawVertices(MakeVertices(vertices), ToBlendMode(dl_mode), paint_);
907 }
908
909 // |flutter::DlOpReceiver|
910 void DlDispatcher::drawImage(const sk_sp<flutter::DlImage> image,
911 const SkPoint point,
912 flutter::DlImageSampling sampling,
913 bool render_with_attributes) {
914 if (!image) {
915 return;
916 }
917
918 auto texture = image->impeller_texture();
919 if (!texture) {
920 return;
921 }
922
923 const auto size = texture->GetSize();
924 const auto src = SkRect::MakeWH(size.width, size.height);
925 const auto dest =
926 SkRect::MakeXYWH(point.fX, point.fY, size.width, size.height);
927
928 drawImageRect(image, // image
929 src, // source rect
930 dest, // destination rect
931 sampling, // sampling options
932 render_with_attributes, // render with attributes
933 SrcRectConstraint::kStrict // constraint
934 );
935 }
936
937 // |flutter::DlOpReceiver|
938 void DlDispatcher::drawImageRect(
939 const sk_sp<flutter::DlImage> image,
940 const SkRect& src,
941 const SkRect& dst,
942 flutter::DlImageSampling sampling,
943 bool render_with_attributes,
944 SrcRectConstraint constraint = SrcRectConstraint::kFast) {
945 canvas_.DrawImageRect(
946 std::make_shared<Image>(image->impeller_texture()), // image
947 skia_conversions::ToRect(src), // source rect
948 skia_conversions::ToRect(dst), // destination rect
949 render_with_attributes ? paint_ : Paint(), // paint
950 ToSamplerDescriptor(sampling) // sampling
951 );
952 }
953
954 // |flutter::DlOpReceiver|
955 void DlDispatcher::drawImageNine(const sk_sp<flutter::DlImage> image,
956 const SkIRect& center,
957 const SkRect& dst,
958 flutter::DlFilterMode filter,
959 bool render_with_attributes) {
960 NinePatchConverter converter = {};
961 converter.DrawNinePatch(
962 std::make_shared<Image>(image->impeller_texture()),
963 Rect::MakeLTRB(center.fLeft, center.fTop, center.fRight, center.fBottom),
964 skia_conversions::ToRect(dst), ToSamplerDescriptor(filter), &canvas_,
965 &paint_);
966 }
967
968 // |flutter::DlOpReceiver|
969 void DlDispatcher::drawAtlas(const sk_sp<flutter::DlImage> atlas,
970 const SkRSXform xform[],
971 const SkRect tex[],
972 const flutter::DlColor colors[],
973 int count,
974 flutter::DlBlendMode mode,
975 flutter::DlImageSampling sampling,
976 const SkRect* cull_rect,
977 bool render_with_attributes) {
978 canvas_.DrawAtlas(std::make_shared<Image>(atlas->impeller_texture()),
979 skia_conversions::ToRSXForms(xform, count),
980 skia_conversions::ToRects(tex, count),
981 ToColors(colors, count), ToBlendMode(mode),
982 ToSamplerDescriptor(sampling),
983 skia_conversions::ToRect(cull_rect), paint_);
984 }
985
986 // |flutter::DlOpReceiver|
987 void DlDispatcher::drawDisplayList(
988 const sk_sp<flutter::DisplayList> display_list,
989 SkScalar opacity) {
990 // Save all values that must remain untouched after the operation.
991 Paint saved_paint = paint_;
992 Matrix saved_initial_matrix = initial_matrix_;
993 int restore_count = canvas_.GetSaveCount();
994
995 // The display list may alter the clip, which must be restored to the current
996 // clip at the end of playback.
997 canvas_.Save();
998
999 // Establish a new baseline for interpreting the new DL.
1000 // Matrix and clip are left untouched, the current
1001 // transform is saved as the new base matrix, and paint
1002 // values are reset to defaults.
1003 initial_matrix_ = canvas_.GetCurrentTransformation();
1004 paint_ = Paint();
1005
1006 // Handle passed opacity in the most brute-force way by using
1007 // a SaveLayer. If the display_list is able to inherit the
1008 // opacity, this could also be handled by modulating all of its
1009 // attribute settings (for example, color), by the indicated
1010 // opacity.
1011 if (opacity < SK_Scalar1) {
1012 Paint save_paint;
1013 save_paint.color = Color(0, 0, 0, opacity);
1014 canvas_.SaveLayer(save_paint);
1015 }
1016
1017 // TODO(131445): Remove this restriction if we can correctly cull with
1018 // perspective transforms.
1019 if (display_list->has_rtree() && !initial_matrix_.HasPerspective()) {
1020 // The canvas remembers the screen-space culling bounds clipped by
1021 // the surface and the history of clip calls. DisplayList can cull
1022 // the ops based on a rectangle expressed in its "destination bounds"
1023 // so we need the canvas to transform those into the current local
1024 // coordinate space into which the DisplayList will be rendered.
1025 auto cull_bounds = canvas_.GetCurrentLocalCullingBounds();
1026 if (cull_bounds.has_value()) {
1027 Rect cull_rect = cull_bounds.value();
1028 display_list->Dispatch(
1029 *this, SkRect::MakeLTRB(cull_rect.GetLeft(), cull_rect.GetTop(),
1030 cull_rect.GetRight(), cull_rect.GetBottom()));
1031 } else {
1032 display_list->Dispatch(*this);
1033 }
1034 } else {
1035 display_list->Dispatch(*this);
1036 }
1037
1038 // Restore all saved state back to what it was before we interpreted
1039 // the display_list
1040 canvas_.RestoreToCount(restore_count);
1041 initial_matrix_ = saved_initial_matrix;
1042 paint_ = saved_paint;
1043 }
1044
1045 // |flutter::DlOpReceiver|
1046 void DlDispatcher::drawTextBlob(const sk_sp<SkTextBlob> blob,
1047 SkScalar x,
1048 SkScalar y) {
1049 // When running with Impeller enabled Skia text blobs are converted to
1050 // Impeller text frames in paragraph_skia.cc
1051 UNIMPLEMENTED;
1052 }
1053
1054 void DlDispatcher::drawTextFrame(const std::shared_ptr<TextFrame>& text_frame,
1055 SkScalar x,
1056 SkScalar y) {
1057 canvas_.DrawTextFrame(text_frame, //
1058 impeller::Point{x, y}, //
1059 paint_ //
1060 );
1061 }
1062
1063 // |flutter::DlOpReceiver|
1064 void DlDispatcher::drawShadow(const SkPath& path,
1065 const flutter::DlColor color,
1066 const SkScalar elevation,
1067 bool transparent_occluder,
1068 SkScalar dpr) {
1069 Color spot_color = skia_conversions::ToColor(color);
1070 spot_color.alpha *= 0.25;
1071
1072 // Compute the spot color -- ported from SkShadowUtils::ComputeTonalColors.
1073 {
1074 Scalar max =
1075 std::max(std::max(spot_color.red, spot_color.green), spot_color.blue);
1076 Scalar min =
1077 std::min(std::min(spot_color.red, spot_color.green), spot_color.blue);
1078 Scalar luminance = (min + max) * 0.5;
1079
1080 Scalar alpha_adjust =
1081 (2.6f + (-2.66667f + 1.06667f * spot_color.alpha) * spot_color.alpha) *
1082 spot_color.alpha;
1083 Scalar color_alpha =
1084 (3.544762f + (-4.891428f + 2.3466f * luminance) * luminance) *
1085 luminance;
1086 color_alpha = std::clamp(alpha_adjust * color_alpha, 0.0f, 1.0f);
1087
1088 Scalar greyscale_alpha =
1089 std::clamp(spot_color.alpha * (1 - 0.4f * luminance), 0.0f, 1.0f);
1090
1091 Scalar color_scale = color_alpha * (1 - greyscale_alpha);
1092 Scalar tonal_alpha = color_scale + greyscale_alpha;
1093 Scalar unpremul_scale = tonal_alpha != 0 ? color_scale / tonal_alpha : 0;
1094 spot_color = Color(unpremul_scale * spot_color.red,
1095 unpremul_scale * spot_color.green,
1096 unpremul_scale * spot_color.blue, tonal_alpha);
1097 }
1098
1099 Vector3 light_position(0, -1, 1);
1100 Scalar occluder_z = dpr * elevation;
1101
1102 constexpr Scalar kLightRadius = 800 / 600; // Light radius / light height
1103
1104 Paint paint;
1105 paint.style = Paint::Style::kFill;
1106 paint.color = spot_color;
1107 paint.mask_blur_descriptor = Paint::MaskBlurDescriptor{
1108 .style = FilterContents::BlurStyle::kNormal,
1109 .sigma = Radius{kLightRadius * occluder_z /
1110 canvas_.GetCurrentTransformation().GetScale().y},
1111 };
1112
1113 canvas_.Save();
1114 canvas_.PreConcat(
1115 Matrix::MakeTranslation(Vector2(0, -occluder_z * light_position.y)));
1116
1117 SkRect rect;
1118 SkRRect rrect;
1119 SkRect oval;
1120 if (path.isRect(&rect)) {
1121 canvas_.DrawRect(skia_conversions::ToRect(rect), paint);
1122 } else if (path.isRRect(&rrect) && rrect.isSimple()) {
1123 canvas_.DrawRRect(skia_conversions::ToRect(rrect.rect()),
1124 rrect.getSimpleRadii().fX, paint);
1125 } else if (path.isOval(&oval) && oval.width() == oval.height()) {
1126 canvas_.DrawCircle(skia_conversions::ToPoint(oval.center()),
1127 oval.width() * 0.5, paint);
1128 } else {
1129 canvas_.DrawPath(skia_conversions::ToPath(path), paint);
1130 }
1131
1132 canvas_.Restore();
1133 }
1134
1135 Picture DlDispatcher::EndRecordingAsPicture() {
1136 TRACE_EVENT0("impeller", "DisplayListDispatcher::EndRecordingAsPicture");
1137 return canvas_.EndRecordingAsPicture();
1138 }
1139
1140 } // namespace impeller
impeller::DlDispatcher::setBlendMode
void setBlendMode(flutter::DlBlendMode mode) override
Definition: dl_dispatcher.cc:496
impeller::DlDispatcher::drawTextBlob
void drawTextBlob(const sk_sp< SkTextBlob > blob, SkScalar x, SkScalar y) override
Definition: dl_dispatcher.cc:1046
impeller::Paint::stroke_cap
Cap stroke_cap
Definition: paint.h:59
impeller::BlendMode
BlendMode
Definition: color.h:57
impeller::Matrix::HasPerspective
constexpr bool HasPerspective() const
Definition: matrix.h:316
impeller::Entity::ClipOperation::kIntersect
@ kIntersect
path.h
impeller::Entity::TileMode::kClamp
@ kClamp
impeller::Canvas::EndRecordingAsPicture
Picture EndRecordingAsPicture()
Definition: canvas.cc:519
impeller::ColorSource::Type::kScene
@ kScene
impeller::DlDispatcher::save
void save() override
Definition: dl_dispatcher.cc:635
impeller::ColorSource::Type::kLinearGradient
@ kLinearGradient
impeller::DlDispatcher::drawOval
void drawOval(const SkRect &bounds) override
Definition: dl_dispatcher.cc:788
impeller::ToClipOperation
static Entity::ClipOperation ToClipOperation(flutter::DlCanvas::ClipOp clip_op)
Definition: dl_dispatcher.cc:726
impeller::Cap::kRound
@ kRound
impeller::Cap::kSquare
@ kSquare
impeller::DlDispatcher::DlDispatcher
DlDispatcher()
impeller::DlDispatcher::drawImageRect
void drawImageRect(const sk_sp< flutter::DlImage > image, const SkRect &src, const SkRect &dst, flutter::DlImageSampling sampling, bool render_with_attributes, SrcRectConstraint constraint) override
Definition: dl_dispatcher.cc:938
impeller::DlDispatcher::scale
void scale(SkScalar sx, SkScalar sy) override
Definition: dl_dispatcher.cc:659
impeller::DlDispatcher::saveLayer
void saveLayer(const SkRect *bounds, const flutter::SaveLayerOptions options, const flutter::DlImageFilter *backdrop) override
Definition: dl_dispatcher.cc:640
impeller::ImageFilter::MakeDilate
static std::shared_ptr< ImageFilter > MakeDilate(Radius radius_x, Radius radius_y)
Definition: image_filter.cc:29
impeller::skia_conversions::ToPoints
std::vector< Point > ToPoints(const SkPoint points[], int count)
Definition: skia_conversions.cc:31
impeller::Entity::ClipOperation::kDifference
@ kDifference
impeller::Scalar
float Scalar
Definition: scalar.h:15
impeller::Canvas::RestoreToCount
void RestoreToCount(size_t count)
Definition: canvas.cc:166
impeller::BlendMode::kMultiply
@ kMultiply
impeller::ColorSource::Type::kRadialGradient
@ kRadialGradient
impeller::Paint::Style::kStroke
@ kStroke
impeller::skia_conversions::ConvertStops
void ConvertStops(const flutter::DlGradientColorSourceBase *gradient, std::vector< Color > &colors, std::vector< float > &stops)
Convert display list colors + stops into impeller colors and stops, taking care to ensure that the st...
Definition: skia_conversions.cc:192
entity.h
impeller::ColorSource::MakeLinearGradient
static ColorSource MakeLinearGradient(Point start_point, Point end_point, std::vector< Color > colors, std::vector< Scalar > stops, Entity::TileMode tile_mode, Matrix effect_transform)
Definition: color_source.cc:45
impeller::Paint
Definition: paint.h:25
impeller::FillType::kOdd
@ kOdd
impeller::DlDispatcher::drawRRect
void drawRRect(const SkRRect &rrect) override
Definition: dl_dispatcher.cc:807
impeller::Canvas::Skew
void Skew(Scalar sx, Scalar sy)
Definition: canvas.cc:154
impeller::FilterContents::BlurStyle
BlurStyle
Definition: filter_contents.h:21
impeller::Color
Definition: color.h:122
impeller::DlDispatcher::clipRRect
void clipRRect(const SkRRect &rrect, ClipOp clip_op, bool is_aa) override
Definition: dl_dispatcher.cc:742
impeller::ToImageFilter
static std::shared_ptr< ImageFilter > ToImageFilter(const flutter::DlImageFilter *filter)
Definition: dl_dispatcher.cc:539
impeller::Paint::color
Color color
Definition: paint.h:54
impeller::Entity::TileMode::kDecal
@ kDecal
impeller::DlDispatcher::drawArc
void drawArc(const SkRect &oval_bounds, SkScalar start_degrees, SkScalar sweep_degrees, bool use_center) override
Definition: dl_dispatcher.cc:853
impeller::DlDispatcher::EndRecordingAsPicture
Picture EndRecordingAsPicture()
Definition: dl_dispatcher.cc:1135
impeller::Canvas::DrawTextFrame
void DrawTextFrame(const std::shared_ptr< TextFrame > &text_frame, Point position, const Paint &paint)
Definition: canvas.cc:563
impeller::DlDispatcher::drawPaint
void drawPaint() override
Definition: dl_dispatcher.cc:766
dl_dispatcher.h
impeller::DlDispatcher::setStrokeJoin
void setStrokeJoin(flutter::DlStrokeJoin join) override
Definition: dl_dispatcher.cc:249
impeller::PathBuilder::AddPath
PathBuilder & AddPath(const Path &path)
Definition: path_builder.cc:443
formats.h
impeller::PathBuilder
Definition: path_builder.h:13
impeller::Paint::MaskBlurDescriptor::style
FilterContents::BlurStyle style
Definition: paint.h:42
impeller::PointStyle::kRound
@ kRound
Points are drawn as squares.
impeller::DlDispatcher::setImageFilter
void setImageFilter(const flutter::DlImageFilter *filter) override
Definition: dl_dispatcher.cc:630
impeller::BlendMode::kSourceIn
@ kSourceIn
tiled_texture_contents.h
impeller::Vector2
Point Vector2
Definition: point.h:310
impeller::Canvas::ResetTransform
void ResetTransform()
Definition: canvas.cc:121
impeller::DlDispatcher::transform2DAffine
void transform2DAffine(SkScalar mxx, SkScalar mxy, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myt) override
Definition: dl_dispatcher.cc:674
impeller::Canvas::DrawVertices
void DrawVertices(const std::shared_ptr< VerticesGeometry > &vertices, BlendMode blend_mode, const Paint &paint)
Definition: canvas.cc:606
impeller::DlDispatcher::transformFullPerspective
void transformFullPerspective(SkScalar mxx, SkScalar mxy, SkScalar mxz, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myz, SkScalar myt, SkScalar mzx, SkScalar mzy, SkScalar mzz, SkScalar mzt, SkScalar mwx, SkScalar mwy, SkScalar mwz, SkScalar mwt) override
Definition: dl_dispatcher.cc:691
impeller::skia_conversions::ToRects
std::vector< Rect > ToRects(const SkRect tex[], int count)
Definition: skia_conversions.cc:23
impeller::NinePatchConverter::DrawNinePatch
void DrawNinePatch(const std::shared_ptr< Image > &image, Rect center, Rect dst, const SamplerDescriptor &sampler, Canvas *canvas, Paint *paint)
Definition: nine_patch_converter.cc:60
impeller::Color::alpha
Scalar alpha
Definition: color.h:141
impeller::MakeVertices
std::shared_ptr< impeller::VerticesGeometry > MakeVertices(const flutter::DlVertices *vertices)
Definition: dl_vertices_geometry.cc:31
impeller::ImageFilter::MakeBlur
static std::shared_ptr< ImageFilter > MakeBlur(Sigma sigma_x, Sigma sigma_y, FilterContents::BlurStyle blur_style, Entity::TileMode tile_mode)
Definition: image_filter.cc:20
impeller::BlendMode::kSaturation
@ kSaturation
impeller::DlDispatcher::drawRect
void drawRect(const SkRect &rect) override
Definition: dl_dispatcher.cc:783
impeller::Paint::MaskBlurDescriptor
Definition: paint.h:41
impeller::skia_conversions::ToColor
Color ToColor(const flutter::DlColor &color)
Definition: skia_conversions.cc:142
impeller::ColorSource::MakeSweepGradient
static ColorSource MakeSweepGradient(Point center, Degrees start_angle, Degrees end_angle, std::vector< Color > colors, std::vector< Scalar > stops, Entity::TileMode tile_mode, Matrix effect_transform)
Definition: color_source.cc:141
impeller::BlendMode::kHue
@ kHue
impeller::ColorSource::MakeColor
static ColorSource MakeColor()
Definition: color_source.cc:41
impeller::ColorSource::MakeImage
static ColorSource MakeImage(std::shared_ptr< Texture > texture, Entity::TileMode x_tile_mode, Entity::TileMode y_tile_mode, SamplerDescriptor sampler_descriptor, Matrix effect_transform)
Definition: color_source.cc:167
impeller::FilterContents::BlurStyle::kNormal
@ kNormal
Blurred inside and outside.
impeller::PathBuilder::SetConvexity
PathBuilder & SetConvexity(Convexity value)
Definition: path_builder.cc:111
impeller::DlDispatcher::drawLine
void drawLine(const SkPoint &p0, const SkPoint &p1) override
Definition: dl_dispatcher.cc:771
sweep_gradient_contents.h
impeller::BlendMode::kDestinationIn
@ kDestinationIn
impeller::BlendMode::kDarken
@ kDarken
impeller::Canvas::SaveLayer
void SaveLayer(const Paint &paint, std::optional< Rect > bounds=std::nullopt, const std::shared_ptr< ImageFilter > &backdrop_filter=nullptr)
Definition: canvas.cc:538
impeller::Cap::kButt
@ kButt
impeller::DlDispatcher::drawColor
void drawColor(flutter::DlColor color, flutter::DlBlendMode mode) override
Definition: dl_dispatcher.cc:757
impeller::Entity::TileMode::kRepeat
@ kRepeat
impeller::Matrix::MakeTranslation
static constexpr Matrix MakeTranslation(const Vector3 &t)
Definition: matrix.h:94
impeller::DlDispatcher::drawImage
void drawImage(const sk_sp< flutter::DlImage > image, const SkPoint point, flutter::DlImageSampling sampling, bool render_with_attributes) override
Definition: dl_dispatcher.cc:910
impeller::DlDispatcher::~DlDispatcher
~DlDispatcher()
impeller::BlendMode::kColor
@ kColor
impeller::Paint::color_source
ColorSource color_source
Definition: paint.h:55
impeller::Color::green
Scalar green
Definition: color.h:131
UNIMPLEMENTED
#define UNIMPLEMENTED
Definition: dl_dispatcher.cc:44
impeller::DlDispatcher::restore
void restore() override
Definition: dl_dispatcher.cc:649
impeller::ToTileMode
static Entity::TileMode ToTileMode(flutter::DlTileMode tile_mode)
Definition: dl_dispatcher.cc:119
impeller::DlDispatcher::drawPath
void drawPath(const SkPath &path) override
Definition: dl_dispatcher.cc:825
impeller::DlDispatcher::clipRect
void clipRect(const SkRect &rect, ClipOp clip_op, bool is_aa) override
Definition: dl_dispatcher.cc:737
impeller::BlendMode::kLuminosity
@ kLuminosity
impeller::Join::kMiter
@ kMiter
runtime_effect_contents.h
impeller::DlDispatcher::drawDisplayList
void drawDisplayList(const sk_sp< flutter::DisplayList > display_list, SkScalar opacity) override
Definition: dl_dispatcher.cc:987
impeller::BlendMode::kXor
@ kXor
impeller::ImageFilter::MakeFromColorFilter
static std::shared_ptr< ImageFilter > MakeFromColorFilter(const ColorFilter &color_filter)
Definition: image_filter.cc:52
impeller::Entity::TileMode::kMirror
@ kMirror
impeller::Paint::stroke_miter
Scalar stroke_miter
Definition: paint.h:61
impeller::DlDispatcher::setStrokeWidth
void setStrokeWidth(SkScalar width) override
Definition: dl_dispatcher.cc:224
impeller::ToMatrix
static Matrix ToMatrix(const SkMatrix &m)
Definition: dl_dispatcher.cc:174
path_builder.h
impeller::ToColors
static std::vector< Color > ToColors(const flutter::DlColor colors[], int count)
Definition: dl_dispatcher.cc:263
impeller::BlendMode::kOverlay
@ kOverlay
impeller::MinMagFilter::kNearest
@ kNearest
Select nearest to the sample point. Most widely supported.
impeller::SamplerDescriptor::mag_filter
MinMagFilter mag_filter
Definition: sampler_descriptor.h:20
impeller::skia_conversions::ToRect
Rect ToRect(const SkRect &rect)
Definition: skia_conversions.cc:12
impeller::SamplerDescriptor
Definition: sampler_descriptor.h:18
impeller::kColor
@ kColor
Definition: geometry.h:27
impeller::BlendMode::kColorBurn
@ kColorBurn
impeller::Paint::color_filter
std::shared_ptr< ColorFilter > color_filter
Definition: paint.h:67
impeller::DlDispatcher::setColorFilter
void setColorFilter(const flutter::DlColorFilter *filter) override
Definition: dl_dispatcher.cc:485
impeller::Picture
Definition: picture.h:19
impeller::Canvas::DrawImageRect
void DrawImageRect(const std::shared_ptr< Image > &image, Rect source, Rect dest, const Paint &paint, SamplerDescriptor sampler={})
Definition: canvas.cc:488
impeller::PointStyle::kSquare
@ kSquare
Points are drawn as circles.
impeller::SamplerDescriptor::min_filter
MinMagFilter min_filter
Definition: sampler_descriptor.h:19
impeller::BlendMode::kLighten
@ kLighten
filter_contents.h
impeller::BlendMode::kSourceOver
@ kSourceOver
impeller::TRect::GetLeft
constexpr auto GetLeft() const
Definition: rect.h:137
impeller::Canvas::Scale
void Scale(const Vector2 &scale)
Definition: canvas.cc:146
scene_contents.h
skia_conversions.h
impeller::DlDispatcher::drawImageNine
void drawImageNine(const sk_sp< flutter::DlImage > image, const SkIRect &center, const SkRect &dst, flutter::DlFilterMode filter, bool render_with_attributes) override
Definition: dl_dispatcher.cc:955
impeller::BlendMode::kHardLight
@ kHardLight
sigma.h
impeller::DlDispatcher::transformReset
void transformReset() override
Definition: dl_dispatcher.cc:721
impeller::BlendMode::kPlus
@ kPlus
impeller::Radius
For convolution filters, the "radius" is the size of the convolution kernel to use on the local space...
Definition: sigma.h:47
impeller::FilterContents::BlurStyle::kSolid
@ kSolid
Solid inside, blurred outside.
impeller::Matrix::GetScale
constexpr Vector3 GetScale() const
Definition: matrix.h:301
impeller::BlendMode::kDestination
@ kDestination
impeller::ColorSource::MakeConicalGradient
static ColorSource MakeConicalGradient(Point center, Scalar radius, std::vector< Color > colors, std::vector< Scalar > stops, Point focus_center, Scalar focus_radius, Entity::TileMode tile_mode, Matrix effect_transform)
Definition: color_source.cc:75
impeller::ColorFilter::MakeBlend
static std::shared_ptr< ColorFilter > MakeBlend(BlendMode blend_mode, Color color)
Definition: color_filter.cc:20
impeller::Canvas::Save
void Save()
Definition: canvas.cc:56
impeller::ColorSource::Type::kRuntimeEffect
@ kRuntimeEffect
impeller::DlDispatcher::setDither
void setDither(bool dither) override
Definition: dl_dispatcher.cc:191
conical_gradient_contents.h
impeller::DlDispatcher::drawDRRect
void drawDRRect(const SkRRect &outer, const SkRRect &inner) override
Definition: dl_dispatcher.cc:817
impeller::DlDispatcher::clipPath
void clipPath(const SkPath &path, ClipOp clip_op, bool is_aa) override
Definition: dl_dispatcher.cc:752
impeller::MinMagFilter::kLinear
@ kLinear
impeller::Paint::style
Style style
Definition: paint.h:62
impeller::Canvas::DrawCircle
void DrawCircle(Point center, Scalar radius, const Paint &paint)
Definition: canvas.cc:277
impeller::ImageFilter::MakeLocalMatrix
static std::shared_ptr< ImageFilter > MakeLocalMatrix(const Matrix &matrix, const ImageFilter &internal_filter)
Definition: image_filter.cc:57
impeller::Paint::Style::kFill
@ kFill
impeller::ToColorSourceType
static std::optional< ColorSource::Type > ToColorSourceType(flutter::DlColorSourceType type)
Definition: dl_dispatcher.cc:274
impeller::ColorMatrix::array
Scalar array[20]
Definition: color.h:116
impeller::DlDispatcher::setMaskFilter
void setMaskFilter(const flutter::DlMaskFilter *filter) override
Definition: dl_dispatcher.cc:520
impeller::ToStyle
static Paint::Style ToStyle(flutter::DlDrawStyle style)
Definition: dl_dispatcher.cc:195
impeller::Canvas::DrawRRect
void DrawRRect(Rect rect, Scalar corner_radius, const Paint &paint)
Definition: canvas.cc:255
geometry.h
impeller::Color::red
Scalar red
Definition: color.h:126
impeller::BlendMode::kDestinationATop
@ kDestinationATop
impeller::Sigma
In filters that use Gaussian distributions, "sigma" is a size of one standard deviation in terms of t...
Definition: sigma.h:31
impeller::Canvas::Restore
bool Restore()
Definition: canvas.cc:92
impeller::ImageFilter::MakeErode
static std::shared_ptr< ImageFilter > MakeErode(Radius radius_x, Radius radius_y)
Definition: image_filter.cc:34
impeller::Canvas::DrawAtlas
void DrawAtlas(const std::shared_ptr< Image > &atlas, std::vector< Matrix > transforms, std::vector< Rect > texture_coordinates, std::vector< Color > colors, BlendMode blend_mode, SamplerDescriptor sampler, std::optional< Rect > cull_rect, const Paint &paint)
Definition: canvas.cc:667
impeller::PathBuilder::AddLine
PathBuilder & AddLine(const Point &p1, const Point &p2)
Move to point p1, then insert a line from p1 to p2.
Definition: path_builder.cc:433
impeller::Canvas::DrawPath
void DrawPath(const Path &path, const Paint &paint)
Definition: canvas.cc:174
impeller::PathBuilder::TakePath
Path TakePath(FillType fill=FillType::kNonZero)
Definition: path_builder.cc:21
impeller::Canvas::DrawPaint
void DrawPaint(const Paint &paint)
Definition: canvas.cc:184
filter_input.h
impeller::NinePatchConverter
Definition: nine_patch_converter.h:19
impeller::ToBlurStyle
static FilterContents::BlurStyle ToBlurStyle(flutter::DlBlurStyle blur_style)
Definition: dl_dispatcher.cc:506
impeller::Canvas::GetSaveCount
size_t GetSaveCount() const
Definition: canvas.cc:162
impeller::Join::kRound
@ kRound
impeller::DlDispatcher::drawShadow
void drawShadow(const SkPath &path, const flutter::DlColor color, const SkScalar elevation, bool transparent_occluder, SkScalar dpr) override
Definition: dl_dispatcher.cc:1064
impeller::Canvas::PreConcat
void PreConcat(const Matrix &xformation)
Definition: canvas.cc:117
impeller::BlendMode::kDestinationOut
@ kDestinationOut
impeller::Vector3::y
Scalar y
Definition: vector.h:21
impeller::FilterContents::BlurStyle::kInner
@ kInner
Blurred inside, nothing outside.
impeller::DlDispatcher::setAntiAlias
void setAntiAlias(bool aa) override
Definition: dl_dispatcher.cc:186
impeller::DlDispatcher::setInvertColors
void setInvertColors(bool invert) override
Definition: dl_dispatcher.cc:491
impeller::DlDispatcher::drawVertices
void drawVertices(const flutter::DlVertices *vertices, flutter::DlBlendMode dl_mode) override
Definition: dl_dispatcher.cc:904
impeller::skia_conversions::ToPoint
Point ToPoint(const SkPoint &point)
Definition: skia_conversions.cc:138
impeller::Entity::TileMode
TileMode
Definition: entity.h:40
impeller::BlendMode::kSoftLight
@ kSoftLight
impeller::SamplerDescriptor::mip_filter
MipFilter mip_filter
Definition: sampler_descriptor.h:21
impeller::DlDispatcher::setColorSource
void setColorSource(const flutter::DlColorSource *source) override
Definition: dl_dispatcher.cc:299
impeller::ColorSource::MakeRadialGradient
static ColorSource MakeRadialGradient(Point center, Scalar radius, std::vector< Color > colors, std::vector< Scalar > stops, Entity::TileMode tile_mode, Matrix effect_transform)
Definition: color_source.cc:110
impeller::ImageFilter::MakeMatrix
static std::shared_ptr< ImageFilter > MakeMatrix(const Matrix &matrix, SamplerDescriptor sampler_descriptor)
Definition: image_filter.cc:39
dl_vertices_geometry.h
impeller::Canvas::Transform
void Transform(const Matrix &xformation)
Definition: canvas.cc:125
impeller::ColorFilter::MakeMatrix
static std::shared_ptr< ColorFilter > MakeMatrix(ColorMatrix color_matrix)
Definition: color_filter.cc:25
scalar.h
impeller::DlDispatcher::drawTextFrame
void drawTextFrame(const std::shared_ptr< impeller::TextFrame > &text_frame, SkScalar x, SkScalar y) override
Definition: dl_dispatcher.cc:1054
impeller::ImageFilter::MakeCompose
static std::shared_ptr< ImageFilter > MakeCompose(const ImageFilter &inner, const ImageFilter &outer)
Definition: image_filter.cc:46
impeller::BlendMode::kDifference
@ kDifference
impeller::DlDispatcher::skew
void skew(SkScalar sx, SkScalar sy) override
Definition: dl_dispatcher.cc:669
impeller::Join::kBevel
@ kBevel
impeller::ColorSource::Type::kImage
@ kImage
impeller::ColorSource::MakeRuntimeEffect
static ColorSource MakeRuntimeEffect(std::shared_ptr< RuntimeStage > runtime_stage, std::shared_ptr< std::vector< uint8_t >> uniform_data, std::vector< RuntimeEffectContents::TextureInput > texture_inputs)
Definition: color_source.cc:197
impeller::Canvas::ClipRRect
void ClipRRect(const Rect &rect, Scalar corner_radius, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
Definition: canvas.cc:321
impeller::FilterContents::BlurStyle::kOuter
@ kOuter
Nothing inside, blurred outside.
impeller::TRect::GetRight
constexpr auto GetRight() const
Definition: rect.h:151
impeller::Canvas::Rotate
void Rotate(Radians radians)
Definition: canvas.cc:158
impeller::ColorSource::Type::kConicalGradient
@ kConicalGradient
impeller::ColorFilter::MakeLinearToSrgb
static std::shared_ptr< ColorFilter > MakeLinearToSrgb()
Definition: color_filter.cc:33
impeller::BlendMode::kExclusion
@ kExclusion
impeller::DlDispatcher::setDrawStyle
void setDrawStyle(flutter::DlDrawStyle style) override
Definition: dl_dispatcher.cc:209
impeller::Canvas::GetCurrentTransformation
const Matrix & GetCurrentTransformation() const
Definition: canvas.cc:129
impeller::BlendMode::kDestinationOver
@ kDestinationOver
impeller::TPoint< Scalar >
impeller::skia_conversions::ToRSXForms
std::vector< Matrix > ToRSXForms(const SkRSXform xform[], int count)
Definition: skia_conversions.cc:151
impeller::BlendMode::kClear
@ kClear
impeller::Paint::invert_colors
bool invert_colors
Definition: paint.h:64
impeller::DlDispatcher::setColor
void setColor(flutter::DlColor color) override
Definition: dl_dispatcher.cc:214
impeller::MipFilter::kLinear
@ kLinear
impeller::Canvas::GetCurrentLocalCullingBounds
const std::optional< Rect > GetCurrentLocalCullingBounds() const
Definition: canvas.cc:133
impeller::SamplerDescriptor::label
std::string label
Definition: sampler_descriptor.h:27
impeller::Entity::ClipOperation
ClipOperation
Definition: entity.h:59
impeller::Canvas::DrawRect
void DrawRect(Rect rect, const Paint &paint)
Definition: canvas.cc:235
impeller::ToBlendMode
static BlendMode ToBlendMode(flutter::DlBlendMode mode)
Definition: dl_dispatcher.cc:55
impeller::DlDispatcher::rotate
void rotate(SkScalar degrees) override
Definition: dl_dispatcher.cc:664
impeller::TRect::GetBottom
constexpr auto GetBottom() const
Definition: rect.h:158
impeller::Degrees
Definition: scalar.h:43
color_filter.h
impeller::Paint::Style
Style
Definition: paint.h:36
impeller::Canvas::DrawPoints
void DrawPoints(std::vector< Point >, Scalar radius, const Paint &paint, PointStyle point_style)
Definition: canvas.cc:424
radial_gradient_contents.h
impeller::Canvas::ClipRect
void ClipRect(const Rect &rect, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
Definition: canvas.cc:300
impeller::ToSamplerDescriptor
static impeller::SamplerDescriptor ToSamplerDescriptor(const flutter::DlImageSampling options)
Definition: dl_dispatcher.cc:132
impeller::BlendMode::kColorDodge
@ kColorDodge
impeller::TRect< Scalar >::MakeLTRB
constexpr static TRect MakeLTRB(Type left, Type top, Type right, Type bottom)
Definition: rect.h:40
impeller::PathBuilder::AddOval
PathBuilder & AddOval(const Rect &rect)
Definition: path_builder.cc:385
impeller::ToColorFilter
static std::shared_ptr< ColorFilter > ToColorFilter(const flutter::DlColorFilter *filter)
Definition: dl_dispatcher.cc:458
impeller::BlendMode::kSourceATop
@ kSourceATop
impeller::ColorFilter::MakeSrgbToLinear
static std::shared_ptr< ColorFilter > MakeSrgbToLinear()
Definition: color_filter.cc:29
impeller::BlendMode::kModulate
@ kModulate
nine_patch_converter.h
impeller::Convexity::kConvex
@ kConvex
impeller::Color::blue
Scalar blue
Definition: color.h:136
impeller::ColorSource::Type::kSweepGradient
@ kSweepGradient
impeller::DlDispatcher::setStrokeMiter
void setStrokeMiter(SkScalar limit) override
Definition: dl_dispatcher.cc:229
impeller::ColorMatrix
Definition: color.h:115
impeller::DlDispatcher::drawPoints
void drawPoints(PointMode mode, uint32_t count, const SkPoint points[]) override
Definition: dl_dispatcher.cc:864
impeller::BlendMode::kScreen
@ kScreen
impeller::DlDispatcher::drawAtlas
void drawAtlas(const sk_sp< flutter::DlImage > atlas, const SkRSXform xform[], const SkRect tex[], const flutter::DlColor colors[], int count, flutter::DlBlendMode mode, flutter::DlImageSampling sampling, const SkRect *cull_rect, bool render_with_attributes) override
Definition: dl_dispatcher.cc:969
impeller
Definition: aiks_context.cc:10
impeller::Paint::dither
bool dither
Definition: paint.h:56
impeller::Paint::mask_blur_descriptor
std::optional< MaskBlurDescriptor > mask_blur_descriptor
Definition: paint.h:68
impeller::TRect::GetTop
constexpr auto GetTop() const
Definition: rect.h:144
impeller::BlendMode::kSourceOut
@ kSourceOut
impeller::Paint::stroke_width
Scalar stroke_width
Definition: paint.h:58
impeller::skia_conversions::ToPath
Path ToPath(const SkPath &path, Point shift)
Definition: skia_conversions.cc:49
impeller::ColorSource::Type::kColor
@ kColor
impeller::DlDispatcher::translate
void translate(SkScalar tx, SkScalar ty) override
Definition: dl_dispatcher.cc:654
impeller::TRect< Scalar >
impeller::BlendMode::kSource
@ kSource
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:36
impeller::PathBuilder::AddArc
PathBuilder & AddArc(const Rect &oval_bounds, Radians start, Radians sweep, bool use_center=false)
Definition: path_builder.cc:325
impeller::Vector3
Definition: vector.h:17
impeller::DlDispatcher::setStrokeCap
void setStrokeCap(flutter::DlStrokeCap cap) override
Definition: dl_dispatcher.cc:234
impeller::Paint::blend_mode
BlendMode blend_mode
Definition: paint.h:63
impeller::DlDispatcher::setPathEffect
void setPathEffect(const flutter::DlPathEffect *effect) override
Definition: dl_dispatcher.cc:501
impeller::DlDispatcher::drawCircle
void drawCircle(const SkPoint &center, SkScalar radius) override
Definition: dl_dispatcher.cc:802
impeller::Paint::image_filter
std::shared_ptr< ImageFilter > image_filter
Definition: paint.h:66
linear_gradient_contents.h
impeller::Paint::stroke_join
Join stroke_join
Definition: paint.h:60
dl_image_impeller.h
impeller::Canvas::Translate
void Translate(const Vector3 &offset)
Definition: canvas.cc:142
impeller::Canvas::ClipPath
void ClipPath(const Path &path, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
Definition: canvas.cc:290