| Flutter Impeller |

impeller.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/toolkit/interop/impeller.h"
6
7 #include <sstream>
8
9 #include "flutter/fml/mapping.h"
10 #include "impeller/base/validation.h"
11 #include "impeller/core/texture.h"
12 #include "impeller/geometry/scalar.h"
13 #include "impeller/renderer/backend/gles/context_gles.h"
14 #include "impeller/renderer/backend/gles/texture_gles.h"
15 #include "impeller/renderer/context.h"
16 #include "impeller/toolkit/interop/color_filter.h"
17 #include "impeller/toolkit/interop/color_source.h"
18 #include "impeller/toolkit/interop/context.h"
19 #include "impeller/toolkit/interop/dl_builder.h"
20 #include "impeller/toolkit/interop/formats.h"
21 #include "impeller/toolkit/interop/image_filter.h"
22 #include "impeller/toolkit/interop/mask_filter.h"
23 #include "impeller/toolkit/interop/object.h"
24 #include "impeller/toolkit/interop/paint.h"
25 #include "impeller/toolkit/interop/paragraph.h"
26 #include "impeller/toolkit/interop/paragraph_builder.h"
27 #include "impeller/toolkit/interop/paragraph_style.h"
28 #include "impeller/toolkit/interop/path.h"
29 #include "impeller/toolkit/interop/path_builder.h"
30 #include "impeller/toolkit/interop/surface.h"
31 #include "impeller/toolkit/interop/texture.h"
32 #include "impeller/toolkit/interop/typography_context.h"
33
34 namespace impeller::interop {
35
36 #define DEFINE_PEER_GETTER(cxx_type, c_type) \
37 cxx_type* GetPeer(c_type object) { \
38 return reinterpret_cast<cxx_type*>(object); \
39 }
40
41 DEFINE_PEER_GETTER(ColorFilter, ImpellerColorFilter);
42 DEFINE_PEER_GETTER(ColorSource, ImpellerColorSource);
43 DEFINE_PEER_GETTER(Context, ImpellerContext);
44 DEFINE_PEER_GETTER(DisplayList, ImpellerDisplayList);
45 DEFINE_PEER_GETTER(DisplayListBuilder, ImpellerDisplayListBuilder);
46 DEFINE_PEER_GETTER(ImageFilter, ImpellerImageFilter);
47 DEFINE_PEER_GETTER(MaskFilter, ImpellerMaskFilter);
48 DEFINE_PEER_GETTER(Paint, ImpellerPaint);
49 DEFINE_PEER_GETTER(Paragraph, ImpellerParagraph);
50 DEFINE_PEER_GETTER(ParagraphBuilder, ImpellerParagraphBuilder);
51 DEFINE_PEER_GETTER(ParagraphStyle, ImpellerParagraphStyle);
52 DEFINE_PEER_GETTER(Path, ImpellerPath);
53 DEFINE_PEER_GETTER(PathBuilder, ImpellerPathBuilder);
54 DEFINE_PEER_GETTER(Surface, ImpellerSurface);
55 DEFINE_PEER_GETTER(Texture, ImpellerTexture);
56 DEFINE_PEER_GETTER(TypographyContext, ImpellerTypographyContext);
57
58 static std::string GetVersionAsString(uint32_t version) {
59 std::stringstream stream;
60 stream << IMPELLER_VERSION_GET_VARIANT(version) << "."
61 << IMPELLER_VERSION_GET_MAJOR(version) << "."
62 << IMPELLER_VERSION_GET_MINOR(version) << "."
63 << IMPELLER_VERSION_GET_PATCH(version);
64 return stream.str();
65 }
66
67 IMPELLER_EXTERN_C
68 uint32_t ImpellerGetVersion() {
69 return IMPELLER_VERSION;
70 }
71
72 IMPELLER_EXTERN_C
73 ImpellerContext ImpellerContextCreateOpenGLESNew(
74 uint32_t version,
75 ImpellerProcAddressCallback gl_proc_address_callback,
76 void* gl_proc_address_callback_user_data) {
77 if (version != IMPELLER_VERSION) {
78 VALIDATION_LOG << "This version of Impeller ("
79 << GetVersionAsString(ImpellerGetVersion()) << ") "
80 << "doesn't match the version the user expects ("
81 << GetVersionAsString(version) << ").";
82 return nullptr;
83 }
84 auto context = Context::CreateOpenGLES(
85 [gl_proc_address_callback,
86 gl_proc_address_callback_user_data](const char* proc_name) -> void* {
87 return gl_proc_address_callback(proc_name,
88 gl_proc_address_callback_user_data);
89 });
90 if (!context || !context->IsValid()) {
91 VALIDATION_LOG << "Could not create valid context.";
92 return nullptr;
93 }
94 return context.Leak();
95 }
96
97 IMPELLER_EXTERN_C
98 void ImpellerContextRetain(ImpellerContext context) {
99 ObjectBase::SafeRetain(context);
100 }
101
102 IMPELLER_EXTERN_C
103 void ImpellerContextRelease(ImpellerContext context) {
104 ObjectBase::SafeRelease(context);
105 }
106
107 IMPELLER_EXTERN_C
108 ImpellerDisplayListBuilder ImpellerDisplayListBuilderNew(
109 const ImpellerRect* cull_rect) {
110 return Create<DisplayListBuilder>(cull_rect).Leak();
111 }
112
113 IMPELLER_EXTERN_C
114 void ImpellerDisplayListBuilderRetain(ImpellerDisplayListBuilder builder) {
115 ObjectBase::SafeRetain(builder);
116 }
117
118 IMPELLER_EXTERN_C
119 void ImpellerDisplayListBuilderRelease(ImpellerDisplayListBuilder builder) {
120 ObjectBase::SafeRelease(builder);
121 }
122
123 IMPELLER_EXTERN_C
124 void ImpellerDisplayListBuilderSave(ImpellerDisplayListBuilder builder) {
125 GetPeer(builder)->Save();
126 }
127
128 IMPELLER_EXTERN_C
129 void ImpellerDisplayListBuilderSaveLayer(ImpellerDisplayListBuilder builder,
130 const ImpellerRect* bounds,
131 ImpellerPaint paint,
132 ImpellerImageFilter backdrop) {
133 GetPeer(builder)->SaveLayer(ToImpellerType(*bounds), //
134 GetPeer(paint), //
135 GetPeer(backdrop) //
136 );
137 }
138
139 IMPELLER_EXTERN_C
140 void ImpellerDisplayListBuilderRestore(ImpellerDisplayListBuilder builder) {
141 GetPeer(builder)->Restore();
142 }
143
144 IMPELLER_EXTERN_C
145 void ImpellerDisplayListBuilderScale(ImpellerDisplayListBuilder builder,
146 float x_scale,
147 float y_scale) {
148 GetPeer(builder)->Scale(Size{x_scale, y_scale});
149 }
150
151 IMPELLER_EXTERN_C
152 void ImpellerDisplayListBuilderRotate(ImpellerDisplayListBuilder builder,
153 float angle_degrees) {
154 GetPeer(builder)->Rotate(Degrees{angle_degrees});
155 }
156
157 IMPELLER_EXTERN_C
158 void ImpellerDisplayListBuilderTranslate(ImpellerDisplayListBuilder builder,
159 float x_translation,
160 float y_translation) {
161 GetPeer(builder)->Translate(Point{x_translation, y_translation});
162 }
163
164 IMPELLER_EXTERN_C
165 void ImpellerDisplayListBuilderSetTransform(ImpellerDisplayListBuilder builder,
166 const ImpellerMatrix* transform) {
167 GetPeer(builder)->SetTransform(ToImpellerType(*transform));
168 }
169
170 IMPELLER_EXTERN_C
171 void ImpellerDisplayListBuilderTransform(ImpellerDisplayListBuilder builder,
172 const ImpellerMatrix* transform) {
173 GetPeer(builder)->Transform(ToImpellerType(*transform));
174 }
175
176 IMPELLER_EXTERN_C
177 void ImpellerDisplayListBuilderGetTransform(ImpellerDisplayListBuilder builder,
178 ImpellerMatrix* out_transform) {
179 FromImpellerType(GetPeer(builder)->GetTransform(), *out_transform);
180 }
181
182 IMPELLER_EXTERN_C
183 void ImpellerDisplayListBuilderResetTransform(
184 ImpellerDisplayListBuilder builder) {
185 GetPeer(builder)->ResetTransform();
186 }
187
188 IMPELLER_EXTERN_C
189 uint32_t ImpellerDisplayListBuilderGetSaveCount(
190 ImpellerDisplayListBuilder builder) {
191 return GetPeer(builder)->GetSaveCount();
192 }
193
194 IMPELLER_EXTERN_C
195 void ImpellerDisplayListBuilderRestoreToCount(
196 ImpellerDisplayListBuilder builder,
197 uint32_t count) {
198 GetPeer(builder)->RestoreToCount(count);
199 }
200
201 IMPELLER_EXTERN_C
202 void ImpellerPathRetain(ImpellerPath path) {
203 ObjectBase::SafeRetain(path);
204 }
205
206 IMPELLER_EXTERN_C
207 void ImpellerPathRelease(ImpellerPath path) {
208 ObjectBase::SafeRelease(path);
209 }
210
211 IMPELLER_EXTERN_C
212 ImpellerPathBuilder ImpellerPathBuilderNew() {
213 return Create<PathBuilder>().Leak();
214 }
215
216 IMPELLER_EXTERN_C
217 void ImpellerPathBuilderRetain(ImpellerPathBuilder builder) {
218 ObjectBase::SafeRetain(builder);
219 }
220
221 IMPELLER_EXTERN_C
222 void ImpellerPathBuilderRelease(ImpellerPathBuilder builder) {
223 ObjectBase::SafeRelease(builder);
224 }
225
226 IMPELLER_EXTERN_C
227 void ImpellerPathBuilderMoveTo(ImpellerPathBuilder builder,
228 const ImpellerPoint* location) {
229 GetPeer(builder)->MoveTo(ToImpellerType(*location));
230 }
231
232 IMPELLER_EXTERN_C
233 void ImpellerPathBuilderLineTo(ImpellerPathBuilder builder,
234 const ImpellerPoint* location) {
235 GetPeer(builder)->LineTo(ToImpellerType(*location));
236 }
237
238 IMPELLER_EXTERN_C
239 void ImpellerPathBuilderQuadraticCurveTo(ImpellerPathBuilder builder,
240 const ImpellerPoint* control_point,
241 const ImpellerPoint* end_point) {
242 GetPeer(builder)->QuadraticCurveTo(ToImpellerType(*control_point),
243 ToImpellerType(*end_point));
244 }
245
246 IMPELLER_EXTERN_C
247 void ImpellerPathBuilderCubicCurveTo(ImpellerPathBuilder builder,
248 const ImpellerPoint* control_point_1,
249 const ImpellerPoint* control_point_2,
250 const ImpellerPoint* end_point) {
251 GetPeer(builder)->CubicCurveTo(ToImpellerType(*control_point_1), //
252 ToImpellerType(*control_point_2), //
253 ToImpellerType(*end_point) //
254 );
255 }
256
257 IMPELLER_EXTERN_C
258 void ImpellerPathBuilderAddRect(ImpellerPathBuilder builder,
259 const ImpellerRect* rect) {
260 GetPeer(builder)->AddRect(ToImpellerType(*rect));
261 }
262
263 IMPELLER_EXTERN_C
264 void ImpellerPathBuilderAddArc(ImpellerPathBuilder builder,
265 const ImpellerRect* oval_bounds,
266 float start_angle_degrees,
267 float end_angle_degrees) {
268 GetPeer(builder)->AddArc(ToImpellerType(*oval_bounds), //
269 Degrees{start_angle_degrees}, //
270 Degrees{end_angle_degrees} //
271 );
272 }
273
274 IMPELLER_EXTERN_C
275 void ImpellerPathBuilderAddOval(ImpellerPathBuilder builder,
276 const ImpellerRect* oval_bounds) {
277 GetPeer(builder)->AddOval(ToImpellerType(*oval_bounds));
278 }
279
280 IMPELLER_EXTERN_C
281 void ImpellerPathBuilderAddRoundedRect(
282 ImpellerPathBuilder builder,
283 const ImpellerRect* rect,
284 const ImpellerRoundingRadii* rounding_radii) {
285 GetPeer(builder)->AddRoundedRect(ToImpellerType(*rect),
286 ToImpellerType(*rounding_radii));
287 }
288
289 IMPELLER_EXTERN_C
290 void ImpellerPathBuilderClose(ImpellerPathBuilder builder) {
291 GetPeer(builder)->Close();
292 }
293
294 IMPELLER_EXTERN_C
295 ImpellerPath ImpellerPathBuilderCopyPathNew(ImpellerPathBuilder builder,
296 ImpellerFillType fill) {
297 return GetPeer(builder)->CopyPath(ToImpellerType(fill)).Leak();
298 }
299
300 IMPELLER_EXTERN_C
301 ImpellerPath ImpellerPathBuilderTakePathNew(ImpellerPathBuilder builder,
302 ImpellerFillType fill) {
303 return GetPeer(builder)->TakePath(ToImpellerType(fill)).Leak();
304 }
305
306 IMPELLER_EXTERN_C
307 void ImpellerDisplayListBuilderClipRect(ImpellerDisplayListBuilder builder,
308 const ImpellerRect* rect,
309 ImpellerClipOperation op) {
310 GetPeer(builder)->ClipRect(ToImpellerType(*rect), ToImpellerType(op));
311 }
312
313 IMPELLER_EXTERN_C
314 void ImpellerDisplayListBuilderClipOval(ImpellerDisplayListBuilder builder,
315 const ImpellerRect* oval_bounds,
316 ImpellerClipOperation op) {
317 GetPeer(builder)->ClipOval(ToImpellerType(*oval_bounds), ToImpellerType(op));
318 }
319
320 IMPELLER_EXTERN_C
321 void ImpellerDisplayListBuilderClipRoundedRect(
322 ImpellerDisplayListBuilder builder,
323 const ImpellerRect* rect,
324 const ImpellerRoundingRadii* radii,
325 ImpellerClipOperation op) {
326 GetPeer(builder)->ClipRoundedRect(ToImpellerType(*rect), //
327 ToImpellerType(*radii), //
328 ToImpellerType(op) //
329 );
330 }
331
332 IMPELLER_EXTERN_C
333 void ImpellerDisplayListBuilderClipPath(ImpellerDisplayListBuilder builder,
334 ImpellerPath path,
335 ImpellerClipOperation op) {
336 GetPeer(builder)->ClipPath(*GetPeer(path), ToImpellerType(op));
337 }
338
339 IMPELLER_EXTERN_C
340 ImpellerPaint ImpellerPaintNew() {
341 return Create<Paint>().Leak();
342 }
343
344 IMPELLER_EXTERN_C
345 void ImpellerPaintRetain(ImpellerPaint paint) {
346 ObjectBase::SafeRetain(paint);
347 }
348
349 IMPELLER_EXTERN_C
350 void ImpellerPaintRelease(ImpellerPaint paint) {
351 ObjectBase::SafeRelease(paint);
352 }
353
354 IMPELLER_EXTERN_C
355 void ImpellerPaintSetColor(ImpellerPaint paint, const ImpellerColor* color) {
356 GetPeer(paint)->SetColor(ToDisplayListType(*color));
357 }
358
359 IMPELLER_EXTERN_C
360 void ImpellerPaintSetBlendMode(ImpellerPaint paint, ImpellerBlendMode mode) {
361 GetPeer(paint)->SetBlendMode(ToImpellerType(mode));
362 }
363
364 IMPELLER_EXTERN_C
365 void ImpellerPaintSetDrawStyle(ImpellerPaint paint, ImpellerDrawStyle style) {
366 GetPeer(paint)->SetDrawStyle(ToDisplayListType(style));
367 }
368
369 IMPELLER_EXTERN_C
370 void ImpellerPaintSetStrokeCap(ImpellerPaint paint, ImpellerStrokeCap cap) {
371 GetPeer(paint)->SetStrokeCap(ToDisplayListType(cap));
372 }
373
374 IMPELLER_EXTERN_C
375 void ImpellerPaintSetStrokeJoin(ImpellerPaint paint, ImpellerStrokeJoin join) {
376 GetPeer(paint)->SetStrokeJoin(ToDisplayListType(join));
377 }
378
379 IMPELLER_EXTERN_C
380 void ImpellerPaintSetStrokeWidth(ImpellerPaint paint, float width) {
381 GetPeer(paint)->SetStrokeWidth(width);
382 }
383
384 IMPELLER_EXTERN_C
385 void ImpellerPaintSetStrokeMiter(ImpellerPaint paint, float miter) {
386 GetPeer(paint)->SetStrokeMiter(miter);
387 }
388
389 IMPELLER_EXTERN_C
390 void ImpellerDisplayListBuilderDrawPaint(ImpellerDisplayListBuilder builder,
391 ImpellerPaint paint) {
392 GetPeer(builder)->DrawPaint(*GetPeer(paint));
393 }
394
395 IMPELLER_EXTERN_C
396 void ImpellerDisplayListBuilderDrawLine(ImpellerDisplayListBuilder builder,
397 const ImpellerPoint* from,
398 const ImpellerPoint* to,
399 ImpellerPaint paint) {
400 GetPeer(builder)->DrawLine(ToImpellerType(*from), //
401 ToImpellerType(*to), //
402 *GetPeer(paint) //
403 );
404 }
405
406 IMPELLER_EXTERN_C
407 void ImpellerDisplayListBuilderDrawDashedLine(
408 ImpellerDisplayListBuilder builder,
409 const ImpellerPoint* from,
410 const ImpellerPoint* to,
411 float on_length,
412 float off_length,
413 ImpellerPaint paint) {
414 GetPeer(builder)->DrawDashedLine(ToImpellerType(*from), //
415 ToImpellerType(*to), //
416 on_length, //
417 off_length, //
418 *GetPeer(paint) //
419 );
420 }
421
422 IMPELLER_EXTERN_C
423 void ImpellerDisplayListBuilderDrawRect(ImpellerDisplayListBuilder builder,
424 const ImpellerRect* rect,
425 ImpellerPaint paint) {
426 GetPeer(builder)->DrawRect(ToImpellerType(*rect), *GetPeer(paint));
427 }
428
429 IMPELLER_EXTERN_C
430 void ImpellerDisplayListBuilderDrawOval(ImpellerDisplayListBuilder builder,
431 const ImpellerRect* oval_bounds,
432 ImpellerPaint paint) {
433 GetPeer(builder)->DrawOval(ToImpellerType(*oval_bounds), *GetPeer(paint));
434 }
435
436 IMPELLER_EXTERN_C
437 void ImpellerDisplayListBuilderDrawRoundedRect(
438 ImpellerDisplayListBuilder builder,
439 const ImpellerRect* rect,
440 const ImpellerRoundingRadii* radii,
441 ImpellerPaint paint) {
442 GetPeer(builder)->DrawRoundedRect(ToImpellerType(*rect), //
443 ToImpellerType(*radii), //
444 *GetPeer(paint) //
445 );
446 }
447
448 IMPELLER_EXTERN_C
449 void ImpellerDisplayListBuilderDrawRoundedRectDifference(
450 ImpellerDisplayListBuilder builder,
451 const ImpellerRect* outer_rect,
452 const ImpellerRoundingRadii* outer_radii,
453 const ImpellerRect* inner_rect,
454 const ImpellerRoundingRadii* inner_radii,
455 ImpellerPaint paint) {
456 GetPeer(builder)->DrawRoundedRectDifference(ToImpellerType(*outer_rect), //
457 ToImpellerType(*outer_radii), //
458 ToImpellerType(*inner_rect), //
459 ToImpellerType(*inner_radii), //
460 *GetPeer(paint) //
461 );
462 }
463
464 IMPELLER_EXTERN_C
465 void ImpellerDisplayListBuilderDrawPath(ImpellerDisplayListBuilder builder,
466 ImpellerPath path,
467 ImpellerPaint paint) {
468 GetPeer(builder)->DrawPath(*GetPeer(path), *GetPeer(paint));
469 }
470
471 IMPELLER_EXTERN_C
472 ImpellerTexture ImpellerTextureCreateWithContentsNew(
473 ImpellerContext context,
474 const ImpellerTextureDescriptor* descriptor,
475 const ImpellerMapping* contents,
476 void* contents_on_release_user_data) {
477 TextureDescriptor desc;
478 desc.storage_mode = StorageMode::kDevicePrivate;
479 desc.type = TextureType::kTexture2D;
480 desc.format = ToImpellerType(descriptor->pixel_format);
481 desc.size = ToImpellerType(descriptor->size);
482 desc.mip_count = std::min(descriptor->mip_count, 1u);
483 desc.usage = TextureUsage::kShaderRead;
484 desc.compression_type = CompressionType::kLossless;
485 auto texture = Create<Texture>(*GetPeer(context), desc);
486 if (!texture->IsValid()) {
487 VALIDATION_LOG << "Could not create texture.";
488 return nullptr;
489 }
490 // Depending on whether the de-allocation can be delayed, it may be possible
491 // to avoid a data copy.
492 if (contents->on_release) {
493 // Avoids data copy.
494 auto wrapped_contents = std::make_shared<fml::NonOwnedMapping>(
495 contents->data, // data ptr
496 contents->length, // data length
497 [on_release = contents->on_release, contents_on_release_user_data](
498 auto, auto) {
499 on_release(contents_on_release_user_data);
500 } // release callback
501 );
502 if (!texture->SetContents(std::move(wrapped_contents))) {
503 VALIDATION_LOG << "Could not set texture contents.";
504 return nullptr;
505 }
506 } else {
507 // May copy.
508 if (!texture->SetContents(contents->data, contents->length)) {
509 VALIDATION_LOG << "Could not set texture contents.";
510 return nullptr;
511 }
512 }
513 return texture.Leak();
514 }
515
516 IMPELLER_EXTERN_C
517 ImpellerTexture ImpellerTextureCreateWithOpenGLTextureHandleNew(
518 ImpellerContext context,
519 const ImpellerTextureDescriptor* descriptor,
520 uint64_t external_gl_handle) {
521 auto impeller_context = GetPeer(context)->GetContext();
522 if (impeller_context->GetBackendType() !=
523 impeller::Context::BackendType::kOpenGLES) {
524 VALIDATION_LOG << "Context is not OpenGL.";
525 return nullptr;
526 }
527
528 const auto& impeller_context_gl = ContextGLES::Cast(*impeller_context);
529 const auto& reactor = impeller_context_gl.GetReactor();
530
531 TextureDescriptor desc;
532 desc.storage_mode = StorageMode::kDevicePrivate;
533 desc.type = TextureType::kTexture2D;
534 desc.format = ToImpellerType(descriptor->pixel_format);
535 desc.size = ToImpellerType(descriptor->size);
536 desc.mip_count = std::min(descriptor->mip_count, 1u);
537 desc.usage = TextureUsage::kShaderRead;
538 desc.compression_type = CompressionType::kLossless;
539
540 auto texture = TextureGLES::WrapTexture(
541 reactor, //
542 desc, //
543 reactor->CreateHandle(HandleType::kTexture, external_gl_handle) //
544 );
545 if (!texture || !texture->IsValid()) {
546 VALIDATION_LOG << "Could not wrap external texture.";
547 return nullptr;
548 }
549 texture->SetCoordinateSystem(TextureCoordinateSystem::kUploadFromHost);
550 return Create<Texture>(impeller::Context::BackendType::kOpenGLES,
551 std::move(texture))
552 .Leak();
553 }
554
555 IMPELLER_EXTERN_C
556 void ImpellerTextureRetain(ImpellerTexture texture) {
557 ObjectBase::SafeRetain(texture);
558 }
559
560 IMPELLER_EXTERN_C
561 void ImpellerTextureRelease(ImpellerTexture texture) {
562 ObjectBase::SafeRelease(texture);
563 }
564
565 IMPELLER_EXTERN_C
566 uint64_t ImpellerTextureGetOpenGLHandle(ImpellerTexture texture) {
567 auto interop_texture = GetPeer(texture);
568 if (interop_texture->GetBackendType() !=
569 impeller::Context::BackendType::kOpenGLES) {
570 VALIDATION_LOG << "Can only fetch the texture handle of an OpenGL texture.";
571 return 0u;
572 }
573 return TextureGLES::Cast(*interop_texture->GetTexture())
574 .GetGLHandle()
575 .value_or(0u);
576 }
577
578 IMPELLER_EXTERN_C
579 void ImpellerDisplayListRetain(ImpellerDisplayList display_list) {
580 ObjectBase::SafeRetain(display_list);
581 }
582
583 IMPELLER_EXTERN_C
584 void ImpellerDisplayListRelease(ImpellerDisplayList display_list) {
585 ObjectBase::SafeRelease(display_list);
586 }
587
588 IMPELLER_EXTERN_C
589 ImpellerDisplayList ImpellerDisplayListBuilderCreateDisplayListNew(
590 ImpellerDisplayListBuilder builder) {
591 auto dl = GetPeer(builder)->Build();
592 if (!dl->IsValid()) {
593 return nullptr;
594 }
595 return dl.Leak();
596 }
597
598 IMPELLER_EXTERN_C
599 void ImpellerDisplayListBuilderDrawDisplayList(
600 ImpellerDisplayListBuilder builder,
601 ImpellerDisplayList display_list,
602 float opacity) {
603 GetPeer(builder)->DrawDisplayList(*GetPeer(display_list), opacity);
604 }
605
606 IMPELLER_EXTERN_C
607 ImpellerSurface ImpellerSurfaceCreateWrappedFBONew(ImpellerContext context,
608 uint64_t fbo,
609 ImpellerPixelFormat format,
610 const ImpellerISize* size) {
611 return Surface::WrapFBO(*GetPeer(context), //
612 fbo, //
613 ToImpellerType(format), //
614 ToImpellerType(*size)) //
615 .Leak();
616 }
617
618 IMPELLER_EXTERN_C
619 void ImpellerSurfaceRetain(ImpellerSurface surface) {
620 ObjectBase::SafeRetain(surface);
621 }
622
623 IMPELLER_EXTERN_C
624 void ImpellerSurfaceRelease(ImpellerSurface surface) {
625 ObjectBase::SafeRelease(surface);
626 }
627
628 IMPELLER_EXTERN_C
629 bool ImpellerSurfaceDrawDisplayList(ImpellerSurface surface,
630 ImpellerDisplayList display_list) {
631 return GetPeer(surface)->DrawDisplayList(*GetPeer(display_list));
632 }
633
634 IMPELLER_EXTERN_C
635 void ImpellerDisplayListBuilderDrawTexture(ImpellerDisplayListBuilder builder,
636 ImpellerTexture texture,
637 const ImpellerPoint* point,
638 ImpellerTextureSampling sampling,
639 ImpellerPaint paint) {
640 GetPeer(builder)->DrawTexture(*GetPeer(texture), //
641 ToImpellerType(*point), //
642 ToDisplayListType(sampling), //
643 GetPeer(paint) //
644 );
645 }
646
647 IMPELLER_EXTERN_C
648 void ImpellerDisplayListBuilderDrawTextureRect(
649 ImpellerDisplayListBuilder builder,
650 ImpellerTexture texture,
651 const ImpellerRect* src_rect,
652 const ImpellerRect* dst_rect,
653 ImpellerTextureSampling sampling,
654 ImpellerPaint paint) {
655 GetPeer(builder)->DrawTextureRect(*GetPeer(texture), //
656 ToImpellerType(*src_rect), //
657 ToImpellerType(*dst_rect), //
658 ToDisplayListType(sampling), //
659 GetPeer(paint) //
660 );
661 }
662
663 IMPELLER_EXTERN_C
664 void ImpellerColorSourceRetain(ImpellerColorSource color_source) {
665 ObjectBase::SafeRetain(color_source);
666 }
667
668 IMPELLER_EXTERN_C
669 void ImpellerColorSourceRelease(ImpellerColorSource color_source) {
670 ObjectBase::SafeRelease(color_source);
671 }
672
673 static std::pair<std::vector<flutter::DlColor>, std::vector<Scalar>>
674 ParseColorsAndStops(uint32_t stop_count,
675 const ImpellerColor* colors,
676 const float* stops) {
677 if (stop_count == 0) {
678 return {};
679 }
680 std::pair<std::vector<flutter::DlColor>, std::vector<Scalar>> result;
681 result.first.reserve(stop_count);
682 result.second.reserve(stop_count);
683 for (size_t i = 0; i < stop_count; i++) {
684 result.first.emplace_back(ToDisplayListType(colors[i]));
685 result.second.emplace_back(stops[i]);
686 }
687 return result;
688 }
689
690 IMPELLER_EXTERN_C
691 ImpellerColorSource ImpellerColorSourceCreateLinearGradientNew(
692 const ImpellerPoint* start_point,
693 const ImpellerPoint* end_point,
694 uint32_t stop_count,
695 const ImpellerColor* colors,
696 const float* stops,
697 ImpellerTileMode tile_mode,
698 const ImpellerMatrix* transformation) {
699 const auto colors_and_stops = ParseColorsAndStops(stop_count, colors, stops);
700 return ColorSource::MakeLinearGradient(
701 ToImpellerType(*start_point), //
702 ToImpellerType(*end_point), //
703 colors_and_stops.first, //
704 colors_and_stops.second, //
705 ToDisplayListType(tile_mode), //
706 transformation == nullptr ? Matrix{}
707 : ToImpellerType(*transformation) //
708 )
709 .Leak();
710 }
711
712 IMPELLER_EXTERN_C
713 ImpellerColorSource ImpellerColorSourceCreateRadialGradientNew(
714 const ImpellerPoint* center,
715 float radius,
716 uint32_t stop_count,
717 const ImpellerColor* colors,
718 const float* stops,
719 ImpellerTileMode tile_mode,
720 const ImpellerMatrix* transformation) {
721 const auto colors_and_stops = ParseColorsAndStops(stop_count, colors, stops);
722 return ColorSource::MakeRadialGradient(
723 ToImpellerType(*center), //
724 radius, //
725 colors_and_stops.first, //
726 colors_and_stops.second, //
727 ToDisplayListType(tile_mode), //
728 transformation == nullptr ? Matrix{}
729 : ToImpellerType(*transformation) //
730 )
731 .Leak();
732 }
733
734 IMPELLER_EXTERN_C
735 ImpellerColorSource ImpellerColorSourceCreateConicalGradientNew(
736 const ImpellerPoint* start_center,
737 float start_radius,
738 const ImpellerPoint* end_center,
739 float end_radius,
740 uint32_t stop_count,
741 const ImpellerColor* colors,
742 const float* stops,
743 ImpellerTileMode tile_mode,
744 const ImpellerMatrix* transformation) {
745 const auto colors_and_stops = ParseColorsAndStops(stop_count, colors, stops);
746 return ColorSource::MakeConicalGradient(
747 ToImpellerType(*start_center), //
748 start_radius, //
749 ToImpellerType(*end_center), //
750 end_radius, //
751 colors_and_stops.first, //
752 colors_and_stops.second, //
753 ToDisplayListType(tile_mode), //
754 transformation == nullptr ? Matrix{}
755 : ToImpellerType(*transformation) //
756 )
757 .Leak();
758 }
759
760 IMPELLER_EXTERN_C
761 ImpellerColorSource ImpellerColorSourceCreateSweepGradientNew(
762 const ImpellerPoint* center,
763 float start,
764 float end,
765 uint32_t stop_count,
766 const ImpellerColor* colors,
767 const float* stops,
768 ImpellerTileMode tile_mode,
769 const ImpellerMatrix* transformation) {
770 const auto colors_and_stops = ParseColorsAndStops(stop_count, colors, stops);
771 return ColorSource::MakeSweepGradient(
772 ToImpellerType(*center), //
773 start, //
774 end, //
775 colors_and_stops.first, //
776 colors_and_stops.second, //
777 ToDisplayListType(tile_mode), //
778 transformation == nullptr ? Matrix{}
779 : ToImpellerType(*transformation) //
780 )
781 .Leak();
782 }
783
784 IMPELLER_EXTERN_C
785 ImpellerColorSource ImpellerColorSourceCreateImageNew(
786 ImpellerTexture image,
787 ImpellerTileMode horizontal_tile_mode,
788 ImpellerTileMode vertical_tile_mode,
789 ImpellerTextureSampling sampling,
790 const ImpellerMatrix* transformation) {
791 return ColorSource::MakeImage(
792 *GetPeer(image), //
793 ToDisplayListType(horizontal_tile_mode), //
794 ToDisplayListType(vertical_tile_mode), //
795 ToDisplayListType(sampling), //
796 transformation == nullptr ? Matrix{}
797 : ToImpellerType(*transformation) //
798 )
799 .Leak();
800 }
801
802 IMPELLER_EXTERN_C
803 void ImpellerColorFilterRetain(ImpellerColorFilter color_filter) {
804 ObjectBase::SafeRetain(color_filter);
805 }
806
807 IMPELLER_EXTERN_C
808 void ImpellerColorFilterRelease(ImpellerColorFilter color_filter) {
809 ObjectBase::SafeRelease(color_filter);
810 }
811
812 IMPELLER_EXTERN_C
813 ImpellerColorFilter ImpellerColorFilterCreateBlendNew(
814 const ImpellerColor* color,
815 ImpellerBlendMode blend_mode) {
816 return ColorFilter::MakeBlend(ToImpellerType(*color),
817 ToImpellerType(blend_mode))
818 .Leak();
819 }
820
821 IMPELLER_EXTERN_C
822 ImpellerColorFilter ImpellerColorFilterCreateColorMatrixNew(
823 const ImpellerColorMatrix* color_matrix) {
824 return ColorFilter::MakeMatrix(color_matrix->m).Leak();
825 }
826
827 IMPELLER_EXTERN_C
828 void ImpellerMaskFilterRetain(ImpellerMaskFilter mask_filter) {
829 ObjectBase::SafeRetain(mask_filter);
830 }
831
832 IMPELLER_EXTERN_C
833 void ImpellerMaskFilterRelease(ImpellerMaskFilter mask_filter) {
834 ObjectBase::SafeRelease(mask_filter);
835 }
836
837 IMPELLER_EXTERN_C
838 ImpellerMaskFilter ImpellerMaskFilterCreateBlurNew(ImpellerBlurStyle style,
839 float sigma) {
840 return MaskFilter::MakeBlur(ToDisplayListType(style), sigma).Leak();
841 }
842
843 IMPELLER_EXTERN_C
844 void ImpellerImageFilterRetain(ImpellerImageFilter image_filter) {
845 ObjectBase::SafeRetain(image_filter);
846 }
847
848 IMPELLER_EXTERN_C
849 void ImpellerImageFilterRelease(ImpellerImageFilter image_filter) {
850 ObjectBase::SafeRelease(image_filter);
851 }
852
853 IMPELLER_EXTERN_C
854 ImpellerImageFilter ImpellerImageFilterCreateBlurNew(
855 float x_sigma,
856 float y_sigma,
857 ImpellerTileMode tile_mode) {
858 return ImageFilter::MakeBlur(x_sigma, y_sigma, ToDisplayListType(tile_mode))
859 .Leak();
860 }
861
862 IMPELLER_EXTERN_C
863 ImpellerImageFilter ImpellerImageFilterCreateDilateNew(float x_radius,
864 float y_radius) {
865 return ImageFilter::MakeDilate(x_radius, y_radius).Leak();
866 }
867
868 IMPELLER_EXTERN_C
869 ImpellerImageFilter ImpellerImageFilterCreateErodeNew(float x_radius,
870 float y_radius) {
871 return ImageFilter::MakeErode(x_radius, y_radius).Leak();
872 }
873
874 IMPELLER_EXTERN_C
875 ImpellerImageFilter ImpellerImageFilterCreateMatrixNew(
876 const ImpellerMatrix* matrix,
877 ImpellerTextureSampling sampling) {
878 return ImageFilter::MakeMatrix(ToImpellerType(*matrix),
879 ToDisplayListType(sampling))
880 .Leak();
881 }
882
883 IMPELLER_EXTERN_C
884 ImpellerImageFilter ImpellerImageFilterCreateComposeNew(
885 ImpellerImageFilter outer,
886 ImpellerImageFilter inner) {
887 return ImageFilter::MakeCompose(*GetPeer(outer), *GetPeer(inner)).Leak();
888 }
889
890 IMPELLER_EXTERN_C
891 void ImpellerPaintSetColorFilter(ImpellerPaint paint,
892 ImpellerColorFilter color_filter) {
893 GetPeer(paint)->SetColorFilter(*GetPeer(color_filter));
894 }
895
896 IMPELLER_EXTERN_C
897 void ImpellerPaintSetColorSource(ImpellerPaint paint,
898 ImpellerColorSource color_source) {
899 GetPeer(paint)->SetColorSource(*GetPeer(color_source));
900 }
901
902 IMPELLER_EXTERN_C
903 void ImpellerPaintSetImageFilter(ImpellerPaint paint,
904 ImpellerImageFilter image_filter) {
905 GetPeer(paint)->SetImageFilter(*GetPeer(image_filter));
906 }
907
908 IMPELLER_EXTERN_C
909 void ImpellerPaintSetMaskFilter(ImpellerPaint paint,
910 ImpellerMaskFilter mask_filter) {
911 GetPeer(paint)->SetMaskFilter(*GetPeer(mask_filter));
912 }
913
914 IMPELLER_EXTERN_C
915 ImpellerParagraphStyle ImpellerParagraphStyleNew() {
916 return Create<ParagraphStyle>().Leak();
917 }
918
919 IMPELLER_EXTERN_C
920 void ImpellerParagraphStyleRetain(ImpellerParagraphStyle paragraph_style) {
921 ObjectBase::SafeRetain(paragraph_style);
922 }
923
924 IMPELLER_EXTERN_C
925 void ImpellerParagraphStyleRelease(ImpellerParagraphStyle paragraph_style) {
926 ObjectBase::SafeRelease(paragraph_style);
927 }
928
929 IMPELLER_EXTERN_C
930 void ImpellerParagraphStyleSetForeground(ImpellerParagraphStyle paragraph_style,
931 ImpellerPaint paint) {
932 GetPeer(paragraph_style)->SetForeground(Ref(GetPeer(paint)));
933 }
934
935 IMPELLER_EXTERN_C
936 void ImpellerParagraphStyleSetBackground(ImpellerParagraphStyle paragraph_style,
937 ImpellerPaint paint) {
938 GetPeer(paragraph_style)->SetBackground(Ref(GetPeer(paint)));
939 }
940
941 IMPELLER_EXTERN_C
942 void ImpellerParagraphStyleSetFontWeight(ImpellerParagraphStyle paragraph_style,
943 ImpellerFontWeight weight) {
944 GetPeer(paragraph_style)->SetFontWeight(ToTxtType(weight));
945 }
946
947 IMPELLER_EXTERN_C
948 void ImpellerParagraphStyleSetFontStyle(ImpellerParagraphStyle paragraph_style,
949 ImpellerFontStyle style) {
950 GetPeer(paragraph_style)->SetFontStyle(ToTxtType(style));
951 }
952
953 static std::string ReadString(const char* string) {
954 if (string == nullptr) {
955 return "";
956 }
957 return std::string{string};
958 }
959
960 IMPELLER_EXTERN_C
961 void ImpellerParagraphStyleSetFontFamily(ImpellerParagraphStyle paragraph_style,
962 const char* family_name) {
963 GetPeer(paragraph_style)->SetFontFamily(ReadString(family_name));
964 }
965
966 IMPELLER_EXTERN_C
967 void ImpellerParagraphStyleSetFontSize(ImpellerParagraphStyle paragraph_style,
968 float size) {
969 GetPeer(paragraph_style)->SetFontSize(size);
970 }
971
972 IMPELLER_EXTERN_C
973 void ImpellerParagraphStyleSetHeight(ImpellerParagraphStyle paragraph_style,
974 float height) {
975 GetPeer(paragraph_style)->SetHeight(height);
976 }
977
978 IMPELLER_EXTERN_C
979 void ImpellerParagraphStyleSetTextAlignment(
980 ImpellerParagraphStyle paragraph_style,
981 ImpellerTextAlignment align) {
982 GetPeer(paragraph_style)->SetTextAlignment(ToTxtType(align));
983 }
984
985 IMPELLER_EXTERN_C
986 void ImpellerParagraphStyleSetTextDirection(
987 ImpellerParagraphStyle paragraph_style,
988 ImpellerTextDirection direction) {
989 GetPeer(paragraph_style)->SetTextDirection(ToTxtType(direction));
990 }
991
992 IMPELLER_EXTERN_C
993 void ImpellerParagraphStyleSetMaxLines(ImpellerParagraphStyle paragraph_style,
994 uint32_t max_lines) {
995 GetPeer(paragraph_style)->SetMaxLines(max_lines);
996 }
997
998 IMPELLER_EXTERN_C
999 void ImpellerParagraphStyleSetLocale(ImpellerParagraphStyle paragraph_style,
1000 const char* locale) {
1001 GetPeer(paragraph_style)->SetLocale(ReadString(locale));
1002 }
1003
1004 IMPELLER_EXTERN_C
1005 void ImpellerDisplayListBuilderDrawParagraph(ImpellerDisplayListBuilder builder,
1006 ImpellerParagraph paragraph,
1007 const ImpellerPoint* point) {
1008 GetPeer(builder)->DrawParagraph(*GetPeer(paragraph), ToImpellerType(*point));
1009 }
1010
1011 IMPELLER_EXTERN_C
1012 ImpellerParagraphBuilder ImpellerParagraphBuilderNew(
1013 ImpellerTypographyContext context) {
1014 auto builder =
1015 Create<ParagraphBuilder>(Ref<TypographyContext>(GetPeer(context)));
1016 if (!builder->IsValid()) {
1017 VALIDATION_LOG << "Could not create valid paragraph builder.";
1018 return nullptr;
1019 }
1020 return builder.Leak();
1021 }
1022
1023 IMPELLER_EXTERN_C
1024 void ImpellerParagraphBuilderRetain(
1025 ImpellerParagraphBuilder paragraph_builder) {
1026 ObjectBase::SafeRetain(paragraph_builder);
1027 }
1028
1029 IMPELLER_EXTERN_C
1030 void ImpellerParagraphBuilderRelease(
1031 ImpellerParagraphBuilder paragraph_builder) {
1032 ObjectBase::SafeRelease(paragraph_builder);
1033 }
1034
1035 IMPELLER_EXTERN_C
1036 void ImpellerParagraphBuilderPushStyle(
1037 ImpellerParagraphBuilder paragraph_builder,
1038 ImpellerParagraphStyle style) {
1039 GetPeer(paragraph_builder)->PushStyle(*GetPeer(style));
1040 }
1041
1042 IMPELLER_EXTERN_C
1043 void ImpellerParagraphBuilderPopStyle(
1044 ImpellerParagraphBuilder paragraph_builder) {
1045 GetPeer(paragraph_builder)->PopStyle();
1046 }
1047
1048 IMPELLER_EXTERN_C
1049 void ImpellerParagraphBuilderAddText(ImpellerParagraphBuilder paragraph_builder,
1050 const uint8_t* data,
1051 uint32_t length) {
1052 if (data == nullptr) {
1053 length = 0;
1054 }
1055 if (length == 0) {
1056 return;
1057 }
1058 GetPeer(paragraph_builder)->AddText(data, length);
1059 }
1060
1061 IMPELLER_EXTERN_C
1062 ImpellerParagraph ImpellerParagraphBuilderBuildParagraphNew(
1063 ImpellerParagraphBuilder paragraph_builder,
1064 float width) {
1065 return GetPeer(paragraph_builder)->Build(width).Leak();
1066 }
1067
1068 IMPELLER_EXTERN_C
1069 void ImpellerParagraphRetain(ImpellerParagraph paragraph) {
1070 ObjectBase::SafeRetain(paragraph);
1071 }
1072
1073 IMPELLER_EXTERN_C
1074 void ImpellerParagraphRelease(ImpellerParagraph paragraph) {
1075 ObjectBase::SafeRelease(paragraph);
1076 }
1077
1078 IMPELLER_EXTERN_C
1079 float ImpellerParagraphGetMaxWidth(ImpellerParagraph paragraph) {
1080 return GetPeer(paragraph)->GetMaxWidth();
1081 }
1082
1083 IMPELLER_EXTERN_C
1084 float ImpellerParagraphGetHeight(ImpellerParagraph paragraph) {
1085 return GetPeer(paragraph)->GetHeight();
1086 }
1087
1088 IMPELLER_EXTERN_C
1089 float ImpellerParagraphGetLongestLineWidth(ImpellerParagraph paragraph) {
1090 return GetPeer(paragraph)->GetLongestLineWidth();
1091 }
1092
1093 IMPELLER_EXTERN_C
1094 float ImpellerParagraphGetMinIntrinsicWidth(ImpellerParagraph paragraph) {
1095 return GetPeer(paragraph)->GetMinIntrinsicWidth();
1096 }
1097
1098 IMPELLER_EXTERN_C
1099 float ImpellerParagraphGetMaxIntrinsicWidth(ImpellerParagraph paragraph) {
1100 return GetPeer(paragraph)->GetMaxIntrinsicWidth();
1101 }
1102
1103 IMPELLER_EXTERN_C
1104 float ImpellerParagraphGetIdeographicBaseline(ImpellerParagraph paragraph) {
1105 return GetPeer(paragraph)->GetIdeographicBaseline();
1106 }
1107
1108 IMPELLER_EXTERN_C
1109 float ImpellerParagraphGetAlphabeticBaseline(ImpellerParagraph paragraph) {
1110 return GetPeer(paragraph)->GetAlphabeticBaseline();
1111 }
1112
1113 IMPELLER_EXTERN_C
1114 uint32_t ImpellerParagraphGetLineCount(ImpellerParagraph paragraph) {
1115 return GetPeer(paragraph)->GetLineCount();
1116 }
1117
1118 IMPELLER_EXTERN_C
1119 ImpellerTypographyContext ImpellerTypographyContextNew() {
1120 auto context = Create<TypographyContext>();
1121 if (!context->IsValid()) {
1122 VALIDATION_LOG << "Could not create typography context.";
1123 return nullptr;
1124 }
1125 return Create<TypographyContext>().Leak();
1126 }
1127
1128 IMPELLER_EXTERN_C
1129 void ImpellerTypographyContextRetain(ImpellerTypographyContext context) {
1130 ObjectBase::SafeRetain(context);
1131 }
1132
1133 IMPELLER_EXTERN_C
1134 void ImpellerTypographyContextRelease(ImpellerTypographyContext context) {
1135 ObjectBase::SafeRelease(context);
1136 }
1137
1138 IMPELLER_EXTERN_C
1139 bool ImpellerTypographyContextRegisterFont(ImpellerTypographyContext context,
1140 const ImpellerMapping* contents,
1141 void* contents_on_release_user_data,
1142 const char* family_name_alias) {
1143 auto wrapped_contents = std::make_unique<fml::NonOwnedMapping>(
1144 contents->data, // data ptr
1145 contents->length, // data length
1146 [on_release = contents->on_release, contents_on_release_user_data](auto,
1147 auto) {
1148 on_release(contents_on_release_user_data);
1149 } // release callback
1150 );
1151 return GetPeer(context)->RegisterFont(std::move(wrapped_contents),
1152 family_name_alias);
1153 }
1154
1155 } // namespace impeller::interop
ImpellerPoint
Definition: impeller.h:447
impeller::interop::ImpellerParagraphGetMaxIntrinsicWidth
IMPELLER_EXTERN_C float ImpellerParagraphGetMaxIntrinsicWidth(ImpellerParagraph paragraph)
Definition: impeller.cc:1099
impeller.h
ImpellerTextureDescriptor
Definition: impeller.h:553
impeller::interop::ImpellerDisplayListBuilderDrawRoundedRect
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawRoundedRect(ImpellerDisplayListBuilder builder, const ImpellerRect *rect, const ImpellerRoundingRadii *radii, ImpellerPaint paint)
Definition: impeller.cc:437
impeller::interop::ImpellerImageFilterCreateMatrixNew
IMPELLER_EXTERN_C ImpellerImageFilter ImpellerImageFilterCreateMatrixNew(const ImpellerMatrix *matrix, ImpellerTextureSampling sampling)
Definition: impeller.cc:875
impeller::interop::ToDisplayListType
constexpr flutter::DlColor ToDisplayListType(Color color)
Definition: formats.h:77
impeller::interop::ImpellerParagraphBuilderRetain
IMPELLER_EXTERN_C void ImpellerParagraphBuilderRetain(ImpellerParagraphBuilder paragraph_builder)
Definition: impeller.cc:1024
impeller::interop::ImpellerPaintSetMaskFilter
IMPELLER_EXTERN_C void ImpellerPaintSetMaskFilter(ImpellerPaint paint, ImpellerMaskFilter mask_filter)
Definition: impeller.cc:909
ImpellerBlurStyle
ImpellerBlurStyle
Definition: impeller.h:393
ImpellerFontStyle
ImpellerFontStyle
Definition: impeller.h:418
paragraph.h
surface.h
impeller::interop::ImpellerParagraphRelease
IMPELLER_EXTERN_C void ImpellerParagraphRelease(ImpellerParagraph paragraph)
Definition: impeller.cc:1074
impeller::interop::ImpellerPaintRetain
IMPELLER_EXTERN_C void ImpellerPaintRetain(ImpellerPaint paint)
Definition: impeller.cc:345
impeller::interop::ImpellerContextCreateOpenGLESNew
IMPELLER_EXTERN_C ImpellerContext ImpellerContextCreateOpenGLESNew(uint32_t version, ImpellerProcAddressCallback gl_proc_address_callback, void *gl_proc_address_callback_user_data)
Definition: impeller.cc:73
ImpellerMapping::length
uint64_t length
Definition: impeller.h:561
impeller::interop::ImpellerImageFilterRetain
IMPELLER_EXTERN_C void ImpellerImageFilterRetain(ImpellerImageFilter image_filter)
Definition: impeller.cc:844
impeller::interop::MaskFilter::MakeBlur
static ScopedObject< MaskFilter > MakeBlur(flutter::DlBlurStyle style, float sigma)
Definition: mask_filter.cc:9
dl_builder.h
impeller::interop::ImpellerDisplayListBuilderRestoreToCount
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderRestoreToCount(ImpellerDisplayListBuilder builder, uint32_t count)
Definition: impeller.cc:195
impeller::interop::ImpellerPaintSetBlendMode
IMPELLER_EXTERN_C void ImpellerPaintSetBlendMode(ImpellerPaint paint, ImpellerBlendMode mode)
Definition: impeller.cc:360
image_filter.h
impeller::interop::ImpellerPathRelease
IMPELLER_EXTERN_C void ImpellerPathRelease(ImpellerPath path)
Definition: impeller.cc:207
impeller::interop::ImpellerParagraphStyleSetLocale
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetLocale(ImpellerParagraphStyle paragraph_style, const char *locale)
Definition: impeller.cc:999
impeller::interop::ImpellerPathBuilderAddOval
IMPELLER_EXTERN_C void ImpellerPathBuilderAddOval(ImpellerPathBuilder builder, const ImpellerRect *oval_bounds)
Definition: impeller.cc:275
impeller::interop::ImpellerDisplayListBuilderRetain
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderRetain(ImpellerDisplayListBuilder builder)
Definition: impeller.cc:114
impeller::interop::ImageFilter::MakeMatrix
static ScopedObject< ImageFilter > MakeMatrix(const Matrix &matrix, flutter::DlImageSampling sampling)
Definition: image_filter.cc:44
ImpellerTextureDescriptor::mip_count
uint32_t mip_count
Definition: impeller.h:556
impeller::interop::ImpellerParagraphBuilderNew
IMPELLER_EXTERN_C ImpellerParagraphBuilder ImpellerParagraphBuilderNew(ImpellerTypographyContext context)
Definition: impeller.cc:1012
impeller::interop::ImpellerPaintSetStrokeWidth
IMPELLER_EXTERN_C void ImpellerPaintSetStrokeWidth(ImpellerPaint paint, float width)
Definition: impeller.cc:380
impeller::interop::FromImpellerType
constexpr void FromImpellerType(const Matrix &from, ImpellerMatrix &to)
Definition: formats.h:209
ImpellerClipOperation
ImpellerClipOperation
Definition: impeller.h:322
color_filter.h
impeller::interop::ImpellerDisplayListBuilderRelease
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderRelease(ImpellerDisplayListBuilder builder)
Definition: impeller.cc:119
impeller::interop::ImpellerTextureCreateWithContentsNew
IMPELLER_EXTERN_C ImpellerTexture ImpellerTextureCreateWithContentsNew(ImpellerContext context, const ImpellerTextureDescriptor *descriptor, const ImpellerMapping *contents, void *contents_on_release_user_data)
Definition: impeller.cc:472
impeller::interop::ObjectBase::SafeRelease
static void SafeRelease(void *ptr)
Definition: object.h:43
impeller::interop::ImpellerDisplayListBuilderDrawDashedLine
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawDashedLine(ImpellerDisplayListBuilder builder, const ImpellerPoint *from, const ImpellerPoint *to, float on_length, float off_length, ImpellerPaint paint)
Definition: impeller.cc:407
impeller::interop::ImpellerTypographyContextNew
IMPELLER_EXTERN_C ImpellerTypographyContext ImpellerTypographyContextNew()
Create a new typography contents.
Definition: impeller.cc:1119
ImpellerMapping::on_release
ImpellerCallback IMPELLER_NULLABLE on_release
Definition: impeller.h:562
impeller::interop::ImpellerColorFilterCreateBlendNew
IMPELLER_EXTERN_C ImpellerColorFilter ImpellerColorFilterCreateBlendNew(const ImpellerColor *color, ImpellerBlendMode blend_mode)
Definition: impeller.cc:813
data
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:64
impeller::interop::ParseColorsAndStops
static std::pair< std::vector< flutter::DlColor >, std::vector< Scalar > > ParseColorsAndStops(uint32_t stop_count, const ImpellerColor *colors, const float *stops)
Definition: impeller.cc:674
ImpellerISize
Definition: impeller.h:457
impeller::TextureDescriptor::format
PixelFormat format
Definition: texture_descriptor.h:41
impeller::interop::ImpellerParagraphGetMinIntrinsicWidth
IMPELLER_EXTERN_C float ImpellerParagraphGetMinIntrinsicWidth(ImpellerParagraph paragraph)
Definition: impeller.cc:1094
impeller::interop::ImpellerDisplayListBuilderGetTransform
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderGetTransform(ImpellerDisplayListBuilder builder, ImpellerMatrix *out_transform)
Definition: impeller.cc:177
ImpellerMapping
Definition: impeller.h:559
impeller::interop::ImpellerPathRetain
IMPELLER_EXTERN_C void ImpellerPathRetain(ImpellerPath path)
Definition: impeller.cc:202
impeller::interop::ImpellerParagraphRetain
IMPELLER_EXTERN_C void ImpellerParagraphRetain(ImpellerParagraph paragraph)
Definition: impeller.cc:1069
impeller::interop::ImpellerParagraphBuilderAddText
IMPELLER_EXTERN_C void ImpellerParagraphBuilderAddText(ImpellerParagraphBuilder paragraph_builder, const uint8_t *data, uint32_t length)
Definition: impeller.cc:1049
impeller::TextureGLES::GetGLHandle
std::optional< GLuint > GetGLHandle() const
Definition: texture_gles.cc:482
impeller::HandleType::kTexture
@ kTexture
ImpellerColor
Definition: impeller.h:545
impeller::interop::ImpellerParagraphBuilderPopStyle
IMPELLER_EXTERN_C void ImpellerParagraphBuilderPopStyle(ImpellerParagraphBuilder paragraph_builder)
Definition: impeller.cc:1043
texture_gles.h
impeller::TextureDescriptor::mip_count
size_t mip_count
Definition: texture_descriptor.h:43
context_gles.h
impeller::interop::ImpellerPathBuilderQuadraticCurveTo
IMPELLER_EXTERN_C void ImpellerPathBuilderQuadraticCurveTo(ImpellerPathBuilder builder, const ImpellerPoint *control_point, const ImpellerPoint *end_point)
Definition: impeller.cc:239
impeller::interop::ImpellerColorSourceCreateConicalGradientNew
IMPELLER_EXTERN_C ImpellerColorSource ImpellerColorSourceCreateConicalGradientNew(const ImpellerPoint *start_center, float start_radius, const ImpellerPoint *end_center, float end_radius, uint32_t stop_count, const ImpellerColor *colors, const float *stops, ImpellerTileMode tile_mode, const ImpellerMatrix *transformation)
Definition: impeller.cc:735
impeller::interop::ImpellerPathBuilderRetain
IMPELLER_EXTERN_C void ImpellerPathBuilderRetain(ImpellerPathBuilder builder)
Definition: impeller.cc:217
impeller::interop::ImpellerDisplayListBuilderDrawTextureRect
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawTextureRect(ImpellerDisplayListBuilder builder, ImpellerTexture texture, const ImpellerRect *src_rect, const ImpellerRect *dst_rect, ImpellerTextureSampling sampling, ImpellerPaint paint)
Definition: impeller.cc:648
ImpellerRect
Definition: impeller.h:440
impeller::interop::ImpellerColorFilterRetain
IMPELLER_EXTERN_C void ImpellerColorFilterRetain(ImpellerColorFilter color_filter)
Definition: impeller.cc:803
impeller::interop::ImpellerParagraphStyleSetFontSize
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetFontSize(ImpellerParagraphStyle paragraph_style, float size)
Definition: impeller.cc:967
impeller::interop::ImpellerDisplayListBuilderDrawTexture
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawTexture(ImpellerDisplayListBuilder builder, ImpellerTexture texture, const ImpellerPoint *point, ImpellerTextureSampling sampling, ImpellerPaint paint)
Definition: impeller.cc:635
impeller::interop::ImpellerSurfaceCreateWrappedFBONew
IMPELLER_EXTERN_C ImpellerSurface ImpellerSurfaceCreateWrappedFBONew(ImpellerContext context, uint64_t fbo, ImpellerPixelFormat format, const ImpellerISize *size)
Definition: impeller.cc:607
impeller::interop::ColorSource::MakeRadialGradient
static ScopedObject< ColorSource > MakeRadialGradient(const Point &center, Scalar radius, const std::vector< flutter::DlColor > &colors, const std::vector< Scalar > &stops, flutter::DlTileMode tile_mode, const Matrix &transformation)
Definition: color_source.cc:30
impeller::interop::ImpellerDisplayListBuilderTranslate
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderTranslate(ImpellerDisplayListBuilder builder, float x_translation, float y_translation)
Definition: impeller.cc:158
impeller::interop::ImpellerPathBuilderRelease
IMPELLER_EXTERN_C void ImpellerPathBuilderRelease(ImpellerPathBuilder builder)
Definition: impeller.cc:222
impeller::interop::ImpellerPaintSetImageFilter
IMPELLER_EXTERN_C void ImpellerPaintSetImageFilter(ImpellerPaint paint, ImpellerImageFilter image_filter)
Definition: impeller.cc:903
ImpellerTileMode
ImpellerTileMode
Definition: impeller.h:386
impeller::interop::ImpellerParagraphGetLineCount
IMPELLER_EXTERN_C uint32_t ImpellerParagraphGetLineCount(ImpellerParagraph paragraph)
Definition: impeller.cc:1114
impeller::interop::ImpellerParagraphStyleRetain
IMPELLER_EXTERN_C void ImpellerParagraphStyleRetain(ImpellerParagraphStyle paragraph_style)
Definition: impeller.cc:920
impeller::interop::ImpellerGetVersion
IMPELLER_EXTERN_C uint32_t ImpellerGetVersion()
Get the version of Impeller standalone API. This is the API that will be accepted for validity checks...
Definition: impeller.cc:68
impeller::interop
Definition: color_filter.cc:7
validation.h
impeller::interop::ImpellerSurfaceDrawDisplayList
IMPELLER_EXTERN_C bool ImpellerSurfaceDrawDisplayList(ImpellerSurface surface, ImpellerDisplayList display_list)
Definition: impeller.cc:629
impeller::interop::ImpellerPathBuilderAddArc
IMPELLER_EXTERN_C void ImpellerPathBuilderAddArc(ImpellerPathBuilder builder, const ImpellerRect *oval_bounds, float start_angle_degrees, float end_angle_degrees)
Definition: impeller.cc:264
impeller::interop::ImpellerParagraphStyleSetFontStyle
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetFontStyle(ImpellerParagraphStyle paragraph_style, ImpellerFontStyle style)
Definition: impeller.cc:948
impeller::TextureDescriptor::usage
TextureUsageMask usage
Definition: texture_descriptor.h:44
impeller::interop::ImpellerDisplayListBuilderRestore
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderRestore(ImpellerDisplayListBuilder builder)
Definition: impeller.cc:140
impeller::interop::ImpellerParagraphStyleSetFontFamily
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetFontFamily(ImpellerParagraphStyle paragraph_style, const char *family_name)
Definition: impeller.cc:961
impeller::interop::ImpellerDisplayListBuilderScale
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderScale(ImpellerDisplayListBuilder builder, float x_scale, float y_scale)
Definition: impeller.cc:145
ImpellerColorMatrix::m
float m[20]
Definition: impeller.h:535
paragraph_builder.h
ImpellerStrokeCap
ImpellerStrokeCap
Definition: impeller.h:365
impeller::interop::ImpellerParagraphStyleSetMaxLines
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetMaxLines(ImpellerParagraphStyle paragraph_style, uint32_t max_lines)
Definition: impeller.cc:993
impeller::interop::ImpellerPathBuilderAddRoundedRect
IMPELLER_EXTERN_C void ImpellerPathBuilderAddRoundedRect(ImpellerPathBuilder builder, const ImpellerRect *rect, const ImpellerRoundingRadii *rounding_radii)
Definition: impeller.cc:281
impeller::interop::DEFINE_PEER_GETTER
DEFINE_PEER_GETTER(ColorFilter, ImpellerColorFilter)
impeller::interop::ImpellerDisplayListBuilderDrawPath
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawPath(ImpellerDisplayListBuilder builder, ImpellerPath path, ImpellerPaint paint)
Definition: impeller.cc:465
typography_context.h
impeller::TextureCoordinateSystem::kUploadFromHost
@ kUploadFromHost
impeller::TextureDescriptor::type
TextureType type
Definition: texture_descriptor.h:40
impeller::interop::ImpellerTypographyContextRegisterFont
IMPELLER_EXTERN_C bool ImpellerTypographyContextRegisterFont(ImpellerTypographyContext context, const ImpellerMapping *contents, void *contents_on_release_user_data, const char *family_name_alias)
Definition: impeller.cc:1139
impeller::interop::ImpellerParagraphStyleSetHeight
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetHeight(ImpellerParagraphStyle paragraph_style, float height)
Definition: impeller.cc:973
impeller::TSize< Scalar >
impeller::interop::ImpellerParagraphGetMaxWidth
IMPELLER_EXTERN_C float ImpellerParagraphGetMaxWidth(ImpellerParagraph paragraph)
Definition: impeller.cc:1079
impeller::interop::ImpellerPaintSetColor
IMPELLER_EXTERN_C void ImpellerPaintSetColor(ImpellerPaint paint, const ImpellerColor *color)
Definition: impeller.cc:355
path.h
ImpellerMatrix
Definition: impeller.h:472
color_source.h
impeller::interop::ImpellerTextureRelease
IMPELLER_EXTERN_C void ImpellerTextureRelease(ImpellerTexture texture)
Definition: impeller.cc:561
impeller::interop::ImpellerPaintSetDrawStyle
IMPELLER_EXTERN_C void ImpellerPaintSetDrawStyle(ImpellerPaint paint, ImpellerDrawStyle style)
Definition: impeller.cc:365
impeller::interop::ImpellerParagraphBuilderPushStyle
IMPELLER_EXTERN_C void ImpellerParagraphBuilderPushStyle(ImpellerParagraphBuilder paragraph_builder, ImpellerParagraphStyle style)
Definition: impeller.cc:1036
impeller::interop::ImpellerMaskFilterCreateBlurNew
IMPELLER_EXTERN_C ImpellerMaskFilter ImpellerMaskFilterCreateBlurNew(ImpellerBlurStyle style, float sigma)
Create a mask filter that blurs contents in the masked shape.
Definition: impeller.cc:838
impeller::interop::ToTxtType
constexpr txt::FontWeight ToTxtType(ImpellerFontWeight weight)
Definition: formats.h:430
impeller::Context::BackendType::kOpenGLES
@ kOpenGLES
impeller::interop::ImpellerDisplayListBuilderClipPath
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderClipPath(ImpellerDisplayListBuilder builder, ImpellerPath path, ImpellerClipOperation op)
Definition: impeller.cc:333
ImpellerPixelFormat
ImpellerPixelFormat
Definition: impeller.h:377
impeller::interop::ColorSource::MakeImage
static ScopedObject< ColorSource > MakeImage(const Texture &image, flutter::DlTileMode horizontal_tile_mode, flutter::DlTileMode vertical_tile_mode, flutter::DlImageSampling sampling, const Matrix &transformation)
Definition: color_source.cc:99
ImpellerRoundingRadii
Definition: impeller.h:538
impeller::interop::ImpellerImageFilterCreateBlurNew
IMPELLER_EXTERN_C ImpellerImageFilter ImpellerImageFilterCreateBlurNew(float x_sigma, float y_sigma, ImpellerTileMode tile_mode)
Creates an image filter that applies a Gaussian blur.
Definition: impeller.cc:854
impeller::interop::ImpellerDisplayListBuilderDrawOval
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawOval(ImpellerDisplayListBuilder builder, const ImpellerRect *oval_bounds, ImpellerPaint paint)
Definition: impeller.cc:430
impeller::interop::ImpellerTextureCreateWithOpenGLTextureHandleNew
IMPELLER_EXTERN_C ImpellerTexture ImpellerTextureCreateWithOpenGLTextureHandleNew(ImpellerContext context, const ImpellerTextureDescriptor *descriptor, uint64_t external_gl_handle)
Definition: impeller.cc:517
transform
Matrix transform
Definition: gaussian_blur_filter_contents.cc:214
impeller::interop::ImpellerDisplayListBuilderCreateDisplayListNew
IMPELLER_EXTERN_C ImpellerDisplayList ImpellerDisplayListBuilderCreateDisplayListNew(ImpellerDisplayListBuilder builder)
Definition: impeller.cc:589
impeller::interop::ImpellerDisplayListBuilderDrawRoundedRectDifference
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawRoundedRectDifference(ImpellerDisplayListBuilder builder, const ImpellerRect *outer_rect, const ImpellerRoundingRadii *outer_radii, const ImpellerRect *inner_rect, const ImpellerRoundingRadii *inner_radii, ImpellerPaint paint)
Definition: impeller.cc:449
impeller::StorageMode::kDevicePrivate
@ kDevicePrivate
impeller::interop::ImageFilter::MakeErode
static ScopedObject< ImageFilter > MakeErode(Scalar x_radius, Scalar y_radius)
Definition: image_filter.cc:35
impeller::interop::ImpellerContextRetain
IMPELLER_EXTERN_C void ImpellerContextRetain(ImpellerContext context)
Definition: impeller.cc:98
impeller::interop::ImpellerDisplayListBuilderGetSaveCount
IMPELLER_EXTERN_C uint32_t ImpellerDisplayListBuilderGetSaveCount(ImpellerDisplayListBuilder builder)
Definition: impeller.cc:189
impeller::interop::Ref
ScopedObject< Object > Ref(Object *object)
Definition: object.h:145
impeller::interop::ImpellerColorSourceCreateRadialGradientNew
IMPELLER_EXTERN_C ImpellerColorSource ImpellerColorSourceCreateRadialGradientNew(const ImpellerPoint *center, float radius, uint32_t stop_count, const ImpellerColor *colors, const float *stops, ImpellerTileMode tile_mode, const ImpellerMatrix *transformation)
Definition: impeller.cc:713
impeller::CompressionType::kLossless
@ kLossless
impeller::interop::ImpellerColorSourceRelease
IMPELLER_EXTERN_C void ImpellerColorSourceRelease(ImpellerColorSource color_source)
Definition: impeller.cc:669
IMPELLER_VERSION_GET_VARIANT
#define IMPELLER_VERSION_GET_VARIANT(version)
Definition: impeller.h:110
impeller::interop::ImpellerPathBuilderLineTo
IMPELLER_EXTERN_C void ImpellerPathBuilderLineTo(ImpellerPathBuilder builder, const ImpellerPoint *location)
Definition: impeller.cc:233
formats.h
impeller::interop::ImpellerMaskFilterRetain
IMPELLER_EXTERN_C void ImpellerMaskFilterRetain(ImpellerMaskFilter mask_filter)
Definition: impeller.cc:828
texture.h
impeller::interop::ImpellerDisplayListBuilderDrawParagraph
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawParagraph(ImpellerDisplayListBuilder builder, ImpellerParagraph paragraph, const ImpellerPoint *point)
Definition: impeller.cc:1005
impeller::interop::ImpellerPathBuilderNew
IMPELLER_EXTERN_C ImpellerPathBuilder ImpellerPathBuilderNew()
Create a new path builder. Paths themselves are immutable. A builder builds these immutable paths.
Definition: impeller.cc:212
impeller::TextureGLES::WrapTexture
static std::shared_ptr< TextureGLES > WrapTexture(std::shared_ptr< ReactorGLES > reactor, TextureDescriptor desc, HandleGLES external_handle)
Create a texture by wrapping an external OpenGL texture handle. Ownership of the texture handle is as...
Definition: texture_gles.cc:155
impeller::interop::ImpellerDisplayListBuilderClipOval
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderClipOval(ImpellerDisplayListBuilder builder, const ImpellerRect *oval_bounds, ImpellerClipOperation op)
Definition: impeller.cc:314
ImpellerStrokeJoin
ImpellerStrokeJoin
Definition: impeller.h:371
impeller::interop::ImpellerMaskFilterRelease
IMPELLER_EXTERN_C void ImpellerMaskFilterRelease(ImpellerMaskFilter mask_filter)
Definition: impeller.cc:833
impeller::interop::ImpellerParagraphStyleSetTextDirection
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetTextDirection(ImpellerParagraphStyle paragraph_style, ImpellerTextDirection direction)
Definition: impeller.cc:986
impeller::interop::ImpellerPaintSetColorFilter
IMPELLER_EXTERN_C void ImpellerPaintSetColorFilter(ImpellerPaint paint, ImpellerColorFilter color_filter)
Definition: impeller.cc:891
impeller::interop::ImpellerDisplayListBuilderRotate
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderRotate(ImpellerDisplayListBuilder builder, float angle_degrees)
Definition: impeller.cc:152
ImpellerDrawStyle
ImpellerDrawStyle
Definition: impeller.h:359
impeller::interop::ImpellerParagraphStyleRelease
IMPELLER_EXTERN_C void ImpellerParagraphStyleRelease(ImpellerParagraphStyle paragraph_style)
Definition: impeller.cc:925
impeller::interop::ImpellerDisplayListBuilderTransform
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderTransform(ImpellerDisplayListBuilder builder, const ImpellerMatrix *transform)
Definition: impeller.cc:171
impeller::interop::ImpellerDisplayListRelease
IMPELLER_EXTERN_C void ImpellerDisplayListRelease(ImpellerDisplayList display_list)
Definition: impeller.cc:584
ImpellerBlendMode
ImpellerBlendMode
Definition: impeller.h:327
impeller::interop::ImpellerPathBuilderClose
IMPELLER_EXTERN_C void ImpellerPathBuilderClose(ImpellerPathBuilder builder)
Definition: impeller.cc:290
impeller::interop::ImpellerTextureRetain
IMPELLER_EXTERN_C void ImpellerTextureRetain(ImpellerTexture texture)
Definition: impeller.cc:556
impeller::interop::ImpellerDisplayListBuilderResetTransform
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderResetTransform(ImpellerDisplayListBuilder builder)
Definition: impeller.cc:183
impeller::interop::ImpellerParagraphGetAlphabeticBaseline
IMPELLER_EXTERN_C float ImpellerParagraphGetAlphabeticBaseline(ImpellerParagraph paragraph)
Definition: impeller.cc:1109
impeller::interop::ImpellerPathBuilderCubicCurveTo
IMPELLER_EXTERN_C void ImpellerPathBuilderCubicCurveTo(ImpellerPathBuilder builder, const ImpellerPoint *control_point_1, const ImpellerPoint *control_point_2, const ImpellerPoint *end_point)
Definition: impeller.cc:247
impeller::interop::ImpellerDisplayListBuilderNew
IMPELLER_EXTERN_C ImpellerDisplayListBuilder ImpellerDisplayListBuilderNew(const ImpellerRect *cull_rect)
Definition: impeller.cc:108
impeller::interop::ImpellerDisplayListBuilderSetTransform
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderSetTransform(ImpellerDisplayListBuilder builder, const ImpellerMatrix *transform)
Definition: impeller.cc:165
impeller::interop::ToImpellerType
constexpr Matrix ToImpellerType(const ImpellerMatrix &m)
Definition: formats.h:201
impeller::interop::ImpellerPathBuilderAddRect
IMPELLER_EXTERN_C void ImpellerPathBuilderAddRect(ImpellerPathBuilder builder, const ImpellerRect *rect)
Definition: impeller.cc:258
impeller::interop::ImpellerImageFilterCreateErodeNew
IMPELLER_EXTERN_C ImpellerImageFilter ImpellerImageFilterCreateErodeNew(float x_radius, float y_radius)
Creates an image filter that dampens the per-channel pixel values to the minimum value in a circle ar...
Definition: impeller.cc:869
impeller::interop::ImpellerDisplayListBuilderDrawLine
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawLine(ImpellerDisplayListBuilder builder, const ImpellerPoint *from, const ImpellerPoint *to, ImpellerPaint paint)
Definition: impeller.cc:396
impeller::interop::ImpellerContextRelease
IMPELLER_EXTERN_C void ImpellerContextRelease(ImpellerContext context)
Definition: impeller.cc:103
impeller::interop::ImpellerParagraphGetIdeographicBaseline
IMPELLER_EXTERN_C float ImpellerParagraphGetIdeographicBaseline(ImpellerParagraph paragraph)
Definition: impeller.cc:1104
impeller::TextureType::kTexture2D
@ kTexture2D
IMPELLER_EXTERN_C
#define IMPELLER_EXTERN_C
Definition: impeller.h:34
impeller::interop::ImpellerColorSourceCreateLinearGradientNew
IMPELLER_EXTERN_C ImpellerColorSource ImpellerColorSourceCreateLinearGradientNew(const ImpellerPoint *start_point, const ImpellerPoint *end_point, uint32_t stop_count, const ImpellerColor *colors, const float *stops, ImpellerTileMode tile_mode, const ImpellerMatrix *transformation)
Definition: impeller.cc:691
impeller::interop::ImpellerPaintSetColorSource
IMPELLER_EXTERN_C void ImpellerPaintSetColorSource(ImpellerPaint paint, ImpellerColorSource color_source)
Definition: impeller.cc:897
IMPELLER_VERSION_GET_PATCH
#define IMPELLER_VERSION_GET_PATCH(version)
Definition: impeller.h:133
impeller::interop::ImpellerPaintSetStrokeCap
IMPELLER_EXTERN_C void ImpellerPaintSetStrokeCap(ImpellerPaint paint, ImpellerStrokeCap cap)
Definition: impeller.cc:370
impeller::interop::ImpellerDisplayListBuilderClipRoundedRect
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderClipRoundedRect(ImpellerDisplayListBuilder builder, const ImpellerRect *rect, const ImpellerRoundingRadii *radii, ImpellerClipOperation op)
Definition: impeller.cc:321
impeller::interop::ImpellerDisplayListBuilderDrawRect
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawRect(ImpellerDisplayListBuilder builder, const ImpellerRect *rect, ImpellerPaint paint)
Definition: impeller.cc:423
impeller::interop::ImpellerPaintSetStrokeJoin
IMPELLER_EXTERN_C void ImpellerPaintSetStrokeJoin(ImpellerPaint paint, ImpellerStrokeJoin join)
Definition: impeller.cc:375
IMPELLER_VERSION
#define IMPELLER_VERSION
Definition: impeller.h:101
impeller::interop::ImpellerDisplayListBuilderDrawDisplayList
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawDisplayList(ImpellerDisplayListBuilder builder, ImpellerDisplayList display_list, float opacity)
Definition: impeller.cc:599
scalar.h
impeller::interop::ImpellerDisplayListBuilderSave
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderSave(ImpellerDisplayListBuilder builder)
Definition: impeller.cc:124
impeller::interop::ColorSource::MakeSweepGradient
static ScopedObject< ColorSource > MakeSweepGradient(const Point &center, Scalar start, Scalar end, const std::vector< flutter::DlColor > &colors, const std::vector< Scalar > &stops, flutter::DlTileMode tile_mode, const Matrix &transformation)
Definition: color_source.cc:76
impeller::TextureDescriptor::size
ISize size
Definition: texture_descriptor.h:42
impeller::interop::ImpellerDisplayListBuilderSaveLayer
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderSaveLayer(ImpellerDisplayListBuilder builder, const ImpellerRect *bounds, ImpellerPaint paint, ImpellerImageFilter backdrop)
Definition: impeller.cc:129
IMPELLER_VERSION_GET_MINOR
#define IMPELLER_VERSION_GET_MINOR(version)
Definition: impeller.h:125
ImpellerTextureDescriptor::pixel_format
ImpellerPixelFormat pixel_format
Definition: impeller.h:554
path_builder.h
impeller::interop::ColorSource::MakeConicalGradient
static ScopedObject< ColorSource > MakeConicalGradient(const Point &start_center, Scalar start_radius, const Point &end_center, Scalar end_radius, const std::vector< flutter::DlColor > &colors, const std::vector< Scalar > &stops, flutter::DlTileMode tile_mode, const Matrix &transformation)
Definition: color_source.cc:51
impeller::interop::ImpellerColorSourceRetain
IMPELLER_EXTERN_C void ImpellerColorSourceRetain(ImpellerColorSource color_source)
Definition: impeller.cc:664
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:91
impeller::interop::ImpellerParagraphGetLongestLineWidth
IMPELLER_EXTERN_C float ImpellerParagraphGetLongestLineWidth(ImpellerParagraph paragraph)
Definition: impeller.cc:1089
ImpellerTextDirection
ImpellerTextDirection
Definition: impeller.h:432
impeller::interop::ImpellerImageFilterRelease
IMPELLER_EXTERN_C void ImpellerImageFilterRelease(ImpellerImageFilter image_filter)
Definition: impeller.cc:849
impeller::interop::ColorFilter::MakeBlend
static ScopedObject< ColorFilter > MakeBlend(Color color, BlendMode mode)
Definition: color_filter.cc:9
ImpellerTextureSampling
ImpellerTextureSampling
Definition: impeller.h:381
impeller::interop::ImpellerParagraphStyleSetTextAlignment
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetTextAlignment(ImpellerParagraphStyle paragraph_style, ImpellerTextAlignment align)
Definition: impeller.cc:979
impeller::interop::Context::CreateOpenGLES
static ScopedObject< Context > CreateOpenGLES(std::function< void *(const char *gl_proc_name)> proc_address_callback)
Definition: context.cc:65
impeller::interop::ImpellerDisplayListRetain
IMPELLER_EXTERN_C void ImpellerDisplayListRetain(ImpellerDisplayList display_list)
Definition: impeller.cc:579
impeller::interop::ImpellerColorSourceCreateSweepGradientNew
IMPELLER_EXTERN_C ImpellerColorSource ImpellerColorSourceCreateSweepGradientNew(const ImpellerPoint *center, float start, float end, uint32_t stop_count, const ImpellerColor *colors, const float *stops, ImpellerTileMode tile_mode, const ImpellerMatrix *transformation)
Definition: impeller.cc:761
impeller::interop::ImpellerDisplayListBuilderDrawPaint
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawPaint(ImpellerDisplayListBuilder builder, ImpellerPaint paint)
Definition: impeller.cc:390
impeller::interop::ImpellerColorFilterCreateColorMatrixNew
IMPELLER_EXTERN_C ImpellerColorFilter ImpellerColorFilterCreateColorMatrixNew(const ImpellerColorMatrix *color_matrix)
Definition: impeller.cc:822
impeller::interop::Surface::WrapFBO
static ScopedObject< Surface > WrapFBO(Context &context, uint64_t fbo, PixelFormat color_format, ISize size)
Definition: surface.cc:23
impeller::TPoint
Definition: point.h:27
impeller::interop::ImpellerPathBuilderCopyPathNew
IMPELLER_EXTERN_C ImpellerPath ImpellerPathBuilderCopyPathNew(ImpellerPathBuilder builder, ImpellerFillType fill)
Definition: impeller.cc:295
paragraph_style.h
impeller::interop::ImpellerImageFilterCreateDilateNew
IMPELLER_EXTERN_C ImpellerImageFilter ImpellerImageFilterCreateDilateNew(float x_radius, float y_radius)
Creates an image filter that enhances the per-channel pixel values to the maximum value in a circle a...
Definition: impeller.cc:863
impeller::BackendCast< ContextGLES, Context >::Cast
static ContextGLES & Cast(Context &base)
Definition: backend_cast.h:13
impeller::interop::ImpellerParagraphStyleSetBackground
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetBackground(ImpellerParagraphStyle paragraph_style, ImpellerPaint paint)
Definition: impeller.cc:936
impeller::TextureUsage::kShaderRead
@ kShaderRead
texture.h
impeller::interop::ReadString
static std::string ReadString(const char *string)
Definition: impeller.cc:953
impeller::interop::ImpellerParagraphBuilderRelease
IMPELLER_EXTERN_C void ImpellerParagraphBuilderRelease(ImpellerParagraphBuilder paragraph_builder)
Definition: impeller.cc:1030
ImpellerFillType
ImpellerFillType
Definition: impeller.h:317
impeller::interop::ImpellerParagraphStyleSetFontWeight
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetFontWeight(ImpellerParagraphStyle paragraph_style, ImpellerFontWeight weight)
Definition: impeller.cc:942
impeller::interop::ImpellerTextureGetOpenGLHandle
IMPELLER_EXTERN_C uint64_t ImpellerTextureGetOpenGLHandle(ImpellerTexture texture)
Definition: impeller.cc:566
impeller::interop::ImpellerSurfaceRelease
IMPELLER_EXTERN_C void ImpellerSurfaceRelease(ImpellerSurface surface)
Definition: impeller.cc:624
impeller::Degrees
Definition: scalar.h:51
context.h
impeller::interop::ImpellerPaintSetStrokeMiter
IMPELLER_EXTERN_C void ImpellerPaintSetStrokeMiter(ImpellerPaint paint, float miter)
Definition: impeller.cc:385
impeller::TextureDescriptor::storage_mode
StorageMode storage_mode
Definition: texture_descriptor.h:39
ImpellerFontWeight
ImpellerFontWeight
Definition: impeller.h:406
paint.h
ImpellerMapping::data
const uint8_t *IMPELLER_NONNULL data
Definition: impeller.h:560
impeller::TextureDescriptor
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...
Definition: texture_descriptor.h:38
impeller::interop::ImpellerDisplayListBuilderClipRect
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderClipRect(ImpellerDisplayListBuilder builder, const ImpellerRect *rect, ImpellerClipOperation op)
Definition: impeller.cc:307
impeller::interop::ColorFilter::MakeMatrix
static ScopedObject< ColorFilter > MakeMatrix(const float matrix[20])
Definition: color_filter.cc:18
impeller::interop::ObjectBase::SafeRetain
static void SafeRetain(void *ptr)
Definition: object.h:37
impeller::interop::ImpellerSurfaceRetain
IMPELLER_EXTERN_C void ImpellerSurfaceRetain(ImpellerSurface surface)
Definition: impeller.cc:619
impeller::interop::ColorSource::MakeLinearGradient
static ScopedObject< ColorSource > MakeLinearGradient(const Point &start_point, const Point &end_point, const std::vector< flutter::DlColor > &colors, const std::vector< Scalar > &stops, flutter::DlTileMode tile_mode, const Matrix &transformation)
Definition: color_source.cc:9
impeller::interop::ImpellerPathBuilderTakePathNew
IMPELLER_EXTERN_C ImpellerPath ImpellerPathBuilderTakePathNew(ImpellerPathBuilder builder, ImpellerFillType fill)
Definition: impeller.cc:301
impeller::interop::ImpellerParagraphStyleSetForeground
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetForeground(ImpellerParagraphStyle paragraph_style, ImpellerPaint paint)
Definition: impeller.cc:930
impeller::interop::ImpellerPathBuilderMoveTo
IMPELLER_EXTERN_C void ImpellerPathBuilderMoveTo(ImpellerPathBuilder builder, const ImpellerPoint *location)
Definition: impeller.cc:227
impeller::interop::GetVersionAsString
static std::string GetVersionAsString(uint32_t version)
Definition: impeller.cc:58
ImpellerProcAddressCallback
void *IMPELLER_NULLABLE(* ImpellerProcAddressCallback)(const char *IMPELLER_NONNULL proc_name, void *IMPELLER_NULLABLE user_data)
Definition: impeller.h:310
impeller::interop::ImpellerParagraphStyleNew
IMPELLER_EXTERN_C ImpellerParagraphStyle ImpellerParagraphStyleNew()
Create a new paragraph style.
Definition: impeller.cc:915
impeller::TextureDescriptor::compression_type
CompressionType compression_type
Definition: texture_descriptor.h:46
impeller::interop::ImageFilter::MakeDilate
static ScopedObject< ImageFilter > MakeDilate(Scalar x_radius, Scalar y_radius)
Definition: image_filter.cc:26
impeller::interop::ImageFilter::MakeBlur
static ScopedObject< ImageFilter > MakeBlur(Scalar x_sigma, Scalar y_sigma, flutter::DlTileMode tile_mode)
Definition: image_filter.cc:16
impeller::interop::ImpellerPaintRelease
IMPELLER_EXTERN_C void ImpellerPaintRelease(ImpellerPaint paint)
Definition: impeller.cc:350
ImpellerColorMatrix
Definition: impeller.h:534
impeller::interop::ImpellerParagraphBuilderBuildParagraphNew
IMPELLER_EXTERN_C ImpellerParagraph ImpellerParagraphBuilderBuildParagraphNew(ImpellerParagraphBuilder paragraph_builder, float width)
Definition: impeller.cc:1062
impeller::interop::ImpellerTypographyContextRelease
IMPELLER_EXTERN_C void ImpellerTypographyContextRelease(ImpellerTypographyContext context)
Definition: impeller.cc:1134
ImpellerTextAlignment
ImpellerTextAlignment
Definition: impeller.h:423
IMPELLER_VERSION_GET_MAJOR
#define IMPELLER_VERSION_GET_MAJOR(version)
Definition: impeller.h:117
impeller::interop::ImpellerColorSourceCreateImageNew
IMPELLER_EXTERN_C ImpellerColorSource ImpellerColorSourceCreateImageNew(ImpellerTexture image, ImpellerTileMode horizontal_tile_mode, ImpellerTileMode vertical_tile_mode, ImpellerTextureSampling sampling, const ImpellerMatrix *transformation)
Definition: impeller.cc:785
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
ImpellerTextureDescriptor::size
ImpellerISize size
Definition: impeller.h:555
context.h
object.h
mask_filter.h
impeller::interop::ImageFilter::MakeCompose
static ScopedObject< ImageFilter > MakeCompose(const ImageFilter &outer, const ImageFilter &inner)
Definition: image_filter.cc:54
impeller::interop::ImpellerImageFilterCreateComposeNew
IMPELLER_EXTERN_C ImpellerImageFilter ImpellerImageFilterCreateComposeNew(ImpellerImageFilter outer, ImpellerImageFilter inner)
Definition: impeller.cc:884
impeller::interop::ImpellerColorFilterRelease
IMPELLER_EXTERN_C void ImpellerColorFilterRelease(ImpellerColorFilter color_filter)
Definition: impeller.cc:808
impeller::interop::ImpellerPaintNew
IMPELLER_EXTERN_C ImpellerPaint ImpellerPaintNew()
Create a new paint with default values.
Definition: impeller.cc:340
impeller::interop::ImpellerParagraphGetHeight
IMPELLER_EXTERN_C float ImpellerParagraphGetHeight(ImpellerParagraph paragraph)
Definition: impeller.cc:1084
impeller::interop::ImpellerTypographyContextRetain
IMPELLER_EXTERN_C void ImpellerTypographyContextRetain(ImpellerTypographyContext context)
Definition: impeller.cc:1129