5 #ifndef FLUTTER_IMPELLER_TOOLKIT_INTEROP_IMPELLER_HPP_
6 #define FLUTTER_IMPELLER_TOOLKIT_INTEROP_IMPELLER_HPP_
11 #include <string_view>
22 #ifndef IMPELLER_HPP_NAMESPACE
23 #define IMPELLER_HPP_NAMESPACE impeller::hpp
29 "C++ bindings must be for the same version as the C API.");
37 const char*
name =
nullptr;
41 template <
class... Args>
43 return function(std::forward<Args>(args)...);
47 #define IMPELLER_HPP_EACH_PROC(PROC) \
48 PROC(ImpellerColorFilterCreateBlendNew) \
49 PROC(ImpellerColorFilterCreateColorMatrixNew) \
50 PROC(ImpellerColorFilterRelease) \
51 PROC(ImpellerColorFilterRetain) \
52 PROC(ImpellerColorSourceCreateConicalGradientNew) \
53 PROC(ImpellerColorSourceCreateImageNew) \
54 PROC(ImpellerColorSourceCreateLinearGradientNew) \
55 PROC(ImpellerColorSourceCreateRadialGradientNew) \
56 PROC(ImpellerColorSourceCreateSweepGradientNew) \
57 PROC(ImpellerColorSourceRelease) \
58 PROC(ImpellerColorSourceRetain) \
59 PROC(ImpellerContextCreateOpenGLESNew) \
60 PROC(ImpellerContextRelease) \
61 PROC(ImpellerContextRetain) \
62 PROC(ImpellerDisplayListBuilderClipOval) \
63 PROC(ImpellerDisplayListBuilderClipPath) \
64 PROC(ImpellerDisplayListBuilderClipRect) \
65 PROC(ImpellerDisplayListBuilderClipRoundedRect) \
66 PROC(ImpellerDisplayListBuilderCreateDisplayListNew) \
67 PROC(ImpellerDisplayListBuilderDrawDashedLine) \
68 PROC(ImpellerDisplayListBuilderDrawDisplayList) \
69 PROC(ImpellerDisplayListBuilderDrawLine) \
70 PROC(ImpellerDisplayListBuilderDrawOval) \
71 PROC(ImpellerDisplayListBuilderDrawPaint) \
72 PROC(ImpellerDisplayListBuilderDrawParagraph) \
73 PROC(ImpellerDisplayListBuilderDrawPath) \
74 PROC(ImpellerDisplayListBuilderDrawRect) \
75 PROC(ImpellerDisplayListBuilderDrawRoundedRect) \
76 PROC(ImpellerDisplayListBuilderDrawRoundedRectDifference) \
77 PROC(ImpellerDisplayListBuilderDrawTexture) \
78 PROC(ImpellerDisplayListBuilderDrawTextureRect) \
79 PROC(ImpellerDisplayListBuilderGetSaveCount) \
80 PROC(ImpellerDisplayListBuilderGetTransform) \
81 PROC(ImpellerDisplayListBuilderNew) \
82 PROC(ImpellerDisplayListBuilderRelease) \
83 PROC(ImpellerDisplayListBuilderResetTransform) \
84 PROC(ImpellerDisplayListBuilderRestore) \
85 PROC(ImpellerDisplayListBuilderRestoreToCount) \
86 PROC(ImpellerDisplayListBuilderRetain) \
87 PROC(ImpellerDisplayListBuilderRotate) \
88 PROC(ImpellerDisplayListBuilderSave) \
89 PROC(ImpellerDisplayListBuilderSaveLayer) \
90 PROC(ImpellerDisplayListBuilderScale) \
91 PROC(ImpellerDisplayListBuilderSetTransform) \
92 PROC(ImpellerDisplayListBuilderTransform) \
93 PROC(ImpellerDisplayListBuilderTranslate) \
94 PROC(ImpellerDisplayListRelease) \
95 PROC(ImpellerDisplayListRetain) \
96 PROC(ImpellerGetVersion) \
97 PROC(ImpellerImageFilterCreateBlurNew) \
98 PROC(ImpellerImageFilterCreateComposeNew) \
99 PROC(ImpellerImageFilterCreateDilateNew) \
100 PROC(ImpellerImageFilterCreateErodeNew) \
101 PROC(ImpellerImageFilterCreateMatrixNew) \
102 PROC(ImpellerImageFilterRelease) \
103 PROC(ImpellerImageFilterRetain) \
104 PROC(ImpellerMaskFilterCreateBlurNew) \
105 PROC(ImpellerMaskFilterRelease) \
106 PROC(ImpellerMaskFilterRetain) \
107 PROC(ImpellerPaintNew) \
108 PROC(ImpellerPaintRelease) \
109 PROC(ImpellerPaintRetain) \
110 PROC(ImpellerPaintSetBlendMode) \
111 PROC(ImpellerPaintSetColor) \
112 PROC(ImpellerPaintSetColorFilter) \
113 PROC(ImpellerPaintSetColorSource) \
114 PROC(ImpellerPaintSetDrawStyle) \
115 PROC(ImpellerPaintSetImageFilter) \
116 PROC(ImpellerPaintSetMaskFilter) \
117 PROC(ImpellerPaintSetStrokeCap) \
118 PROC(ImpellerPaintSetStrokeJoin) \
119 PROC(ImpellerPaintSetStrokeMiter) \
120 PROC(ImpellerPaintSetStrokeWidth) \
121 PROC(ImpellerParagraphBuilderAddText) \
122 PROC(ImpellerParagraphBuilderBuildParagraphNew) \
123 PROC(ImpellerParagraphBuilderNew) \
124 PROC(ImpellerParagraphBuilderPopStyle) \
125 PROC(ImpellerParagraphBuilderPushStyle) \
126 PROC(ImpellerParagraphBuilderRelease) \
127 PROC(ImpellerParagraphBuilderRetain) \
128 PROC(ImpellerParagraphGetAlphabeticBaseline) \
129 PROC(ImpellerParagraphGetHeight) \
130 PROC(ImpellerParagraphGetIdeographicBaseline) \
131 PROC(ImpellerParagraphGetLineCount) \
132 PROC(ImpellerParagraphGetLongestLineWidth) \
133 PROC(ImpellerParagraphGetMaxIntrinsicWidth) \
134 PROC(ImpellerParagraphGetMaxWidth) \
135 PROC(ImpellerParagraphGetMinIntrinsicWidth) \
136 PROC(ImpellerParagraphRelease) \
137 PROC(ImpellerParagraphRetain) \
138 PROC(ImpellerParagraphStyleNew) \
139 PROC(ImpellerParagraphStyleRelease) \
140 PROC(ImpellerParagraphStyleRetain) \
141 PROC(ImpellerParagraphStyleSetBackground) \
142 PROC(ImpellerParagraphStyleSetFontFamily) \
143 PROC(ImpellerParagraphStyleSetFontSize) \
144 PROC(ImpellerParagraphStyleSetFontStyle) \
145 PROC(ImpellerParagraphStyleSetFontWeight) \
146 PROC(ImpellerParagraphStyleSetForeground) \
147 PROC(ImpellerParagraphStyleSetHeight) \
148 PROC(ImpellerParagraphStyleSetLocale) \
149 PROC(ImpellerParagraphStyleSetMaxLines) \
150 PROC(ImpellerParagraphStyleSetTextAlignment) \
151 PROC(ImpellerParagraphStyleSetTextDirection) \
152 PROC(ImpellerPathBuilderAddArc) \
153 PROC(ImpellerPathBuilderAddOval) \
154 PROC(ImpellerPathBuilderAddRect) \
155 PROC(ImpellerPathBuilderAddRoundedRect) \
156 PROC(ImpellerPathBuilderClose) \
157 PROC(ImpellerPathBuilderCopyPathNew) \
158 PROC(ImpellerPathBuilderCubicCurveTo) \
159 PROC(ImpellerPathBuilderLineTo) \
160 PROC(ImpellerPathBuilderMoveTo) \
161 PROC(ImpellerPathBuilderNew) \
162 PROC(ImpellerPathBuilderQuadraticCurveTo) \
163 PROC(ImpellerPathBuilderRelease) \
164 PROC(ImpellerPathBuilderRetain) \
165 PROC(ImpellerPathBuilderTakePathNew) \
166 PROC(ImpellerPathRelease) \
167 PROC(ImpellerPathRetain) \
168 PROC(ImpellerSurfaceCreateWrappedFBONew) \
169 PROC(ImpellerSurfaceDrawDisplayList) \
170 PROC(ImpellerSurfaceRelease) \
171 PROC(ImpellerSurfaceRetain) \
172 PROC(ImpellerTextureCreateWithContentsNew) \
173 PROC(ImpellerTextureCreateWithOpenGLTextureHandleNew) \
174 PROC(ImpellerTextureGetOpenGLHandle) \
175 PROC(ImpellerTextureRelease) \
176 PROC(ImpellerTextureRetain) \
177 PROC(ImpellerTypographyContextNew) \
178 PROC(ImpellerTypographyContextRegisterFont) \
179 PROC(ImpellerTypographyContextRelease) \
180 PROC(ImpellerTypographyContextRetain)
184 const std::function<
void*(
const char* function_name)>& resolver) {
185 #define IMPELLER_HPP_PROC(proc) \
188 reinterpret_cast<decltype(proc.function)>(resolver(proc.name)); \
189 if (proc.function == nullptr) { \
194 #undef IMPELLER_HPP_PROC
198 #define IMPELLER_HPP_PROC(name) Proc<decltype(name)> name = {#name, nullptr};
200 #undef IMPELLER_HPP_PROC
209 template <
class T,
class Traits>
214 explicit Object(T
object) { Reset(
object); }
225 std::swap(object_, other.object_);
234 T
Get()
const {
return object_; }
236 explicit operator bool()
const {
return object_ !=
nullptr; }
241 void Reset(T other =
nullptr) {
242 if (object_ == other) {
246 Traits::Release(object_);
250 Traits::Retain(other);
255 [[nodiscard]] T Leak() {
262 #define IMPELLER_HPP_DEFINE_TRAITS(object) \
263 struct object##Traits { \
264 static void Retain(object ctx) { \
265 gGlobalProcTable.object##Retain(ctx); \
267 static void Release(object ctx) { \
268 gGlobalProcTable.object##Release(ctx); \
289 #undef IMPELLER_HPP_DEFINE_TRAITS
295 std::function<
void()> release_callback)
298 release_callback_(
std::move(release_callback)) {}
305 const uint8_t* mapping_ =
nullptr;
307 std::function<void()> release_callback_;
313 class Context final :
public Object<ImpellerContext, ImpellerContextTraits> {
321 const std::function<
void*(
const char*)>& gl_proc_address_resolver) {
323 std::function<
void*(
const char*)> resolver;
326 user_data.resolver = gl_proc_address_resolver;
328 void* user_data) ->
void* {
329 return reinterpret_cast<UserData*
>(user_data)->resolver(proc_name);
343 class Texture final :
public Object<ImpellerTexture, ImpellerTextureTraits> {
352 std::unique_ptr<Mapping> mapping =
nullptr) {
353 if (mapping ==
nullptr) {
354 mapping = std::make_unique<Mapping>(
nullptr, 0u,
nullptr);
357 c_mapping.
data = mapping->GetMapping();
358 c_mapping.
length = mapping->GetSize();
359 c_mapping.
on_release = [](
void* user_data) ->
void {
360 delete reinterpret_cast<Mapping*
>(user_data);
395 :
public Object<ImpellerColorFilter, ImpellerColorFilterTraits> {
422 :
public Object<ImpellerColorSource, ImpellerColorSourceTraits> {
464 horizontal_tile_mode,
551 :
public Object<ImpellerImageFilter, ImpellerImageFilterTraits> {
562 x_sigma, y_sigma, tile_mode),
572 outer.
Get(), inner.
Get()),
609 :
public Object<ImpellerMaskFilter, ImpellerMaskFilterTraits> {
627 :
public Object<ImpellerParagraph, ImpellerParagraphTraits> {
692 class Paint final :
public Object<ImpellerPaint, ImpellerPaintTraits> {
789 :
public Object<ImpellerParagraphStyle, ImpellerParagraphStyleTraits> {
888 ImpellerTypographyContextTraits> {
898 const char* optional_family_name_alias =
nullptr) {
903 c_mapping.
data = mapping->GetMapping();
904 c_mapping.
length = mapping->GetSize();
906 delete reinterpret_cast<Mapping*
>(user_data);
912 optional_family_name_alias
921 :
public Object<ImpellerParagraphBuilder, ImpellerParagraphBuilderTraits> {
966 return AddText(
reinterpret_cast<const uint8_t*
>(
string.
data()),
974 return AddText(
reinterpret_cast<const uint8_t*
>(
string.
data()),
982 class Path final :
public Object<ImpellerPath, ImpellerPathTraits> {
991 :
public Object<ImpellerPathBuilder, ImpellerPathBuilderTraits> {
1018 float start_angle_degrees,
1019 float end_angle_degrees) {
1022 start_angle_degrees,
1069 Get(), &control_point_1, &control_point_2, &end_point);
1104 :
public Object<ImpellerDisplayList, ImpellerDisplayListTraits> {
1107 :
Object(display_list, tag) {}
1140 display_list.
Get());
1148 :
public Object<ImpellerDisplayListBuilder,
1149 ImpellerDisplayListBuilderTraits> {
1220 const Paint& paint) {
1234 float opacity = 1.0f) {
1236 Get(), display_list.
Get(), opacity);
1245 const Paint& paint) {
1258 const Paint& paint) {
1280 Get(), paragraph.
Get(), &point);
1307 const Paint& paint) {
1323 const Paint& paint) {
1340 const Paint& paint) {
1342 Get(), texture.
Get(), &point, sampling, paint.
Get());
1353 const Paint& paint) {
1425 const Paint* paint =
nullptr,
1430 paint ? paint->Get() : NULL,
1431 backdrop ? backdrop->Get() : NULL
static ColorFilter Blend(const ImpellerColor &color, ImpellerBlendMode mode)
static ColorFilter Matrix(const ImpellerColorMatrix &color_matrix)
ColorFilter(ImpellerColorFilter filter, AdoptTag tag)
ColorSource(ImpellerColorSource source, AdoptTag tag)
static ColorSource ConicalGradient(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=nullptr)
static ColorSource Image(const Texture &image, ImpellerTileMode horizontal_tile_mode, ImpellerTileMode vertical_tile_mode, ImpellerTextureSampling sampling, const ImpellerMatrix *transformation=nullptr)
static ColorSource SweepGradient(const ImpellerPoint ¢er, float start, float end, uint32_t stop_count, const ImpellerColor *colors, const float *stops, ImpellerTileMode tile_mode, const ImpellerMatrix *transformation=nullptr)
static ColorSource LinearGradient(const ImpellerPoint &start_point, const ImpellerPoint &end_point, uint32_t stop_count, const ImpellerColor *colors, const float *stops, ImpellerTileMode tile_mode, const ImpellerMatrix *transformation=nullptr)
static ColorSource RadialGradient(const ImpellerPoint ¢er, float radius, uint32_t stop_count, const ImpellerColor *colors, const float *stops, ImpellerTileMode tile_mode, const ImpellerMatrix *transformation=nullptr)
static Context OpenGLES(const std::function< void *(const char *)> &gl_proc_address_resolver)
Context(ImpellerContext context, AdoptTag tag)
DisplayListBuilder & Transform(const ImpellerMatrix &transform)
DisplayListBuilder & DrawRoundedRect(const ImpellerRect &rect, const ImpellerRoundingRadii &radii, const Paint &paint)
DisplayListBuilder & Restore()
DisplayListBuilder & DrawLine(const ImpellerPoint &from, const ImpellerPoint &to, const Paint &paint)
DisplayListBuilder & Scale(float x_scale, float y_scale)
DisplayListBuilder & DrawRoundedRectDifference(const ImpellerRect &outer_rect, const ImpellerRoundingRadii &outer_radii, const ImpellerRect &inner_rect, const ImpellerRoundingRadii &inner_radii, const Paint &paint)
DisplayListBuilder & Rotate(float angle_degrees)
DisplayListBuilder & ClipRect(const ImpellerRect &rect, ImpellerClipOperation op)
DisplayListBuilder & DrawRect(const ImpellerRect &rect, const Paint &paint)
DisplayListBuilder & ResetTransform()
DisplayListBuilder & DrawTextureRect(const Texture &texture, const ImpellerRect &src_rect, const ImpellerRect &dst_rect, ImpellerTextureSampling sampling, const Paint &paint)
DisplayListBuilder & DrawParagraph(const Paragraph ¶graph, const ImpellerPoint &point)
DisplayListBuilder & DrawPaint(const Paint &paint)
DisplayListBuilder & DrawDashedLine(const ImpellerPoint &from, const ImpellerPoint &to, float on_length, float off_length, const Paint &paint)
DisplayListBuilder & DrawPath(const Path &path, const Paint &paint)
DisplayListBuilder & ClipRoundedRect(const ImpellerRect &rect, const ImpellerRoundingRadii &radii, ImpellerClipOperation op)
DisplayListBuilder & SaveLayer(const ImpellerRect &bounds, const Paint *paint=nullptr, const ImageFilter *backdrop=nullptr)
ImpellerMatrix GetTransform()
DisplayListBuilder & SetTransform(const ImpellerMatrix &transform)
DisplayListBuilder(const ImpellerRect *cull_rect=nullptr)
DisplayListBuilder & RestoreToCount(uint32_t count)
DisplayListBuilder & DrawOval(const ImpellerRect &oval_bounds, const Paint &paint)
DisplayListBuilder & Save()
DisplayListBuilder & Translate(float x_translation, float y_translation)
DisplayListBuilder & DrawTexture(const Texture &texture, const ImpellerPoint &point, ImpellerTextureSampling sampling, const Paint &paint)
DisplayListBuilder & DrawDisplayList(const DisplayList &display_list, float opacity=1.0f)
DisplayListBuilder & ClipPath(const Path &path, ImpellerClipOperation op)
DisplayListBuilder & ClipOval(const ImpellerRect &oval_bounds, ImpellerClipOperation op)
DisplayList(ImpellerDisplayList display_list, AdoptTag tag)
static ImageFilter Compose(const ImageFilter &outer, const ImageFilter &inner)
static ImageFilter Dilate(float x_radius, float y_radius)
static ImageFilter Matrix(const ImpellerMatrix &matrix, ImpellerTextureSampling sampling)
static ImageFilter Blur(float x_sigma, float y_sigma, ImpellerTileMode tile_mode)
static ImageFilter Erode(float x_radius, float y_radius)
ImageFilter(ImpellerImageFilter filter, AdoptTag tag)
const uint8_t * GetMapping() const
Mapping(const uint8_t *mapping, size_t size, std::function< void()> release_callback)
static MaskFilter Blur(ImpellerBlurStyle style, float sigma)
MaskFilter(ImpellerMaskFilter filter, AdoptTag tag)
Object & operator=(const Object &other)
Object & operator=(Object &&other)
Object(T object, AdoptTag)
Object(const Object &other)
Paint & SetDrawStyle(ImpellerDrawStyle style)
Paint & SetColor(const ImpellerColor &color)
Paint & SetBlendMode(ImpellerBlendMode mode)
Paint & SetMaskFilter(const MaskFilter &filter)
Paint & SetStrokeJoin(ImpellerStrokeJoin join)
Paint & SetStrokeWidth(float width)
Paint & SetStrokeCap(ImpellerStrokeCap cap)
Paint & SetColorFilter(const ColorFilter &filter)
Paint & SetColorSource(const ColorSource &source)
Paint & SetImageFilter(const ImageFilter &filter)
Paint & SetStrokeMiter(float miter)
Paragraph Build(float width)
ParagraphBuilder & PushStyle(const ParagraphStyle &style)
ParagraphBuilder & PopStyle()
ParagraphBuilder(const TypographyContext &context)
ParagraphBuilder & AddText(const std::string &string)
ParagraphBuilder & AddText(const std::string_view &string)
ParagraphBuilder & AddText(const uint8_t *utf8_data, uint32_t length)
float GetMaxIntrinsicWidth()
float GetAlphabeticBaseline()
float GetIdeographicBaseline()
Paragraph(ImpellerParagraph paragraph, AdoptTag tag)
float GetLongestLineWidth()
float GetMinIntrinsicWidth()
ParagraphStyle & SetTextAlignment(ImpellerTextAlignment align)
ParagraphStyle & SetTextDirection(ImpellerTextDirection direction)
ParagraphStyle & SetFontSize(float size)
ParagraphStyle & SetForeground(const Paint &paint)
ParagraphStyle & SetLocale(const char *locale)
ParagraphStyle & SetBackground(const Paint &paint)
ParagraphStyle & SetFontStyle(ImpellerFontStyle style)
ParagraphStyle & SetFontFamily(const char *family_name)
ParagraphStyle & SetFontWeight(ImpellerFontWeight weight)
ParagraphStyle & SetMaxLines(uint32_t max_lines)
ParagraphStyle & SetHeight(float height)
PathBuilder & QuadraticCurveTo(const ImpellerPoint &control_point, const ImpellerPoint &end_point)
PathBuilder & AddRect(const ImpellerRect &rect)
PathBuilder & CubicCurveTo(const ImpellerPoint &control_point_1, const ImpellerPoint &control_point_2, const ImpellerPoint &end_point)
Path BuildCopy(ImpellerFillType fill=ImpellerFillType::kImpellerFillTypeNonZero) const
PathBuilder & AddArc(const ImpellerRect &oval_bounds, float start_angle_degrees, float end_angle_degrees)
Path Build(ImpellerFillType fill=ImpellerFillType::kImpellerFillTypeNonZero)
PathBuilder & MoveTo(const ImpellerPoint &location)
PathBuilder & LineTo(const ImpellerPoint &location)
PathBuilder & AddOval(const ImpellerRect &oval_bounds)
PathBuilder & AddRoundedRect(const ImpellerRect &rect, const ImpellerRoundingRadii &rounding_radii)
Path(ImpellerPath path, AdoptTag tag)
bool Draw(const DisplayList &display_list)
static Surface WrapFBO(const Context &context, uint64_t fbo, ImpellerPixelFormat format, const ImpellerISize &size)
Surface(ImpellerSurface surface, AdoptTag tag)
Surface(ImpellerSurface surface)
Texture(ImpellerTexture texture, AdoptTag adopt)
static Texture WithContents(const Context &context, const ImpellerTextureDescriptor &descriptor, std::unique_ptr< Mapping > mapping=nullptr)
static Texture WithOpenGLTexture(const Context &context, const ImpellerTextureDescriptor &descriptor, uint64_t handle)
uint64_t GetOpenGLHandle() const
bool RegisterFont(std::unique_ptr< Mapping > mapping, const char *optional_family_name_alias=nullptr)
@ kImpellerFillTypeNonZero
#define IMPELLER_MAKE_VERSION(variant, major, minor, patch)
Pack a version in a uint32_t.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPathBuilder IMPELLER_NULLABLE ImpellerPathBuilderNew()
Create a new path builder. Paths themselves are immutable. A builder builds these immutable paths.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPaint IMPELLER_NULLABLE ImpellerPaintNew()
Create a new paint with default values.
void *IMPELLER_NULLABLE(* ImpellerProcAddressCallback)(const char *IMPELLER_NONNULL proc_name, void *IMPELLER_NULLABLE user_data)
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphStyle IMPELLER_NULLABLE ImpellerParagraphStyleNew()
Create a new paragraph style.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTypographyContext IMPELLER_NULLABLE ImpellerTypographyContextNew()
Create a new typography contents.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerDisplayListBuilder IMPELLER_NULLABLE ImpellerDisplayListBuilderNew(const ImpellerRect *IMPELLER_NULLABLE cull_rect)
Create a new display list builder.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphBuilder IMPELLER_NULLABLE ImpellerParagraphBuilderNew(ImpellerTypographyContext IMPELLER_NONNULL context)
Create a new paragraph builder.
#define IMPELLER_HPP_PROC(proc)
#define IMPELLER_HPP_EACH_PROC(PROC)
ProcTable gGlobalProcTable
IMPELLER_HPP_DEFINE_TRAITS(ImpellerColorFilter)
auto operator()(Args &&... args) const
bool Initialize(const std::function< void *(const char *function_name)> &resolver)
ImpellerCallback IMPELLER_NULLABLE on_release
const uint8_t *IMPELLER_NONNULL data
std::shared_ptr< const fml::Mapping > data