Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
canvas.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
6
7#include <cmath>
8
16
17using tonic::ToDart;
18
19namespace flutter {
20
22
23void Canvas::Create(Dart_Handle wrapper,
24 PictureRecorder* recorder,
25 double left,
26 double top,
27 double right,
28 double bottom) {
29 UIDartState::ThrowIfUIOperationsProhibited();
30
31 if (!recorder) {
32 Dart_ThrowException(
33 ToDart("Canvas constructor called with non-genuine PictureRecorder."));
34 return;
35 }
36
37 fml::RefPtr<Canvas> canvas =
38 fml::MakeRefCounted<Canvas>(recorder->BeginRecording(
39 DlRect::MakeLTRB(SafeNarrow(left), SafeNarrow(top), SafeNarrow(right),
40 SafeNarrow(bottom))));
41 recorder->set_canvas(canvas);
42 canvas->AssociateWithDartWrapper(wrapper);
43}
44
45Canvas::Canvas(sk_sp<DisplayListBuilder> builder)
46 : display_list_builder_(std::move(builder)) {}
47
49
50void Canvas::save() {
51 if (display_list_builder_) {
52 builder()->Save();
53 }
54}
55
56void Canvas::saveLayerWithoutBounds(Dart_Handle paint_objects,
57 Dart_Handle paint_data) {
58 Paint paint(paint_objects, paint_data);
59
60 FML_DCHECK(paint.isNotNull());
61 if (display_list_builder_) {
62 DlPaint dl_paint;
63 const DlPaint* save_paint =
64 paint.paint(dl_paint, kSaveLayerWithPaintFlags, DlTileMode::kDecal);
65 FML_DCHECK(save_paint);
66 TRACE_EVENT0("flutter", "ui.Canvas::saveLayer (Recorded)");
67 builder()->SaveLayer(std::nullopt, save_paint);
68 }
69}
70
71void Canvas::saveLayer(double left,
72 double top,
73 double right,
74 double bottom,
75 Dart_Handle paint_objects,
76 Dart_Handle paint_data) {
77 Paint paint(paint_objects, paint_data);
78
79 FML_DCHECK(paint.isNotNull());
80 DlRect bounds = DlRect::MakeLTRB(SafeNarrow(left), SafeNarrow(top),
81 SafeNarrow(right), SafeNarrow(bottom));
82 if (display_list_builder_) {
83 DlPaint dl_paint;
84 const DlPaint* save_paint =
85 paint.paint(dl_paint, kSaveLayerWithPaintFlags, DlTileMode::kDecal);
86 FML_DCHECK(save_paint);
87 TRACE_EVENT0("flutter", "ui.Canvas::saveLayer (Recorded)");
88 builder()->SaveLayer(bounds, save_paint);
89 }
90}
91
92void Canvas::restore() {
93 if (display_list_builder_) {
94 builder()->Restore();
95 }
96}
97
98int Canvas::getSaveCount() {
99 if (display_list_builder_) {
100 return builder()->GetSaveCount();
101 } else {
102 return 0;
103 }
104}
105
106void Canvas::restoreToCount(int count) {
107 if (display_list_builder_ && count < getSaveCount()) {
108 builder()->RestoreToCount(count);
109 }
110}
111
112void Canvas::translate(double dx, double dy) {
113 if (display_list_builder_) {
114 builder()->Translate(SafeNarrow(dx), SafeNarrow(dy));
115 }
116}
117
118void Canvas::scale(double sx, double sy) {
119 if (display_list_builder_) {
120 builder()->Scale(SafeNarrow(sx), SafeNarrow(sy));
121 }
122}
123
124void Canvas::rotate(double radians) {
125 if (display_list_builder_) {
126 builder()->Rotate(SafeNarrow(radians) * 180.0f / static_cast<float>(M_PI));
127 }
128}
129
130void Canvas::skew(double sx, double sy) {
131 if (display_list_builder_) {
132 builder()->Skew(SafeNarrow(sx), SafeNarrow(sy));
133 }
134}
135
136void Canvas::transform(const tonic::Float64List& matrix4) {
137 // The Float array stored by Dart Matrix4 is in column-major order
138 // DisplayList TransformFullPerspective takes row-major matrix order
139 if (display_list_builder_) {
140 // clang-format off
141 builder()->TransformFullPerspective(
142 SafeNarrow(matrix4[ 0]), SafeNarrow(matrix4[ 4]), SafeNarrow(matrix4[ 8]), SafeNarrow(matrix4[12]),
143 SafeNarrow(matrix4[ 1]), SafeNarrow(matrix4[ 5]), SafeNarrow(matrix4[ 9]), SafeNarrow(matrix4[13]),
144 SafeNarrow(matrix4[ 2]), SafeNarrow(matrix4[ 6]), SafeNarrow(matrix4[10]), SafeNarrow(matrix4[14]),
145 SafeNarrow(matrix4[ 3]), SafeNarrow(matrix4[ 7]), SafeNarrow(matrix4[11]), SafeNarrow(matrix4[15]));
146 // clang-format on
147 }
148}
149
150void Canvas::getTransform(Dart_Handle matrix4_handle) {
151 if (display_list_builder_) {
152 // The Float array stored by DlMatrix is in column-major order
153 DlMatrix matrix = builder()->GetMatrix();
154 auto matrix4 = tonic::Float64List(matrix4_handle);
155 for (int i = 0; i < 16; i++) {
156 matrix4[i] = matrix.m[i];
157 }
158 }
159}
160
161void Canvas::clipRect(double left,
162 double top,
163 double right,
164 double bottom,
165 DlClipOp clipOp,
166 bool doAntiAlias) {
167 if (display_list_builder_) {
168 builder()->ClipRect(DlRect::MakeLTRB(SafeNarrow(left), SafeNarrow(top),
169 SafeNarrow(right), SafeNarrow(bottom)),
170 clipOp, doAntiAlias);
171 }
172}
173
174void Canvas::clipRRect(const RRect& rrect, bool doAntiAlias) {
175 if (display_list_builder_) {
176 builder()->ClipRoundRect(rrect.rrect, DlClipOp::kIntersect, doAntiAlias);
177 }
178}
179
180void Canvas::clipRSuperellipse(const RSuperellipse* rse, bool doAntiAlias) {
181 if (display_list_builder_) {
182 builder()->ClipRoundSuperellipse(rse->rsuperellipse(), DlClipOp::kIntersect,
183 doAntiAlias);
184 }
185}
186
187void Canvas::clipPath(const CanvasPath* path, bool doAntiAlias) {
188 if (!path) {
189 Dart_ThrowException(
190 ToDart("Canvas.clipPath called with non-genuine Path."));
191 return;
192 }
193 if (display_list_builder_) {
194 builder()->ClipPath(path->path(), DlClipOp::kIntersect, doAntiAlias);
195 }
196}
197
198void Canvas::getDestinationClipBounds(Dart_Handle rect_handle) {
199 if (display_list_builder_) {
200 auto rect = tonic::Float64List(rect_handle);
201 DlRect bounds = builder()->GetDestinationClipCoverage();
202 rect[0] = bounds.GetLeft();
203 rect[1] = bounds.GetTop();
204 rect[2] = bounds.GetRight();
205 rect[3] = bounds.GetBottom();
206 }
207}
208
209void Canvas::getLocalClipBounds(Dart_Handle rect_handle) {
210 if (display_list_builder_) {
211 auto rect = tonic::Float64List(rect_handle);
212 DlRect bounds = builder()->GetLocalClipCoverage();
213 rect[0] = bounds.GetLeft();
214 rect[1] = bounds.GetTop();
215 rect[2] = bounds.GetRight();
216 rect[3] = bounds.GetBottom();
217 }
218}
219
220void Canvas::drawColor(uint32_t color, DlBlendMode blend_mode) {
221 if (display_list_builder_) {
222 builder()->DrawColor(DlColor(color), blend_mode);
223 }
224}
225
226void Canvas::drawLine(double x1,
227 double y1,
228 double x2,
229 double y2,
230 Dart_Handle paint_objects,
231 Dart_Handle paint_data) {
232 Paint paint(paint_objects, paint_data);
233
234 FML_DCHECK(paint.isNotNull());
235 if (display_list_builder_) {
236 DlPaint dl_paint;
237 paint.paint(dl_paint, kDrawLineFlags, DlTileMode::kDecal);
238 builder()->DrawLine(DlPoint(SafeNarrow(x1), SafeNarrow(y1)),
239 DlPoint(SafeNarrow(x2), SafeNarrow(y2)), dl_paint);
240 }
241}
242
243void Canvas::drawPaint(Dart_Handle paint_objects, Dart_Handle paint_data) {
244 Paint paint(paint_objects, paint_data);
245
246 FML_DCHECK(paint.isNotNull());
247 if (display_list_builder_) {
248 DlPaint dl_paint;
249 paint.paint(dl_paint, kDrawPaintFlags, DlTileMode::kClamp);
250 std::shared_ptr<DlImageFilter> filter = dl_paint.getImageFilter();
251 if (filter && !filter->asColorFilter()) {
252 // drawPaint does an implicit saveLayer if an DlImageFilter is
253 // present that cannot be replaced by an DlColorFilter.
254 TRACE_EVENT0("flutter", "ui.Canvas::saveLayer (Recorded)");
255 }
256 builder()->DrawPaint(dl_paint);
257 }
258}
259
260void Canvas::drawRect(double left,
261 double top,
262 double right,
263 double bottom,
264 Dart_Handle paint_objects,
265 Dart_Handle paint_data) {
266 Paint paint(paint_objects, paint_data);
267
268 FML_DCHECK(paint.isNotNull());
269 if (display_list_builder_) {
270 DlPaint dl_paint;
271 paint.paint(dl_paint, kDrawRectFlags, DlTileMode::kDecal);
272 builder()->DrawRect(DlRect::MakeLTRB(SafeNarrow(left), SafeNarrow(top),
273 SafeNarrow(right), SafeNarrow(bottom)),
274 dl_paint);
275 }
276}
277
278void Canvas::drawRRect(const RRect& rrect,
279 Dart_Handle paint_objects,
280 Dart_Handle paint_data) {
281 Paint paint(paint_objects, paint_data);
282
283 FML_DCHECK(paint.isNotNull());
284 if (display_list_builder_) {
285 DlPaint dl_paint;
286 paint.paint(dl_paint, kDrawRRectFlags, DlTileMode::kDecal);
287 builder()->DrawRoundRect(rrect.rrect, dl_paint);
288 }
289}
290
291void Canvas::drawDRRect(const RRect& outer,
292 const RRect& inner,
293 Dart_Handle paint_objects,
294 Dart_Handle paint_data) {
295 Paint paint(paint_objects, paint_data);
296
297 FML_DCHECK(paint.isNotNull());
298 if (display_list_builder_) {
299 DlPaint dl_paint;
300 paint.paint(dl_paint, kDrawDRRectFlags, DlTileMode::kDecal);
301 builder()->DrawDiffRoundRect(outer.rrect, inner.rrect, dl_paint);
302 }
303}
304
305void Canvas::drawRSuperellipse(const RSuperellipse* rse,
306 Dart_Handle paint_objects,
307 Dart_Handle paint_data) {
308 Paint paint(paint_objects, paint_data);
309
310 FML_DCHECK(paint.isNotNull());
311 if (display_list_builder_) {
312 DlPaint dl_paint;
313 paint.paint(dl_paint, kDrawDRRectFlags, DlTileMode::kDecal);
314 builder()->DrawRoundSuperellipse(rse->rsuperellipse(), dl_paint);
315 }
316}
317
318void Canvas::drawOval(double left,
319 double top,
320 double right,
321 double bottom,
322 Dart_Handle paint_objects,
323 Dart_Handle paint_data) {
324 Paint paint(paint_objects, paint_data);
325
326 FML_DCHECK(paint.isNotNull());
327 if (display_list_builder_) {
328 DlPaint dl_paint;
329 paint.paint(dl_paint, kDrawOvalFlags, DlTileMode::kDecal);
330 builder()->DrawOval(DlRect::MakeLTRB(SafeNarrow(left), SafeNarrow(top),
331 SafeNarrow(right), SafeNarrow(bottom)),
332 dl_paint);
333 }
334}
335
336void Canvas::drawCircle(double x,
337 double y,
338 double radius,
339 Dart_Handle paint_objects,
340 Dart_Handle paint_data) {
341 Paint paint(paint_objects, paint_data);
342
343 FML_DCHECK(paint.isNotNull());
344 if (display_list_builder_) {
345 DlPaint dl_paint;
346 paint.paint(dl_paint, kDrawCircleFlags, DlTileMode::kDecal);
347 builder()->DrawCircle(DlPoint(SafeNarrow(x), SafeNarrow(y)),
348 SafeNarrow(radius), dl_paint);
349 }
350}
351
352void Canvas::drawArc(double left,
353 double top,
354 double right,
355 double bottom,
356 double startAngle,
357 double sweepAngle,
358 bool useCenter,
359 Dart_Handle paint_objects,
360 Dart_Handle paint_data) {
361 Paint paint(paint_objects, paint_data);
362
363 FML_DCHECK(paint.isNotNull());
364 if (display_list_builder_) {
365 DlPaint dl_paint;
366 paint.paint(dl_paint,
367 useCenter ? kDrawArcWithCenterFlags : kDrawArcNoCenterFlags,
368 DlTileMode::kDecal);
369 builder()->DrawArc(
370 DlRect::MakeLTRB(SafeNarrow(left), SafeNarrow(top), SafeNarrow(right),
371 SafeNarrow(bottom)),
372 SafeNarrow(startAngle) * 180.0f / static_cast<float>(M_PI),
373 SafeNarrow(sweepAngle) * 180.0f / static_cast<float>(M_PI), useCenter,
374 dl_paint);
375 }
376}
377
378void Canvas::drawPath(const CanvasPath* path,
379 Dart_Handle paint_objects,
380 Dart_Handle paint_data) {
381 if (!path) {
382 Dart_ThrowException(
383 ToDart("Canvas.drawPath called with non-genuine Path."));
384 return;
385 }
386 if (display_list_builder_) {
387 Paint paint(paint_objects, paint_data);
388 FML_DCHECK(paint.isNotNull());
389 DlPaint dl_paint;
390 paint.paint(dl_paint, kDrawPathFlags, DlTileMode::kDecal);
391 builder()->DrawPath(path->path(), dl_paint);
392 }
393}
394
395Dart_Handle Canvas::drawImage(const CanvasImage* image,
396 double x,
397 double y,
398 Dart_Handle paint_objects,
399 Dart_Handle paint_data,
400 int filterQualityIndex) {
401 Paint paint(paint_objects, paint_data);
402
403 FML_DCHECK(paint.isNotNull());
404 if (!image) {
405 return ToDart("Canvas.drawImage called with non-genuine Image.");
406 }
407
408 auto dl_image = image->image();
409 if (!dl_image) {
410 return Dart_Null();
411 }
412 auto error = dl_image->get_error();
413 if (error) {
414 return ToDart(error.value());
415 }
416
417 auto sampling = ImageFilter::SamplingFromIndex(filterQualityIndex);
418 if (display_list_builder_) {
419 DlPaint dl_paint;
420 const DlPaint* opt_paint =
421 paint.paint(dl_paint, kDrawImageWithPaintFlags, DlTileMode::kClamp);
422 builder()->DrawImage(dl_image, DlPoint(SafeNarrow(x), SafeNarrow(y)),
423 sampling, opt_paint);
424 }
425 return Dart_Null();
426}
427
428Dart_Handle Canvas::drawImageRect(const CanvasImage* image,
429 double src_left,
430 double src_top,
431 double src_right,
432 double src_bottom,
433 double dst_left,
434 double dst_top,
435 double dst_right,
436 double dst_bottom,
437 Dart_Handle paint_objects,
438 Dart_Handle paint_data,
439 int filterQualityIndex) {
440 Paint paint(paint_objects, paint_data);
441
442 FML_DCHECK(paint.isNotNull());
443 if (!image) {
444 return ToDart("Canvas.drawImageRect called with non-genuine Image.");
445 }
446
447 auto dl_image = image->image();
448 if (!dl_image) {
449 return Dart_Null();
450 }
451 auto error = dl_image->get_error();
452 if (error) {
453 return ToDart(error.value());
454 }
455
456 DlRect src = DlRect::MakeLTRB(SafeNarrow(src_left), SafeNarrow(src_top),
457 SafeNarrow(src_right), SafeNarrow(src_bottom));
458 DlRect dst = DlRect::MakeLTRB(SafeNarrow(dst_left), SafeNarrow(dst_top),
459 SafeNarrow(dst_right), SafeNarrow(dst_bottom));
460 auto sampling = ImageFilter::SamplingFromIndex(filterQualityIndex);
461 if (display_list_builder_) {
462 DlPaint dl_paint;
463 const DlPaint* opt_paint =
464 paint.paint(dl_paint, kDrawImageRectWithPaintFlags, DlTileMode::kClamp);
465 builder()->DrawImageRect(dl_image, src, dst, sampling, opt_paint,
466 DlSrcRectConstraint::kFast);
467 }
468 return Dart_Null();
469}
470
471Dart_Handle Canvas::drawImageNine(const CanvasImage* image,
472 double center_left,
473 double center_top,
474 double center_right,
475 double center_bottom,
476 double dst_left,
477 double dst_top,
478 double dst_right,
479 double dst_bottom,
480 Dart_Handle paint_objects,
481 Dart_Handle paint_data,
482 int bitmapSamplingIndex) {
483 Paint paint(paint_objects, paint_data);
484
485 FML_DCHECK(paint.isNotNull());
486 if (!image) {
487 return ToDart("Canvas.drawImageNine called with non-genuine Image.");
488 }
489 auto dl_image = image->image();
490 if (!dl_image) {
491 return Dart_Null();
492 }
493 auto error = dl_image->get_error();
494 if (error) {
495 return ToDart(error.value());
496 }
497
498 DlRect center =
499 DlRect::MakeLTRB(SafeNarrow(center_left), SafeNarrow(center_top),
500 SafeNarrow(center_right), SafeNarrow(center_bottom));
501 DlIRect icenter = DlIRect::Round(center);
502 DlRect dst = DlRect::MakeLTRB(SafeNarrow(dst_left), SafeNarrow(dst_top),
503 SafeNarrow(dst_right), SafeNarrow(dst_bottom));
504 auto filter = ImageFilter::FilterModeFromIndex(bitmapSamplingIndex);
505 if (display_list_builder_) {
506 DlPaint dl_paint;
507 const DlPaint* opt_paint =
508 paint.paint(dl_paint, kDrawImageNineWithPaintFlags, DlTileMode::kClamp);
509 builder()->DrawImageNine(dl_image, icenter, dst, filter, opt_paint);
510 }
511 return Dart_Null();
512}
513
514void Canvas::drawPicture(Picture* picture) {
515 if (!picture) {
516 Dart_ThrowException(
517 ToDart("Canvas.drawPicture called with non-genuine Picture."));
518 return;
519 }
520 if (picture->display_list()) {
521 if (display_list_builder_) {
522 builder()->DrawDisplayList(picture->display_list());
523 }
524 } else {
525 FML_DCHECK(false);
526 }
527}
528
529void Canvas::drawPoints(Dart_Handle paint_objects,
530 Dart_Handle paint_data,
531 DlPointMode point_mode,
532 const tonic::Float32List& points) {
533 Paint paint(paint_objects, paint_data);
534
535 static_assert(sizeof(DlPoint) == sizeof(float) * 2,
536 "DlPoint doesn't use floats.");
537
538 FML_DCHECK(paint.isNotNull());
539 if (display_list_builder_) {
540 DlPaint dl_paint;
541 switch (point_mode) {
542 case DlPointMode::kPoints:
543 paint.paint(dl_paint, kDrawPointsAsPointsFlags, DlTileMode::kDecal);
544 break;
545 case DlPointMode::kLines:
546 paint.paint(dl_paint, kDrawPointsAsLinesFlags, DlTileMode::kDecal);
547 break;
548 case DlPointMode::kPolygon:
549 paint.paint(dl_paint, kDrawPointsAsPolygonFlags, DlTileMode::kDecal);
550 break;
551 }
552 builder()->DrawPoints(point_mode,
553 points.num_elements() / 2, // DlPoints have 2 floats
554 reinterpret_cast<const DlPoint*>(points.data()),
555 dl_paint);
556 }
557}
558
559void Canvas::drawVertices(const Vertices* vertices,
560 DlBlendMode blend_mode,
561 Dart_Handle paint_objects,
562 Dart_Handle paint_data) {
563 Paint paint(paint_objects, paint_data);
564
565 if (!vertices) {
566 Dart_ThrowException(
567 ToDart("Canvas.drawVertices called with non-genuine Vertices."));
568 return;
569 }
570 FML_DCHECK(paint.isNotNull());
571 if (display_list_builder_) {
572 DlPaint dl_paint;
573 paint.paint(dl_paint, kDrawVerticesFlags, DlTileMode::kDecal);
574 builder()->DrawVertices(vertices->vertices(), blend_mode, dl_paint);
575 }
576}
577
578Dart_Handle Canvas::drawAtlas(Dart_Handle paint_objects,
579 Dart_Handle paint_data,
580 int filterQualityIndex,
581 CanvasImage* atlas,
582 Dart_Handle transforms_handle,
583 Dart_Handle rects_handle,
584 Dart_Handle colors_handle,
585 DlBlendMode blend_mode,
586 Dart_Handle cull_rect_handle) {
587 Paint paint(paint_objects, paint_data);
588
589 if (!atlas) {
590 return ToDart(
591 "Canvas.drawAtlas or Canvas.drawRawAtlas called with "
592 "non-genuine Image.");
593 }
594
595 auto dl_image = atlas->image();
596 auto error = dl_image->get_error();
597 if (error) {
598 return ToDart(error.value());
599 }
600
601 static_assert(sizeof(DlRSTransform) == sizeof(float) * 4,
602 "DlRSTransform doesn't use floats.");
603 static_assert(sizeof(DlRect) == sizeof(float) * 4,
604 "DlRect doesn't use floats.");
605
606 auto sampling = ImageFilter::SamplingFromIndex(filterQualityIndex);
607
608 FML_DCHECK(paint.isNotNull());
609 if (display_list_builder_) {
610 tonic::Float32List transforms(transforms_handle);
611 tonic::Float32List rects(rects_handle);
612 tonic::Int32List colors(colors_handle);
613 tonic::Float32List cull_rect(cull_rect_handle);
614
615 std::vector<DlColor> dl_color(colors.num_elements());
616 size_t count = colors.num_elements();
617 for (size_t i = 0; i < count; i++) {
618 dl_color[i] = DlColor(colors[i]);
619 }
620
621 DlPaint dl_paint;
622 const DlPaint* opt_paint =
623 paint.paint(dl_paint, kDrawAtlasWithPaintFlags, DlTileMode::kClamp);
624 builder()->DrawAtlas(
625 dl_image, reinterpret_cast<const DlRSTransform*>(transforms.data()),
626 reinterpret_cast<const DlRect*>(rects.data()), dl_color.data(),
627 rects.num_elements() / 4, // DlRect have four floats.
628 blend_mode, sampling, reinterpret_cast<const DlRect*>(cull_rect.data()),
629 opt_paint);
630 }
631 return Dart_Null();
632}
633
634void Canvas::drawShadow(const CanvasPath* path,
635 uint32_t color,
636 double elevation,
637 bool transparentOccluder) {
638 if (!path) {
639 Dart_ThrowException(
640 ToDart("Canvas.drawShader called with non-genuine Path."));
641 return;
642 }
643
644 // Not using SafeNarrow because DPR will always be a relatively small number.
645 const ViewportMetrics* metrics =
646 UIDartState::Current()->platform_configuration()->GetMetrics(0);
647 DlScalar dpr;
648 // TODO(dkwingsmt): We should support rendering shadows on non-implicit views.
649 // However, currently this method has no way to get the target view ID.
650 if (metrics == nullptr) {
651 dpr = 1.0f;
652 } else {
653 dpr = static_cast<float>(metrics->device_pixel_ratio);
654 }
655 if (display_list_builder_) {
656 builder()->DrawShadow(path->path(), DlColor(color), SafeNarrow(elevation),
657 transparentOccluder, dpr);
658 }
659}
660
661void Canvas::Invalidate() {
662 display_list_builder_ = nullptr;
663 if (dart_wrapper()) {
664 ClearDartWrapper();
665 }
666}
667
668} // namespace flutter
static void Create(Dart_Handle wrapper, PictureRecorder *recorder, double left, double top, double right, double bottom)
Definition canvas.cc:23
~Canvas() override
sk_sp< DlImage > image() const
Definition image.h:56
const std::shared_ptr< DlImageFilter > & getImageFilter() const
Definition dl_paint.h:162
sk_sp< DisplayList > display_list() const
Definition picture.h:28
sk_sp< DisplayListBuilder > BeginRecording(DlRect bounds)
void set_canvas(fml::RefPtr< Canvas > canvas)
DlRoundRect rrect
Definition rrect.h:17
flutter::DlRoundSuperellipse rsuperellipse() const
Canvas(ContentContext &renderer, const RenderTarget &render_target, bool is_onscreen, bool requires_readback)
Definition canvas.cc:284
#define IMPLEMENT_WRAPPERTYPEINFO(LibraryName, ClassName)
int32_t x
FlutterVulkanImage * image
const uint8_t uint32_t uint32_t GError ** error
#define FML_DCHECK(condition)
Definition logging.h:122
double y
impeller::Scalar DlScalar
DlPointMode
Definition dl_types.h:15
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition switch_defs.h:52
flutter::DlRect DlRect
flutter::DlPoint DlPoint
BlendMode
Definition color.h:58
Definition ref_ptr.h:261
Dart_Handle ToDart(const T &object)
FlutterVulkanImageHandle image
Definition embedder.h:931
A 4x4 matrix using column-major storage.
Definition matrix.h:37
Scalar m[16]
Definition matrix.h:39
constexpr auto GetBottom() const
Definition rect.h:357
constexpr auto GetTop() const
Definition rect.h:353
constexpr auto GetLeft() const
Definition rect.h:351
Round(const TRect< U > &r)
Definition rect.h:695
constexpr auto GetRight() const
Definition rect.h:355
static constexpr TRect MakeLTRB(Type left, Type top, Type right, Type bottom)
Definition rect.h:129
std::vector< Point > points
#define TRACE_EVENT0(category_group, name)