Flutter Engine
 
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 Paint paint(paint_objects, paint_data);
382
383 FML_DCHECK(paint.isNotNull());
384 if (!path) {
385 Dart_ThrowException(
386 ToDart("Canvas.drawPath called with non-genuine Path."));
387 return;
388 }
389 if (display_list_builder_) {
390 DlPaint dl_paint;
391 paint.paint(dl_paint, kDrawPathFlags, DlTileMode::kDecal);
392 builder()->DrawPath(path->path(), dl_paint);
393 }
394}
395
396Dart_Handle Canvas::drawImage(const CanvasImage* image,
397 double x,
398 double y,
399 Dart_Handle paint_objects,
400 Dart_Handle paint_data,
401 int filterQualityIndex) {
402 Paint paint(paint_objects, paint_data);
403
404 FML_DCHECK(paint.isNotNull());
405 if (!image) {
406 return ToDart("Canvas.drawImage called with non-genuine Image.");
407 }
408
409 auto dl_image = image->image();
410 if (!dl_image) {
411 return Dart_Null();
412 }
413 auto error = dl_image->get_error();
414 if (error) {
415 return ToDart(error.value());
416 }
417
418 auto sampling = ImageFilter::SamplingFromIndex(filterQualityIndex);
419 if (display_list_builder_) {
420 DlPaint dl_paint;
421 const DlPaint* opt_paint =
422 paint.paint(dl_paint, kDrawImageWithPaintFlags, DlTileMode::kClamp);
423 builder()->DrawImage(dl_image, DlPoint(SafeNarrow(x), SafeNarrow(y)),
424 sampling, opt_paint);
425 }
426 return Dart_Null();
427}
428
429Dart_Handle Canvas::drawImageRect(const CanvasImage* image,
430 double src_left,
431 double src_top,
432 double src_right,
433 double src_bottom,
434 double dst_left,
435 double dst_top,
436 double dst_right,
437 double dst_bottom,
438 Dart_Handle paint_objects,
439 Dart_Handle paint_data,
440 int filterQualityIndex) {
441 Paint paint(paint_objects, paint_data);
442
443 FML_DCHECK(paint.isNotNull());
444 if (!image) {
445 return ToDart("Canvas.drawImageRect called with non-genuine Image.");
446 }
447
448 auto dl_image = image->image();
449 if (!dl_image) {
450 return Dart_Null();
451 }
452 auto error = dl_image->get_error();
453 if (error) {
454 return ToDart(error.value());
455 }
456
457 DlRect src = DlRect::MakeLTRB(SafeNarrow(src_left), SafeNarrow(src_top),
458 SafeNarrow(src_right), SafeNarrow(src_bottom));
459 DlRect dst = DlRect::MakeLTRB(SafeNarrow(dst_left), SafeNarrow(dst_top),
460 SafeNarrow(dst_right), SafeNarrow(dst_bottom));
461 auto sampling = ImageFilter::SamplingFromIndex(filterQualityIndex);
462 if (display_list_builder_) {
463 DlPaint dl_paint;
464 const DlPaint* opt_paint =
465 paint.paint(dl_paint, kDrawImageRectWithPaintFlags, DlTileMode::kClamp);
466 builder()->DrawImageRect(dl_image, src, dst, sampling, opt_paint,
467 DlSrcRectConstraint::kFast);
468 }
469 return Dart_Null();
470}
471
472Dart_Handle Canvas::drawImageNine(const CanvasImage* image,
473 double center_left,
474 double center_top,
475 double center_right,
476 double center_bottom,
477 double dst_left,
478 double dst_top,
479 double dst_right,
480 double dst_bottom,
481 Dart_Handle paint_objects,
482 Dart_Handle paint_data,
483 int bitmapSamplingIndex) {
484 Paint paint(paint_objects, paint_data);
485
486 FML_DCHECK(paint.isNotNull());
487 if (!image) {
488 return ToDart("Canvas.drawImageNine called with non-genuine Image.");
489 }
490 auto dl_image = image->image();
491 if (!dl_image) {
492 return Dart_Null();
493 }
494 auto error = dl_image->get_error();
495 if (error) {
496 return ToDart(error.value());
497 }
498
499 DlRect center =
500 DlRect::MakeLTRB(SafeNarrow(center_left), SafeNarrow(center_top),
501 SafeNarrow(center_right), SafeNarrow(center_bottom));
502 DlIRect icenter = DlIRect::Round(center);
503 DlRect dst = DlRect::MakeLTRB(SafeNarrow(dst_left), SafeNarrow(dst_top),
504 SafeNarrow(dst_right), SafeNarrow(dst_bottom));
505 auto filter = ImageFilter::FilterModeFromIndex(bitmapSamplingIndex);
506 if (display_list_builder_) {
507 DlPaint dl_paint;
508 const DlPaint* opt_paint =
509 paint.paint(dl_paint, kDrawImageNineWithPaintFlags, DlTileMode::kClamp);
510 builder()->DrawImageNine(dl_image, icenter, dst, filter, opt_paint);
511 }
512 return Dart_Null();
513}
514
515void Canvas::drawPicture(Picture* picture) {
516 if (!picture) {
517 Dart_ThrowException(
518 ToDart("Canvas.drawPicture called with non-genuine Picture."));
519 return;
520 }
521 if (picture->display_list()) {
522 if (display_list_builder_) {
523 builder()->DrawDisplayList(picture->display_list());
524 }
525 } else {
526 FML_DCHECK(false);
527 }
528}
529
530void Canvas::drawPoints(Dart_Handle paint_objects,
531 Dart_Handle paint_data,
532 DlPointMode point_mode,
533 const tonic::Float32List& points) {
534 Paint paint(paint_objects, paint_data);
535
536 static_assert(sizeof(DlPoint) == sizeof(float) * 2,
537 "DlPoint doesn't use floats.");
538
539 FML_DCHECK(paint.isNotNull());
540 if (display_list_builder_) {
541 DlPaint dl_paint;
542 switch (point_mode) {
543 case DlPointMode::kPoints:
544 paint.paint(dl_paint, kDrawPointsAsPointsFlags, DlTileMode::kDecal);
545 break;
546 case DlPointMode::kLines:
547 paint.paint(dl_paint, kDrawPointsAsLinesFlags, DlTileMode::kDecal);
548 break;
549 case DlPointMode::kPolygon:
550 paint.paint(dl_paint, kDrawPointsAsPolygonFlags, DlTileMode::kDecal);
551 break;
552 }
553 builder()->DrawPoints(point_mode,
554 points.num_elements() / 2, // DlPoints have 2 floats
555 reinterpret_cast<const DlPoint*>(points.data()),
556 dl_paint);
557 }
558}
559
560void Canvas::drawVertices(const Vertices* vertices,
561 DlBlendMode blend_mode,
562 Dart_Handle paint_objects,
563 Dart_Handle paint_data) {
564 Paint paint(paint_objects, paint_data);
565
566 if (!vertices) {
567 Dart_ThrowException(
568 ToDart("Canvas.drawVertices called with non-genuine Vertices."));
569 return;
570 }
571 FML_DCHECK(paint.isNotNull());
572 if (display_list_builder_) {
573 DlPaint dl_paint;
574 paint.paint(dl_paint, kDrawVerticesFlags, DlTileMode::kDecal);
575 builder()->DrawVertices(vertices->vertices(), blend_mode, dl_paint);
576 }
577}
578
579Dart_Handle Canvas::drawAtlas(Dart_Handle paint_objects,
580 Dart_Handle paint_data,
581 int filterQualityIndex,
582 CanvasImage* atlas,
583 Dart_Handle transforms_handle,
584 Dart_Handle rects_handle,
585 Dart_Handle colors_handle,
586 DlBlendMode blend_mode,
587 Dart_Handle cull_rect_handle) {
588 Paint paint(paint_objects, paint_data);
589
590 if (!atlas) {
591 return ToDart(
592 "Canvas.drawAtlas or Canvas.drawRawAtlas called with "
593 "non-genuine Image.");
594 }
595
596 auto dl_image = atlas->image();
597 auto error = dl_image->get_error();
598 if (error) {
599 return ToDart(error.value());
600 }
601
602 static_assert(sizeof(DlRSTransform) == sizeof(float) * 4,
603 "DlRSTransform doesn't use floats.");
604 static_assert(sizeof(DlRect) == sizeof(float) * 4,
605 "DlRect doesn't use floats.");
606
607 auto sampling = ImageFilter::SamplingFromIndex(filterQualityIndex);
608
609 FML_DCHECK(paint.isNotNull());
610 if (display_list_builder_) {
611 tonic::Float32List transforms(transforms_handle);
612 tonic::Float32List rects(rects_handle);
613 tonic::Int32List colors(colors_handle);
614 tonic::Float32List cull_rect(cull_rect_handle);
615
616 std::vector<DlColor> dl_color(colors.num_elements());
617 size_t count = colors.num_elements();
618 for (size_t i = 0; i < count; i++) {
619 dl_color[i] = DlColor(colors[i]);
620 }
621
622 DlPaint dl_paint;
623 const DlPaint* opt_paint =
624 paint.paint(dl_paint, kDrawAtlasWithPaintFlags, DlTileMode::kClamp);
625 builder()->DrawAtlas(
626 dl_image, reinterpret_cast<const DlRSTransform*>(transforms.data()),
627 reinterpret_cast<const DlRect*>(rects.data()), dl_color.data(),
628 rects.num_elements() / 4, // DlRect have four floats.
629 blend_mode, sampling, reinterpret_cast<const DlRect*>(cull_rect.data()),
630 opt_paint);
631 }
632 return Dart_Null();
633}
634
635void Canvas::drawShadow(const CanvasPath* path,
636 uint32_t color,
637 double elevation,
638 bool transparentOccluder) {
639 if (!path) {
640 Dart_ThrowException(
641 ToDart("Canvas.drawShader called with non-genuine Path."));
642 return;
643 }
644
645 // Not using SafeNarrow because DPR will always be a relatively small number.
646 const ViewportMetrics* metrics =
647 UIDartState::Current()->platform_configuration()->GetMetrics(0);
648 DlScalar dpr;
649 // TODO(dkwingsmt): We should support rendering shadows on non-implicit views.
650 // However, currently this method has no way to get the target view ID.
651 if (metrics == nullptr) {
652 dpr = 1.0f;
653 } else {
654 dpr = static_cast<float>(metrics->device_pixel_ratio);
655 }
656 if (display_list_builder_) {
657 builder()->DrawShadow(path->path(), DlColor(color), SafeNarrow(elevation),
658 transparentOccluder, dpr);
659 }
660}
661
662void Canvas::Invalidate() {
663 display_list_builder_ = nullptr;
664 if (dart_wrapper()) {
665 ClearDartWrapper();
666 }
667}
668
669} // 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:42
const std::shared_ptr< DlImageFilter > & getImageFilter() const
Definition dl_paint.h:162
sk_sp< DisplayList > display_list() const
Definition picture.h:27
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:199
#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)