| 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/geometry/scalar.h"
12 #include "impeller/renderer/backend/gles/context_gles.h"
13 #include "impeller/renderer/backend/gles/texture_gles.h"
14 #include "impeller/renderer/context.h"
15 #include "impeller/toolkit/interop/color_filter.h"
16 #include "impeller/toolkit/interop/color_source.h"
17 #include "impeller/toolkit/interop/context.h"
18 #include "impeller/toolkit/interop/dl_builder.h"
19 #include "impeller/toolkit/interop/formats.h"
20 #include "impeller/toolkit/interop/glyph_info.h"
21 #include "impeller/toolkit/interop/image_filter.h"
22 #include "impeller/toolkit/interop/line_metrics.h"
23 #include "impeller/toolkit/interop/mask_filter.h"
24 #include "impeller/toolkit/interop/object.h"
25 #include "impeller/toolkit/interop/paint.h"
26 #include "impeller/toolkit/interop/paragraph.h"
27 #include "impeller/toolkit/interop/paragraph_builder.h"
28 #include "impeller/toolkit/interop/paragraph_style.h"
29 #include "impeller/toolkit/interop/path.h"
30 #include "impeller/toolkit/interop/path_builder.h"
31 #include "impeller/toolkit/interop/surface.h"
32 #include "impeller/toolkit/interop/texture.h"
33 #include "impeller/toolkit/interop/typography_context.h"
34
35 #if IMPELLER_ENABLE_OPENGLES
36 #include "impeller/toolkit/interop/backend/gles/context_gles.h"
37 #include "impeller/toolkit/interop/backend/gles/surface_gles.h"
38 #endif // IMPELLER_ENABLE_OPENGLES
39
40 #if IMPELLER_ENABLE_METAL
41 #include "impeller/toolkit/interop/backend/metal/context_mtl.h"
42 #include "impeller/toolkit/interop/backend/metal/surface_mtl.h"
43 #endif // IMPELLER_ENABLE_METAL
44
45 #if IMPELLER_ENABLE_VULKAN
46 #include "impeller/toolkit/interop/backend/vulkan/context_vk.h"
47 #include "impeller/toolkit/interop/backend/vulkan/surface_vk.h"
48 #include "impeller/toolkit/interop/backend/vulkan/swapchain_vk.h"
49 #endif // IMPELLER_ENABLE_VULKAN
50
51 namespace impeller::interop {
52
53 #define DEFINE_PEER_GETTER(cxx_type, c_type) \
54 cxx_type* GetPeer(c_type object) { \
55 return reinterpret_cast<cxx_type*>(object); \
56 }
57
58 DEFINE_PEER_GETTER(ColorFilter, ImpellerColorFilter);
59 DEFINE_PEER_GETTER(ColorSource, ImpellerColorSource);
60 DEFINE_PEER_GETTER(Context, ImpellerContext);
61 DEFINE_PEER_GETTER(DisplayList, ImpellerDisplayList);
62 DEFINE_PEER_GETTER(DisplayListBuilder, ImpellerDisplayListBuilder);
63 DEFINE_PEER_GETTER(GlyphInfo, ImpellerGlyphInfo);
64 DEFINE_PEER_GETTER(ImageFilter, ImpellerImageFilter);
65 DEFINE_PEER_GETTER(LineMetrics, ImpellerLineMetrics);
66 DEFINE_PEER_GETTER(MaskFilter, ImpellerMaskFilter);
67 DEFINE_PEER_GETTER(Paint, ImpellerPaint);
68 DEFINE_PEER_GETTER(Paragraph, ImpellerParagraph);
69 DEFINE_PEER_GETTER(ParagraphBuilder, ImpellerParagraphBuilder);
70 DEFINE_PEER_GETTER(ParagraphStyle, ImpellerParagraphStyle);
71 DEFINE_PEER_GETTER(Path, ImpellerPath);
72 DEFINE_PEER_GETTER(PathBuilder, ImpellerPathBuilder);
73 DEFINE_PEER_GETTER(Surface, ImpellerSurface);
74 DEFINE_PEER_GETTER(SwapchainVK, ImpellerVulkanSwapchain);
75 DEFINE_PEER_GETTER(Texture, ImpellerTexture);
76 DEFINE_PEER_GETTER(TypographyContext, ImpellerTypographyContext);
77
78 static std::string GetVersionAsString(uint32_t version) {
79 std::stringstream stream;
80 stream << IMPELLER_VERSION_GET_VARIANT(version) << "."
81 << IMPELLER_VERSION_GET_MAJOR(version) << "."
82 << IMPELLER_VERSION_GET_MINOR(version) << "."
83 << IMPELLER_VERSION_GET_PATCH(version);
84 return stream.str();
85 }
86
87 IMPELLER_EXTERN_C
88 uint32_t ImpellerGetVersion() {
89 return IMPELLER_VERSION;
90 }
91
92 static bool CheckVersion(uint32_t version) {
93 if (version != IMPELLER_VERSION) {
94 VALIDATION_LOG << "This version of Impeller ("
95 << GetVersionAsString(ImpellerGetVersion()) << ") "
96 << "doesn't match the version the user expects ("
97 << GetVersionAsString(version) << ").";
98 return false;
99 }
100 return true;
101 }
102
103 IMPELLER_EXTERN_C
104 ImpellerContext ImpellerContextCreateOpenGLESNew(
105 uint32_t version,
106 ImpellerProcAddressCallback gl_proc_address_callback,
107 void* gl_proc_address_callback_user_data) {
108 if (!CheckVersion(version)) {
109 return nullptr;
110 }
111 #if IMPELLER_ENABLE_OPENGLES
112 auto context = ContextGLES::Create(
113 [gl_proc_address_callback,
114 gl_proc_address_callback_user_data](const char* proc_name) -> void* {
115 return gl_proc_address_callback(proc_name,
116 gl_proc_address_callback_user_data);
117 });
118 if (!context || !context->IsValid()) {
119 VALIDATION_LOG << "Could not create valid context.";
120 return nullptr;
121 }
122 return context.Leak();
123 #else // IMPELLER_ENABLE_OPENGLES
124 VALIDATION_LOG << "OpenGLES not available.";
125 return nullptr;
126 #endif // IMPELLER_ENABLE_OPENGLES
127 }
128
129 IMPELLER_EXTERN_C ImpellerContext ImpellerContextCreateMetalNew(
130 uint32_t version) {
131 if (!CheckVersion(version)) {
132 return nullptr;
133 }
134 #if IMPELLER_ENABLE_METAL
135 auto context = ContextMTL::Create();
136 if (!context || !context->IsValid()) {
137 VALIDATION_LOG << "Could not create valid context.";
138 return nullptr;
139 }
140 return context.Leak();
141 #else // IMPELLER_ENABLE_METAL
142 VALIDATION_LOG << "Metal not available.";
143 return nullptr;
144 #endif // IMPELLER_ENABLE_METAL
145 }
146
147 IMPELLER_EXTERN_C ImpellerContext ImpellerContextCreateVulkanNew(
148 uint32_t version,
149 const ImpellerContextVulkanSettings* settings) {
150 if (!CheckVersion(version)) {
151 return nullptr;
152 }
153 #if IMPELLER_ENABLE_VULKAN
154 auto context = ContextVK::Create(ContextVK::Settings(*settings));
155 if (!context || !context->IsValid()) {
156 VALIDATION_LOG << "Could not create valid context.";
157 return nullptr;
158 }
159 return context.Leak();
160 #else // IMPELLER_ENABLE_VULKAN
161 VALIDATION_LOG << "Vulkan not available.";
162 return nullptr;
163 #endif // IMPELLER_ENABLE_VULKAN
164 }
165
166 IMPELLER_EXTERN_C
167 void ImpellerContextRetain(ImpellerContext context) {
168 ObjectBase::SafeRetain(context);
169 }
170
171 IMPELLER_EXTERN_C
172 void ImpellerContextRelease(ImpellerContext context) {
173 ObjectBase::SafeRelease(context);
174 }
175
176 IMPELLER_EXTERN_C
177 bool ImpellerContextGetVulkanInfo(ImpellerContext IMPELLER_NONNULL context,
178 ImpellerContextVulkanInfo* out_vulkan_info) {
179 #if IMPELLER_ENABLE_VULKAN
180 if (!GetPeer(context)->IsVulkan()) {
181 VALIDATION_LOG << "Not a Vulkan context.";
182 return false;
183 }
184 return reinterpret_cast<ContextVK*>(GetPeer(context))
185 ->GetInfo(*out_vulkan_info);
186 #else // IMPELLER_ENABLE_VULKAN
187 VALIDATION_LOG << "Vulkan not available.";
188 return nullptr;
189 #endif // IMPELLER_ENABLE_VULKAN
190 }
191
192 IMPELLER_EXTERN_C
193 ImpellerVulkanSwapchain ImpellerVulkanSwapchainCreateNew(
194 ImpellerContext context,
195 void* vulkan_surface_khr) {
196 #if IMPELLER_ENABLE_VULKAN
197 return Create<SwapchainVK>(
198 *GetPeer(context), //
199 reinterpret_cast<VkSurfaceKHR>(vulkan_surface_khr) //
200 )
201 .Leak();
202 #else // IMPELLER_ENABLE_VULKAN
203 VALIDATION_LOG << "Vulkan not available.";
204 return nullptr;
205 #endif // IMPELLER_ENABLE_VULKAN
206 }
207
208 IMPELLER_EXTERN_C
209 void ImpellerVulkanSwapchainRetain(ImpellerVulkanSwapchain swapchain) {
210 ObjectBase::SafeRetain(swapchain);
211 }
212
213 IMPELLER_EXTERN_C
214 void ImpellerVulkanSwapchainRelease(ImpellerVulkanSwapchain swapchain) {
215 ObjectBase::SafeRelease(swapchain);
216 }
217
218 IMPELLER_EXTERN_C
219 ImpellerSurface ImpellerVulkanSwapchainAcquireNextSurfaceNew(
220 ImpellerVulkanSwapchain swapchain) {
221 return GetPeer(swapchain)->AcquireNextSurface().Leak();
222 }
223
224 IMPELLER_EXTERN_C ImpellerDisplayListBuilder ImpellerDisplayListBuilderNew(
225 const ImpellerRect* cull_rect) {
226 return Create<DisplayListBuilder>(cull_rect).Leak();
227 }
228
229 IMPELLER_EXTERN_C
230 void ImpellerDisplayListBuilderRetain(ImpellerDisplayListBuilder builder) {
231 ObjectBase::SafeRetain(builder);
232 }
233
234 IMPELLER_EXTERN_C
235 void ImpellerDisplayListBuilderRelease(ImpellerDisplayListBuilder builder) {
236 ObjectBase::SafeRelease(builder);
237 }
238
239 IMPELLER_EXTERN_C
240 void ImpellerDisplayListBuilderSave(ImpellerDisplayListBuilder builder) {
241 GetPeer(builder)->Save();
242 }
243
244 IMPELLER_EXTERN_C
245 void ImpellerDisplayListBuilderSaveLayer(ImpellerDisplayListBuilder builder,
246 const ImpellerRect* bounds,
247 ImpellerPaint paint,
248 ImpellerImageFilter backdrop) {
249 GetPeer(builder)->SaveLayer(ToImpellerType(*bounds), //
250 GetPeer(paint), //
251 GetPeer(backdrop) //
252 );
253 }
254
255 IMPELLER_EXTERN_C
256 void ImpellerDisplayListBuilderRestore(ImpellerDisplayListBuilder builder) {
257 GetPeer(builder)->Restore();
258 }
259
260 IMPELLER_EXTERN_C
261 void ImpellerDisplayListBuilderScale(ImpellerDisplayListBuilder builder,
262 float x_scale,
263 float y_scale) {
264 GetPeer(builder)->Scale(Size{x_scale, y_scale});
265 }
266
267 IMPELLER_EXTERN_C
268 void ImpellerDisplayListBuilderRotate(ImpellerDisplayListBuilder builder,
269 float angle_degrees) {
270 GetPeer(builder)->Rotate(Degrees{angle_degrees});
271 }
272
273 IMPELLER_EXTERN_C
274 void ImpellerDisplayListBuilderTranslate(ImpellerDisplayListBuilder builder,
275 float x_translation,
276 float y_translation) {
277 GetPeer(builder)->Translate(Point{x_translation, y_translation});
278 }
279
280 IMPELLER_EXTERN_C
281 void ImpellerDisplayListBuilderSetTransform(ImpellerDisplayListBuilder builder,
282 const ImpellerMatrix* transform) {
283 GetPeer(builder)->SetTransform(ToImpellerType(*transform));
284 }
285
286 IMPELLER_EXTERN_C
287 void ImpellerDisplayListBuilderTransform(ImpellerDisplayListBuilder builder,
288 const ImpellerMatrix* transform) {
289 GetPeer(builder)->Transform(ToImpellerType(*transform));
290 }
291
292 IMPELLER_EXTERN_C
293 void ImpellerDisplayListBuilderGetTransform(ImpellerDisplayListBuilder builder,
294 ImpellerMatrix* out_transform) {
295 FromImpellerType(GetPeer(builder)->GetTransform(), *out_transform);
296 }
297
298 IMPELLER_EXTERN_C
299 void ImpellerDisplayListBuilderResetTransform(
300 ImpellerDisplayListBuilder builder) {
301 GetPeer(builder)->ResetTransform();
302 }
303
304 IMPELLER_EXTERN_C
305 uint32_t ImpellerDisplayListBuilderGetSaveCount(
306 ImpellerDisplayListBuilder builder) {
307 return GetPeer(builder)->GetSaveCount();
308 }
309
310 IMPELLER_EXTERN_C
311 void ImpellerDisplayListBuilderRestoreToCount(
312 ImpellerDisplayListBuilder builder,
313 uint32_t count) {
314 GetPeer(builder)->RestoreToCount(count);
315 }
316
317 IMPELLER_EXTERN_C
318 void ImpellerPathRetain(ImpellerPath path) {
319 ObjectBase::SafeRetain(path);
320 }
321
322 IMPELLER_EXTERN_C
323 void ImpellerPathRelease(ImpellerPath path) {
324 ObjectBase::SafeRelease(path);
325 }
326
327 IMPELLER_EXTERN_C
328 ImpellerPathBuilder ImpellerPathBuilderNew() {
329 return Create<PathBuilder>().Leak();
330 }
331
332 IMPELLER_EXTERN_C
333 void ImpellerPathBuilderRetain(ImpellerPathBuilder builder) {
334 ObjectBase::SafeRetain(builder);
335 }
336
337 IMPELLER_EXTERN_C
338 void ImpellerPathBuilderRelease(ImpellerPathBuilder builder) {
339 ObjectBase::SafeRelease(builder);
340 }
341
342 IMPELLER_EXTERN_C
343 void ImpellerPathBuilderMoveTo(ImpellerPathBuilder builder,
344 const ImpellerPoint* location) {
345 GetPeer(builder)->MoveTo(ToImpellerType(*location));
346 }
347
348 IMPELLER_EXTERN_C
349 void ImpellerPathBuilderLineTo(ImpellerPathBuilder builder,
350 const ImpellerPoint* location) {
351 GetPeer(builder)->LineTo(ToImpellerType(*location));
352 }
353
354 IMPELLER_EXTERN_C
355 void ImpellerPathBuilderQuadraticCurveTo(ImpellerPathBuilder builder,
356 const ImpellerPoint* control_point,
357 const ImpellerPoint* end_point) {
358 GetPeer(builder)->QuadraticCurveTo(ToImpellerType(*control_point),
359 ToImpellerType(*end_point));
360 }
361
362 IMPELLER_EXTERN_C
363 void ImpellerPathBuilderCubicCurveTo(ImpellerPathBuilder builder,
364 const ImpellerPoint* control_point_1,
365 const ImpellerPoint* control_point_2,
366 const ImpellerPoint* end_point) {
367 GetPeer(builder)->CubicCurveTo(ToImpellerType(*control_point_1), //
368 ToImpellerType(*control_point_2), //
369 ToImpellerType(*end_point) //
370 );
371 }
372
373 IMPELLER_EXTERN_C
374 void ImpellerPathBuilderAddRect(ImpellerPathBuilder builder,
375 const ImpellerRect* rect) {
376 GetPeer(builder)->AddRect(ToImpellerType(*rect));
377 }
378
379 IMPELLER_EXTERN_C
380 void ImpellerPathBuilderAddArc(ImpellerPathBuilder builder,
381 const ImpellerRect* oval_bounds,
382 float start_angle_degrees,
383 float end_angle_degrees) {
384 GetPeer(builder)->AddArc(ToImpellerType(*oval_bounds), //
385 Degrees{start_angle_degrees}, //
386 Degrees{end_angle_degrees} //
387 );
388 }
389
390 IMPELLER_EXTERN_C
391 void ImpellerPathBuilderAddOval(ImpellerPathBuilder builder,
392 const ImpellerRect* oval_bounds) {
393 GetPeer(builder)->AddOval(ToImpellerType(*oval_bounds));
394 }
395
396 IMPELLER_EXTERN_C
397 void ImpellerPathBuilderAddRoundedRect(
398 ImpellerPathBuilder builder,
399 const ImpellerRect* rect,
400 const ImpellerRoundingRadii* rounding_radii) {
401 GetPeer(builder)->AddRoundedRect(ToImpellerType(*rect),
402 ToImpellerType(*rounding_radii));
403 }
404
405 IMPELLER_EXTERN_C
406 void ImpellerPathBuilderClose(ImpellerPathBuilder builder) {
407 GetPeer(builder)->Close();
408 }
409
410 IMPELLER_EXTERN_C
411 ImpellerPath ImpellerPathBuilderCopyPathNew(ImpellerPathBuilder builder,
412 ImpellerFillType fill) {
413 return GetPeer(builder)->CopyPath(ToImpellerType(fill)).Leak();
414 }
415
416 IMPELLER_EXTERN_C
417 ImpellerPath ImpellerPathBuilderTakePathNew(ImpellerPathBuilder builder,
418 ImpellerFillType fill) {
419 return GetPeer(builder)->TakePath(ToImpellerType(fill)).Leak();
420 }
421
422 IMPELLER_EXTERN_C
423 void ImpellerDisplayListBuilderClipRect(ImpellerDisplayListBuilder builder,
424 const ImpellerRect* rect,
425 ImpellerClipOperation op) {
426 GetPeer(builder)->ClipRect(ToImpellerType(*rect), ToImpellerType(op));
427 }
428
429 IMPELLER_EXTERN_C
430 void ImpellerDisplayListBuilderClipOval(ImpellerDisplayListBuilder builder,
431 const ImpellerRect* oval_bounds,
432 ImpellerClipOperation op) {
433 GetPeer(builder)->ClipOval(ToImpellerType(*oval_bounds), ToImpellerType(op));
434 }
435
436 IMPELLER_EXTERN_C
437 void ImpellerDisplayListBuilderClipRoundedRect(
438 ImpellerDisplayListBuilder builder,
439 const ImpellerRect* rect,
440 const ImpellerRoundingRadii* radii,
441 ImpellerClipOperation op) {
442 GetPeer(builder)->ClipRoundedRect(ToImpellerType(*rect), //
443 ToImpellerType(*radii), //
444 ToImpellerType(op) //
445 );
446 }
447
448 IMPELLER_EXTERN_C
449 void ImpellerDisplayListBuilderClipPath(ImpellerDisplayListBuilder builder,
450 ImpellerPath path,
451 ImpellerClipOperation op) {
452 GetPeer(builder)->ClipPath(*GetPeer(path), ToImpellerType(op));
453 }
454
455 IMPELLER_EXTERN_C
456 ImpellerPaint ImpellerPaintNew() {
457 return Create<Paint>().Leak();
458 }
459
460 IMPELLER_EXTERN_C
461 void ImpellerPaintRetain(ImpellerPaint paint) {
462 ObjectBase::SafeRetain(paint);
463 }
464
465 IMPELLER_EXTERN_C
466 void ImpellerPaintRelease(ImpellerPaint paint) {
467 ObjectBase::SafeRelease(paint);
468 }
469
470 IMPELLER_EXTERN_C
471 void ImpellerPaintSetColor(ImpellerPaint paint, const ImpellerColor* color) {
472 GetPeer(paint)->SetColor(ToDisplayListType(*color));
473 }
474
475 IMPELLER_EXTERN_C
476 void ImpellerPaintSetBlendMode(ImpellerPaint paint, ImpellerBlendMode mode) {
477 GetPeer(paint)->SetBlendMode(ToImpellerType(mode));
478 }
479
480 IMPELLER_EXTERN_C
481 void ImpellerPaintSetDrawStyle(ImpellerPaint paint, ImpellerDrawStyle style) {
482 GetPeer(paint)->SetDrawStyle(ToDisplayListType(style));
483 }
484
485 IMPELLER_EXTERN_C
486 void ImpellerPaintSetStrokeCap(ImpellerPaint paint, ImpellerStrokeCap cap) {
487 GetPeer(paint)->SetStrokeCap(ToDisplayListType(cap));
488 }
489
490 IMPELLER_EXTERN_C
491 void ImpellerPaintSetStrokeJoin(ImpellerPaint paint, ImpellerStrokeJoin join) {
492 GetPeer(paint)->SetStrokeJoin(ToDisplayListType(join));
493 }
494
495 IMPELLER_EXTERN_C
496 void ImpellerPaintSetStrokeWidth(ImpellerPaint paint, float width) {
497 GetPeer(paint)->SetStrokeWidth(width);
498 }
499
500 IMPELLER_EXTERN_C
501 void ImpellerPaintSetStrokeMiter(ImpellerPaint paint, float miter) {
502 GetPeer(paint)->SetStrokeMiter(miter);
503 }
504
505 IMPELLER_EXTERN_C
506 void ImpellerDisplayListBuilderDrawPaint(ImpellerDisplayListBuilder builder,
507 ImpellerPaint paint) {
508 GetPeer(builder)->DrawPaint(*GetPeer(paint));
509 }
510
511 IMPELLER_EXTERN_C
512 void ImpellerDisplayListBuilderDrawLine(ImpellerDisplayListBuilder builder,
513 const ImpellerPoint* from,
514 const ImpellerPoint* to,
515 ImpellerPaint paint) {
516 GetPeer(builder)->DrawLine(ToImpellerType(*from), //
517 ToImpellerType(*to), //
518 *GetPeer(paint) //
519 );
520 }
521
522 IMPELLER_EXTERN_C
523 void ImpellerDisplayListBuilderDrawDashedLine(
524 ImpellerDisplayListBuilder builder,
525 const ImpellerPoint* from,
526 const ImpellerPoint* to,
527 float on_length,
528 float off_length,
529 ImpellerPaint paint) {
530 GetPeer(builder)->DrawDashedLine(ToImpellerType(*from), //
531 ToImpellerType(*to), //
532 on_length, //
533 off_length, //
534 *GetPeer(paint) //
535 );
536 }
537
538 IMPELLER_EXTERN_C
539 void ImpellerDisplayListBuilderDrawRect(ImpellerDisplayListBuilder builder,
540 const ImpellerRect* rect,
541 ImpellerPaint paint) {
542 GetPeer(builder)->DrawRect(ToImpellerType(*rect), *GetPeer(paint));
543 }
544
545 IMPELLER_EXTERN_C
546 void ImpellerDisplayListBuilderDrawOval(ImpellerDisplayListBuilder builder,
547 const ImpellerRect* oval_bounds,
548 ImpellerPaint paint) {
549 GetPeer(builder)->DrawOval(ToImpellerType(*oval_bounds), *GetPeer(paint));
550 }
551
552 IMPELLER_EXTERN_C
553 void ImpellerDisplayListBuilderDrawRoundedRect(
554 ImpellerDisplayListBuilder builder,
555 const ImpellerRect* rect,
556 const ImpellerRoundingRadii* radii,
557 ImpellerPaint paint) {
558 GetPeer(builder)->DrawRoundedRect(ToImpellerType(*rect), //
559 ToImpellerType(*radii), //
560 *GetPeer(paint) //
561 );
562 }
563
564 IMPELLER_EXTERN_C
565 void ImpellerDisplayListBuilderDrawRoundedRectDifference(
566 ImpellerDisplayListBuilder builder,
567 const ImpellerRect* outer_rect,
568 const ImpellerRoundingRadii* outer_radii,
569 const ImpellerRect* inner_rect,
570 const ImpellerRoundingRadii* inner_radii,
571 ImpellerPaint paint) {
572 GetPeer(builder)->DrawRoundedRectDifference(ToImpellerType(*outer_rect), //
573 ToImpellerType(*outer_radii), //
574 ToImpellerType(*inner_rect), //
575 ToImpellerType(*inner_radii), //
576 *GetPeer(paint) //
577 );
578 }
579
580 IMPELLER_EXTERN_C
581 void ImpellerDisplayListBuilderDrawPath(ImpellerDisplayListBuilder builder,
582 ImpellerPath path,
583 ImpellerPaint paint) {
584 GetPeer(builder)->DrawPath(*GetPeer(path), *GetPeer(paint));
585 }
586
587 IMPELLER_EXTERN_C
588 ImpellerTexture ImpellerTextureCreateWithContentsNew(
589 ImpellerContext context,
590 const ImpellerTextureDescriptor* descriptor,
591 const ImpellerMapping* contents,
592 void* contents_on_release_user_data) {
593 TextureDescriptor desc;
594 desc.storage_mode = StorageMode::kHostVisible;
595 desc.type = TextureType::kTexture2D;
596 desc.format = ToImpellerType(descriptor->pixel_format);
597 desc.size = ToImpellerType(descriptor->size);
598 desc.mip_count = std::min(descriptor->mip_count, 1u);
599 desc.usage = TextureUsage::kShaderRead;
600 desc.compression_type = CompressionType::kLossless;
601 auto texture = Create<Texture>(*GetPeer(context), desc);
602 if (!texture->IsValid()) {
603 VALIDATION_LOG << "Could not create texture.";
604 return nullptr;
605 }
606 // Depending on whether the de-allocation can be delayed, it may be possible
607 // to avoid a data copy.
608 if (contents->on_release) {
609 // Avoids data copy.
610 auto wrapped_contents = std::make_shared<fml::NonOwnedMapping>(
611 contents->data, // data ptr
612 contents->length, // data length
613 [on_release = contents->on_release, contents_on_release_user_data](
614 auto, auto) {
615 on_release(contents_on_release_user_data);
616 } // release callback
617 );
618 if (!texture->SetContents(std::move(wrapped_contents))) {
619 VALIDATION_LOG << "Could not set texture contents.";
620 return nullptr;
621 }
622 } else {
623 // May copy.
624 if (!texture->SetContents(contents->data, contents->length)) {
625 VALIDATION_LOG << "Could not set texture contents.";
626 return nullptr;
627 }
628 }
629 return texture.Leak();
630 }
631
632 IMPELLER_EXTERN_C
633 ImpellerTexture ImpellerTextureCreateWithOpenGLTextureHandleNew(
634 ImpellerContext context,
635 const ImpellerTextureDescriptor* descriptor,
636 uint64_t external_gl_handle) {
637 auto impeller_context = GetPeer(context)->GetContext();
638 if (impeller_context->GetBackendType() !=
639 impeller::Context::BackendType::kOpenGLES) {
640 VALIDATION_LOG << "Context is not OpenGL.";
641 return nullptr;
642 }
643
644 const auto& impeller_context_gl =
645 impeller::ContextGLES::Cast(*impeller_context);
646 const auto& reactor = impeller_context_gl.GetReactor();
647
648 TextureDescriptor desc;
649 desc.storage_mode = StorageMode::kDevicePrivate;
650 desc.type = TextureType::kTexture2D;
651 desc.format = ToImpellerType(descriptor->pixel_format);
652 desc.size = ToImpellerType(descriptor->size);
653 desc.mip_count = std::min(descriptor->mip_count, 1u);
654 desc.usage = TextureUsage::kShaderRead;
655 desc.compression_type = CompressionType::kLossless;
656
657 auto texture = TextureGLES::WrapTexture(
658 reactor, //
659 desc, //
660 reactor->CreateHandle(HandleType::kTexture, external_gl_handle) //
661 );
662 if (!texture || !texture->IsValid()) {
663 VALIDATION_LOG << "Could not wrap external texture.";
664 return nullptr;
665 }
666 texture->SetCoordinateSystem(TextureCoordinateSystem::kUploadFromHost);
667 return Create<Texture>(impeller::Context::BackendType::kOpenGLES,
668 std::move(texture))
669 .Leak();
670 }
671
672 IMPELLER_EXTERN_C
673 void ImpellerTextureRetain(ImpellerTexture texture) {
674 ObjectBase::SafeRetain(texture);
675 }
676
677 IMPELLER_EXTERN_C
678 void ImpellerTextureRelease(ImpellerTexture texture) {
679 ObjectBase::SafeRelease(texture);
680 }
681
682 IMPELLER_EXTERN_C
683 uint64_t ImpellerTextureGetOpenGLHandle(ImpellerTexture texture) {
684 auto interop_texture = GetPeer(texture);
685 if (interop_texture->GetBackendType() !=
686 impeller::Context::BackendType::kOpenGLES) {
687 VALIDATION_LOG << "Can only fetch the texture handle of an OpenGL texture.";
688 return 0u;
689 }
690 return TextureGLES::Cast(*interop_texture->GetTexture())
691 .GetGLHandle()
692 .value_or(0u);
693 }
694
695 IMPELLER_EXTERN_C
696 void ImpellerDisplayListRetain(ImpellerDisplayList display_list) {
697 ObjectBase::SafeRetain(display_list);
698 }
699
700 IMPELLER_EXTERN_C
701 void ImpellerDisplayListRelease(ImpellerDisplayList display_list) {
702 ObjectBase::SafeRelease(display_list);
703 }
704
705 IMPELLER_EXTERN_C
706 ImpellerDisplayList ImpellerDisplayListBuilderCreateDisplayListNew(
707 ImpellerDisplayListBuilder builder) {
708 auto dl = GetPeer(builder)->Build();
709 if (!dl->IsValid()) {
710 return nullptr;
711 }
712 return dl.Leak();
713 }
714
715 IMPELLER_EXTERN_C
716 void ImpellerDisplayListBuilderDrawDisplayList(
717 ImpellerDisplayListBuilder builder,
718 ImpellerDisplayList display_list,
719 float opacity) {
720 GetPeer(builder)->DrawDisplayList(*GetPeer(display_list), opacity);
721 }
722
723 IMPELLER_EXTERN_C
724 ImpellerSurface ImpellerSurfaceCreateWrappedFBONew(ImpellerContext context,
725 uint64_t fbo,
726 ImpellerPixelFormat format,
727 const ImpellerISize* size) {
728 #if IMPELLER_ENABLE_OPENGLES
729 if (!GetPeer(context)->IsGL()) {
730 VALIDATION_LOG << "Context is not OpenGL.";
731 return nullptr;
732 }
733 return Create<SurfaceGLES>(*GetPeer(context), //
734 fbo, //
735 ToImpellerType(format), //
736 ToImpellerType(*size)) //
737 .Leak();
738 #else // IMPELLER_ENABLE_OPENGLES
739 VALIDATION_LOG << "OpenGL unavailable.";
740 return nullptr;
741 #endif // IMPELLER_ENABLE_OPENGLES
742 }
743
744 IMPELLER_EXTERN_C
745 ImpellerSurface ImpellerSurfaceCreateWrappedMetalDrawableNew(
746 ImpellerContext context,
747 void* metal_drawable) {
748 #if IMPELLER_ENABLE_METAL
749 if (!GetPeer(context)->IsMetal()) {
750 VALIDATION_LOG << "Context is not Metal.";
751 return nullptr;
752 }
753 return Create<SurfaceMTL>(*GetPeer(context), metal_drawable).Leak();
754 #else // IMPELLER_ENABLE_METAL
755 VALIDATION_LOG << "Metal unavailable.";
756 return nullptr;
757 #endif // IMPELLER_ENABLE_METAL
758 }
759
760 IMPELLER_EXTERN_C void ImpellerSurfaceRetain(ImpellerSurface surface) {
761 ObjectBase::SafeRetain(surface);
762 }
763
764 IMPELLER_EXTERN_C
765 void ImpellerSurfaceRelease(ImpellerSurface surface) {
766 ObjectBase::SafeRelease(surface);
767 }
768
769 IMPELLER_EXTERN_C
770 bool ImpellerSurfaceDrawDisplayList(ImpellerSurface surface,
771 ImpellerDisplayList display_list) {
772 return GetPeer(surface)->DrawDisplayList(*GetPeer(display_list));
773 }
774
775 IMPELLER_EXTERN_C
776 bool ImpellerSurfacePresent(ImpellerSurface surface) {
777 return GetPeer(surface)->Present();
778 }
779
780 IMPELLER_EXTERN_C
781 void ImpellerDisplayListBuilderDrawTexture(ImpellerDisplayListBuilder builder,
782 ImpellerTexture texture,
783 const ImpellerPoint* point,
784 ImpellerTextureSampling sampling,
785 ImpellerPaint paint) {
786 GetPeer(builder)->DrawTexture(*GetPeer(texture), //
787 ToImpellerType(*point), //
788 ToDisplayListType(sampling), //
789 GetPeer(paint) //
790 );
791 }
792
793 IMPELLER_EXTERN_C
794 void ImpellerDisplayListBuilderDrawTextureRect(
795 ImpellerDisplayListBuilder builder,
796 ImpellerTexture texture,
797 const ImpellerRect* src_rect,
798 const ImpellerRect* dst_rect,
799 ImpellerTextureSampling sampling,
800 ImpellerPaint paint) {
801 GetPeer(builder)->DrawTextureRect(*GetPeer(texture), //
802 ToImpellerType(*src_rect), //
803 ToImpellerType(*dst_rect), //
804 ToDisplayListType(sampling), //
805 GetPeer(paint) //
806 );
807 }
808
809 IMPELLER_EXTERN_C
810 void ImpellerColorSourceRetain(ImpellerColorSource color_source) {
811 ObjectBase::SafeRetain(color_source);
812 }
813
814 IMPELLER_EXTERN_C
815 void ImpellerColorSourceRelease(ImpellerColorSource color_source) {
816 ObjectBase::SafeRelease(color_source);
817 }
818
819 static std::pair<std::vector<flutter::DlColor>, std::vector<Scalar>>
820 ParseColorsAndStops(uint32_t stop_count,
821 const ImpellerColor* colors,
822 const float* stops) {
823 if (stop_count == 0) {
824 return {};
825 }
826 std::pair<std::vector<flutter::DlColor>, std::vector<Scalar>> result;
827 result.first.reserve(stop_count);
828 result.second.reserve(stop_count);
829 for (size_t i = 0; i < stop_count; i++) {
830 result.first.emplace_back(ToDisplayListType(colors[i]));
831 result.second.emplace_back(stops[i]);
832 }
833 return result;
834 }
835
836 IMPELLER_EXTERN_C
837 ImpellerColorSource ImpellerColorSourceCreateLinearGradientNew(
838 const ImpellerPoint* start_point,
839 const ImpellerPoint* end_point,
840 uint32_t stop_count,
841 const ImpellerColor* colors,
842 const float* stops,
843 ImpellerTileMode tile_mode,
844 const ImpellerMatrix* transformation) {
845 const auto colors_and_stops = ParseColorsAndStops(stop_count, colors, stops);
846 return ColorSource::MakeLinearGradient(
847 ToImpellerType(*start_point), //
848 ToImpellerType(*end_point), //
849 colors_and_stops.first, //
850 colors_and_stops.second, //
851 ToDisplayListType(tile_mode), //
852 transformation == nullptr ? Matrix{}
853 : ToImpellerType(*transformation) //
854 )
855 .Leak();
856 }
857
858 IMPELLER_EXTERN_C
859 ImpellerColorSource ImpellerColorSourceCreateRadialGradientNew(
860 const ImpellerPoint* center,
861 float radius,
862 uint32_t stop_count,
863 const ImpellerColor* colors,
864 const float* stops,
865 ImpellerTileMode tile_mode,
866 const ImpellerMatrix* transformation) {
867 const auto colors_and_stops = ParseColorsAndStops(stop_count, colors, stops);
868 return ColorSource::MakeRadialGradient(
869 ToImpellerType(*center), //
870 radius, //
871 colors_and_stops.first, //
872 colors_and_stops.second, //
873 ToDisplayListType(tile_mode), //
874 transformation == nullptr ? Matrix{}
875 : ToImpellerType(*transformation) //
876 )
877 .Leak();
878 }
879
880 IMPELLER_EXTERN_C
881 ImpellerColorSource ImpellerColorSourceCreateConicalGradientNew(
882 const ImpellerPoint* start_center,
883 float start_radius,
884 const ImpellerPoint* end_center,
885 float end_radius,
886 uint32_t stop_count,
887 const ImpellerColor* colors,
888 const float* stops,
889 ImpellerTileMode tile_mode,
890 const ImpellerMatrix* transformation) {
891 const auto colors_and_stops = ParseColorsAndStops(stop_count, colors, stops);
892 return ColorSource::MakeConicalGradient(
893 ToImpellerType(*start_center), //
894 start_radius, //
895 ToImpellerType(*end_center), //
896 end_radius, //
897 colors_and_stops.first, //
898 colors_and_stops.second, //
899 ToDisplayListType(tile_mode), //
900 transformation == nullptr ? Matrix{}
901 : ToImpellerType(*transformation) //
902 )
903 .Leak();
904 }
905
906 IMPELLER_EXTERN_C
907 ImpellerColorSource ImpellerColorSourceCreateSweepGradientNew(
908 const ImpellerPoint* center,
909 float start,
910 float end,
911 uint32_t stop_count,
912 const ImpellerColor* colors,
913 const float* stops,
914 ImpellerTileMode tile_mode,
915 const ImpellerMatrix* transformation) {
916 const auto colors_and_stops = ParseColorsAndStops(stop_count, colors, stops);
917 return ColorSource::MakeSweepGradient(
918 ToImpellerType(*center), //
919 start, //
920 end, //
921 colors_and_stops.first, //
922 colors_and_stops.second, //
923 ToDisplayListType(tile_mode), //
924 transformation == nullptr ? Matrix{}
925 : ToImpellerType(*transformation) //
926 )
927 .Leak();
928 }
929
930 IMPELLER_EXTERN_C
931 ImpellerColorSource ImpellerColorSourceCreateImageNew(
932 ImpellerTexture image,
933 ImpellerTileMode horizontal_tile_mode,
934 ImpellerTileMode vertical_tile_mode,
935 ImpellerTextureSampling sampling,
936 const ImpellerMatrix* transformation) {
937 return ColorSource::MakeImage(
938 *GetPeer(image), //
939 ToDisplayListType(horizontal_tile_mode), //
940 ToDisplayListType(vertical_tile_mode), //
941 ToDisplayListType(sampling), //
942 transformation == nullptr ? Matrix{}
943 : ToImpellerType(*transformation) //
944 )
945 .Leak();
946 }
947
948 IMPELLER_EXTERN_C
949 void ImpellerColorFilterRetain(ImpellerColorFilter color_filter) {
950 ObjectBase::SafeRetain(color_filter);
951 }
952
953 IMPELLER_EXTERN_C
954 void ImpellerColorFilterRelease(ImpellerColorFilter color_filter) {
955 ObjectBase::SafeRelease(color_filter);
956 }
957
958 IMPELLER_EXTERN_C
959 ImpellerColorFilter ImpellerColorFilterCreateBlendNew(
960 const ImpellerColor* color,
961 ImpellerBlendMode blend_mode) {
962 return ColorFilter::MakeBlend(ToImpellerType(*color),
963 ToImpellerType(blend_mode))
964 .Leak();
965 }
966
967 IMPELLER_EXTERN_C
968 ImpellerColorFilter ImpellerColorFilterCreateColorMatrixNew(
969 const ImpellerColorMatrix* color_matrix) {
970 return ColorFilter::MakeMatrix(color_matrix->m).Leak();
971 }
972
973 IMPELLER_EXTERN_C
974 void ImpellerMaskFilterRetain(ImpellerMaskFilter mask_filter) {
975 ObjectBase::SafeRetain(mask_filter);
976 }
977
978 IMPELLER_EXTERN_C
979 void ImpellerMaskFilterRelease(ImpellerMaskFilter mask_filter) {
980 ObjectBase::SafeRelease(mask_filter);
981 }
982
983 IMPELLER_EXTERN_C
984 ImpellerMaskFilter ImpellerMaskFilterCreateBlurNew(ImpellerBlurStyle style,
985 float sigma) {
986 return MaskFilter::MakeBlur(ToDisplayListType(style), sigma).Leak();
987 }
988
989 IMPELLER_EXTERN_C
990 void ImpellerImageFilterRetain(ImpellerImageFilter image_filter) {
991 ObjectBase::SafeRetain(image_filter);
992 }
993
994 IMPELLER_EXTERN_C
995 void ImpellerImageFilterRelease(ImpellerImageFilter image_filter) {
996 ObjectBase::SafeRelease(image_filter);
997 }
998
999 IMPELLER_EXTERN_C
1000 ImpellerImageFilter ImpellerImageFilterCreateBlurNew(
1001 float x_sigma,
1002 float y_sigma,
1003 ImpellerTileMode tile_mode) {
1004 return ImageFilter::MakeBlur(x_sigma, y_sigma, ToDisplayListType(tile_mode))
1005 .Leak();
1006 }
1007
1008 IMPELLER_EXTERN_C
1009 ImpellerImageFilter ImpellerImageFilterCreateDilateNew(float x_radius,
1010 float y_radius) {
1011 return ImageFilter::MakeDilate(x_radius, y_radius).Leak();
1012 }
1013
1014 IMPELLER_EXTERN_C
1015 ImpellerImageFilter ImpellerImageFilterCreateErodeNew(float x_radius,
1016 float y_radius) {
1017 return ImageFilter::MakeErode(x_radius, y_radius).Leak();
1018 }
1019
1020 IMPELLER_EXTERN_C
1021 ImpellerImageFilter ImpellerImageFilterCreateMatrixNew(
1022 const ImpellerMatrix* matrix,
1023 ImpellerTextureSampling sampling) {
1024 return ImageFilter::MakeMatrix(ToImpellerType(*matrix),
1025 ToDisplayListType(sampling))
1026 .Leak();
1027 }
1028
1029 IMPELLER_EXTERN_C
1030 ImpellerImageFilter ImpellerImageFilterCreateComposeNew(
1031 ImpellerImageFilter outer,
1032 ImpellerImageFilter inner) {
1033 return ImageFilter::MakeCompose(*GetPeer(outer), *GetPeer(inner)).Leak();
1034 }
1035
1036 IMPELLER_EXTERN_C
1037 void ImpellerPaintSetColorFilter(ImpellerPaint paint,
1038 ImpellerColorFilter color_filter) {
1039 GetPeer(paint)->SetColorFilter(*GetPeer(color_filter));
1040 }
1041
1042 IMPELLER_EXTERN_C
1043 void ImpellerPaintSetColorSource(ImpellerPaint paint,
1044 ImpellerColorSource color_source) {
1045 GetPeer(paint)->SetColorSource(*GetPeer(color_source));
1046 }
1047
1048 IMPELLER_EXTERN_C
1049 void ImpellerPaintSetImageFilter(ImpellerPaint paint,
1050 ImpellerImageFilter image_filter) {
1051 GetPeer(paint)->SetImageFilter(*GetPeer(image_filter));
1052 }
1053
1054 IMPELLER_EXTERN_C
1055 void ImpellerPaintSetMaskFilter(ImpellerPaint paint,
1056 ImpellerMaskFilter mask_filter) {
1057 GetPeer(paint)->SetMaskFilter(*GetPeer(mask_filter));
1058 }
1059
1060 IMPELLER_EXTERN_C
1061 ImpellerParagraphStyle ImpellerParagraphStyleNew() {
1062 return Create<ParagraphStyle>().Leak();
1063 }
1064
1065 IMPELLER_EXTERN_C
1066 void ImpellerParagraphStyleRetain(ImpellerParagraphStyle paragraph_style) {
1067 ObjectBase::SafeRetain(paragraph_style);
1068 }
1069
1070 IMPELLER_EXTERN_C
1071 void ImpellerParagraphStyleRelease(ImpellerParagraphStyle paragraph_style) {
1072 ObjectBase::SafeRelease(paragraph_style);
1073 }
1074
1075 IMPELLER_EXTERN_C
1076 void ImpellerParagraphStyleSetForeground(ImpellerParagraphStyle paragraph_style,
1077 ImpellerPaint paint) {
1078 GetPeer(paragraph_style)->SetForeground(Ref(GetPeer(paint)));
1079 }
1080
1081 IMPELLER_EXTERN_C
1082 void ImpellerParagraphStyleSetBackground(ImpellerParagraphStyle paragraph_style,
1083 ImpellerPaint paint) {
1084 GetPeer(paragraph_style)->SetBackground(Ref(GetPeer(paint)));
1085 }
1086
1087 IMPELLER_EXTERN_C
1088 void ImpellerParagraphStyleSetFontWeight(ImpellerParagraphStyle paragraph_style,
1089 ImpellerFontWeight weight) {
1090 GetPeer(paragraph_style)->SetFontWeight(ToTxtType(weight));
1091 }
1092
1093 IMPELLER_EXTERN_C
1094 void ImpellerParagraphStyleSetFontStyle(ImpellerParagraphStyle paragraph_style,
1095 ImpellerFontStyle style) {
1096 GetPeer(paragraph_style)->SetFontStyle(ToTxtType(style));
1097 }
1098
1099 static std::string ReadString(const char* string) {
1100 if (string == nullptr) {
1101 return "";
1102 }
1103 return std::string{string};
1104 }
1105
1106 IMPELLER_EXTERN_C
1107 void ImpellerParagraphStyleSetFontFamily(ImpellerParagraphStyle paragraph_style,
1108 const char* family_name) {
1109 GetPeer(paragraph_style)->SetFontFamily(ReadString(family_name));
1110 }
1111
1112 IMPELLER_EXTERN_C
1113 void ImpellerParagraphStyleSetFontSize(ImpellerParagraphStyle paragraph_style,
1114 float size) {
1115 GetPeer(paragraph_style)->SetFontSize(size);
1116 }
1117
1118 IMPELLER_EXTERN_C
1119 void ImpellerParagraphStyleSetHeight(ImpellerParagraphStyle paragraph_style,
1120 float height) {
1121 GetPeer(paragraph_style)->SetHeight(height);
1122 }
1123
1124 IMPELLER_EXTERN_C
1125 void ImpellerParagraphStyleSetTextAlignment(
1126 ImpellerParagraphStyle paragraph_style,
1127 ImpellerTextAlignment align) {
1128 GetPeer(paragraph_style)->SetTextAlignment(ToTxtType(align));
1129 }
1130
1131 IMPELLER_EXTERN_C
1132 void ImpellerParagraphStyleSetTextDirection(
1133 ImpellerParagraphStyle paragraph_style,
1134 ImpellerTextDirection direction) {
1135 GetPeer(paragraph_style)->SetTextDirection(ToTxtType(direction));
1136 }
1137
1138 IMPELLER_EXTERN_C
1139 void ImpellerParagraphStyleSetMaxLines(ImpellerParagraphStyle paragraph_style,
1140 uint32_t max_lines) {
1141 GetPeer(paragraph_style)->SetMaxLines(max_lines);
1142 }
1143
1144 IMPELLER_EXTERN_C
1145 void ImpellerParagraphStyleSetLocale(ImpellerParagraphStyle paragraph_style,
1146 const char* locale) {
1147 GetPeer(paragraph_style)->SetLocale(ReadString(locale));
1148 }
1149
1150 IMPELLER_EXTERN_C
1151 void ImpellerDisplayListBuilderDrawParagraph(ImpellerDisplayListBuilder builder,
1152 ImpellerParagraph paragraph,
1153 const ImpellerPoint* point) {
1154 GetPeer(builder)->DrawParagraph(*GetPeer(paragraph), ToImpellerType(*point));
1155 }
1156
1157 IMPELLER_EXTERN_C
1158 void ImpellerDisplayListBuilderDrawShadow(ImpellerDisplayListBuilder builder,
1159 ImpellerPath path,
1160 const ImpellerColor* color,
1161 float elevation,
1162 bool occluder_is_transparent,
1163 float device_pixel_ratio) {
1164 GetPeer(builder)->DrawShadow(*GetPeer(path), //
1165 ToDisplayListType(*color), //
1166 elevation, //
1167 occluder_is_transparent, //
1168 device_pixel_ratio //
1169 );
1170 }
1171
1172 IMPELLER_EXTERN_C
1173 ImpellerParagraphBuilder ImpellerParagraphBuilderNew(
1174 ImpellerTypographyContext context) {
1175 auto builder =
1176 Create<ParagraphBuilder>(Ref<TypographyContext>(GetPeer(context)));
1177 if (!builder->IsValid()) {
1178 VALIDATION_LOG << "Could not create valid paragraph builder.";
1179 return nullptr;
1180 }
1181 return builder.Leak();
1182 }
1183
1184 IMPELLER_EXTERN_C
1185 void ImpellerParagraphBuilderRetain(
1186 ImpellerParagraphBuilder paragraph_builder) {
1187 ObjectBase::SafeRetain(paragraph_builder);
1188 }
1189
1190 IMPELLER_EXTERN_C
1191 void ImpellerParagraphBuilderRelease(
1192 ImpellerParagraphBuilder paragraph_builder) {
1193 ObjectBase::SafeRelease(paragraph_builder);
1194 }
1195
1196 IMPELLER_EXTERN_C
1197 void ImpellerParagraphBuilderPushStyle(
1198 ImpellerParagraphBuilder paragraph_builder,
1199 ImpellerParagraphStyle style) {
1200 GetPeer(paragraph_builder)->PushStyle(*GetPeer(style));
1201 }
1202
1203 IMPELLER_EXTERN_C
1204 void ImpellerParagraphBuilderPopStyle(
1205 ImpellerParagraphBuilder paragraph_builder) {
1206 GetPeer(paragraph_builder)->PopStyle();
1207 }
1208
1209 IMPELLER_EXTERN_C
1210 void ImpellerParagraphBuilderAddText(ImpellerParagraphBuilder paragraph_builder,
1211 const uint8_t* data,
1212 uint32_t length) {
1213 if (data == nullptr) {
1214 length = 0;
1215 }
1216 if (length == 0) {
1217 return;
1218 }
1219 GetPeer(paragraph_builder)->AddText(data, length);
1220 }
1221
1222 IMPELLER_EXTERN_C
1223 ImpellerParagraph ImpellerParagraphBuilderBuildParagraphNew(
1224 ImpellerParagraphBuilder paragraph_builder,
1225 float width) {
1226 return GetPeer(paragraph_builder)->Build(width).Leak();
1227 }
1228
1229 IMPELLER_EXTERN_C
1230 void ImpellerParagraphRetain(ImpellerParagraph paragraph) {
1231 ObjectBase::SafeRetain(paragraph);
1232 }
1233
1234 IMPELLER_EXTERN_C
1235 void ImpellerParagraphRelease(ImpellerParagraph paragraph) {
1236 ObjectBase::SafeRelease(paragraph);
1237 }
1238
1239 IMPELLER_EXTERN_C
1240 float ImpellerParagraphGetMaxWidth(ImpellerParagraph paragraph) {
1241 return GetPeer(paragraph)->GetMaxWidth();
1242 }
1243
1244 IMPELLER_EXTERN_C
1245 float ImpellerParagraphGetHeight(ImpellerParagraph paragraph) {
1246 return GetPeer(paragraph)->GetHeight();
1247 }
1248
1249 IMPELLER_EXTERN_C
1250 float ImpellerParagraphGetLongestLineWidth(ImpellerParagraph paragraph) {
1251 return GetPeer(paragraph)->GetLongestLineWidth();
1252 }
1253
1254 IMPELLER_EXTERN_C
1255 float ImpellerParagraphGetMinIntrinsicWidth(ImpellerParagraph paragraph) {
1256 return GetPeer(paragraph)->GetMinIntrinsicWidth();
1257 }
1258
1259 IMPELLER_EXTERN_C
1260 float ImpellerParagraphGetMaxIntrinsicWidth(ImpellerParagraph paragraph) {
1261 return GetPeer(paragraph)->GetMaxIntrinsicWidth();
1262 }
1263
1264 IMPELLER_EXTERN_C
1265 float ImpellerParagraphGetIdeographicBaseline(ImpellerParagraph paragraph) {
1266 return GetPeer(paragraph)->GetIdeographicBaseline();
1267 }
1268
1269 IMPELLER_EXTERN_C
1270 float ImpellerParagraphGetAlphabeticBaseline(ImpellerParagraph paragraph) {
1271 return GetPeer(paragraph)->GetAlphabeticBaseline();
1272 }
1273
1274 IMPELLER_EXTERN_C
1275 uint32_t ImpellerParagraphGetLineCount(ImpellerParagraph paragraph) {
1276 return GetPeer(paragraph)->GetLineCount();
1277 }
1278
1279 IMPELLER_EXTERN_C
1280 ImpellerRange ImpellerParagraphGetWordBoundary(ImpellerParagraph paragraph,
1281 size_t code_unit_index) {
1282 return GetPeer(paragraph)->GetWordBoundary(code_unit_index);
1283 }
1284
1285 IMPELLER_EXTERN_C
1286 ImpellerTypographyContext ImpellerTypographyContextNew() {
1287 auto context = Create<TypographyContext>();
1288 if (!context->IsValid()) {
1289 VALIDATION_LOG << "Could not create typography context.";
1290 return nullptr;
1291 }
1292 return context.Leak();
1293 }
1294
1295 IMPELLER_EXTERN_C
1296 void ImpellerTypographyContextRetain(ImpellerTypographyContext context) {
1297 ObjectBase::SafeRetain(context);
1298 }
1299
1300 IMPELLER_EXTERN_C
1301 void ImpellerTypographyContextRelease(ImpellerTypographyContext context) {
1302 ObjectBase::SafeRelease(context);
1303 }
1304
1305 IMPELLER_EXTERN_C
1306 bool ImpellerTypographyContextRegisterFont(ImpellerTypographyContext context,
1307 const ImpellerMapping* contents,
1308 void* contents_on_release_user_data,
1309 const char* family_name_alias) {
1310 auto wrapped_contents = std::make_unique<fml::NonOwnedMapping>(
1311 contents->data, // data ptr
1312 contents->length, // data length
1313 [on_release = contents->on_release, contents_on_release_user_data](auto,
1314 auto) {
1315 on_release(contents_on_release_user_data);
1316 } // release callback
1317 );
1318 return GetPeer(context)->RegisterFont(std::move(wrapped_contents),
1319 family_name_alias);
1320 }
1321
1322 IMPELLER_EXTERN_C
1323 ImpellerLineMetrics ImpellerParagraphGetLineMetrics(
1324 ImpellerParagraph paragraph) {
1325 return GetPeer(paragraph)->GetLineMetrics().GetC();
1326 }
1327
1328 IMPELLER_EXTERN_C
1329 ImpellerGlyphInfo ImpellerParagraphCreateGlyphInfoAtCodeUnitIndexNew(
1330 ImpellerParagraph paragraph,
1331 size_t code_unit_index) {
1332 return GetPeer(paragraph)
1333 ->GetGlyphInfoAtCodeUnitIndex(code_unit_index)
1334 .Leak();
1335 }
1336
1337 IMPELLER_EXTERN_C
1338 ImpellerGlyphInfo ImpellerParagraphCreateGlyphInfoAtParagraphCoordinatesNew(
1339 ImpellerParagraph paragraph,
1340 double x,
1341 double y) {
1342 return GetPeer(paragraph)
1343 ->GetClosestGlyphInfoAtParagraphCoordinates(x, y)
1344 .Leak();
1345 }
1346
1347 //------------------------------------------------------------------------------
1348 // Line Metrics
1349 //------------------------------------------------------------------------------
1350
1351 IMPELLER_EXTERN_C
1352 void ImpellerLineMetricsRetain(ImpellerLineMetrics line_metrics) {
1353 ObjectBase::SafeRetain(line_metrics);
1354 }
1355
1356 IMPELLER_EXTERN_C
1357 void ImpellerLineMetricsRelease(ImpellerLineMetrics line_metrics) {
1358 ObjectBase::SafeRelease(line_metrics);
1359 }
1360
1361 IMPELLER_EXTERN_C
1362 double ImpellerLineMetricsGetUnscaledAscent(ImpellerLineMetrics metrics,
1363 size_t line) {
1364 return GetPeer(metrics)->GetUnscaledAscent(line);
1365 }
1366
1367 IMPELLER_EXTERN_C
1368 double ImpellerLineMetricsGetAscent(ImpellerLineMetrics metrics, size_t line) {
1369 return GetPeer(metrics)->GetAscent(line);
1370 }
1371
1372 IMPELLER_EXTERN_C
1373 double ImpellerLineMetricsGetDescent(ImpellerLineMetrics metrics, size_t line) {
1374 return GetPeer(metrics)->GetDescent(line);
1375 }
1376
1377 IMPELLER_EXTERN_C
1378 double ImpellerLineMetricsGetBaseline(ImpellerLineMetrics metrics,
1379 size_t line) {
1380 return GetPeer(metrics)->GetBaseline(line);
1381 }
1382
1383 IMPELLER_EXTERN_C
1384 bool ImpellerLineMetricsIsHardbreak(ImpellerLineMetrics metrics, size_t line) {
1385 return GetPeer(metrics)->IsHardbreak(line);
1386 }
1387
1388 IMPELLER_EXTERN_C
1389 double ImpellerLineMetricsGetWidth(ImpellerLineMetrics metrics, size_t line) {
1390 return GetPeer(metrics)->GetWidth(line);
1391 }
1392
1393 IMPELLER_EXTERN_C
1394 double ImpellerLineMetricsGetHeight(ImpellerLineMetrics metrics, size_t line) {
1395 return GetPeer(metrics)->GetHeight(line);
1396 }
1397
1398 IMPELLER_EXTERN_C
1399 double ImpellerLineMetricsGetLeft(ImpellerLineMetrics metrics, size_t line) {
1400 return GetPeer(metrics)->GetLeft(line);
1401 }
1402
1403 IMPELLER_EXTERN_C
1404 size_t ImpellerLineMetricsGetCodeUnitStartIndex(ImpellerLineMetrics metrics,
1405 size_t line) {
1406 return GetPeer(metrics)->GetCodeUnitStartIndex(line);
1407 }
1408
1409 IMPELLER_EXTERN_C
1410 size_t ImpellerLineMetricsGetCodeUnitEndIndex(ImpellerLineMetrics metrics,
1411 size_t line) {
1412 return GetPeer(metrics)->GetCodeUnitEndIndex(line);
1413 }
1414
1415 IMPELLER_EXTERN_C
1416 size_t ImpellerLineMetricsGetCodeUnitEndIndexExcludingWhitespace(
1417 ImpellerLineMetrics metrics,
1418 size_t line) {
1419 return GetPeer(metrics)->GetCodeUnitEndIndexExcludingWhitespace(line);
1420 }
1421
1422 IMPELLER_EXTERN_C
1423 size_t ImpellerLineMetricsGetCodeUnitEndIndexIncludingNewline(
1424 ImpellerLineMetrics metrics,
1425 size_t line) {
1426 return GetPeer(metrics)->GetCodeUnitEndIndexIncludingNewline(line);
1427 }
1428
1429 //------------------------------------------------------------------------------
1430 // Glyph Info
1431 //------------------------------------------------------------------------------
1432
1433 IMPELLER_EXTERN_C
1434 void ImpellerGlyphInfoRetain(ImpellerGlyphInfo glyph_info) {
1435 ObjectBase::SafeRetain(glyph_info);
1436 }
1437
1438 IMPELLER_EXTERN_C
1439 void ImpellerGlyphInfoRelease(ImpellerGlyphInfo glyph_info) {
1440 ObjectBase::SafeRelease(glyph_info);
1441 }
1442
1443 IMPELLER_EXTERN_C
1444 size_t ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeBegin(
1445 ImpellerGlyphInfo glyph_info) {
1446 return GetPeer(glyph_info)->GetGraphemeClusterCodeUnitRangeBegin();
1447 }
1448
1449 IMPELLER_EXTERN_C
1450 size_t ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeEnd(
1451 ImpellerGlyphInfo glyph_info) {
1452 return GetPeer(glyph_info)->GetGraphemeClusterCodeUnitRangeEnd();
1453 }
1454
1455 IMPELLER_EXTERN_C
1456 ImpellerRect ImpellerGlyphInfoGetGraphemeClusterBounds(
1457 ImpellerGlyphInfo glyph_info) {
1458 return GetPeer(glyph_info)->GetGraphemeClusterBounds();
1459 }
1460
1461 IMPELLER_EXTERN_C
1462 bool ImpellerGlyphInfoIsEllipsis(ImpellerGlyphInfo glyph_info) {
1463 return GetPeer(glyph_info)->IsEllipsis();
1464 }
1465
1466 IMPELLER_EXTERN_C
1467 ImpellerTextDirection ImpellerGlyphInfoGetTextDirection(
1468 ImpellerGlyphInfo glyph_info) {
1469 return GetPeer(glyph_info)->GetTextDirection();
1470 }
1471
1472 } // namespace impeller::interop
impeller::BackendCast< ContextGLES, Context >::Cast
static ContextGLES & Cast(Context &base)
Definition: backend_cast.h:13
impeller::Context::BackendType::kOpenGLES
@ kOpenGLES
impeller::TextureGLES::GetGLHandle
std::optional< GLuint > GetGLHandle() const
Definition: texture_gles.cc:499
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:158
impeller::interop::ColorFilter
Definition: color_filter.h:17
impeller::interop::ColorFilter::MakeMatrix
static ScopedObject< ColorFilter > MakeMatrix(const float matrix[20])
Definition: color_filter.cc:18
impeller::interop::ColorFilter::MakeBlend
static ScopedObject< ColorFilter > MakeBlend(Color color, BlendMode mode)
Definition: color_filter.cc:9
impeller::interop::ColorSource
Definition: color_source.h:23
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::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
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::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::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::ContextGLES::Create
static ScopedObject< Context > Create(std::function< void *(const char *gl_proc_name)> proc_address_callback)
Definition: context_gles.cc:14
impeller::interop::Context
Definition: context.h:16
impeller::interop::ContextMTL::Create
static ScopedObject< Context > Create()
Definition: context_mtl.mm:29
impeller::interop::ContextVK
Definition: context_vk.h:14
impeller::interop::ContextVK::Create
static ScopedObject< Context > Create(const Settings &settings)
Definition: context_vk.cc:45
impeller::interop::DisplayListBuilder
Definition: dl_builder.h:26
impeller::interop::DisplayList
Definition: dl.h:16
impeller::interop::GlyphInfo
Internal C++ peer of ImpellerGlyphInfo. For detailed documentation, refer to the headerdocs in the pu...
Definition: glyph_info.h:21
impeller::interop::ImageFilter
Definition: image_filter.h:17
impeller::interop::ImageFilter::MakeDilate
static ScopedObject< ImageFilter > MakeDilate(Scalar x_radius, Scalar y_radius)
Definition: image_filter.cc:26
impeller::interop::ImageFilter::MakeErode
static ScopedObject< ImageFilter > MakeErode(Scalar x_radius, Scalar y_radius)
Definition: image_filter.cc:35
impeller::interop::ImageFilter::MakeCompose
static ScopedObject< ImageFilter > MakeCompose(const ImageFilter &outer, const ImageFilter &inner)
Definition: image_filter.cc:54
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::ImageFilter::MakeMatrix
static ScopedObject< ImageFilter > MakeMatrix(const Matrix &matrix, flutter::DlImageSampling sampling)
Definition: image_filter.cc:44
impeller::interop::LineMetrics
Internal C++ peer of ImpellerLineMetrics. For detailed documentation, refer to the headerdocs in the ...
Definition: line_metrics.h:26
impeller::interop::MaskFilter
Definition: mask_filter.h:16
impeller::interop::MaskFilter::MakeBlur
static ScopedObject< MaskFilter > MakeBlur(flutter::DlBlurStyle style, float sigma)
Definition: mask_filter.cc:9
impeller::interop::ObjectBase::SafeRelease
static void SafeRelease(void *ptr)
Definition: object.h:43
impeller::interop::ObjectBase::SafeRetain
static void SafeRetain(void *ptr)
Definition: object.h:37
impeller::interop::Paint
Definition: paint.h:22
impeller::interop::ParagraphBuilder
Definition: paragraph_builder.h:21
impeller::interop::Paragraph
Definition: paragraph.h:21
impeller::interop::ParagraphStyle
Definition: paragraph_style.h:17
impeller::interop::PathBuilder
Definition: path_builder.h:19
impeller::interop::Path
Definition: path.h:16
impeller::interop::Surface
Definition: surface.h:19
impeller::interop::SwapchainVK
Definition: swapchain_vk.h:18
impeller::interop::Texture
Definition: texture.h:17
impeller::interop::TypographyContext
Definition: typography_context.h:19
color_source.h
dl_builder.h
x
int32_t x
Definition: dl_golden_unittests.cc:458
transform
Matrix transform
Definition: gaussian_blur_filter_contents.cc:214
glyph_info.h
impeller.h
ImpellerFillType
ImpellerFillType
Definition: impeller.h:355
ImpellerTextDirection
ImpellerTextDirection
Definition: impeller.h:470
ImpellerTextureSampling
ImpellerTextureSampling
Definition: impeller.h:419
IMPELLER_VERSION_GET_PATCH
#define IMPELLER_VERSION_GET_PATCH(version)
Definition: impeller.h:135
IMPELLER_VERSION_GET_MAJOR
#define IMPELLER_VERSION_GET_MAJOR(version)
Definition: impeller.h:119
IMPELLER_VERSION_GET_VARIANT
#define IMPELLER_VERSION_GET_VARIANT(version)
Definition: impeller.h:112
ImpellerStrokeJoin
ImpellerStrokeJoin
Definition: impeller.h:409
ImpellerBlendMode
ImpellerBlendMode
Definition: impeller.h:365
IMPELLER_VERSION
#define IMPELLER_VERSION
Definition: impeller.h:103
ImpellerFontWeight
ImpellerFontWeight
Definition: impeller.h:444
IMPELLER_VERSION_GET_MINOR
#define IMPELLER_VERSION_GET_MINOR(version)
Definition: impeller.h:127
ImpellerProcAddressCallback
void *IMPELLER_NULLABLE(* ImpellerProcAddressCallback)(const char *IMPELLER_NONNULL proc_name, void *IMPELLER_NULLABLE user_data)
Definition: impeller.h:338
IMPELLER_EXTERN_C
#define IMPELLER_EXTERN_C
Definition: impeller.h:36
ImpellerStrokeCap
ImpellerStrokeCap
Definition: impeller.h:403
ImpellerDrawStyle
ImpellerDrawStyle
Definition: impeller.h:397
ImpellerTileMode
ImpellerTileMode
Definition: impeller.h:424
ImpellerTextAlignment
ImpellerTextAlignment
Definition: impeller.h:461
ImpellerFontStyle
ImpellerFontStyle
Definition: impeller.h:456
ImpellerClipOperation
ImpellerClipOperation
Definition: impeller.h:360
IMPELLER_NONNULL
#define IMPELLER_NONNULL
Definition: impeller.h:58
ImpellerBlurStyle
ImpellerBlurStyle
Definition: impeller.h:431
ImpellerPixelFormat
ImpellerPixelFormat
Definition: impeller.h:415
line_metrics.h
mask_filter.h
impeller::interop
Definition: context_gles.cc:12
impeller::interop::ImpellerImageFilterCreateComposeNew
IMPELLER_EXTERN_C ImpellerImageFilter ImpellerImageFilterCreateComposeNew(ImpellerImageFilter outer, ImpellerImageFilter inner)
Definition: impeller.cc:1030
impeller::interop::ImpellerParagraphBuilderRetain
IMPELLER_EXTERN_C void ImpellerParagraphBuilderRetain(ImpellerParagraphBuilder paragraph_builder)
Definition: impeller.cc:1185
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:907
impeller::interop::ImpellerLineMetricsIsHardbreak
IMPELLER_EXTERN_C bool ImpellerLineMetricsIsHardbreak(ImpellerLineMetrics metrics, size_t line)
Definition: impeller.cc:1384
impeller::interop::ImpellerGlyphInfoRelease
IMPELLER_EXTERN_C void ImpellerGlyphInfoRelease(ImpellerGlyphInfo glyph_info)
Definition: impeller.cc:1439
impeller::interop::ImpellerImageFilterCreateMatrixNew
IMPELLER_EXTERN_C ImpellerImageFilter ImpellerImageFilterCreateMatrixNew(const ImpellerMatrix *matrix, ImpellerTextureSampling sampling)
Definition: impeller.cc:1021
impeller::interop::ImpellerDisplayListBuilderDrawPaint
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawPaint(ImpellerDisplayListBuilder builder, ImpellerPaint paint)
Definition: impeller.cc:506
impeller::interop::ImpellerSurfaceRetain
IMPELLER_EXTERN_C void ImpellerSurfaceRetain(ImpellerSurface surface)
Definition: impeller.cc:760
impeller::interop::ImpellerParagraphStyleRelease
IMPELLER_EXTERN_C void ImpellerParagraphStyleRelease(ImpellerParagraphStyle paragraph_style)
Definition: impeller.cc:1071
impeller::interop::ImpellerGetVersion
IMPELLER_EXTERN_C uint32_t ImpellerGetVersion()
Definition: impeller.cc:88
impeller::interop::ImpellerParagraphStyleRetain
IMPELLER_EXTERN_C void ImpellerParagraphStyleRetain(ImpellerParagraphStyle paragraph_style)
Definition: impeller.cc:1066
impeller::interop::ImpellerLineMetricsGetCodeUnitStartIndex
IMPELLER_EXTERN_C size_t ImpellerLineMetricsGetCodeUnitStartIndex(ImpellerLineMetrics metrics, size_t line)
Definition: impeller.cc:1404
impeller::interop::ImpellerGlyphInfoGetTextDirection
IMPELLER_EXTERN_C ImpellerTextDirection ImpellerGlyphInfoGetTextDirection(ImpellerGlyphInfo glyph_info)
Definition: impeller.cc:1467
impeller::interop::ImpellerPaintSetColorSource
IMPELLER_EXTERN_C void ImpellerPaintSetColorSource(ImpellerPaint paint, ImpellerColorSource color_source)
Definition: impeller.cc:1043
impeller::interop::ImpellerPathBuilderClose
IMPELLER_EXTERN_C void ImpellerPathBuilderClose(ImpellerPathBuilder builder)
Definition: impeller.cc:406
impeller::interop::ImpellerPathBuilderQuadraticCurveTo
IMPELLER_EXTERN_C void ImpellerPathBuilderQuadraticCurveTo(ImpellerPathBuilder builder, const ImpellerPoint *control_point, const ImpellerPoint *end_point)
Definition: impeller.cc:355
impeller::interop::ImpellerTextureGetOpenGLHandle
IMPELLER_EXTERN_C uint64_t ImpellerTextureGetOpenGLHandle(ImpellerTexture texture)
Definition: impeller.cc:683
impeller::interop::ImpellerDisplayListBuilderRetain
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderRetain(ImpellerDisplayListBuilder builder)
Definition: impeller.cc:230
impeller::interop::ImpellerParagraphBuilderPopStyle
IMPELLER_EXTERN_C void ImpellerParagraphBuilderPopStyle(ImpellerParagraphBuilder paragraph_builder)
Definition: impeller.cc:1204
impeller::interop::CheckVersion
static bool CheckVersion(uint32_t version)
Definition: impeller.cc:92
impeller::interop::ImpellerMaskFilterCreateBlurNew
IMPELLER_EXTERN_C ImpellerMaskFilter ImpellerMaskFilterCreateBlurNew(ImpellerBlurStyle style, float sigma)
Definition: impeller.cc:984
impeller::interop::ImpellerParagraphStyleSetMaxLines
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetMaxLines(ImpellerParagraphStyle paragraph_style, uint32_t max_lines)
Definition: impeller.cc:1139
impeller::interop::ImpellerLineMetricsGetCodeUnitEndIndex
IMPELLER_EXTERN_C size_t ImpellerLineMetricsGetCodeUnitEndIndex(ImpellerLineMetrics metrics, size_t line)
Definition: impeller.cc:1410
impeller::interop::ImpellerColorFilterRetain
IMPELLER_EXTERN_C void ImpellerColorFilterRetain(ImpellerColorFilter color_filter)
Definition: impeller.cc:949
impeller::interop::ImpellerSurfaceCreateWrappedFBONew
IMPELLER_EXTERN_C ImpellerSurface ImpellerSurfaceCreateWrappedFBONew(ImpellerContext context, uint64_t fbo, ImpellerPixelFormat format, const ImpellerISize *size)
Definition: impeller.cc:724
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:794
impeller::interop::ImpellerLineMetricsRelease
IMPELLER_EXTERN_C void ImpellerLineMetricsRelease(ImpellerLineMetrics line_metrics)
Definition: impeller.cc:1357
impeller::interop::ImpellerDisplayListBuilderSave
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderSave(ImpellerDisplayListBuilder builder)
Definition: impeller.cc:240
impeller::interop::ImpellerDisplayListBuilderCreateDisplayListNew
IMPELLER_EXTERN_C ImpellerDisplayList ImpellerDisplayListBuilderCreateDisplayListNew(ImpellerDisplayListBuilder builder)
Definition: impeller.cc:706
impeller::interop::ImpellerGlyphInfoIsEllipsis
IMPELLER_EXTERN_C bool ImpellerGlyphInfoIsEllipsis(ImpellerGlyphInfo glyph_info)
Definition: impeller.cc:1462
impeller::interop::ImpellerPathBuilderRelease
IMPELLER_EXTERN_C void ImpellerPathBuilderRelease(ImpellerPathBuilder builder)
Definition: impeller.cc:338
impeller::interop::ImpellerParagraphBuilderNew
IMPELLER_EXTERN_C ImpellerParagraphBuilder ImpellerParagraphBuilderNew(ImpellerTypographyContext context)
Definition: impeller.cc:1173
impeller::interop::ImpellerColorFilterCreateColorMatrixNew
IMPELLER_EXTERN_C ImpellerColorFilter ImpellerColorFilterCreateColorMatrixNew(const ImpellerColorMatrix *color_matrix)
Definition: impeller.cc:968
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:820
impeller::interop::ImpellerPaintRelease
IMPELLER_EXTERN_C void ImpellerPaintRelease(ImpellerPaint paint)
Definition: impeller.cc:466
impeller::interop::ImpellerDisplayListBuilderNew
IMPELLER_EXTERN_C ImpellerDisplayListBuilder ImpellerDisplayListBuilderNew(const ImpellerRect *cull_rect)
Definition: impeller.cc:224
impeller::interop::ImpellerLineMetricsGetDescent
IMPELLER_EXTERN_C double ImpellerLineMetricsGetDescent(ImpellerLineMetrics metrics, size_t line)
Definition: impeller.cc:1373
impeller::interop::ImpellerParagraphStyleSetFontStyle
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetFontStyle(ImpellerParagraphStyle paragraph_style, ImpellerFontStyle style)
Definition: impeller.cc:1094
impeller::interop::ImpellerPaintNew
IMPELLER_EXTERN_C ImpellerPaint ImpellerPaintNew()
Definition: impeller.cc:456
impeller::interop::ImpellerTypographyContextRetain
IMPELLER_EXTERN_C void ImpellerTypographyContextRetain(ImpellerTypographyContext context)
Definition: impeller.cc:1296
impeller::interop::ImpellerGlyphInfoGetGraphemeClusterBounds
IMPELLER_EXTERN_C ImpellerRect ImpellerGlyphInfoGetGraphemeClusterBounds(ImpellerGlyphInfo glyph_info)
Definition: impeller.cc:1456
impeller::interop::ImpellerLineMetricsGetCodeUnitEndIndexIncludingNewline
IMPELLER_EXTERN_C size_t ImpellerLineMetricsGetCodeUnitEndIndexIncludingNewline(ImpellerLineMetrics metrics, size_t line)
Definition: impeller.cc:1423
impeller::interop::ImpellerParagraphStyleSetTextDirection
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetTextDirection(ImpellerParagraphStyle paragraph_style, ImpellerTextDirection direction)
Definition: impeller.cc:1132
impeller::interop::Ref
ScopedObject< Object > Ref(Object *object)
Definition: object.h:146
impeller::interop::ImpellerSurfaceCreateWrappedMetalDrawableNew
IMPELLER_EXTERN_C ImpellerSurface ImpellerSurfaceCreateWrappedMetalDrawableNew(ImpellerContext context, void *metal_drawable)
Definition: impeller.cc:745
impeller::interop::ImpellerDisplayListBuilderDrawOval
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawOval(ImpellerDisplayListBuilder builder, const ImpellerRect *oval_bounds, ImpellerPaint paint)
Definition: impeller.cc:546
impeller::interop::ImpellerLineMetricsGetCodeUnitEndIndexExcludingWhitespace
IMPELLER_EXTERN_C size_t ImpellerLineMetricsGetCodeUnitEndIndexExcludingWhitespace(ImpellerLineMetrics metrics, size_t line)
Definition: impeller.cc:1416
impeller::interop::ImpellerContextCreateVulkanNew
IMPELLER_EXTERN_C ImpellerContext ImpellerContextCreateVulkanNew(uint32_t version, const ImpellerContextVulkanSettings *settings)
Definition: impeller.cc:147
impeller::interop::ImpellerParagraphBuilderBuildParagraphNew
IMPELLER_EXTERN_C ImpellerParagraph ImpellerParagraphBuilderBuildParagraphNew(ImpellerParagraphBuilder paragraph_builder, float width)
Definition: impeller.cc:1223
impeller::interop::ImpellerDisplayListBuilderSaveLayer
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderSaveLayer(ImpellerDisplayListBuilder builder, const ImpellerRect *bounds, ImpellerPaint paint, ImpellerImageFilter backdrop)
Definition: impeller.cc:245
impeller::interop::ImpellerPathBuilderAddRect
IMPELLER_EXTERN_C void ImpellerPathBuilderAddRect(ImpellerPathBuilder builder, const ImpellerRect *rect)
Definition: impeller.cc:374
impeller::interop::ImpellerParagraphCreateGlyphInfoAtCodeUnitIndexNew
IMPELLER_EXTERN_C ImpellerGlyphInfo ImpellerParagraphCreateGlyphInfoAtCodeUnitIndexNew(ImpellerParagraph paragraph, size_t code_unit_index)
Definition: impeller.cc:1329
impeller::interop::ImpellerLineMetricsGetBaseline
IMPELLER_EXTERN_C double ImpellerLineMetricsGetBaseline(ImpellerLineMetrics metrics, size_t line)
Definition: impeller.cc:1378
impeller::interop::ImpellerPaintSetStrokeCap
IMPELLER_EXTERN_C void ImpellerPaintSetStrokeCap(ImpellerPaint paint, ImpellerStrokeCap cap)
Definition: impeller.cc:486
impeller::interop::ImpellerParagraphBuilderRelease
IMPELLER_EXTERN_C void ImpellerParagraphBuilderRelease(ImpellerParagraphBuilder paragraph_builder)
Definition: impeller.cc:1191
impeller::interop::ImpellerLineMetricsGetUnscaledAscent
IMPELLER_EXTERN_C double ImpellerLineMetricsGetUnscaledAscent(ImpellerLineMetrics metrics, size_t line)
Definition: impeller.cc:1362
impeller::interop::ImpellerPathBuilderLineTo
IMPELLER_EXTERN_C void ImpellerPathBuilderLineTo(ImpellerPathBuilder builder, const ImpellerPoint *location)
Definition: impeller.cc:349
impeller::interop::ImpellerPathRetain
IMPELLER_EXTERN_C void ImpellerPathRetain(ImpellerPath path)
Definition: impeller.cc:318
impeller::interop::ImpellerPaintSetStrokeJoin
IMPELLER_EXTERN_C void ImpellerPaintSetStrokeJoin(ImpellerPaint paint, ImpellerStrokeJoin join)
Definition: impeller.cc:491
impeller::interop::ImpellerParagraphCreateGlyphInfoAtParagraphCoordinatesNew
IMPELLER_EXTERN_C ImpellerGlyphInfo ImpellerParagraphCreateGlyphInfoAtParagraphCoordinatesNew(ImpellerParagraph paragraph, double x, double y)
Definition: impeller.cc:1338
impeller::interop::ImpellerParagraphGetHeight
IMPELLER_EXTERN_C float ImpellerParagraphGetHeight(ImpellerParagraph paragraph)
Definition: impeller.cc:1245
impeller::interop::ImpellerDisplayListBuilderClipOval
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderClipOval(ImpellerDisplayListBuilder builder, const ImpellerRect *oval_bounds, ImpellerClipOperation op)
Definition: impeller.cc:430
impeller::interop::ImpellerPathBuilderRetain
IMPELLER_EXTERN_C void ImpellerPathBuilderRetain(ImpellerPathBuilder builder)
Definition: impeller.cc:333
impeller::interop::ImpellerParagraphBuilderPushStyle
IMPELLER_EXTERN_C void ImpellerParagraphBuilderPushStyle(ImpellerParagraphBuilder paragraph_builder, ImpellerParagraphStyle style)
Definition: impeller.cc:1197
impeller::interop::ImpellerPathBuilderAddOval
IMPELLER_EXTERN_C void ImpellerPathBuilderAddOval(ImpellerPathBuilder builder, const ImpellerRect *oval_bounds)
Definition: impeller.cc:391
impeller::interop::ImpellerTypographyContextNew
IMPELLER_EXTERN_C ImpellerTypographyContext ImpellerTypographyContextNew()
Definition: impeller.cc:1286
impeller::interop::ImpellerParagraphGetAlphabeticBaseline
IMPELLER_EXTERN_C float ImpellerParagraphGetAlphabeticBaseline(ImpellerParagraph paragraph)
Definition: impeller.cc:1270
impeller::interop::ImpellerPathRelease
IMPELLER_EXTERN_C void ImpellerPathRelease(ImpellerPath path)
Definition: impeller.cc:323
impeller::interop::ImpellerImageFilterCreateBlurNew
IMPELLER_EXTERN_C ImpellerImageFilter ImpellerImageFilterCreateBlurNew(float x_sigma, float y_sigma, ImpellerTileMode tile_mode)
Definition: impeller.cc:1000
impeller::interop::ImpellerColorSourceRetain
IMPELLER_EXTERN_C void ImpellerColorSourceRetain(ImpellerColorSource color_source)
Definition: impeller.cc:810
impeller::interop::ImpellerParagraphGetMinIntrinsicWidth
IMPELLER_EXTERN_C float ImpellerParagraphGetMinIntrinsicWidth(ImpellerParagraph paragraph)
Definition: impeller.cc:1255
impeller::interop::ImpellerPaintSetStrokeWidth
IMPELLER_EXTERN_C void ImpellerPaintSetStrokeWidth(ImpellerPaint paint, float width)
Definition: impeller.cc:496
impeller::interop::ImpellerMaskFilterRetain
IMPELLER_EXTERN_C void ImpellerMaskFilterRetain(ImpellerMaskFilter mask_filter)
Definition: impeller.cc:974
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:523
impeller::interop::ImpellerPathBuilderTakePathNew
IMPELLER_EXTERN_C ImpellerPath ImpellerPathBuilderTakePathNew(ImpellerPathBuilder builder, ImpellerFillType fill)
Definition: impeller.cc:417
impeller::interop::ImpellerPathBuilderCopyPathNew
IMPELLER_EXTERN_C ImpellerPath ImpellerPathBuilderCopyPathNew(ImpellerPathBuilder builder, ImpellerFillType fill)
Definition: impeller.cc:411
impeller::interop::ImpellerColorSourceRelease
IMPELLER_EXTERN_C void ImpellerColorSourceRelease(ImpellerColorSource color_source)
Definition: impeller.cc:815
impeller::interop::ImpellerDisplayListBuilderClipRoundedRect
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderClipRoundedRect(ImpellerDisplayListBuilder builder, const ImpellerRect *rect, const ImpellerRoundingRadii *radii, ImpellerClipOperation op)
Definition: impeller.cc:437
impeller::interop::ImpellerDisplayListBuilderClipRect
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderClipRect(ImpellerDisplayListBuilder builder, const ImpellerRect *rect, ImpellerClipOperation op)
Definition: impeller.cc:423
impeller::interop::ImpellerLineMetricsGetAscent
IMPELLER_EXTERN_C double ImpellerLineMetricsGetAscent(ImpellerLineMetrics metrics, size_t line)
Definition: impeller.cc:1368
impeller::interop::ToImpellerType
constexpr Matrix ToImpellerType(const ImpellerMatrix &m)
Definition: formats.h:201
impeller::interop::ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeEnd
IMPELLER_EXTERN_C size_t ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeEnd(ImpellerGlyphInfo glyph_info)
Definition: impeller.cc:1450
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:859
impeller::interop::ImpellerParagraphStyleSetTextAlignment
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetTextAlignment(ImpellerParagraphStyle paragraph_style, ImpellerTextAlignment align)
Definition: impeller.cc:1125
impeller::interop::ImpellerTypographyContextRelease
IMPELLER_EXTERN_C void ImpellerTypographyContextRelease(ImpellerTypographyContext context)
Definition: impeller.cc:1301
impeller::interop::ImpellerTextureCreateWithOpenGLTextureHandleNew
IMPELLER_EXTERN_C ImpellerTexture ImpellerTextureCreateWithOpenGLTextureHandleNew(ImpellerContext context, const ImpellerTextureDescriptor *descriptor, uint64_t external_gl_handle)
Definition: impeller.cc:633
impeller::interop::ImpellerDisplayListBuilderDrawRoundedRect
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawRoundedRect(ImpellerDisplayListBuilder builder, const ImpellerRect *rect, const ImpellerRoundingRadii *radii, ImpellerPaint paint)
Definition: impeller.cc:553
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:588
impeller::interop::ImpellerPathBuilderMoveTo
IMPELLER_EXTERN_C void ImpellerPathBuilderMoveTo(ImpellerPathBuilder builder, const ImpellerPoint *location)
Definition: impeller.cc:343
impeller::interop::ImpellerDisplayListBuilderTransform
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderTransform(ImpellerDisplayListBuilder builder, const ImpellerMatrix *transform)
Definition: impeller.cc:287
impeller::interop::ImpellerLineMetricsGetWidth
IMPELLER_EXTERN_C double ImpellerLineMetricsGetWidth(ImpellerLineMetrics metrics, size_t line)
Definition: impeller.cc:1389
impeller::interop::ImpellerColorFilterRelease
IMPELLER_EXTERN_C void ImpellerColorFilterRelease(ImpellerColorFilter color_filter)
Definition: impeller.cc:954
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:1306
impeller::interop::ImpellerLineMetricsGetLeft
IMPELLER_EXTERN_C double ImpellerLineMetricsGetLeft(ImpellerLineMetrics metrics, size_t line)
Definition: impeller.cc:1399
impeller::interop::ImpellerParagraphStyleSetFontWeight
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetFontWeight(ImpellerParagraphStyle paragraph_style, ImpellerFontWeight weight)
Definition: impeller.cc:1088
impeller::interop::ImpellerParagraphGetMaxIntrinsicWidth
IMPELLER_EXTERN_C float ImpellerParagraphGetMaxIntrinsicWidth(ImpellerParagraph paragraph)
Definition: impeller.cc:1260
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:837
impeller::interop::ImpellerVulkanSwapchainAcquireNextSurfaceNew
IMPELLER_EXTERN_C ImpellerSurface ImpellerVulkanSwapchainAcquireNextSurfaceNew(ImpellerVulkanSwapchain swapchain)
Definition: impeller.cc:219
impeller::interop::ImpellerPathBuilderNew
IMPELLER_EXTERN_C ImpellerPathBuilder ImpellerPathBuilderNew()
Definition: impeller.cc:328
impeller::interop::ImpellerContextCreateMetalNew
IMPELLER_EXTERN_C ImpellerContext ImpellerContextCreateMetalNew(uint32_t version)
Definition: impeller.cc:129
impeller::interop::ImpellerParagraphStyleSetFontSize
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetFontSize(ImpellerParagraphStyle paragraph_style, float size)
Definition: impeller.cc:1113
impeller::interop::ImpellerTextureRelease
IMPELLER_EXTERN_C void ImpellerTextureRelease(ImpellerTexture texture)
Definition: impeller.cc:678
impeller::interop::ImpellerContextGetVulkanInfo
IMPELLER_EXTERN_C bool ImpellerContextGetVulkanInfo(ImpellerContext IMPELLER_NONNULL context, ImpellerContextVulkanInfo *out_vulkan_info)
Definition: impeller.cc:177
impeller::interop::ImpellerContextRelease
IMPELLER_EXTERN_C void ImpellerContextRelease(ImpellerContext context)
Definition: impeller.cc:172
impeller::interop::ImpellerImageFilterRelease
IMPELLER_EXTERN_C void ImpellerImageFilterRelease(ImpellerImageFilter image_filter)
Definition: impeller.cc:995
impeller::interop::ImpellerDisplayListBuilderDrawParagraph
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawParagraph(ImpellerDisplayListBuilder builder, ImpellerParagraph paragraph, const ImpellerPoint *point)
Definition: impeller.cc:1151
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:104
impeller::interop::ToTxtType
constexpr txt::FontWeight ToTxtType(ImpellerFontWeight weight)
Definition: formats.h:430
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:931
impeller::interop::ImpellerMaskFilterRelease
IMPELLER_EXTERN_C void ImpellerMaskFilterRelease(ImpellerMaskFilter mask_filter)
Definition: impeller.cc:979
impeller::interop::ImpellerParagraphStyleSetFontFamily
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetFontFamily(ImpellerParagraphStyle paragraph_style, const char *family_name)
Definition: impeller.cc:1107
impeller::interop::ImpellerParagraphStyleSetHeight
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetHeight(ImpellerParagraphStyle paragraph_style, float height)
Definition: impeller.cc:1119
impeller::interop::ImpellerPaintRetain
IMPELLER_EXTERN_C void ImpellerPaintRetain(ImpellerPaint paint)
Definition: impeller.cc:461
impeller::interop::ImpellerContextRetain
IMPELLER_EXTERN_C void ImpellerContextRetain(ImpellerContext context)
Definition: impeller.cc:167
impeller::interop::ImpellerParagraphRelease
IMPELLER_EXTERN_C void ImpellerParagraphRelease(ImpellerParagraph paragraph)
Definition: impeller.cc:1235
impeller::interop::ImpellerPaintSetBlendMode
IMPELLER_EXTERN_C void ImpellerPaintSetBlendMode(ImpellerPaint paint, ImpellerBlendMode mode)
Definition: impeller.cc:476
impeller::interop::ImpellerDisplayListBuilderResetTransform
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderResetTransform(ImpellerDisplayListBuilder builder)
Definition: impeller.cc:299
impeller::interop::GetVersionAsString
static std::string GetVersionAsString(uint32_t version)
Definition: impeller.cc:78
impeller::interop::ImpellerDisplayListBuilderScale
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderScale(ImpellerDisplayListBuilder builder, float x_scale, float y_scale)
Definition: impeller.cc:261
impeller::interop::ImpellerParagraphStyleSetLocale
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetLocale(ImpellerParagraphStyle paragraph_style, const char *locale)
Definition: impeller.cc:1145
impeller::interop::ImpellerSurfaceDrawDisplayList
IMPELLER_EXTERN_C bool ImpellerSurfaceDrawDisplayList(ImpellerSurface surface, ImpellerDisplayList display_list)
Definition: impeller.cc:770
impeller::interop::ImpellerSurfacePresent
IMPELLER_EXTERN_C bool ImpellerSurfacePresent(ImpellerSurface surface)
Definition: impeller.cc:776
impeller::interop::ImpellerDisplayListBuilderDrawLine
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawLine(ImpellerDisplayListBuilder builder, const ImpellerPoint *from, const ImpellerPoint *to, ImpellerPaint paint)
Definition: impeller.cc:512
impeller::interop::ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeBegin
IMPELLER_EXTERN_C size_t ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeBegin(ImpellerGlyphInfo glyph_info)
Definition: impeller.cc:1444
impeller::interop::ImpellerDisplayListBuilderDrawDisplayList
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawDisplayList(ImpellerDisplayListBuilder builder, ImpellerDisplayList display_list, float opacity)
Definition: impeller.cc:716
impeller::interop::ImpellerDisplayListBuilderRestore
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderRestore(ImpellerDisplayListBuilder builder)
Definition: impeller.cc:256
impeller::interop::ImpellerParagraphGetWordBoundary
IMPELLER_EXTERN_C ImpellerRange ImpellerParagraphGetWordBoundary(ImpellerParagraph paragraph, size_t code_unit_index)
Definition: impeller.cc:1280
impeller::interop::ImpellerDisplayListBuilderDrawShadow
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawShadow(ImpellerDisplayListBuilder builder, ImpellerPath path, const ImpellerColor *color, float elevation, bool occluder_is_transparent, float device_pixel_ratio)
Definition: impeller.cc:1158
impeller::interop::ImpellerVulkanSwapchainRelease
IMPELLER_EXTERN_C void ImpellerVulkanSwapchainRelease(ImpellerVulkanSwapchain swapchain)
Definition: impeller.cc:214
impeller::interop::ImpellerDisplayListBuilderTranslate
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderTranslate(ImpellerDisplayListBuilder builder, float x_translation, float y_translation)
Definition: impeller.cc:274
impeller::interop::ImpellerParagraphStyleSetForeground
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetForeground(ImpellerParagraphStyle paragraph_style, ImpellerPaint paint)
Definition: impeller.cc:1076
impeller::interop::ImpellerDisplayListBuilderGetSaveCount
IMPELLER_EXTERN_C uint32_t ImpellerDisplayListBuilderGetSaveCount(ImpellerDisplayListBuilder builder)
Definition: impeller.cc:305
impeller::interop::ImpellerImageFilterCreateDilateNew
IMPELLER_EXTERN_C ImpellerImageFilter ImpellerImageFilterCreateDilateNew(float x_radius, float y_radius)
Definition: impeller.cc:1009
impeller::interop::ImpellerPaintSetStrokeMiter
IMPELLER_EXTERN_C void ImpellerPaintSetStrokeMiter(ImpellerPaint paint, float miter)
Definition: impeller.cc:501
impeller::interop::ImpellerParagraphStyleNew
IMPELLER_EXTERN_C ImpellerParagraphStyle ImpellerParagraphStyleNew()
Definition: impeller.cc:1061
impeller::interop::ImpellerTextureRetain
IMPELLER_EXTERN_C void ImpellerTextureRetain(ImpellerTexture texture)
Definition: impeller.cc:673
impeller::interop::ImpellerParagraphGetLineMetrics
IMPELLER_EXTERN_C ImpellerLineMetrics ImpellerParagraphGetLineMetrics(ImpellerParagraph paragraph)
Definition: impeller.cc:1323
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:363
impeller::interop::ImpellerImageFilterRetain
IMPELLER_EXTERN_C void ImpellerImageFilterRetain(ImpellerImageFilter image_filter)
Definition: impeller.cc:990
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:565
impeller::interop::ImpellerParagraphRetain
IMPELLER_EXTERN_C void ImpellerParagraphRetain(ImpellerParagraph paragraph)
Definition: impeller.cc:1230
impeller::interop::ImpellerDisplayListBuilderRelease
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderRelease(ImpellerDisplayListBuilder builder)
Definition: impeller.cc:235
impeller::interop::ImpellerColorFilterCreateBlendNew
IMPELLER_EXTERN_C ImpellerColorFilter ImpellerColorFilterCreateBlendNew(const ImpellerColor *color, ImpellerBlendMode blend_mode)
Definition: impeller.cc:959
impeller::interop::ImpellerDisplayListBuilderRestoreToCount
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderRestoreToCount(ImpellerDisplayListBuilder builder, uint32_t count)
Definition: impeller.cc:311
impeller::interop::ImpellerParagraphGetLongestLineWidth
IMPELLER_EXTERN_C float ImpellerParagraphGetLongestLineWidth(ImpellerParagraph paragraph)
Definition: impeller.cc:1250
impeller::interop::ImpellerGlyphInfoRetain
IMPELLER_EXTERN_C void ImpellerGlyphInfoRetain(ImpellerGlyphInfo glyph_info)
Definition: impeller.cc:1434
impeller::interop::ImpellerPaintSetMaskFilter
IMPELLER_EXTERN_C void ImpellerPaintSetMaskFilter(ImpellerPaint paint, ImpellerMaskFilter mask_filter)
Definition: impeller.cc:1055
impeller::interop::ImpellerDisplayListBuilderSetTransform
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderSetTransform(ImpellerDisplayListBuilder builder, const ImpellerMatrix *transform)
Definition: impeller.cc:281
impeller::interop::ImpellerParagraphGetLineCount
IMPELLER_EXTERN_C uint32_t ImpellerParagraphGetLineCount(ImpellerParagraph paragraph)
Definition: impeller.cc:1275
impeller::interop::ImpellerLineMetricsRetain
IMPELLER_EXTERN_C void ImpellerLineMetricsRetain(ImpellerLineMetrics line_metrics)
Definition: impeller.cc:1352
impeller::interop::ImpellerImageFilterCreateErodeNew
IMPELLER_EXTERN_C ImpellerImageFilter ImpellerImageFilterCreateErodeNew(float x_radius, float y_radius)
Definition: impeller.cc:1015
impeller::interop::ImpellerLineMetricsGetHeight
IMPELLER_EXTERN_C double ImpellerLineMetricsGetHeight(ImpellerLineMetrics metrics, size_t line)
Definition: impeller.cc:1394
impeller::interop::ImpellerDisplayListBuilderGetTransform
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderGetTransform(ImpellerDisplayListBuilder builder, ImpellerMatrix *out_transform)
Definition: impeller.cc:293
impeller::interop::ImpellerSurfaceRelease
IMPELLER_EXTERN_C void ImpellerSurfaceRelease(ImpellerSurface surface)
Definition: impeller.cc:765
impeller::interop::FromImpellerType
constexpr void FromImpellerType(const Matrix &from, ImpellerMatrix &to)
Definition: formats.h:209
impeller::interop::ReadString
static std::string ReadString(const char *string)
Definition: impeller.cc:1099
impeller::interop::ImpellerPaintSetColorFilter
IMPELLER_EXTERN_C void ImpellerPaintSetColorFilter(ImpellerPaint paint, ImpellerColorFilter color_filter)
Definition: impeller.cc:1037
impeller::interop::ImpellerDisplayListBuilderRotate
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderRotate(ImpellerDisplayListBuilder builder, float angle_degrees)
Definition: impeller.cc:268
impeller::interop::ImpellerParagraphGetMaxWidth
IMPELLER_EXTERN_C float ImpellerParagraphGetMaxWidth(ImpellerParagraph paragraph)
Definition: impeller.cc:1240
impeller::interop::DEFINE_PEER_GETTER
DEFINE_PEER_GETTER(ColorFilter, ImpellerColorFilter)
impeller::interop::ImpellerPathBuilderAddRoundedRect
IMPELLER_EXTERN_C void ImpellerPathBuilderAddRoundedRect(ImpellerPathBuilder builder, const ImpellerRect *rect, const ImpellerRoundingRadii *rounding_radii)
Definition: impeller.cc:397
impeller::interop::ImpellerVulkanSwapchainRetain
IMPELLER_EXTERN_C void ImpellerVulkanSwapchainRetain(ImpellerVulkanSwapchain swapchain)
Definition: impeller.cc:209
impeller::interop::ImpellerVulkanSwapchainCreateNew
IMPELLER_EXTERN_C ImpellerVulkanSwapchain ImpellerVulkanSwapchainCreateNew(ImpellerContext context, void *vulkan_surface_khr)
Definition: impeller.cc:193
impeller::interop::ImpellerParagraphGetIdeographicBaseline
IMPELLER_EXTERN_C float ImpellerParagraphGetIdeographicBaseline(ImpellerParagraph paragraph)
Definition: impeller.cc:1265
impeller::interop::ToDisplayListType
constexpr flutter::DlColor ToDisplayListType(Color color)
Definition: formats.h:77
impeller::interop::ImpellerPaintSetDrawStyle
IMPELLER_EXTERN_C void ImpellerPaintSetDrawStyle(ImpellerPaint paint, ImpellerDrawStyle style)
Definition: impeller.cc:481
impeller::interop::ImpellerDisplayListBuilderDrawTexture
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawTexture(ImpellerDisplayListBuilder builder, ImpellerTexture texture, const ImpellerPoint *point, ImpellerTextureSampling sampling, ImpellerPaint paint)
Definition: impeller.cc:781
impeller::interop::ImpellerPaintSetImageFilter
IMPELLER_EXTERN_C void ImpellerPaintSetImageFilter(ImpellerPaint paint, ImpellerImageFilter image_filter)
Definition: impeller.cc:1049
impeller::interop::ImpellerDisplayListRelease
IMPELLER_EXTERN_C void ImpellerDisplayListRelease(ImpellerDisplayList display_list)
Definition: impeller.cc:701
impeller::interop::ImpellerDisplayListBuilderClipPath
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderClipPath(ImpellerDisplayListBuilder builder, ImpellerPath path, ImpellerClipOperation op)
Definition: impeller.cc:449
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:881
impeller::interop::ImpellerDisplayListBuilderDrawPath
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawPath(ImpellerDisplayListBuilder builder, ImpellerPath path, ImpellerPaint paint)
Definition: impeller.cc:581
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:380
impeller::interop::ImpellerDisplayListRetain
IMPELLER_EXTERN_C void ImpellerDisplayListRetain(ImpellerDisplayList display_list)
Definition: impeller.cc:696
impeller::interop::ImpellerParagraphStyleSetBackground
IMPELLER_EXTERN_C void ImpellerParagraphStyleSetBackground(ImpellerParagraphStyle paragraph_style, ImpellerPaint paint)
Definition: impeller.cc:1082
impeller::interop::ImpellerDisplayListBuilderDrawRect
IMPELLER_EXTERN_C void ImpellerDisplayListBuilderDrawRect(ImpellerDisplayListBuilder builder, const ImpellerRect *rect, ImpellerPaint paint)
Definition: impeller.cc:539
impeller::interop::ImpellerPaintSetColor
IMPELLER_EXTERN_C void ImpellerPaintSetColor(ImpellerPaint paint, const ImpellerColor *color)
Definition: impeller.cc:471
impeller::interop::ImpellerParagraphBuilderAddText
IMPELLER_EXTERN_C void ImpellerParagraphBuilderAddText(ImpellerParagraphBuilder paragraph_builder, const uint8_t *data, uint32_t length)
Definition: impeller.cc:1210
impeller::StorageMode::kDevicePrivate
@ kDevicePrivate
impeller::StorageMode::kHostVisible
@ kHostVisible
impeller::TextureType::kTexture2D
@ kTexture2D
impeller::TextureCoordinateSystem::kUploadFromHost
@ kUploadFromHost
impeller::CompressionType::kLossless
@ kLossless
impeller::HandleType::kTexture
@ kTexture
impeller::TextureUsage::kShaderRead
@ kShaderRead
object.h
paragraph.h
paragraph_builder.h
paragraph_style.h
context_gles.h
context.h
scalar.h
ImpellerColor
Definition: impeller.h:588
ImpellerColorMatrix
Definition: impeller.h:577
ImpellerColorMatrix::m
float m[20]
Definition: impeller.h:578
ImpellerContextVulkanInfo
Definition: impeller.h:614
ImpellerContextVulkanSettings
Definition: impeller.h:608
ImpellerISize
Definition: impeller.h:495
ImpellerMapping
Definition: impeller.h:602
ImpellerMapping::on_release
ImpellerCallback IMPELLER_NULLABLE on_release
Definition: impeller.h:605
ImpellerMapping::length
uint64_t length
Definition: impeller.h:604
ImpellerMapping::data
const uint8_t *IMPELLER_NONNULL data
Definition: impeller.h:603
ImpellerMatrix
Definition: impeller.h:515
ImpellerPoint
Definition: impeller.h:485
ImpellerRange
Definition: impeller.h:500
ImpellerRect
Definition: impeller.h:478
ImpellerRoundingRadii
Definition: impeller.h:581
ImpellerTextureDescriptor
Definition: impeller.h:596
ImpellerTextureDescriptor::mip_count
uint32_t mip_count
Definition: impeller.h:599
ImpellerTextureDescriptor::pixel_format
ImpellerPixelFormat pixel_format
Definition: impeller.h:597
ImpellerTextureDescriptor::size
ImpellerISize size
Definition: impeller.h:598
impeller::Degrees
Definition: scalar.h:51
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
impeller::TPoint< Scalar >
impeller::TSize< Scalar >
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::TextureDescriptor::usage
TextureUsageMask usage
Definition: texture_descriptor.h:44
impeller::TextureDescriptor::compression_type
CompressionType compression_type
Definition: texture_descriptor.h:46
impeller::TextureDescriptor::type
TextureType type
Definition: texture_descriptor.h:40
impeller::TextureDescriptor::size
ISize size
Definition: texture_descriptor.h:42
impeller::TextureDescriptor::storage_mode
StorageMode storage_mode
Definition: texture_descriptor.h:39
impeller::TextureDescriptor::mip_count
size_t mip_count
Definition: texture_descriptor.h:43
impeller::TextureDescriptor::format
PixelFormat format
Definition: texture_descriptor.h:41
impeller::interop::ContextVK::Settings
Definition: context_vk.h:16
data
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:67
texture_gles.h
context_gles.h
surface_gles.h
context_mtl.h
surface_mtl.h
context_vk.h
surface_vk.h
swapchain_vk.h
color_filter.h
context.h
formats.h
image_filter.h
paint.h
path.h
path_builder.h
surface.h
texture.h
typography_context.h
validation.h
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:91