| Flutter Impeller |

impeller.h
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 #ifndef FLUTTER_IMPELLER_TOOLKIT_INTEROP_IMPELLER_H_
6 #define FLUTTER_IMPELLER_TOOLKIT_INTEROP_IMPELLER_H_
7
8 #include <stdbool.h>
9 #include <stddef.h>
10 #include <stdint.h>
11
12 ///-----------------------------------------------------------------------------
13 ///-----------------------------------------------------------------------------
14 /// ------- ___ _ _ _ ____ ___ --------
15 /// ------- |_ _|_ __ ___ _ __ ___| | | ___ _ __ / \ | _ \_ _| --------
16 /// ------- | || '_ ` _ \| '_ \ / _ \ | |/ _ \ '__| / _ \ | |_) | | --------
17 /// ------- | || | | | | | |_) | __/ | | __/ | / ___ \| __/| | --------
18 /// ------- |___|_| |_| |_| .__/ \___|_|_|\___|_| /_/ \_\_| |___| --------
19 /// ------- |_| --------
20 ///-----------------------------------------------------------------------------
21 ///-----------------------------------------------------------------------------
22 ///
23 /// This file describes a high-level, single-header, dependency-free, 2D
24 /// graphics API.
25 ///
26 /// The API fundamentals that include details about the object model, reference
27 /// counting, and null-safety are described in the README.
28 ///
29 #if defined(__cplusplus)
30 #define IMPELLER_EXTERN_C extern "C"
31 #define IMPELLER_EXTERN_C_BEGIN IMPELLER_EXTERN_C {
32 #define IMPELLER_EXTERN_C_END }
33 #else // defined(__cplusplus)
34 #define IMPELLER_EXTERN_C
35 #define IMPELLER_EXTERN_C_BEGIN
36 #define IMPELLER_EXTERN_C_END
37 #endif // defined(__cplusplus)
38
39 #ifdef _WIN32
40 #define IMPELLER_EXPORT_DECORATION __declspec(dllexport)
41 #else
42 #define IMPELLER_EXPORT_DECORATION __attribute__((visibility("default")))
43 #endif
44
45 #ifndef IMPELLER_NO_EXPORT
46 #define IMPELLER_EXPORT IMPELLER_EXPORT_DECORATION
47 #else // IMPELLER_NO_EXPORT
48 #define IMPELLER_EXPORT
49 #endif // IMPELLER_NO_EXPORT
50
51 #ifdef __clang__
52 #define IMPELLER_NULLABLE _Nullable
53 #define IMPELLER_NONNULL _Nonnull
54 #else // __clang__
55 #define IMPELLER_NULLABLE
56 #define IMPELLER_NONNULL
57 #endif // __clang__
58
59 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202000L)
60 #define IMPELLER_NODISCARD [[nodiscard]]
61 #else // defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202000L)
62 #define IMPELLER_NODISCARD
63 #endif // defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202000L)
64
65 IMPELLER_EXTERN_C_BEGIN
66
67 //------------------------------------------------------------------------------
68 /// @brief Pack a version in a uint32_t.
69 ///
70 /// @param[in] variant The version variant.
71 /// @param[in] major The major version.
72 /// @param[in] minor The minor version.
73 /// @param[in] patch The patch version.
74 ///
75 /// @return The packed version number.
76 ///
77 #define IMPELLER_MAKE_VERSION(variant, major, minor, patch) \
78 ((((uint32_t)(variant)) << 29U) | (((uint32_t)(major)) << 22U) | \
79 (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch)))
80
81 #define IMPELLER_VERSION_VARIANT 1
82 #define IMPELLER_VERSION_MAJOR 1
83 #define IMPELLER_VERSION_MINOR 2
84 #define IMPELLER_VERSION_PATCH 0
85
86 //------------------------------------------------------------------------------
87 /// The current Impeller API version.
88 ///
89 /// This version must be passed to APIs that create top-level objects like
90 /// graphics contexts. Construction of the context may fail if the API version
91 /// expected by the caller is not supported by the library.
92 ///
93 /// The version currently supported by the library is returned by a call to
94 /// `ImpellerGetVersion`
95 ///
96 /// Since there are no API stability guarantees today, passing a version that is
97 /// different to the one returned by `ImpellerGetVersion` will always fail.
98 ///
99 /// @see `ImpellerGetVersion`
100 ///
101 #define IMPELLER_VERSION \
102 IMPELLER_MAKE_VERSION(IMPELLER_VERSION_VARIANT, IMPELLER_VERSION_MAJOR, \
103 IMPELLER_VERSION_MINOR, IMPELLER_VERSION_PATCH)
104
105 //------------------------------------------------------------------------------
106 /// @param[in] version The packed version.
107 ///
108 /// @return The version variant.
109 ///
110 #define IMPELLER_VERSION_GET_VARIANT(version) ((uint32_t)(version) >> 29U)
111
112 //------------------------------------------------------------------------------
113 /// @param[in] version The packed version.
114 ///
115 /// @return The major version.
116 ///
117 #define IMPELLER_VERSION_GET_MAJOR(version) \
118 (((uint32_t)(version) >> 22U) & 0x7FU)
119
120 //------------------------------------------------------------------------------
121 /// @param[in] version The packed version.
122 ///
123 /// @return The minor version.
124 ///
125 #define IMPELLER_VERSION_GET_MINOR(version) \
126 (((uint32_t)(version) >> 12U) & 0x3FFU)
127
128 //------------------------------------------------------------------------------
129 /// @param[in] version The packed version.
130 ///
131 /// @return The patch version.
132 ///
133 #define IMPELLER_VERSION_GET_PATCH(version) ((uint32_t)(version) & 0xFFFU)
134
135 //------------------------------------------------------------------------------
136 // Handles
137 //------------------------------------------------------------------------------
138
139 #define IMPELLER_INTERNAL_HANDLE_NAME(handle) handle##_
140 #define IMPELLER_DEFINE_HANDLE(handle) \
141 typedef struct IMPELLER_INTERNAL_HANDLE_NAME(handle) * handle;
142
143 //------------------------------------------------------------------------------
144 /// An Impeller graphics context. Contexts are platform and client-rendering-API
145 /// specific.
146 ///
147 /// Contexts are thread-safe objects that are expensive to create. Most
148 /// applications will only ever create a single context during their lifetimes.
149 /// Once setup, Impeller is ready to render frames as performantly as possible.
150 ///
151 /// During setup, context create the underlying graphics pipelines, allocators,
152 /// worker threads, etc...
153 ///
154 /// The general guidance is to create as few contexts as possible (typically
155 /// just one) and share them as much as possible.
156 ///
157 IMPELLER_DEFINE_HANDLE(ImpellerContext);
158
159 //------------------------------------------------------------------------------
160 /// Display lists represent encoded rendering intent. These objects are
161 /// immutable, reusable, thread-safe, and context-agnostic.
162 ///
163 /// While it is perfectly fine to create new display lists per frame, there may
164 /// be opportunities for optimization when display lists are reused multiple
165 /// times.
166 ///
167 IMPELLER_DEFINE_HANDLE(ImpellerDisplayList);
168
169 //------------------------------------------------------------------------------
170 /// Display list builders allow for the incremental creation of display lists.
171 ///
172 /// Display list builders are context-agnostic.
173 ///
174 IMPELLER_DEFINE_HANDLE(ImpellerDisplayListBuilder);
175
176 //------------------------------------------------------------------------------
177 /// Paints control the behavior of draw calls encoded in a display list.
178 ///
179 /// Like display lists, paints are context-agnostic.
180 ///
181 IMPELLER_DEFINE_HANDLE(ImpellerPaint);
182
183 //------------------------------------------------------------------------------
184 /// Color filters are functions that take two colors and mix them to produce a
185 /// single color. This color is then merged with the destination during
186 /// blending.
187 ///
188 IMPELLER_DEFINE_HANDLE(ImpellerColorFilter);
189
190 //------------------------------------------------------------------------------
191 /// Color sources are functions that generate colors for each texture element
192 /// covered by a draw call. The colors for each element can be generated using a
193 /// mathematical function (to produce gradients for example) or sampled from a
194 /// texture.
195 ///
196 IMPELLER_DEFINE_HANDLE(ImpellerColorSource);
197
198 //------------------------------------------------------------------------------
199 /// Image filters are functions that are applied regions of a texture to produce
200 /// a single color. Contrast this with color filters that operate independently
201 /// on a per-pixel basis. The generated color is then merged with the
202 /// destination during blending.
203 ///
204 IMPELLER_DEFINE_HANDLE(ImpellerImageFilter);
205
206 //------------------------------------------------------------------------------
207 /// Mask filters are functions that are applied over a shape after it has been
208 /// drawn but before it has been blended into the final image.
209 ///
210 IMPELLER_DEFINE_HANDLE(ImpellerMaskFilter);
211
212 //------------------------------------------------------------------------------
213 /// Typography contexts allow for the layout and rendering of text.
214 ///
215 /// These are typically expensive to create and applications will only ever need
216 /// to create a single one of these during their lifetimes.
217 ///
218 /// Unlike graphics context, typograhy contexts are not thread-safe. These must
219 /// be created, used, and collected on a single thread.
220 ///
221 IMPELLER_DEFINE_HANDLE(ImpellerTypographyContext);
222
223 //------------------------------------------------------------------------------
224 /// An immutable, fully laid out paragraph.
225 ///
226 IMPELLER_DEFINE_HANDLE(ImpellerParagraph);
227
228 //------------------------------------------------------------------------------
229 /// Paragraph builders allow for the creation of fully laid out paragraphs
230 /// (which themselves are immutable).
231 ///
232 /// To build a paragraph, users push/pop paragraph styles onto a stack then add
233 /// UTF-8 encoded text. The properties on the top of paragraph style stack when
234 /// the text is added are used to layout and shape that subset of the paragraph.
235 ///
236 /// @see `ImpellerParagraphStyle`
237 ///
238 IMPELLER_DEFINE_HANDLE(ImpellerParagraphBuilder);
239
240 //------------------------------------------------------------------------------
241 /// Specified when building a paragraph, paragraph styles are managed in a stack
242 /// with specify text properties to apply to text that is added to the paragraph
243 /// builder.
244 ///
245 IMPELLER_DEFINE_HANDLE(ImpellerParagraphStyle);
246
247 //------------------------------------------------------------------------------
248 /// Represents a two-dimensional path that is immutable and graphics context
249 /// agnostic.
250 ///
251 /// Paths in Impeller consist of linear, cubic Bézier curve, and quadratic
252 /// Bézier curve segments. All other shapes are approximations using these
253 /// building blocks.
254 ///
255 /// Paths are created using path builder that allow for the configuration of the
256 /// path segments, how they are filled, and/or stroked.
257 ///
258 IMPELLER_DEFINE_HANDLE(ImpellerPath);
259
260 //------------------------------------------------------------------------------
261 /// Path builders allow for the incremental building up of paths.
262 ///
263 IMPELLER_DEFINE_HANDLE(ImpellerPathBuilder);
264
265 //------------------------------------------------------------------------------
266 /// A surface represents a render target for Impeller to direct the rendering
267 /// intent specified the form of display lists to.
268 ///
269 /// Render targets are how Impeller API users perform Window System Integration
270 /// (WSI). Users wrap swapchain images as surfaces and draw display lists onto
271 /// these surfaces to present content.
272 ///
273 /// Creating surfaces is typically platform and client-rendering-API specific.
274 ///
275 IMPELLER_DEFINE_HANDLE(ImpellerSurface);
276
277 //------------------------------------------------------------------------------
278 /// A reference to a texture whose data is resident on the GPU. These can be
279 /// referenced in draw calls and paints.
280 ///
281 /// Creating textures is extremely expensive. Creating a single one can
282 /// typically comfortably blow the frame budget of an application. Textures
283 /// should be created on background threads.
284 ///
285 /// @warning While textures themselves are thread safe, some context types
286 /// (like OpenGL) may need extra configuration to be able to operate
287 /// from multiple threads.
288 ///
289 IMPELLER_DEFINE_HANDLE(ImpellerTexture);
290
291 //------------------------------------------------------------------------------
292 // Signatures
293 //------------------------------------------------------------------------------
294
295 //------------------------------------------------------------------------------
296 /// A callback invoked by Impeller that passes a user supplied baton back to the
297 /// user. Impeller does not interpret the baton in any way. The way the baton is
298 /// specified and the thread on which the callback is invoked depends on how the
299 /// user supplies the callback to Impeller.
300 ///
301 typedef void (*ImpellerCallback)(void* IMPELLER_NULLABLE user_data);
302
303 //------------------------------------------------------------------------------
304 /// A callback used by Impeller to allow the user to resolve function pointers.
305 /// A user supplied baton that is uninterpreted by Impeller is passed back to
306 /// the user in the callback. How the baton is specified to Impeller and the
307 /// thread on which the callback is invoked depends on how the callback is
308 /// specified to Impeller.
309 ///
310 typedef void* IMPELLER_NULLABLE (*ImpellerProcAddressCallback)(
311 const char* IMPELLER_NONNULL proc_name,
312 void* IMPELLER_NULLABLE user_data);
313
314 //------------------------------------------------------------------------------
315 // Enumerations
316 // -----------------------------------------------------------------------------
317 typedef enum ImpellerFillType {
318 kImpellerFillTypeNonZero,
319 kImpellerFillTypeOdd,
320 } ImpellerFillType;
321
322 typedef enum ImpellerClipOperation {
323 kImpellerClipOperationDifference,
324 kImpellerClipOperationIntersect,
325 } ImpellerClipOperation;
326
327 typedef enum ImpellerBlendMode {
328 kImpellerBlendModeClear,
329 kImpellerBlendModeSource,
330 kImpellerBlendModeDestination,
331 kImpellerBlendModeSourceOver,
332 kImpellerBlendModeDestinationOver,
333 kImpellerBlendModeSourceIn,
334 kImpellerBlendModeDestinationIn,
335 kImpellerBlendModeSourceOut,
336 kImpellerBlendModeDestinationOut,
337 kImpellerBlendModeSourceATop,
338 kImpellerBlendModeDestinationATop,
339 kImpellerBlendModeXor,
340 kImpellerBlendModePlus,
341 kImpellerBlendModeModulate,
342 kImpellerBlendModeScreen,
343 kImpellerBlendModeOverlay,
344 kImpellerBlendModeDarken,
345 kImpellerBlendModeLighten,
346 kImpellerBlendModeColorDodge,
347 kImpellerBlendModeColorBurn,
348 kImpellerBlendModeHardLight,
349 kImpellerBlendModeSoftLight,
350 kImpellerBlendModeDifference,
351 kImpellerBlendModeExclusion,
352 kImpellerBlendModeMultiply,
353 kImpellerBlendModeHue,
354 kImpellerBlendModeSaturation,
355 kImpellerBlendModeColor,
356 kImpellerBlendModeLuminosity,
357 } ImpellerBlendMode;
358
359 typedef enum ImpellerDrawStyle {
360 kImpellerDrawStyleFill,
361 kImpellerDrawStyleStroke,
362 kImpellerDrawStyleStrokeAndFill,
363 } ImpellerDrawStyle;
364
365 typedef enum ImpellerStrokeCap {
366 kImpellerStrokeCapButt,
367 kImpellerStrokeCapRound,
368 kImpellerStrokeCapSquare,
369 } ImpellerStrokeCap;
370
371 typedef enum ImpellerStrokeJoin {
372 kImpellerStrokeJoinMiter,
373 kImpellerStrokeJoinRound,
374 kImpellerStrokeJoinBevel,
375 } ImpellerStrokeJoin;
376
377 typedef enum ImpellerPixelFormat {
378 kImpellerPixelFormatRGBA8888,
379 } ImpellerPixelFormat;
380
381 typedef enum ImpellerTextureSampling {
382 kImpellerTextureSamplingNearestNeighbor,
383 kImpellerTextureSamplingLinear,
384 } ImpellerTextureSampling;
385
386 typedef enum ImpellerTileMode {
387 kImpellerTileModeClamp,
388 kImpellerTileModeRepeat,
389 kImpellerTileModeMirror,
390 kImpellerTileModeDecal,
391 } ImpellerTileMode;
392
393 typedef enum ImpellerBlurStyle {
394 kImpellerBlurStyleNormal,
395 kImpellerBlurStyleSolid,
396 kImpellerBlurStyleOuter,
397 kImpellerBlurStyleInner,
398 } ImpellerBlurStyle;
399
400 typedef enum ImpellerColorSpace {
401 kImpellerColorSpaceSRGB,
402 kImpellerColorSpaceExtendedSRGB,
403 kImpellerColorSpaceDisplayP3,
404 } ImpellerColorSpace;
405
406 typedef enum ImpellerFontWeight {
407 kImpellerFontWeight100, // Thin
408 kImpellerFontWeight200, // Extra-Light
409 kImpellerFontWeight300, // Light
410 kImpellerFontWeight400, // Normal/Regular
411 kImpellerFontWeight500, // Medium
412 kImpellerFontWeight600, // Semi-bold
413 kImpellerFontWeight700, // Bold
414 kImpellerFontWeight800, // Extra-Bold
415 kImpellerFontWeight900, // Black
416 } ImpellerFontWeight;
417
418 typedef enum ImpellerFontStyle {
419 kImpellerFontStyleNormal,
420 kImpellerFontStyleItalic,
421 } ImpellerFontStyle;
422
423 typedef enum ImpellerTextAlignment {
424 kImpellerTextAlignmentLeft,
425 kImpellerTextAlignmentRight,
426 kImpellerTextAlignmentCenter,
427 kImpellerTextAlignmentJustify,
428 kImpellerTextAlignmentStart,
429 kImpellerTextAlignmentEnd,
430 } ImpellerTextAlignment;
431
432 typedef enum ImpellerTextDirection {
433 kImpellerTextDirectionRTL,
434 kImpellerTextDirectionLTR,
435 } ImpellerTextDirection;
436
437 //------------------------------------------------------------------------------
438 // Non-opaque structs
439 // -----------------------------------------------------------------------------
440 typedef struct ImpellerRect {
441 float x;
442 float y;
443 float width;
444 float height;
445 } ImpellerRect;
446
447 typedef struct ImpellerPoint {
448 float x;
449 float y;
450 } ImpellerPoint;
451
452 typedef struct ImpellerSize {
453 float width;
454 float height;
455 } ImpellerSize;
456
457 typedef struct ImpellerISize {
458 int64_t width;
459 int64_t height;
460 } ImpellerISize;
461
462 //------------------------------------------------------------------------------
463 /// A 4x4 transformation matrix using column-major storage.
464 ///
465 /// ```
466 /// | m[0] m[4] m[8] m[12] |
467 /// | m[1] m[5] m[9] m[13] |
468 /// | m[2] m[6] m[10] m[14] |
469 /// | m[3] m[7] m[11] m[15] |
470 /// ```
471 ///
472 typedef struct ImpellerMatrix {
473 float m[16];
474 } ImpellerMatrix;
475
476 //------------------------------------------------------------------------------
477 /// A 4x5 matrix using row-major storage used for transforming color values.
478 ///
479 /// To transform color values, a 5x5 matrix is constructed with the 5th row
480 /// being identity. Then the following transformation is performed:
481 ///
482 /// ```
483 /// | R' | | m[0] m[1] m[2] m[3] m[4] | | R |
484 /// | G' | | m[5] m[6] m[7] m[8] m[9] | | G |
485 /// | B' | = | m[10] m[11] m[12] m[13] m[14] | * | B |
486 /// | A' | | m[15] m[16] m[17] m[18] m[19] | | A |
487 /// | 1 | | 0 0 0 0 1 | | 1 |
488 /// ```
489 ///
490 /// The translation column (m[4], m[9], m[14], m[19]) must be specified in
491 /// non-normalized 8-bit unsigned integer space (0 to 255). Values outside this
492 /// range will produce undefined results.
493 ///
494 /// The identity transformation is thus:
495 ///
496 /// ```
497 /// 1, 0, 0, 0, 0,
498 /// 0, 1, 0, 0, 0,
499 /// 0, 0, 1, 0, 0,
500 /// 0, 0, 0, 1, 0,
501 /// ```
502 ///
503 /// Some examples:
504 ///
505 /// To invert all colors:
506 ///
507 /// ```
508 /// -1, 0, 0, 0, 255,
509 /// 0, -1, 0, 0, 255,
510 /// 0, 0, -1, 0, 255,
511 /// 0, 0, 0, 1, 0,
512 /// ```
513 ///
514 /// To apply a sepia filter:
515 ///
516 /// ```
517 /// 0.393, 0.769, 0.189, 0, 0,
518 /// 0.349, 0.686, 0.168, 0, 0,
519 /// 0.272, 0.534, 0.131, 0, 0,
520 /// 0, 0, 0, 1, 0,
521 /// ```
522 ///
523 /// To apply a grayscale conversion filter:
524 ///
525 /// ```
526 /// 0.2126, 0.7152, 0.0722, 0, 0,
527 /// 0.2126, 0.7152, 0.0722, 0, 0,
528 /// 0.2126, 0.7152, 0.0722, 0, 0,
529 /// 0, 0, 0, 1, 0,
530 /// ```
531 ///
532 /// @see ImpellerColorFilter
533 ///
534 typedef struct ImpellerColorMatrix {
535 float m[20];
536 } ImpellerColorMatrix;
537
538 typedef struct ImpellerRoundingRadii {
539 ImpellerPoint top_left;
540 ImpellerPoint bottom_left;
541 ImpellerPoint top_right;
542 ImpellerPoint bottom_right;
543 } ImpellerRoundingRadii;
544
545 typedef struct ImpellerColor {
546 float red;
547 float green;
548 float blue;
549 float alpha;
550 ImpellerColorSpace color_space;
551 } ImpellerColor;
552
553 typedef struct ImpellerTextureDescriptor {
554 ImpellerPixelFormat pixel_format;
555 ImpellerISize size;
556 uint32_t mip_count;
557 } ImpellerTextureDescriptor;
558
559 typedef struct ImpellerMapping {
560 const uint8_t* IMPELLER_NONNULL data;
561 uint64_t length;
562 ImpellerCallback IMPELLER_NULLABLE on_release;
563 } ImpellerMapping;
564
565 //------------------------------------------------------------------------------
566 // Version
567 //------------------------------------------------------------------------------
568
569 //------------------------------------------------------------------------------
570 /// @brief Get the version of Impeller standalone API. This is the API that
571 /// will be accepted for validity checks when provided to the
572 /// context creation methods.
573 ///
574 /// The current version of the API is denoted by the
575 /// `IMPELLER_VERSION` macro. This version must be passed to APIs
576 /// that create top-level objects like graphics contexts.
577 /// Construction of the context may fail if the API version expected
578 /// by the caller is not supported by the library.
579 ///
580 /// Since there are no API stability guarantees today, passing a
581 /// version that is different to the one returned by
582 /// `ImpellerGetVersion` will always fail.
583 ///
584 /// @see `ImpellerContextCreateOpenGLESNew`
585 ///
586 /// @return The version of the standalone API.
587 ///
588 IMPELLER_EXPORT
589 uint32_t ImpellerGetVersion();
590
591 //------------------------------------------------------------------------------
592 // Context
593 //------------------------------------------------------------------------------
594
595 //------------------------------------------------------------------------------
596 /// @brief Create an OpenGL(ES) Impeller context.
597 ///
598 /// @warning Unlike other context types, the OpenGL ES context can only be
599 /// created, used, and collected on the calling thread. This
600 /// restriction may be lifted in the future once reactor workers are
601 /// exposed in the API. No other context types have threading
602 /// restrictions. Till reactor workers can be used, using the
603 /// context on a background thread will cause a stall of OpenGL
604 /// operations.
605 ///
606 /// @param[in] version The version of the Impeller
607 /// standalone API. See `ImpellerGetVersion`. If the
608 /// specified here is not compatible with the version
609 /// of the library, context creation will fail and NULL
610 /// context returned from this call.
611 /// @param[in] gl_proc_address_callback
612 /// The gl proc address callback. For instance,
613 /// `eglGetProcAddress`.
614 /// @param[in] gl_proc_address_callback_user_data
615 /// The gl proc address callback user data baton. This
616 /// pointer is not interpreted by Impeller and will be
617 /// returned as user data in the proc address callback.
618 /// user data.
619 ///
620 /// @return The context or NULL if one cannot be created.
621 ///
622 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE
623 ImpellerContextCreateOpenGLESNew(
624 uint32_t version,
625 ImpellerProcAddressCallback IMPELLER_NONNULL gl_proc_address_callback,
626 void* IMPELLER_NULLABLE gl_proc_address_callback_user_data);
627
628 //------------------------------------------------------------------------------
629 /// @brief Retain a strong reference to the object. The object can be NULL
630 /// in which case this method is a no-op.
631 ///
632 /// @param[in] context The context.
633 ///
634 IMPELLER_EXPORT
635 void ImpellerContextRetain(ImpellerContext IMPELLER_NULLABLE context);
636
637 //------------------------------------------------------------------------------
638 /// @brief Release a previously retained reference to the object. The
639 /// object can be NULL in which case this method is a no-op.
640 ///
641 /// @param[in] context The context.
642 ///
643 IMPELLER_EXPORT
644 void ImpellerContextRelease(ImpellerContext IMPELLER_NULLABLE context);
645
646 //------------------------------------------------------------------------------
647 // Surface
648 //------------------------------------------------------------------------------
649
650 //------------------------------------------------------------------------------
651 /// @brief Create a new surface by wrapping an existing framebuffer object.
652 /// The framebuffer must be complete as determined by
653 /// `glCheckFramebufferStatus`. The framebuffer is still owned by
654 /// the caller and it must be collected once the surface is
655 /// collected.
656 ///
657 /// @param[in] context The context.
658 /// @param[in] fbo The framebuffer object handle.
659 /// @param[in] format The format of the framebuffer.
660 /// @param[in] size The size of the framebuffer is texels.
661 ///
662 /// @return The surface if once can be created, NULL otherwise.
663 ///
664 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE
665 ImpellerSurfaceCreateWrappedFBONew(ImpellerContext IMPELLER_NULLABLE context,
666 uint64_t fbo,
667 ImpellerPixelFormat format,
668 const ImpellerISize* IMPELLER_NULLABLE size);
669
670 //------------------------------------------------------------------------------
671 /// @brief Retain a strong reference to the object. The object can be NULL
672 /// in which case this method is a no-op.
673 ///
674 /// @param[in] surface The surface.
675 ///
676 IMPELLER_EXPORT
677 void ImpellerSurfaceRetain(ImpellerSurface IMPELLER_NULLABLE surface);
678
679 //------------------------------------------------------------------------------
680 /// @brief Release a previously retained reference to the object. The
681 /// object can be NULL in which case this method is a no-op.
682 ///
683 /// @param[in] surface The surface.
684 ///
685 IMPELLER_EXPORT
686 void ImpellerSurfaceRelease(ImpellerSurface IMPELLER_NULLABLE surface);
687
688 //------------------------------------------------------------------------------
689 /// @brief Draw a display list onto the surface. The same display list can
690 /// be drawn multiple times to different surfaces.
691 ///
692 /// @warning In the OpenGL backend, Impeller will not make an effort to
693 /// preserve the OpenGL state that is current in the context.
694 /// Embedders that perform additional OpenGL operations in the
695 /// context should expect the reset state after control transitions
696 /// back to them. Key state to watch out for would be the viewports,
697 /// stencil rects, test toggles, resource (texture, framebuffer,
698 /// buffer) bindings, etc...
699 ///
700 /// @param[in] surface The surface to draw the display list to.
701 /// @param[in] display_list The display list to draw onto the surface.
702 ///
703 /// @return If the display list could be drawn onto the surface.
704 ///
705 IMPELLER_EXPORT
706 bool ImpellerSurfaceDrawDisplayList(
707 ImpellerSurface IMPELLER_NULLABLE surface,
708 ImpellerDisplayList IMPELLER_NONNULL display_list);
709
710 //------------------------------------------------------------------------------
711 // Path
712 //------------------------------------------------------------------------------
713
714 //------------------------------------------------------------------------------
715 /// @brief Retain a strong reference to the object. The object can be NULL
716 /// in which case this method is a no-op.
717 ///
718 /// @param[in] path The path.
719 ///
720 IMPELLER_EXPORT
721 void ImpellerPathRetain(ImpellerPath IMPELLER_NULLABLE path);
722
723 //------------------------------------------------------------------------------
724 /// @brief Release a previously retained reference to the object. The
725 /// object can be NULL in which case this method is a no-op.
726 ///
727 /// @param[in] path The path.
728 ///
729 IMPELLER_EXPORT
730 void ImpellerPathRelease(ImpellerPath IMPELLER_NULLABLE path);
731
732 //------------------------------------------------------------------------------
733 // Path Builder
734 //------------------------------------------------------------------------------
735
736 //------------------------------------------------------------------------------
737 /// @brief Create a new path builder. Paths themselves are immutable.
738 /// A builder builds these immutable paths.
739 ///
740 /// @return The path builder.
741 ///
742 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPathBuilder IMPELLER_NULLABLE
743 ImpellerPathBuilderNew();
744
745 //------------------------------------------------------------------------------
746 /// @brief Retain a strong reference to the object. The object can be NULL
747 /// in which case this method is a no-op.
748 ///
749 /// @param[in] builder The builder.
750 ///
751 IMPELLER_EXPORT
752 void ImpellerPathBuilderRetain(ImpellerPathBuilder IMPELLER_NULLABLE builder);
753
754 //------------------------------------------------------------------------------
755 /// @brief Release a previously retained reference to the object. The
756 /// object can be NULL in which case this method is a no-op.
757 ///
758 /// @param[in] builder The builder.
759 ///
760 IMPELLER_EXPORT
761 void ImpellerPathBuilderRelease(ImpellerPathBuilder IMPELLER_NULLABLE builder);
762
763 //------------------------------------------------------------------------------
764 /// @brief Move the cursor to the specified location.
765 ///
766 /// @param[in] builder The builder.
767 /// @param[in] location The location.
768 ///
769 IMPELLER_EXPORT
770 void ImpellerPathBuilderMoveTo(ImpellerPathBuilder IMPELLER_NONNULL builder,
771 const ImpellerPoint* IMPELLER_NONNULL location);
772
773 //------------------------------------------------------------------------------
774 /// @brief Add a line segment from the current cursor location to the given
775 /// location. The cursor location is updated to be at the endpoint.
776 ///
777 /// @param[in] builder The builder.
778 /// @param[in] location The location.
779 ///
780 IMPELLER_EXPORT
781 void ImpellerPathBuilderLineTo(ImpellerPathBuilder IMPELLER_NONNULL builder,
782 const ImpellerPoint* IMPELLER_NONNULL location);
783
784 //------------------------------------------------------------------------------
785 /// @brief Add a quadratic curve from whose start point is the cursor to
786 /// the specified end point using the a single control point.
787 ///
788 /// The new location of the cursor after this call is the end point.
789 ///
790 /// @param[in] builder The builder.
791 /// @param[in] control_point The control point.
792 /// @param[in] end_point The end point.
793 ///
794 IMPELLER_EXPORT
795 void ImpellerPathBuilderQuadraticCurveTo(
796 ImpellerPathBuilder IMPELLER_NONNULL builder,
797 const ImpellerPoint* IMPELLER_NONNULL control_point,
798 const ImpellerPoint* IMPELLER_NONNULL end_point);
799
800 //------------------------------------------------------------------------------
801 /// @brief Add a cubic curve whose start point is current cursor location
802 /// to the specified end point using the two specified control
803 /// points.
804 ///
805 /// The new location of the cursor after this call is the end point
806 /// supplied.
807 ///
808 /// @param[in] builder The builder
809 /// @param[in] control_point_1 The control point 1
810 /// @param[in] control_point_2 The control point 2
811 /// @param[in] end_point The end point
812 ///
813 IMPELLER_EXPORT
814 void ImpellerPathBuilderCubicCurveTo(
815 ImpellerPathBuilder IMPELLER_NONNULL builder,
816 const ImpellerPoint* IMPELLER_NONNULL control_point_1,
817 const ImpellerPoint* IMPELLER_NONNULL control_point_2,
818 const ImpellerPoint* IMPELLER_NONNULL end_point);
819
820 //------------------------------------------------------------------------------
821 /// @brief Adds a rectangle to the path.
822 ///
823 /// @param[in] builder The builder.
824 /// @param[in] rect The rectangle.
825 ///
826 IMPELLER_EXPORT
827 void ImpellerPathBuilderAddRect(ImpellerPathBuilder IMPELLER_NONNULL builder,
828 const ImpellerRect* IMPELLER_NONNULL rect);
829
830 //------------------------------------------------------------------------------
831 /// @brief Add an arc to the path.
832 ///
833 /// @param[in] builder The builder.
834 /// @param[in] oval_bounds The oval bounds.
835 /// @param[in] start_angle_degrees The start angle in degrees.
836 /// @param[in] end_angle_degrees The end angle in degrees.
837 ///
838 IMPELLER_EXPORT
839 void ImpellerPathBuilderAddArc(ImpellerPathBuilder IMPELLER_NONNULL builder,
840 const ImpellerRect* IMPELLER_NONNULL oval_bounds,
841 float start_angle_degrees,
842 float end_angle_degrees);
843
844 //------------------------------------------------------------------------------
845 /// @brief Add an oval to the path.
846 ///
847 /// @param[in] builder The builder.
848 /// @param[in] oval_bounds The oval bounds.
849 ///
850 IMPELLER_EXPORT
851 void ImpellerPathBuilderAddOval(
852 ImpellerPathBuilder IMPELLER_NONNULL builder,
853 const ImpellerRect* IMPELLER_NONNULL oval_bounds);
854
855 //------------------------------------------------------------------------------
856 /// @brief Add a rounded rect with potentially non-uniform radii to the
857 /// path.
858 ///
859 /// @param[in] builder The builder.
860 /// @param[in] rect The rectangle.
861 /// @param[in] rounding_radii The rounding radii.
862 ///
863 IMPELLER_EXPORT
864 void ImpellerPathBuilderAddRoundedRect(
865 ImpellerPathBuilder IMPELLER_NONNULL builder,
866 const ImpellerRect* IMPELLER_NONNULL rect,
867 const ImpellerRoundingRadii* IMPELLER_NONNULL rounding_radii);
868
869 //------------------------------------------------------------------------------
870 /// @brief Close the path.
871 ///
872 /// @param[in] builder The builder.
873 ///
874 IMPELLER_EXPORT
875 void ImpellerPathBuilderClose(ImpellerPathBuilder IMPELLER_NONNULL builder);
876
877 //------------------------------------------------------------------------------
878 /// @brief Create a new path by copying the existing built-up path. The
879 /// existing path can continue being added to.
880 ///
881 /// @param[in] builder The builder.
882 /// @param[in] fill The fill.
883 ///
884 /// @return The impeller path.
885 ///
886 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPath IMPELLER_NULLABLE
887 ImpellerPathBuilderCopyPathNew(ImpellerPathBuilder IMPELLER_NONNULL builder,
888 ImpellerFillType fill);
889
890 //------------------------------------------------------------------------------
891 /// @brief Create a new path using the existing built-up path. The existing
892 /// path builder now contains an empty path.
893 ///
894 /// @param[in] builder The builder.
895 /// @param[in] fill The fill.
896 ///
897 /// @return The impeller path.
898 ///
899 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPath IMPELLER_NULLABLE
900 ImpellerPathBuilderTakePathNew(ImpellerPathBuilder IMPELLER_NONNULL builder,
901 ImpellerFillType fill);
902
903 //------------------------------------------------------------------------------
904 // Paint
905 //------------------------------------------------------------------------------
906
907 //------------------------------------------------------------------------------
908 /// @brief Create a new paint with default values.
909 ///
910 /// @return The impeller paint.
911 ///
912 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPaint IMPELLER_NULLABLE
913 ImpellerPaintNew();
914
915 //------------------------------------------------------------------------------
916 /// @brief Retain a strong reference to the object. The object can be NULL
917 /// in which case this method is a no-op.
918 ///
919 /// @param[in] paint The paint.
920 ///
921 IMPELLER_EXPORT
922 void ImpellerPaintRetain(ImpellerPaint IMPELLER_NULLABLE paint);
923
924 //------------------------------------------------------------------------------
925 /// @brief Release a previously retained reference to the object. The
926 /// object can be NULL in which case this method is a no-op.
927 ///
928 /// @param[in] paint The paint.
929 ///
930 IMPELLER_EXPORT
931 void ImpellerPaintRelease(ImpellerPaint IMPELLER_NULLABLE paint);
932
933 //------------------------------------------------------------------------------
934 /// @brief Set the paint color.
935 ///
936 /// @param[in] paint The paint.
937 /// @param[in] color The color.
938 ///
939 IMPELLER_EXPORT
940 void ImpellerPaintSetColor(ImpellerPaint IMPELLER_NONNULL paint,
941 const ImpellerColor* IMPELLER_NONNULL color);
942
943 //------------------------------------------------------------------------------
944 /// @brief Set the paint blend mode. The blend mode controls how the new
945 /// paints contents are mixed with the values already drawn using
946 /// previous draw calls.
947 ///
948 /// @param[in] paint The paint.
949 /// @param[in] mode The mode.
950 ///
951 IMPELLER_EXPORT
952 void ImpellerPaintSetBlendMode(ImpellerPaint IMPELLER_NONNULL paint,
953 ImpellerBlendMode mode);
954
955 //------------------------------------------------------------------------------
956 /// @brief Set the paint draw style. The style controls if the closed
957 /// shapes are filled and/or stroked.
958 ///
959 /// @param[in] paint The paint.
960 /// @param[in] style The style.
961 ///
962 IMPELLER_EXPORT
963 void ImpellerPaintSetDrawStyle(ImpellerPaint IMPELLER_NONNULL paint,
964 ImpellerDrawStyle style);
965
966 //------------------------------------------------------------------------------
967 /// @brief Sets how strokes rendered using this paint are capped.
968 ///
969 /// @param[in] paint The paint.
970 /// @param[in] cap The stroke cap style.
971 ///
972 IMPELLER_EXPORT
973 void ImpellerPaintSetStrokeCap(ImpellerPaint IMPELLER_NONNULL paint,
974 ImpellerStrokeCap cap);
975
976 //------------------------------------------------------------------------------
977 /// @brief Sets how strokes rendered using this paint are joined.
978 ///
979 /// @param[in] paint The paint.
980 /// @param[in] join The join.
981 ///
982 IMPELLER_EXPORT
983 void ImpellerPaintSetStrokeJoin(ImpellerPaint IMPELLER_NONNULL paint,
984 ImpellerStrokeJoin join);
985
986 //------------------------------------------------------------------------------
987 /// @brief Set the width of the strokes rendered using this paint.
988 ///
989 /// @param[in] paint The paint.
990 /// @param[in] width The width.
991 ///
992 IMPELLER_EXPORT
993 void ImpellerPaintSetStrokeWidth(ImpellerPaint IMPELLER_NONNULL paint,
994 float width);
995
996 //------------------------------------------------------------------------------
997 /// @brief Set the miter limit of the strokes rendered using this paint.
998 ///
999 /// @param[in] paint The paint.
1000 /// @param[in] miter The miter limit.
1001 ///
1002 IMPELLER_EXPORT
1003 void ImpellerPaintSetStrokeMiter(ImpellerPaint IMPELLER_NONNULL paint,
1004 float miter);
1005
1006 //------------------------------------------------------------------------------
1007 /// @brief Set the color filter of the paint.
1008 ///
1009 /// Color filters are functions that take two colors and mix them to
1010 /// produce a single color. This color is then usually merged with
1011 /// the destination during blending.
1012 ///
1013 /// @param[in] paint The paint.
1014 /// @param[in] color_filter The color filter.
1015 ///
1016 IMPELLER_EXPORT
1017 void ImpellerPaintSetColorFilter(
1018 ImpellerPaint IMPELLER_NONNULL paint,
1019 ImpellerColorFilter IMPELLER_NONNULL color_filter);
1020
1021 //------------------------------------------------------------------------------
1022 /// @brief Set the color source of the paint.
1023 ///
1024 /// Color sources are functions that generate colors for each
1025 /// texture element covered by a draw call.
1026 ///
1027 /// @param[in] paint The paint.
1028 /// @param[in] color_source The color source.
1029 ///
1030 IMPELLER_EXPORT
1031 void ImpellerPaintSetColorSource(
1032 ImpellerPaint IMPELLER_NONNULL paint,
1033 ImpellerColorSource IMPELLER_NONNULL color_source);
1034
1035 //------------------------------------------------------------------------------
1036 /// @brief Set the image filter of a paint.
1037 ///
1038 /// Image filters are functions that are applied to regions of a
1039 /// texture to produce a single color.
1040 ///
1041 /// @param[in] paint The paint.
1042 /// @param[in] image_filter The image filter.
1043 ///
1044 IMPELLER_EXPORT
1045 void ImpellerPaintSetImageFilter(
1046 ImpellerPaint IMPELLER_NONNULL paint,
1047 ImpellerImageFilter IMPELLER_NONNULL image_filter);
1048
1049 //------------------------------------------------------------------------------
1050 /// @brief Set the mask filter of a paint.
1051 ///
1052 /// @param[in] paint The paint.
1053 /// @param[in] mask_filter The mask filter.
1054 ///
1055 IMPELLER_EXPORT
1056 void ImpellerPaintSetMaskFilter(
1057 ImpellerPaint IMPELLER_NONNULL paint,
1058 ImpellerMaskFilter IMPELLER_NONNULL mask_filter);
1059
1060 //------------------------------------------------------------------------------
1061 // Texture
1062 //------------------------------------------------------------------------------
1063
1064 //------------------------------------------------------------------------------
1065 /// @brief Create a texture with decompressed bytes.
1066 ///
1067 /// Impeller will do its best to perform the transfer of this data
1068 /// to GPU memory with a minimal number of copies. Towards this
1069 /// end, it may need to send this data to a different thread for
1070 /// preparation and transfer. To facilitate this transfer, it is
1071 /// recommended that the content mapping have a release callback
1072 /// attach to it. When there is a release callback, Impeller assumes
1073 /// that collection of the data can be deferred till texture upload
1074 /// is done and can happen on a background thread. When there is no
1075 /// release callback, Impeller may try to perform an eager copy of
1076 /// the data if it needs to perform data preparation and transfer on
1077 /// a background thread.
1078 ///
1079 /// Whether an extra data copy actually occurs will always depend on
1080 /// the rendering backend in use. But it is best practice to provide
1081 /// a release callback and be resilient to the data being released
1082 /// in a deferred manner on a background thread.
1083 ///
1084 /// @warning Do **not** supply compressed image data directly (PNG, JPEG,
1085 /// etc...). This function only works with tightly packed
1086 /// decompressed data.
1087 ///
1088 /// @param[in] context The context.
1089 /// @param[in] descriptor The texture descriptor.
1090 /// @param[in] contents The contents.
1091 /// @param[in] contents_on_release_user_data The baton passes to the contents
1092 /// release callback if one exists.
1093 ///
1094 /// @return The texture if one can be created using the provided data, NULL
1095 /// otherwise.
1096 ///
1097 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTexture IMPELLER_NULLABLE
1098 ImpellerTextureCreateWithContentsNew(
1099 ImpellerContext IMPELLER_NONNULL context,
1100 const ImpellerTextureDescriptor* IMPELLER_NONNULL descriptor,
1101 const ImpellerMapping* IMPELLER_NONNULL contents,
1102 void* IMPELLER_NULLABLE contents_on_release_user_data);
1103
1104 //------------------------------------------------------------------------------
1105 /// @brief Create a texture with an externally created OpenGL texture
1106 /// handle.
1107 ///
1108 /// Ownership of the handle is transferred over to Impeller after a
1109 /// successful call to this method. Impeller is responsible for
1110 /// calling glDeleteTextures on this handle. Do **not** collect this
1111 /// handle yourself as this will lead to a double-free.
1112 ///
1113 /// The handle must be created in the same context as the one used
1114 /// by Impeller. If a different context is used, that context must
1115 /// be in the same sharegroup as Impellers OpenGL context and all
1116 /// synchronization of texture contents must already be complete.
1117 ///
1118 /// If the context is not an OpenGL context, this call will always
1119 /// fail.
1120 ///
1121 /// @param[in] context The context
1122 /// @param[in] descriptor The descriptor
1123 /// @param[in] handle The handle
1124 ///
1125 /// @return The texture if one could be created by adopting the supplied
1126 /// texture handle, NULL otherwise.
1127 ///
1128 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTexture IMPELLER_NULLABLE
1129 ImpellerTextureCreateWithOpenGLTextureHandleNew(
1130 ImpellerContext IMPELLER_NONNULL context,
1131 const ImpellerTextureDescriptor* IMPELLER_NONNULL descriptor,
1132 uint64_t handle // transfer-in ownership
1133 );
1134
1135 //------------------------------------------------------------------------------
1136 /// @brief Retain a strong reference to the object. The object can be NULL
1137 /// in which case this method is a no-op.
1138 ///
1139 /// @param[in] texture The texture.
1140 ///
1141 IMPELLER_EXPORT
1142 void ImpellerTextureRetain(ImpellerTexture IMPELLER_NULLABLE texture);
1143
1144 //------------------------------------------------------------------------------
1145 /// @brief Release a previously retained reference to the object. The
1146 /// object can be NULL in which case this method is a no-op.
1147 ///
1148 /// @param[in] texture The texture.
1149 ///
1150 IMPELLER_EXPORT
1151 void ImpellerTextureRelease(ImpellerTexture IMPELLER_NULLABLE texture);
1152
1153 //------------------------------------------------------------------------------
1154 /// @brief Get the OpenGL handle associated with this texture. If this is
1155 /// not an OpenGL texture, this method will always return 0.
1156 ///
1157 /// OpenGL handles are lazily created, this method will return
1158 /// GL_NONE is no OpenGL handle is available. To ensure that this
1159 /// call eagerly creates an OpenGL texture, call this on a thread
1160 /// where Impeller knows there is an OpenGL context available.
1161 ///
1162 /// @param[in] texture The texture.
1163 ///
1164 /// @return The OpenGL handle if one is available, GL_NONE otherwise.
1165 ///
1166 IMPELLER_EXPORT
1167 uint64_t ImpellerTextureGetOpenGLHandle(
1168 ImpellerTexture IMPELLER_NONNULL texture);
1169
1170 //------------------------------------------------------------------------------
1171 // Color Sources
1172 //------------------------------------------------------------------------------
1173
1174 //------------------------------------------------------------------------------
1175 /// @brief Retain a strong reference to the object. The object can be NULL
1176 /// in which case this method is a no-op.
1177 ///
1178 /// @param[in] color_source The color source.
1179 ///
1180
1181 IMPELLER_EXPORT
1182 void ImpellerColorSourceRetain(
1183 ImpellerColorSource IMPELLER_NULLABLE color_source);
1184
1185 //------------------------------------------------------------------------------
1186 /// @brief Release a previously retained reference to the object. The
1187 /// object can be NULL in which case this method is a no-op.
1188 ///
1189 /// @param[in] color_source The color source.
1190 ///
1191 IMPELLER_EXPORT
1192 void ImpellerColorSourceRelease(
1193 ImpellerColorSource IMPELLER_NULLABLE color_source);
1194
1195 //------------------------------------------------------------------------------
1196 /// @brief Create a color source that forms a linear gradient.
1197 ///
1198 /// @param[in] start_point The start point.
1199 /// @param[in] end_point The end point.
1200 /// @param[in] stop_count The stop count.
1201 /// @param[in] colors The colors.
1202 /// @param[in] stops The stops.
1203 /// @param[in] tile_mode The tile mode.
1204 /// @param[in] transformation The transformation.
1205 ///
1206 /// @return The color source.
1207 ///
1208 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE
1209 ImpellerColorSourceCreateLinearGradientNew(
1210 const ImpellerPoint* IMPELLER_NONNULL start_point,
1211 const ImpellerPoint* IMPELLER_NONNULL end_point,
1212 uint32_t stop_count,
1213 const ImpellerColor* IMPELLER_NONNULL colors,
1214 const float* IMPELLER_NONNULL stops,
1215 ImpellerTileMode tile_mode,
1216 const ImpellerMatrix* IMPELLER_NULLABLE transformation);
1217
1218 //------------------------------------------------------------------------------
1219 /// @brief Create a color source that forms a radial gradient.
1220 ///
1221 /// @param[in] center The center.
1222 /// @param[in] radius The radius.
1223 /// @param[in] stop_count The stop count.
1224 /// @param[in] colors The colors.
1225 /// @param[in] stops The stops.
1226 /// @param[in] tile_mode The tile mode.
1227 /// @param[in] transformation The transformation.
1228 ///
1229 /// @return The color source.
1230 ///
1231 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE
1232 ImpellerColorSourceCreateRadialGradientNew(
1233 const ImpellerPoint* IMPELLER_NONNULL center,
1234 float radius,
1235 uint32_t stop_count,
1236 const ImpellerColor* IMPELLER_NONNULL colors,
1237 const float* IMPELLER_NONNULL stops,
1238 ImpellerTileMode tile_mode,
1239 const ImpellerMatrix* IMPELLER_NULLABLE transformation);
1240
1241 //------------------------------------------------------------------------------
1242 /// @brief Create a color source that forms a conical gradient.
1243 ///
1244 /// @param[in] start_center The start center.
1245 /// @param[in] start_radius The start radius.
1246 /// @param[in] end_center The end center.
1247 /// @param[in] end_radius The end radius.
1248 /// @param[in] stop_count The stop count.
1249 /// @param[in] colors The colors.
1250 /// @param[in] stops The stops.
1251 /// @param[in] tile_mode The tile mode.
1252 /// @param[in] transformation The transformation.
1253 ///
1254 /// @return The color source.
1255 ///
1256 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE
1257 ImpellerColorSourceCreateConicalGradientNew(
1258 const ImpellerPoint* IMPELLER_NONNULL start_center,
1259 float start_radius,
1260 const ImpellerPoint* IMPELLER_NONNULL end_center,
1261 float end_radius,
1262 uint32_t stop_count,
1263 const ImpellerColor* IMPELLER_NONNULL colors,
1264 const float* IMPELLER_NONNULL stops,
1265 ImpellerTileMode tile_mode,
1266 const ImpellerMatrix* IMPELLER_NULLABLE transformation);
1267
1268 //------------------------------------------------------------------------------
1269 /// @brief Create a color source that forms a sweep gradient.
1270 ///
1271 /// @param[in] center The center.
1272 /// @param[in] start The start.
1273 /// @param[in] end The end.
1274 /// @param[in] stop_count The stop count.
1275 /// @param[in] colors The colors.
1276 /// @param[in] stops The stops.
1277 /// @param[in] tile_mode The tile mode.
1278 /// @param[in] transformation The transformation.
1279 ///
1280 /// @return The color source.
1281 ///
1282 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE
1283 ImpellerColorSourceCreateSweepGradientNew(
1284 const ImpellerPoint* IMPELLER_NONNULL center,
1285 float start,
1286 float end,
1287 uint32_t stop_count,
1288 const ImpellerColor* IMPELLER_NONNULL colors,
1289 const float* IMPELLER_NONNULL stops,
1290 ImpellerTileMode tile_mode,
1291 const ImpellerMatrix* IMPELLER_NULLABLE transformation);
1292
1293 //------------------------------------------------------------------------------
1294 /// @brief Create a color source that samples from an image.
1295 ///
1296 /// @param[in] image The image.
1297 /// @param[in] horizontal_tile_mode The horizontal tile mode.
1298 /// @param[in] vertical_tile_mode The vertical tile mode.
1299 /// @param[in] sampling The sampling.
1300 /// @param[in] transformation The transformation.
1301 ///
1302 /// @return The color source.
1303 ///
1304 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE
1305 ImpellerColorSourceCreateImageNew(
1306 ImpellerTexture IMPELLER_NONNULL image,
1307 ImpellerTileMode horizontal_tile_mode,
1308 ImpellerTileMode vertical_tile_mode,
1309 ImpellerTextureSampling sampling,
1310 const ImpellerMatrix* IMPELLER_NULLABLE transformation);
1311
1312 //------------------------------------------------------------------------------
1313 // Color Filters
1314 //------------------------------------------------------------------------------
1315
1316 //------------------------------------------------------------------------------
1317 /// @brief Retain a strong reference to the object. The object can be NULL
1318 /// in which case this method is a no-op.
1319 ///
1320 /// @param[in] color_filter The color filter.
1321 ///
1322 IMPELLER_EXPORT
1323 void ImpellerColorFilterRetain(
1324 ImpellerColorFilter IMPELLER_NULLABLE color_filter);
1325
1326 //------------------------------------------------------------------------------
1327 /// @brief Release a previously retained reference to the object. The
1328 /// object can be NULL in which case this method is a no-op.
1329 ///
1330 /// @param[in] color_filter The color filter.
1331 ///
1332 IMPELLER_EXPORT
1333 void ImpellerColorFilterRelease(
1334 ImpellerColorFilter IMPELLER_NULLABLE color_filter);
1335
1336 //------------------------------------------------------------------------------
1337 /// @brief Create a color filter that performs blending of pixel values
1338 /// independently.
1339 ///
1340 /// @param[in] color The color.
1341 /// @param[in] blend_mode The blend mode.
1342 ///
1343 /// @return The color filter.
1344 ///
1345 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorFilter IMPELLER_NULLABLE
1346 ImpellerColorFilterCreateBlendNew(const ImpellerColor* IMPELLER_NONNULL color,
1347 ImpellerBlendMode blend_mode);
1348
1349 //------------------------------------------------------------------------------
1350 /// @brief Create a color filter that transforms pixel color values
1351 /// independently.
1352 ///
1353 /// @param[in] color_matrix The color matrix.
1354 ///
1355 /// @return The color filter.
1356 ///
1357 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorFilter IMPELLER_NULLABLE
1358 ImpellerColorFilterCreateColorMatrixNew(
1359 const ImpellerColorMatrix* IMPELLER_NONNULL color_matrix);
1360
1361 //------------------------------------------------------------------------------
1362 // Mask Filters
1363 //------------------------------------------------------------------------------
1364
1365 //------------------------------------------------------------------------------
1366 /// @brief Retain a strong reference to the object. The object can be NULL
1367 /// in which case this method is a no-op.
1368 ///
1369 /// @param[in] mask_filter The mask filter.
1370 ///
1371 IMPELLER_EXPORT
1372 void ImpellerMaskFilterRetain(ImpellerMaskFilter IMPELLER_NULLABLE mask_filter);
1373
1374 //------------------------------------------------------------------------------
1375 /// @brief Release a previously retained reference to the object. The
1376 /// object can be NULL in which case this method is a no-op.
1377 ///
1378 /// @param[in] mask_filter The mask filter.
1379 ///
1380 IMPELLER_EXPORT
1381 void ImpellerMaskFilterRelease(
1382 ImpellerMaskFilter IMPELLER_NULLABLE mask_filter);
1383
1384 //------------------------------------------------------------------------------
1385 /// @brief Create a mask filter that blurs contents in the masked shape.
1386 ///
1387 /// @param[in] style The style.
1388 /// @param[in] sigma The sigma.
1389 ///
1390 /// @return The mask filter.
1391 ///
1392 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerMaskFilter IMPELLER_NULLABLE
1393 ImpellerMaskFilterCreateBlurNew(ImpellerBlurStyle style, float sigma);
1394
1395 //------------------------------------------------------------------------------
1396 // Image Filters
1397 //------------------------------------------------------------------------------
1398
1399 //------------------------------------------------------------------------------
1400 /// @brief Retain a strong reference to the object. The object can be NULL
1401 /// in which case this method is a no-op.
1402 ///
1403 /// @param[in] image_filter The image filter.
1404 ///
1405 IMPELLER_EXPORT
1406 void ImpellerImageFilterRetain(
1407 ImpellerImageFilter IMPELLER_NULLABLE image_filter);
1408
1409 //------------------------------------------------------------------------------
1410 /// @brief Release a previously retained reference to the object. The
1411 /// object can be NULL in which case this method is a no-op.
1412 ///
1413 /// @param[in] image_filter The image filter.
1414 ///
1415 IMPELLER_EXPORT
1416 void ImpellerImageFilterRelease(
1417 ImpellerImageFilter IMPELLER_NULLABLE image_filter);
1418
1419 //------------------------------------------------------------------------------
1420 /// @brief Creates an image filter that applies a Gaussian blur.
1421 ///
1422 /// The Gaussian blur applied may be an approximation for
1423 /// performance.
1424 ///
1425 ///
1426 /// @param[in] x_sigma The x sigma.
1427 /// @param[in] y_sigma The y sigma.
1428 /// @param[in] tile_mode The tile mode.
1429 ///
1430 /// @return The image filter.
1431 ///
1432 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE
1433 ImpellerImageFilterCreateBlurNew(float x_sigma,
1434 float y_sigma,
1435 ImpellerTileMode tile_mode);
1436
1437 //------------------------------------------------------------------------------
1438 /// @brief Creates an image filter that enhances the per-channel pixel
1439 /// values to the maximum value in a circle around the pixel.
1440 ///
1441 /// @param[in] x_radius The x radius.
1442 /// @param[in] y_radius The y radius.
1443 ///
1444 /// @return The image filter.
1445 ///
1446
1447 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE
1448 ImpellerImageFilterCreateDilateNew(float x_radius, float y_radius);
1449
1450 //------------------------------------------------------------------------------
1451 /// @brief Creates an image filter that dampens the per-channel pixel
1452 /// values to the minimum value in a circle around the pixel.
1453 ///
1454 /// @param[in] x_radius The x radius.
1455 /// @param[in] y_radius The y radius.
1456 ///
1457 /// @return The image filter.
1458 ///
1459 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE
1460 ImpellerImageFilterCreateErodeNew(float x_radius, float y_radius);
1461
1462 //------------------------------------------------------------------------------
1463 /// @brief Creates an image filter that applies a transformation matrix to
1464 /// the underlying image.
1465 ///
1466 /// @param[in] matrix The transformation matrix.
1467 /// @param[in] sampling The image sampling mode.
1468 ///
1469 /// @return The image filter.
1470 ///
1471 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE
1472 ImpellerImageFilterCreateMatrixNew(
1473 const ImpellerMatrix* IMPELLER_NONNULL matrix,
1474 ImpellerTextureSampling sampling);
1475
1476 //------------------------------------------------------------------------------
1477 /// @brief Creates a composed filter that when applied is identical to
1478 /// subsequently applying the inner and then the outer filters.
1479 ///
1480 /// ```
1481 /// destination = outer_filter(inner_filter(source))
1482 /// ```
1483 ///
1484 /// @param[in] outer The outer image filter.
1485 /// @param[in] inner The inner image filter.
1486 ///
1487 /// @return The combined image filter.
1488 ///
1489 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE
1490 ImpellerImageFilterCreateComposeNew(ImpellerImageFilter IMPELLER_NONNULL outer,
1491 ImpellerImageFilter IMPELLER_NONNULL inner);
1492
1493 //------------------------------------------------------------------------------
1494 // Display List
1495 //------------------------------------------------------------------------------
1496
1497 //------------------------------------------------------------------------------
1498 /// @brief Retain a strong reference to the object. The object can be NULL
1499 /// in which case this method is a no-op.
1500 ///
1501 /// @param[in] display_list The display list.
1502 ///
1503 IMPELLER_EXPORT
1504 void ImpellerDisplayListRetain(
1505 ImpellerDisplayList IMPELLER_NULLABLE display_list);
1506
1507 //------------------------------------------------------------------------------
1508 /// @brief Release a previously retained reference to the object. The
1509 /// object can be NULL in which case this method is a no-op.
1510 ///
1511 /// @param[in] display_list The display list.
1512 ///
1513 IMPELLER_EXPORT
1514 void ImpellerDisplayListRelease(
1515 ImpellerDisplayList IMPELLER_NULLABLE display_list);
1516
1517 //------------------------------------------------------------------------------
1518 // Display List Builder
1519 //------------------------------------------------------------------------------
1520
1521 //------------------------------------------------------------------------------
1522 /// @brief Create a new display list builder.
1523 ///
1524 /// An optional cull rectangle may be specified. Impeller is allowed
1525 /// to treat the contents outside this rectangle as being undefined.
1526 /// This may aid performance optimizations.
1527 ///
1528 /// @param[in] cull_rect The cull rectangle or NULL.
1529 ///
1530 /// @return The display list builder.
1531 ///
1532 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerDisplayListBuilder IMPELLER_NULLABLE
1533 ImpellerDisplayListBuilderNew(const ImpellerRect* IMPELLER_NULLABLE cull_rect);
1534
1535 //------------------------------------------------------------------------------
1536 /// @brief Retain a strong reference to the object. The object can be NULL
1537 /// in which case this method is a no-op.
1538 ///
1539 /// @param[in] builder The display list builder.
1540 ///
1541 IMPELLER_EXPORT
1542 void ImpellerDisplayListBuilderRetain(
1543 ImpellerDisplayListBuilder IMPELLER_NULLABLE builder);
1544
1545 //------------------------------------------------------------------------------
1546 /// @brief Release a previously retained reference to the object. The
1547 /// object can be NULL in which case this method is a no-op.
1548 ///
1549 /// @param[in] builder The display list builder.
1550 ///
1551 IMPELLER_EXPORT
1552 void ImpellerDisplayListBuilderRelease(
1553 ImpellerDisplayListBuilder IMPELLER_NULLABLE builder);
1554
1555 //------------------------------------------------------------------------------
1556 /// @brief Create a new display list using the rendering intent already
1557 /// encoded in the builder. The builder is reset after this call.
1558 ///
1559 /// @param[in] builder The builder.
1560 ///
1561 /// @return The display list.
1562 ///
1563 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerDisplayList IMPELLER_NULLABLE
1564 ImpellerDisplayListBuilderCreateDisplayListNew(
1565 ImpellerDisplayListBuilder IMPELLER_NONNULL builder);
1566
1567 //------------------------------------------------------------------------------
1568 // Display List Builder: Managing the transformation stack.
1569 //------------------------------------------------------------------------------
1570
1571 //------------------------------------------------------------------------------
1572 /// @brief Stashes the current transformation and clip state onto a save
1573 /// stack.
1574 ///
1575 /// @param[in] builder The builder.
1576 ///
1577 IMPELLER_EXPORT
1578 void ImpellerDisplayListBuilderSave(
1579 ImpellerDisplayListBuilder IMPELLER_NONNULL builder);
1580
1581 //------------------------------------------------------------------------------
1582 /// @brief Stashes the current transformation and clip state onto a save
1583 /// stack and creates and creates an offscreen layer onto which
1584 /// subsequent rendering intent will be directed to.
1585 ///
1586 /// On the balancing call to restore, the supplied paints filters
1587 /// and blend modes will be used to composite the offscreen contents
1588 /// back onto the display display list.
1589 ///
1590 /// @param[in] builder The builder.
1591 /// @param[in] bounds The bounds.
1592 /// @param[in] paint The paint.
1593 /// @param[in] backdrop The backdrop.
1594 ///
1595 IMPELLER_EXPORT
1596 void ImpellerDisplayListBuilderSaveLayer(
1597 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1598 const ImpellerRect* IMPELLER_NONNULL bounds,
1599 ImpellerPaint IMPELLER_NULLABLE paint,
1600 ImpellerImageFilter IMPELLER_NULLABLE backdrop);
1601
1602 //------------------------------------------------------------------------------
1603 /// @brief Pops the last entry pushed onto the save stack using a call to
1604 /// `ImpellerDisplayListBuilderSave` or
1605 /// `ImpellerDisplayListBuilderSaveLayer`.
1606 ///
1607 /// @param[in] builder The builder.
1608 ///
1609 IMPELLER_EXPORT
1610 void ImpellerDisplayListBuilderRestore(
1611 ImpellerDisplayListBuilder IMPELLER_NONNULL builder);
1612
1613 //------------------------------------------------------------------------------
1614 /// @brief Apply a scale to the transformation matrix currently on top of
1615 /// the save stack.
1616 ///
1617 /// @param[in] builder The builder.
1618 /// @param[in] x_scale The x scale.
1619 /// @param[in] y_scale The y scale.
1620 ///
1621 IMPELLER_EXPORT
1622 void ImpellerDisplayListBuilderScale(
1623 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1624 float x_scale,
1625 float y_scale);
1626
1627 //------------------------------------------------------------------------------
1628 /// @brief Apply a clockwise rotation to the transformation matrix
1629 /// currently on top of the save stack.
1630 ///
1631 /// @param[in] builder The builder.
1632 /// @param[in] angle_degrees The angle in degrees.
1633 ///
1634
1635 IMPELLER_EXPORT
1636 void ImpellerDisplayListBuilderRotate(
1637 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1638 float angle_degrees);
1639
1640 //------------------------------------------------------------------------------
1641 /// @brief Apply a translation to the transformation matrix currently on
1642 /// top of the save stack.
1643 ///
1644 /// @param[in] builder The builder.
1645 /// @param[in] x_translation The x translation.
1646 /// @param[in] y_translation The y translation.
1647 ///
1648 IMPELLER_EXPORT
1649 void ImpellerDisplayListBuilderTranslate(
1650 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1651 float x_translation,
1652 float y_translation);
1653
1654 //------------------------------------------------------------------------------
1655 /// @brief Appends the the provided transformation to the transformation
1656 /// already on the save stack.
1657 ///
1658 /// @param[in] builder The builder.
1659 /// @param[in] transform The transform to append.
1660 ///
1661 IMPELLER_EXPORT
1662 void ImpellerDisplayListBuilderTransform(
1663 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1664 const ImpellerMatrix* IMPELLER_NONNULL transform);
1665
1666 //------------------------------------------------------------------------------
1667 /// @brief Clear the transformation on top of the save stack and replace it
1668 /// with a new value.
1669 ///
1670 /// @param[in] builder The builder.
1671 /// @param[in] transform The new transform.
1672 ///
1673 IMPELLER_EXPORT
1674 void ImpellerDisplayListBuilderSetTransform(
1675 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1676 const ImpellerMatrix* IMPELLER_NONNULL transform);
1677
1678 //------------------------------------------------------------------------------
1679 /// @brief Get the transformation currently built up on the top of the
1680 /// transformation stack.
1681 ///
1682 /// @param[in] builder The builder.
1683 /// @param[out] out_transform The transform.
1684 ///
1685 IMPELLER_EXPORT
1686 void ImpellerDisplayListBuilderGetTransform(
1687 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1688 ImpellerMatrix* IMPELLER_NONNULL out_transform);
1689
1690 //------------------------------------------------------------------------------
1691 /// @brief Reset the transformation on top of the transformation stack to
1692 /// identity.
1693 ///
1694 /// @param[in] builder The builder.
1695 ///
1696 IMPELLER_EXPORT
1697 void ImpellerDisplayListBuilderResetTransform(
1698 ImpellerDisplayListBuilder IMPELLER_NONNULL builder);
1699
1700 //------------------------------------------------------------------------------
1701 /// @brief Get the current size of the save stack.
1702 ///
1703 /// @param[in] builder The builder.
1704 ///
1705 /// @return The save stack size.
1706 ///
1707 IMPELLER_EXPORT
1708 uint32_t ImpellerDisplayListBuilderGetSaveCount(
1709 ImpellerDisplayListBuilder IMPELLER_NONNULL builder);
1710
1711 //------------------------------------------------------------------------------
1712 /// @brief Effectively calls ImpellerDisplayListBuilderRestore till the
1713 /// size of the save stack becomes a specified count.
1714 ///
1715 /// @param[in] builder The builder.
1716 /// @param[in] count The count.
1717 ///
1718 IMPELLER_EXPORT
1719 void ImpellerDisplayListBuilderRestoreToCount(
1720 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1721 uint32_t count);
1722
1723 //------------------------------------------------------------------------------
1724 // Display List Builder: Clipping
1725 //------------------------------------------------------------------------------
1726
1727 //------------------------------------------------------------------------------
1728 /// @brief Reduces the clip region to the intersection of the current clip
1729 /// and the given rectangle taking into account the clip operation.
1730 ///
1731 /// @param[in] builder The builder.
1732 /// @param[in] rect The rectangle.
1733 /// @param[in] op The operation.
1734 ///
1735 IMPELLER_EXPORT
1736 void ImpellerDisplayListBuilderClipRect(
1737 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1738 const ImpellerRect* IMPELLER_NONNULL rect,
1739 ImpellerClipOperation op);
1740
1741 //------------------------------------------------------------------------------
1742 /// @brief Reduces the clip region to the intersection of the current clip
1743 /// and the given oval taking into account the clip operation.
1744 ///
1745 /// @param[in] builder The builder.
1746 /// @param[in] oval_bounds The oval bounds.
1747 /// @param[in] op The operation.
1748 ///
1749 IMPELLER_EXPORT
1750 void ImpellerDisplayListBuilderClipOval(
1751 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1752 const ImpellerRect* IMPELLER_NONNULL oval_bounds,
1753 ImpellerClipOperation op);
1754
1755 //------------------------------------------------------------------------------
1756 /// @brief Reduces the clip region to the intersection of the current clip
1757 /// and the given rounded rectangle taking into account the clip
1758 /// operation.
1759 ///
1760 /// @param[in] builder The builder.
1761 /// @param[in] rect The rectangle.
1762 /// @param[in] radii The radii.
1763 /// @param[in] op The operation.
1764 ///
1765 IMPELLER_EXPORT
1766 void ImpellerDisplayListBuilderClipRoundedRect(
1767 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1768 const ImpellerRect* IMPELLER_NONNULL rect,
1769 const ImpellerRoundingRadii* IMPELLER_NONNULL radii,
1770 ImpellerClipOperation op);
1771
1772 //------------------------------------------------------------------------------
1773 /// @brief Reduces the clip region to the intersection of the current clip
1774 /// and the given path taking into account the clip operation.
1775 ///
1776 /// @param[in] builder The builder.
1777 /// @param[in] path The path.
1778 /// @param[in] op The operation.
1779 ///
1780 IMPELLER_EXPORT
1781 void ImpellerDisplayListBuilderClipPath(
1782 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1783 ImpellerPath IMPELLER_NONNULL path,
1784 ImpellerClipOperation op);
1785
1786 //------------------------------------------------------------------------------
1787 // Display List Builder: Drawing Shapes
1788 //------------------------------------------------------------------------------
1789
1790 //------------------------------------------------------------------------------
1791 /// @brief Fills the current clip with the specified paint.
1792 ///
1793 /// @param[in] builder The builder.
1794 /// @param[in] paint The paint.
1795 ///
1796 IMPELLER_EXPORT
1797 void ImpellerDisplayListBuilderDrawPaint(
1798 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1799 ImpellerPaint IMPELLER_NONNULL paint);
1800
1801 //------------------------------------------------------------------------------
1802 /// @brief Draws a line segment.
1803 ///
1804 /// @param[in] builder The builder.
1805 /// @param[in] from The starting point of the line.
1806 /// @param[in] to The end point of the line.
1807 /// @param[in] paint The paint.
1808 ///
1809 IMPELLER_EXPORT
1810 void ImpellerDisplayListBuilderDrawLine(
1811 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1812 const ImpellerPoint* IMPELLER_NONNULL from,
1813 const ImpellerPoint* IMPELLER_NONNULL to,
1814 ImpellerPaint IMPELLER_NONNULL paint);
1815
1816 //------------------------------------------------------------------------------
1817 /// @brief Draws a dash line segment.
1818 ///
1819 /// @param[in] builder The builder.
1820 /// @param[in] from The starting point of the line.
1821 /// @param[in] to The end point of the line.
1822 /// @param[in] on_length On length.
1823 /// @param[in] off_length Off length.
1824 /// @param[in] paint The paint.
1825 ///
1826 IMPELLER_EXPORT
1827 void ImpellerDisplayListBuilderDrawDashedLine(
1828 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1829 const ImpellerPoint* IMPELLER_NONNULL from,
1830 const ImpellerPoint* IMPELLER_NONNULL to,
1831 float on_length,
1832 float off_length,
1833 ImpellerPaint IMPELLER_NONNULL paint);
1834
1835 //------------------------------------------------------------------------------
1836 /// @brief Draws a rectangle.
1837 ///
1838 /// @param[in] builder The builder.
1839 /// @param[in] rect The rectangle.
1840 /// @param[in] paint The paint.
1841 ///
1842 IMPELLER_EXPORT
1843 void ImpellerDisplayListBuilderDrawRect(
1844 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1845 const ImpellerRect* IMPELLER_NONNULL rect,
1846 ImpellerPaint IMPELLER_NONNULL paint);
1847
1848 //------------------------------------------------------------------------------
1849 /// @brief Draws an oval.
1850 ///
1851 /// @param[in] builder The builder.
1852 /// @param[in] oval_bounds The oval bounds.
1853 /// @param[in] paint The paint.
1854 ///
1855 IMPELLER_EXPORT
1856 void ImpellerDisplayListBuilderDrawOval(
1857 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1858 const ImpellerRect* IMPELLER_NONNULL oval_bounds,
1859 ImpellerPaint IMPELLER_NONNULL paint);
1860
1861 //------------------------------------------------------------------------------
1862 /// @brief Draws a rounded rect.
1863 ///
1864 /// @param[in] builder The builder.
1865 /// @param[in] rect The rectangle.
1866 /// @param[in] radii The radii.
1867 /// @param[in] paint The paint.
1868 ///
1869 IMPELLER_EXPORT
1870 void ImpellerDisplayListBuilderDrawRoundedRect(
1871 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1872 const ImpellerRect* IMPELLER_NONNULL rect,
1873 const ImpellerRoundingRadii* IMPELLER_NONNULL radii,
1874 ImpellerPaint IMPELLER_NONNULL paint);
1875
1876 //------------------------------------------------------------------------------
1877 /// @brief Draws a shape that is the different between the specified
1878 /// rectangles (each with configurable corner radii).
1879 ///
1880 /// @param[in] builder The builder.
1881 /// @param[in] outer_rect The outer rectangle.
1882 /// @param[in] outer_radii The outer radii.
1883 /// @param[in] inner_rect The inner rectangle.
1884 /// @param[in] inner_radii The inner radii.
1885 /// @param[in] paint The paint.
1886 ///
1887 IMPELLER_EXPORT
1888 void ImpellerDisplayListBuilderDrawRoundedRectDifference(
1889 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1890 const ImpellerRect* IMPELLER_NONNULL outer_rect,
1891 const ImpellerRoundingRadii* IMPELLER_NONNULL outer_radii,
1892 const ImpellerRect* IMPELLER_NONNULL inner_rect,
1893 const ImpellerRoundingRadii* IMPELLER_NONNULL inner_radii,
1894 ImpellerPaint IMPELLER_NONNULL paint);
1895
1896 //------------------------------------------------------------------------------
1897 /// @brief Draws the specified shape.
1898 ///
1899 /// @param[in] builder The builder.
1900 /// @param[in] path The path.
1901 /// @param[in] paint The paint.
1902 ///
1903 IMPELLER_EXPORT
1904 void ImpellerDisplayListBuilderDrawPath(
1905 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1906 ImpellerPath IMPELLER_NONNULL path,
1907 ImpellerPaint IMPELLER_NONNULL paint);
1908
1909 //------------------------------------------------------------------------------
1910 /// @brief Flattens the contents of another display list into the one
1911 /// currently being built.
1912 ///
1913 /// @param[in] builder The builder.
1914 /// @param[in] display_list The display list.
1915 /// @param[in] opacity The opacity.
1916 ///
1917 IMPELLER_EXPORT
1918 void ImpellerDisplayListBuilderDrawDisplayList(
1919 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1920 ImpellerDisplayList IMPELLER_NONNULL display_list,
1921 float opacity);
1922
1923 //------------------------------------------------------------------------------
1924 /// @brief Draw a paragraph at the specified point.
1925 ///
1926 /// @param[in] builder The builder.
1927 /// @param[in] paragraph The paragraph.
1928 /// @param[in] point The point.
1929 ///
1930 IMPELLER_EXPORT
1931 void ImpellerDisplayListBuilderDrawParagraph(
1932 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1933 ImpellerParagraph IMPELLER_NONNULL paragraph,
1934 const ImpellerPoint* IMPELLER_NONNULL point);
1935
1936 //------------------------------------------------------------------------------
1937 // Display List Builder: Drawing Textures
1938 //------------------------------------------------------------------------------
1939
1940 //------------------------------------------------------------------------------
1941 /// @brief Draw a texture at the specified point.
1942 ///
1943 /// @param[in] builder The builder.
1944 /// @param[in] texture The texture.
1945 /// @param[in] point The point.
1946 /// @param[in] sampling The sampling.
1947 /// @param[in] paint The paint.
1948 ///
1949 IMPELLER_EXPORT
1950 void ImpellerDisplayListBuilderDrawTexture(
1951 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1952 ImpellerTexture IMPELLER_NONNULL texture,
1953 const ImpellerPoint* IMPELLER_NONNULL point,
1954 ImpellerTextureSampling sampling,
1955 ImpellerPaint IMPELLER_NULLABLE paint);
1956
1957 //------------------------------------------------------------------------------
1958 /// @brief Draw a portion of texture at the specified location.
1959 ///
1960 /// @param[in] builder The builder.
1961 /// @param[in] texture The texture.
1962 /// @param[in] src_rect The source rectangle.
1963 /// @param[in] dst_rect The destination rectangle.
1964 /// @param[in] sampling The sampling.
1965 /// @param[in] paint The paint.
1966 ///
1967 IMPELLER_EXPORT
1968 void ImpellerDisplayListBuilderDrawTextureRect(
1969 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1970 ImpellerTexture IMPELLER_NONNULL texture,
1971 const ImpellerRect* IMPELLER_NONNULL src_rect,
1972 const ImpellerRect* IMPELLER_NONNULL dst_rect,
1973 ImpellerTextureSampling sampling,
1974 ImpellerPaint IMPELLER_NULLABLE paint);
1975
1976 //------------------------------------------------------------------------------
1977 // Typography Context
1978 //------------------------------------------------------------------------------
1979
1980 //------------------------------------------------------------------------------
1981 /// @brief Create a new typography contents.
1982 ///
1983 /// @return The typography context.
1984 ///
1985 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTypographyContext IMPELLER_NULLABLE
1986 ImpellerTypographyContextNew();
1987
1988 //------------------------------------------------------------------------------
1989 /// @brief Retain a strong reference to the object. The object can be NULL
1990 /// in which case this method is a no-op.
1991 ///
1992 /// @param[in] context The typography context.
1993 ///
1994 IMPELLER_EXPORT
1995 void ImpellerTypographyContextRetain(
1996 ImpellerTypographyContext IMPELLER_NULLABLE context);
1997
1998 //------------------------------------------------------------------------------
1999 /// @brief Release a previously retained reference to the object. The
2000 /// object can be NULL in which case this method is a no-op.
2001 ///
2002 /// @param[in] context The typography context.
2003 ///
2004 IMPELLER_EXPORT
2005 void ImpellerTypographyContextRelease(
2006 ImpellerTypographyContext IMPELLER_NULLABLE context);
2007
2008 //------------------------------------------------------------------------------
2009 /// @brief Register a custom font.
2010 ///
2011 /// The following font formats are supported:
2012 /// * OpenType font collections (.ttc extension)
2013 /// * TrueType fonts: (.ttf extension)
2014 /// * OpenType fonts: (.otf extension)
2015 ///
2016 /// @warning Web Open Font Formats (.woff and .woff2 extensions) are **not**
2017 /// supported.
2018 ///
2019 /// The font data is specified as a mapping. It is possible for the
2020 /// release callback of the mapping to not be called even past the
2021 /// destruction of the typography context. Care must be taken to not
2022 /// collect the mapping till the release callback is invoked by
2023 /// Impeller.
2024 ///
2025 /// The family alias name can be NULL. In such cases, the font
2026 /// family specified in paragraph styles must match the family that
2027 /// is specified in the font data.
2028 ///
2029 /// If the family name alias is not NULL, that family name must be
2030 /// used in the paragraph style to reference glyphs from this font
2031 /// instead of the one encoded in the font itself.
2032 ///
2033 /// Multiple fonts (with glyphs for different styles) can be
2034 /// specified with the same family.
2035 ///
2036 /// @see `ImpellerParagraphStyleSetFontFamily`
2037 ///
2038 /// @param[in] context The context.
2039 /// @param[in] contents The contents.
2040 /// @param[in] contents_on_release_user_data The user data baton to be passed
2041 /// to the contents release callback.
2042 /// @param[in] family_name_alias The family name alias or NULL if
2043 /// the one specified in the font
2044 /// data is to be used.
2045 ///
2046 /// @return If the font could be successfully registered.
2047 ///
2048 IMPELLER_EXPORT
2049 bool ImpellerTypographyContextRegisterFont(
2050 ImpellerTypographyContext IMPELLER_NONNULL context,
2051 const ImpellerMapping* IMPELLER_NONNULL contents,
2052 void* IMPELLER_NULLABLE contents_on_release_user_data,
2053 const char* IMPELLER_NULLABLE family_name_alias);
2054
2055 //------------------------------------------------------------------------------
2056 // Paragraph Style
2057 //------------------------------------------------------------------------------
2058
2059 //------------------------------------------------------------------------------
2060 /// @brief Create a new paragraph style.
2061 ///
2062 /// @return The paragraph style.
2063 ///
2064 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphStyle IMPELLER_NULLABLE
2065 ImpellerParagraphStyleNew();
2066
2067 //------------------------------------------------------------------------------
2068 /// @brief Retain a strong reference to the object. The object can be NULL
2069 /// in which case this method is a no-op.
2070 ///
2071 /// @param[in] paragraph_style The paragraph style.
2072 ///
2073 IMPELLER_EXPORT
2074 void ImpellerParagraphStyleRetain(
2075 ImpellerParagraphStyle IMPELLER_NULLABLE paragraph_style);
2076
2077 //------------------------------------------------------------------------------
2078 /// @brief Release a previously retained reference to the object. The
2079 /// object can be NULL in which case this method is a no-op.
2080 ///
2081 /// @param[in] paragraph_style The paragraph style.
2082 ///
2083 IMPELLER_EXPORT
2084 void ImpellerParagraphStyleRelease(
2085 ImpellerParagraphStyle IMPELLER_NULLABLE paragraph_style);
2086
2087 //------------------------------------------------------------------------------
2088 /// @brief Set the paint used to render the text glyph contents.
2089 ///
2090 /// @param[in] paragraph_style The paragraph style.
2091 /// @param[in] paint The paint.
2092 ///
2093 IMPELLER_EXPORT
2094 void ImpellerParagraphStyleSetForeground(
2095 ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2096 ImpellerPaint IMPELLER_NONNULL paint);
2097
2098 //------------------------------------------------------------------------------
2099 /// @brief Set the paint used to render the background of the text glyphs.
2100 ///
2101 /// @param[in] paragraph_style The paragraph style.
2102 /// @param[in] paint The paint.
2103 ///
2104 IMPELLER_EXPORT
2105 void ImpellerParagraphStyleSetBackground(
2106 ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2107 ImpellerPaint IMPELLER_NONNULL paint);
2108
2109 //------------------------------------------------------------------------------
2110 /// @brief Set the weight of the font to select when rendering glyphs.
2111 ///
2112 /// @param[in] paragraph_style The paragraph style.
2113 /// @param[in] weight The weight.
2114 ///
2115 IMPELLER_EXPORT
2116 void ImpellerParagraphStyleSetFontWeight(
2117 ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2118 ImpellerFontWeight weight);
2119
2120 //------------------------------------------------------------------------------
2121 /// @brief Set whether the glyphs should be bolded or italicized.
2122 ///
2123 /// @param[in] paragraph_style The paragraph style.
2124 /// @param[in] style The style.
2125 ///
2126 IMPELLER_EXPORT
2127 void ImpellerParagraphStyleSetFontStyle(
2128 ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2129 ImpellerFontStyle style);
2130
2131 //------------------------------------------------------------------------------
2132 /// @brief Set the font family.
2133 ///
2134 /// @param[in] paragraph_style The paragraph style.
2135 /// @param[in] family_name The family name.
2136 ///
2137 IMPELLER_EXPORT
2138 void ImpellerParagraphStyleSetFontFamily(
2139 ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2140 const char* IMPELLER_NONNULL family_name);
2141
2142 //------------------------------------------------------------------------------
2143 /// @brief Set the font size.
2144 ///
2145 /// @param[in] paragraph_style The paragraph style.
2146 /// @param[in] size The size.
2147 ///
2148 IMPELLER_EXPORT
2149 void ImpellerParagraphStyleSetFontSize(
2150 ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2151 float size);
2152
2153 //------------------------------------------------------------------------------
2154 /// @brief The height of the text as a multiple of text size.
2155 ///
2156 /// When height is 0.0, the line height will be determined by the
2157 /// font's metrics directly, which may differ from the font size.
2158 /// Otherwise the line height of the text will be a multiple of font
2159 /// size, and be exactly fontSize * height logical pixels tall.
2160 ///
2161 /// @param[in] paragraph_style The paragraph style.
2162 /// @param[in] height The height.
2163 ///
2164 IMPELLER_EXPORT
2165 void ImpellerParagraphStyleSetHeight(
2166 ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2167 float height);
2168
2169 //------------------------------------------------------------------------------
2170 /// @brief Set the alignment of text within the paragraph.
2171 ///
2172 /// @param[in] paragraph_style The paragraph style.
2173 /// @param[in] align The align.
2174 ///
2175 IMPELLER_EXPORT
2176 void ImpellerParagraphStyleSetTextAlignment(
2177 ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2178 ImpellerTextAlignment align);
2179
2180 //------------------------------------------------------------------------------
2181 /// @brief Set the directionality of the text within the paragraph.
2182 ///
2183 /// @param[in] paragraph_style The paragraph style.
2184 /// @param[in] direction The direction.
2185 ///
2186 IMPELLER_EXPORT
2187 void ImpellerParagraphStyleSetTextDirection(
2188 ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2189 ImpellerTextDirection direction);
2190
2191 //------------------------------------------------------------------------------
2192 /// @brief Set the maximum line count within the paragraph.
2193 ///
2194 /// @param[in] paragraph_style The paragraph style.
2195 /// @param[in] max_lines The maximum lines.
2196 ///
2197 IMPELLER_EXPORT
2198 void ImpellerParagraphStyleSetMaxLines(
2199 ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2200 uint32_t max_lines);
2201
2202 //------------------------------------------------------------------------------
2203 /// @brief Set the paragraph locale.
2204 ///
2205 /// @param[in] paragraph_style The paragraph style.
2206 /// @param[in] locale The locale.
2207 ///
2208 IMPELLER_EXPORT
2209 void ImpellerParagraphStyleSetLocale(
2210 ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2211 const char* IMPELLER_NONNULL locale);
2212
2213 //------------------------------------------------------------------------------
2214 // Paragraph Builder
2215 //------------------------------------------------------------------------------
2216
2217 //------------------------------------------------------------------------------
2218 /// @brief Create a new paragraph builder.
2219 ///
2220 /// @param[in] context The context.
2221 ///
2222 /// @return The paragraph builder.
2223 ///
2224 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphBuilder IMPELLER_NULLABLE
2225 ImpellerParagraphBuilderNew(ImpellerTypographyContext IMPELLER_NONNULL context);
2226
2227 //------------------------------------------------------------------------------
2228 /// @brief Retain a strong reference to the object. The object can be NULL
2229 /// in which case this method is a no-op.
2230 ///
2231 /// @param[in] paragraph_builder The paragraph builder.
2232 ///
2233 IMPELLER_EXPORT
2234 void ImpellerParagraphBuilderRetain(
2235 ImpellerParagraphBuilder IMPELLER_NULLABLE paragraph_builder);
2236
2237 //------------------------------------------------------------------------------
2238 /// @brief Release a previously retained reference to the object. The
2239 /// object can be NULL in which case this method is a no-op.
2240 ///
2241 /// @param[in] paragraph_builder The paragraph_builder.
2242 ///
2243 IMPELLER_EXPORT
2244 void ImpellerParagraphBuilderRelease(
2245 ImpellerParagraphBuilder IMPELLER_NULLABLE paragraph_builder);
2246
2247 //------------------------------------------------------------------------------
2248 /// @brief Push a new paragraph style onto the paragraph style stack
2249 /// managed by the paragraph builder.
2250 ///
2251 /// Not all paragraph styles can be combined. For instance, it does
2252 /// not make sense to mix text alignment for different text runs
2253 /// within a paragraph. In such cases, the preference of the the
2254 /// first paragraph style on the style stack will take hold.
2255 ///
2256 /// If text is pushed onto the paragraph builder without a style
2257 /// previously pushed onto the stack, a default paragraph text style
2258 /// will be used. This may not always be desirable because some
2259 /// style element cannot be overridden. It is recommended that a
2260 /// default paragraph style always be pushed onto the stack before
2261 /// the addition of any text.
2262 ///
2263 /// @param[in] paragraph_builder The paragraph builder.
2264 /// @param[in] style The style.
2265 ///
2266 IMPELLER_EXPORT
2267 void ImpellerParagraphBuilderPushStyle(
2268 ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder,
2269 ImpellerParagraphStyle IMPELLER_NONNULL style);
2270
2271 //------------------------------------------------------------------------------
2272 /// @brief Pop a previously pushed paragraph style from the paragraph style
2273 /// stack.
2274 ///
2275 /// @param[in] paragraph_builder The paragraph builder.
2276 ///
2277 IMPELLER_EXPORT
2278 void ImpellerParagraphBuilderPopStyle(
2279 ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder);
2280
2281 //------------------------------------------------------------------------------
2282 /// @brief Add UTF-8 encoded text to the paragraph. The text will be styled
2283 /// according to the paragraph style already on top of the paragraph
2284 /// style stack.
2285 ///
2286 /// @param[in] paragraph_builder The paragraph builder.
2287 /// @param[in] data The data.
2288 /// @param[in] length The length.
2289 ///
2290 IMPELLER_EXPORT
2291 void ImpellerParagraphBuilderAddText(
2292 ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder,
2293 const uint8_t* IMPELLER_NULLABLE data,
2294 uint32_t length);
2295
2296 //------------------------------------------------------------------------------
2297 /// @brief Layout and build a new paragraph using the specified width. The
2298 /// resulting paragraph is immutable. The paragraph builder must be
2299 /// discarded and a new one created to build more paragraphs.
2300 ///
2301 /// @param[in] paragraph_builder The paragraph builder.
2302 /// @param[in] width The paragraph width.
2303 ///
2304 /// @return The paragraph if one can be created, NULL otherwise.
2305 ///
2306 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraph IMPELLER_NULLABLE
2307 ImpellerParagraphBuilderBuildParagraphNew(
2308 ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder,
2309 float width);
2310
2311 //------------------------------------------------------------------------------
2312 // Paragraph
2313 //------------------------------------------------------------------------------
2314
2315 //------------------------------------------------------------------------------
2316 /// @brief Retain a strong reference to the object. The object can be NULL
2317 /// in which case this method is a no-op.
2318 ///
2319 /// @param[in] paragraph The paragraph.
2320 ///
2321 IMPELLER_EXPORT
2322 void ImpellerParagraphRetain(ImpellerParagraph IMPELLER_NULLABLE paragraph);
2323
2324 //------------------------------------------------------------------------------
2325 /// @brief Release a previously retained reference to the object. The
2326 /// object can be NULL in which case this method is a no-op.
2327 ///
2328 /// @param[in] paragraph The paragraph.
2329 ///
2330 IMPELLER_EXPORT
2331 void ImpellerParagraphRelease(ImpellerParagraph IMPELLER_NULLABLE paragraph);
2332
2333 //------------------------------------------------------------------------------
2334 /// @see `ImpellerParagraphGetMinIntrinsicWidth`
2335 ///
2336 /// @param[in] paragraph The paragraph.
2337 ///
2338 ///
2339 /// @return The width provided to the paragraph builder during the call to
2340 /// layout. This is the maximum width any line in the laid out
2341 /// paragraph can occupy. But, it is not necessarily the actual
2342 /// width of the paragraph after layout.
2343 ///
2344 IMPELLER_EXPORT
2345 float ImpellerParagraphGetMaxWidth(
2346 ImpellerParagraph IMPELLER_NONNULL paragraph);
2347
2348 //------------------------------------------------------------------------------
2349 /// @param[in] paragraph The paragraph.
2350 ///
2351 /// @return The height of the laid out paragraph. This is **not** a tight
2352 /// bounding box and some glyphs may not reach the minimum location
2353 /// they are allowed to reach.
2354 ///
2355 IMPELLER_EXPORT
2356 float ImpellerParagraphGetHeight(ImpellerParagraph IMPELLER_NONNULL paragraph);
2357
2358 //------------------------------------------------------------------------------
2359 /// @param[in] paragraph The paragraph.
2360 ///
2361 /// @return The length of the longest line in the paragraph. This is the
2362 /// horizontal distance between the left edge of the leftmost glyph
2363 /// and the right edge of the rightmost glyph, in the longest line
2364 /// in the paragraph.
2365 ///
2366 IMPELLER_EXPORT
2367 float ImpellerParagraphGetLongestLineWidth(
2368 ImpellerParagraph IMPELLER_NONNULL paragraph);
2369
2370 //------------------------------------------------------------------------------
2371 /// @see `ImpellerParagraphGetMaxWidth`
2372 ///
2373 /// @param[in] paragraph The paragraph.
2374 ///
2375 /// @return The actual width of the longest line in the paragraph after
2376 /// layout. This is expected to be less than or equal to
2377 /// `ImpellerParagraphGetMaxWidth`.
2378 ///
2379 IMPELLER_EXPORT
2380 float ImpellerParagraphGetMinIntrinsicWidth(
2381 ImpellerParagraph IMPELLER_NONNULL paragraph);
2382
2383 //------------------------------------------------------------------------------
2384 /// @param[in] paragraph The paragraph.
2385 ///
2386 /// @return The width of the paragraph without line breaking.
2387 ///
2388 IMPELLER_EXPORT
2389 float ImpellerParagraphGetMaxIntrinsicWidth(
2390 ImpellerParagraph IMPELLER_NONNULL paragraph);
2391
2392 //------------------------------------------------------------------------------
2393 /// @param[in] paragraph The paragraph.
2394 ///
2395 /// @return The distance from the top of the paragraph to the ideographic
2396 /// baseline of the first line when using ideographic fonts
2397 /// (Japanese, Korean, etc...).
2398 ///
2399 IMPELLER_EXPORT
2400 float ImpellerParagraphGetIdeographicBaseline(
2401 ImpellerParagraph IMPELLER_NONNULL paragraph);
2402
2403 //------------------------------------------------------------------------------
2404 /// @param[in] paragraph The paragraph.
2405 ///
2406 /// @return The distance from the top of the paragraph to the alphabetic
2407 /// baseline of the first line when using alphabetic fonts (A-Z,
2408 /// a-z, Greek, etc...).
2409 ///
2410 IMPELLER_EXPORT
2411 float ImpellerParagraphGetAlphabeticBaseline(
2412 ImpellerParagraph IMPELLER_NONNULL paragraph);
2413
2414 //------------------------------------------------------------------------------
2415 /// @param[in] paragraph The paragraph.
2416 ///
2417 /// @return The number of lines visible in the paragraph after line
2418 /// breaking.
2419 ///
2420 IMPELLER_EXPORT
2421 uint32_t ImpellerParagraphGetLineCount(
2422 ImpellerParagraph IMPELLER_NONNULL paragraph);
2423
2424 IMPELLER_EXTERN_C_END
2425
2426 #endif // FLUTTER_IMPELLER_TOOLKIT_INTEROP_IMPELLER_H_
transform
Matrix transform
Definition: gaussian_blur_filter_contents.cc:214
ImpellerColorSourceRelease
IMPELLER_EXPORT void ImpellerColorSourceRelease(ImpellerColorSource IMPELLER_NULLABLE color_source)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
ImpellerDisplayListBuilderTranslate
IMPELLER_EXPORT void ImpellerDisplayListBuilderTranslate(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, float x_translation, float y_translation)
Apply a translation to the transformation matrix currently on top of the save stack.
ImpellerDisplayListBuilderDrawParagraph
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawParagraph(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerParagraph IMPELLER_NONNULL paragraph, const ImpellerPoint *IMPELLER_NONNULL point)
Draw a paragraph at the specified point.
ImpellerDisplayListBuilderClipRect
IMPELLER_EXPORT void ImpellerDisplayListBuilderClipRect(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect, ImpellerClipOperation op)
Reduces the clip region to the intersection of the current clip and the given rectangle taking into a...
ImpellerDisplayListBuilderScale
IMPELLER_EXPORT void ImpellerDisplayListBuilderScale(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, float x_scale, float y_scale)
Apply a scale to the transformation matrix currently on top of the save stack.
ImpellerDisplayListBuilderSaveLayer
IMPELLER_EXPORT void ImpellerDisplayListBuilderSaveLayer(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL bounds, ImpellerPaint IMPELLER_NULLABLE paint, ImpellerImageFilter IMPELLER_NULLABLE backdrop)
Stashes the current transformation and clip state onto a save stack and creates and creates an offscr...
ImpellerDisplayListBuilderDrawRoundedRectDifference
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawRoundedRectDifference(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL outer_rect, const ImpellerRoundingRadii *IMPELLER_NONNULL outer_radii, const ImpellerRect *IMPELLER_NONNULL inner_rect, const ImpellerRoundingRadii *IMPELLER_NONNULL inner_radii, ImpellerPaint IMPELLER_NONNULL paint)
Draws a shape that is the different between the specified rectangles (each with configurable corner r...
ImpellerPaintSetDrawStyle
IMPELLER_EXPORT void ImpellerPaintSetDrawStyle(ImpellerPaint IMPELLER_NONNULL paint, ImpellerDrawStyle style)
Set the paint draw style. The style controls if the closed shapes are filled and/or stroked.
ImpellerParagraphGetHeight
IMPELLER_EXPORT float ImpellerParagraphGetHeight(ImpellerParagraph IMPELLER_NONNULL paragraph)
ImpellerFillType
ImpellerFillType
Definition: impeller.h:317
kImpellerFillTypeOdd
@ kImpellerFillTypeOdd
Definition: impeller.h:319
kImpellerFillTypeNonZero
@ kImpellerFillTypeNonZero
Definition: impeller.h:318
ImpellerParagraphGetLongestLineWidth
IMPELLER_EXPORT float ImpellerParagraphGetLongestLineWidth(ImpellerParagraph IMPELLER_NONNULL paragraph)
ImpellerTextDirection
ImpellerTextDirection
Definition: impeller.h:432
kImpellerTextDirectionLTR
@ kImpellerTextDirectionLTR
Definition: impeller.h:434
kImpellerTextDirectionRTL
@ kImpellerTextDirectionRTL
Definition: impeller.h:433
ImpellerTypographyContextRegisterFont
IMPELLER_EXPORT bool ImpellerTypographyContextRegisterFont(ImpellerTypographyContext IMPELLER_NONNULL context, const ImpellerMapping *IMPELLER_NONNULL contents, void *IMPELLER_NULLABLE contents_on_release_user_data, const char *IMPELLER_NULLABLE family_name_alias)
Register a custom font.
ImpellerTextureSampling
ImpellerTextureSampling
Definition: impeller.h:381
kImpellerTextureSamplingNearestNeighbor
@ kImpellerTextureSamplingNearestNeighbor
Definition: impeller.h:382
kImpellerTextureSamplingLinear
@ kImpellerTextureSamplingLinear
Definition: impeller.h:383
ImpellerPathBuilderRelease
IMPELLER_EXPORT void ImpellerPathBuilderRelease(ImpellerPathBuilder IMPELLER_NULLABLE builder)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
ImpellerDisplayListBuilderRetain
IMPELLER_EXPORT void ImpellerDisplayListBuilderRetain(ImpellerDisplayListBuilder IMPELLER_NULLABLE builder)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
ImpellerPathBuilderMoveTo
IMPELLER_EXPORT void ImpellerPathBuilderMoveTo(ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerPoint *IMPELLER_NONNULL location)
Move the cursor to the specified location.
ImpellerPaintRelease
IMPELLER_EXPORT void ImpellerPaintRelease(ImpellerPaint IMPELLER_NULLABLE paint)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
ImpellerPaintSetStrokeCap
IMPELLER_EXPORT void ImpellerPaintSetStrokeCap(ImpellerPaint IMPELLER_NONNULL paint, ImpellerStrokeCap cap)
Sets how strokes rendered using this paint are capped.
ImpellerImageFilterRelease
IMPELLER_EXPORT void ImpellerImageFilterRelease(ImpellerImageFilter IMPELLER_NULLABLE image_filter)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
ImpellerDisplayListBuilderResetTransform
IMPELLER_EXPORT void ImpellerDisplayListBuilderResetTransform(ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
Reset the transformation on top of the transformation stack to identity.
ImpellerDisplayListBuilderClipPath
IMPELLER_EXPORT void ImpellerDisplayListBuilderClipPath(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerPath IMPELLER_NONNULL path, ImpellerClipOperation op)
Reduces the clip region to the intersection of the current clip and the given path taking into accoun...
ImpellerParagraphBuilderPopStyle
IMPELLER_EXPORT void ImpellerParagraphBuilderPopStyle(ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder)
Pop a previously pushed paragraph style from the paragraph style stack.
ImpellerPaintSetImageFilter
IMPELLER_EXPORT void ImpellerPaintSetImageFilter(ImpellerPaint IMPELLER_NONNULL paint, ImpellerImageFilter IMPELLER_NONNULL image_filter)
Set the image filter of a paint.
ImpellerDisplayListBuilderRestore
IMPELLER_EXPORT void ImpellerDisplayListBuilderRestore(ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
Pops the last entry pushed onto the save stack using a call to ImpellerDisplayListBuilderSave or Impe...
ImpellerSurfaceDrawDisplayList
IMPELLER_EXPORT bool ImpellerSurfaceDrawDisplayList(ImpellerSurface IMPELLER_NULLABLE surface, ImpellerDisplayList IMPELLER_NONNULL display_list)
Draw a display list onto the surface. The same display list can be drawn multiple times to different ...
ImpellerImageFilterCreateComposeNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateComposeNew(ImpellerImageFilter IMPELLER_NONNULL outer, ImpellerImageFilter IMPELLER_NONNULL inner)
Creates a composed filter that when applied is identical to subsequently applying the inner and then ...
ImpellerParagraphStyleRelease
IMPELLER_EXPORT void ImpellerParagraphStyleRelease(ImpellerParagraphStyle IMPELLER_NULLABLE paragraph_style)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
IMPELLER_DEFINE_HANDLE
#define IMPELLER_DEFINE_HANDLE(handle)
Definition: impeller.h:140
ImpellerPaintSetStrokeMiter
IMPELLER_EXPORT void ImpellerPaintSetStrokeMiter(ImpellerPaint IMPELLER_NONNULL paint, float miter)
Set the miter limit of the strokes rendered using this paint.
ImpellerColorFilterCreateBlendNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorFilter IMPELLER_NULLABLE ImpellerColorFilterCreateBlendNew(const ImpellerColor *IMPELLER_NONNULL color, ImpellerBlendMode blend_mode)
Create a color filter that performs blending of pixel values independently.
ImpellerSurfaceRelease
IMPELLER_EXPORT void ImpellerSurfaceRelease(ImpellerSurface IMPELLER_NULLABLE surface)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
ImpellerImageFilterCreateBlurNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateBlurNew(float x_sigma, float y_sigma, ImpellerTileMode tile_mode)
Creates an image filter that applies a Gaussian blur.
ImpellerPathBuilderNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPathBuilder IMPELLER_NULLABLE ImpellerPathBuilderNew()
Create a new path builder. Paths themselves are immutable. A builder builds these immutable paths.
ImpellerDisplayListBuilderSave
IMPELLER_EXPORT void ImpellerDisplayListBuilderSave(ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
Stashes the current transformation and clip state onto a save stack.
ImpellerTypographyContextRelease
IMPELLER_EXPORT void ImpellerTypographyContextRelease(ImpellerTypographyContext IMPELLER_NULLABLE context)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
ImpellerTextureRelease
IMPELLER_EXPORT void ImpellerTextureRelease(ImpellerTexture IMPELLER_NULLABLE texture)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
ImpellerParagraphBuilderRetain
IMPELLER_EXPORT void ImpellerParagraphBuilderRetain(ImpellerParagraphBuilder IMPELLER_NULLABLE paragraph_builder)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
ImpellerSurfaceRetain
IMPELLER_EXPORT void ImpellerSurfaceRetain(ImpellerSurface IMPELLER_NULLABLE surface)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
IMPELLER_NULLABLE
#define IMPELLER_NULLABLE
Definition: impeller.h:55
ImpellerDisplayListBuilderTransform
IMPELLER_EXPORT void ImpellerDisplayListBuilderTransform(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerMatrix *IMPELLER_NONNULL transform)
Appends the the provided transformation to the transformation already on the save stack.
ImpellerDisplayListBuilderDrawRect
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawRect(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect, ImpellerPaint IMPELLER_NONNULL paint)
Draws a rectangle.
ImpellerDisplayListBuilderGetSaveCount
IMPELLER_EXPORT uint32_t ImpellerDisplayListBuilderGetSaveCount(ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
Get the current size of the save stack.
ImpellerMaskFilterRetain
IMPELLER_EXPORT void ImpellerMaskFilterRetain(ImpellerMaskFilter IMPELLER_NULLABLE mask_filter)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
ImpellerParagraphStyleSetFontStyle
IMPELLER_EXPORT void ImpellerParagraphStyleSetFontStyle(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerFontStyle style)
Set whether the glyphs should be bolded or italicized.
ImpellerParagraphBuilderAddText
IMPELLER_EXPORT void ImpellerParagraphBuilderAddText(ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder, const uint8_t *IMPELLER_NULLABLE data, uint32_t length)
Add UTF-8 encoded text to the paragraph. The text will be styled according to the paragraph style alr...
ImpellerDisplayListBuilderDrawTexture
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawTexture(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerTexture IMPELLER_NONNULL texture, const ImpellerPoint *IMPELLER_NONNULL point, ImpellerTextureSampling sampling, ImpellerPaint IMPELLER_NULLABLE paint)
Draw a texture at the specified point.
IMPELLER_EXTERN_C_END
#define IMPELLER_EXTERN_C_END
Definition: impeller.h:36
ImpellerPaintNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPaint IMPELLER_NULLABLE ImpellerPaintNew()
Create a new paint with default values.
ImpellerDisplayListBuilderClipRoundedRect
IMPELLER_EXPORT void ImpellerDisplayListBuilderClipRoundedRect(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect, const ImpellerRoundingRadii *IMPELLER_NONNULL radii, ImpellerClipOperation op)
Reduces the clip region to the intersection of the current clip and the given rounded rectangle takin...
ImpellerTextureGetOpenGLHandle
IMPELLER_EXPORT uint64_t ImpellerTextureGetOpenGLHandle(ImpellerTexture IMPELLER_NONNULL texture)
Get the OpenGL handle associated with this texture. If this is not an OpenGL texture,...
ImpellerColorFilterCreateColorMatrixNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorFilter IMPELLER_NULLABLE ImpellerColorFilterCreateColorMatrixNew(const ImpellerColorMatrix *IMPELLER_NONNULL color_matrix)
Create a color filter that transforms pixel color values independently.
ImpellerParagraphRetain
IMPELLER_EXPORT void ImpellerParagraphRetain(ImpellerParagraph IMPELLER_NULLABLE paragraph)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
ImpellerDisplayListBuilderCreateDisplayListNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerDisplayList IMPELLER_NULLABLE ImpellerDisplayListBuilderCreateDisplayListNew(ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
Create a new display list using the rendering intent already encoded in the builder....
ImpellerParagraphGetLineCount
IMPELLER_EXPORT uint32_t ImpellerParagraphGetLineCount(ImpellerParagraph IMPELLER_NONNULL paragraph)
ImpellerImageFilterCreateDilateNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateDilateNew(float x_radius, float y_radius)
Creates an image filter that enhances the per-channel pixel values to the maximum value in a circle a...
ImpellerDisplayListBuilderRelease
IMPELLER_EXPORT void ImpellerDisplayListBuilderRelease(ImpellerDisplayListBuilder IMPELLER_NULLABLE builder)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
ImpellerColorSourceCreateRadialGradientNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateRadialGradientNew(const ImpellerPoint *IMPELLER_NONNULL center, float radius, uint32_t stop_count, const ImpellerColor *IMPELLER_NONNULL colors, const float *IMPELLER_NONNULL stops, ImpellerTileMode tile_mode, const ImpellerMatrix *IMPELLER_NULLABLE transformation)
Create a color source that forms a radial gradient.
ImpellerRoundingRadii
struct ImpellerRoundingRadii ImpellerRoundingRadii
ImpellerMapping
struct ImpellerMapping ImpellerMapping
ImpellerImageFilterRetain
IMPELLER_EXPORT void ImpellerImageFilterRetain(ImpellerImageFilter IMPELLER_NULLABLE image_filter)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
ImpellerPathBuilderTakePathNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPath IMPELLER_NULLABLE ImpellerPathBuilderTakePathNew(ImpellerPathBuilder IMPELLER_NONNULL builder, ImpellerFillType fill)
Create a new path using the existing built-up path. The existing path builder now contains an empty p...
ImpellerStrokeJoin
ImpellerStrokeJoin
Definition: impeller.h:371
kImpellerStrokeJoinRound
@ kImpellerStrokeJoinRound
Definition: impeller.h:373
kImpellerStrokeJoinBevel
@ kImpellerStrokeJoinBevel
Definition: impeller.h:374
kImpellerStrokeJoinMiter
@ kImpellerStrokeJoinMiter
Definition: impeller.h:372
ImpellerPaintSetColor
IMPELLER_EXPORT void ImpellerPaintSetColor(ImpellerPaint IMPELLER_NONNULL paint, const ImpellerColor *IMPELLER_NONNULL color)
Set the paint color.
ImpellerPathBuilderAddRect
IMPELLER_EXPORT void ImpellerPathBuilderAddRect(ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect)
Adds a rectangle to the path.
ImpellerDisplayListBuilderRotate
IMPELLER_EXPORT void ImpellerDisplayListBuilderRotate(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, float angle_degrees)
Apply a clockwise rotation to the transformation matrix currently on top of the save stack.
ImpellerCallback
void(* ImpellerCallback)(void *IMPELLER_NULLABLE user_data)
Definition: impeller.h:301
ImpellerDisplayListBuilderDrawOval
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawOval(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL oval_bounds, ImpellerPaint IMPELLER_NONNULL paint)
Draws an oval.
ImpellerParagraphGetMinIntrinsicWidth
IMPELLER_EXPORT float ImpellerParagraphGetMinIntrinsicWidth(ImpellerParagraph IMPELLER_NONNULL paragraph)
ImpellerSurfaceCreateWrappedFBONew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE ImpellerSurfaceCreateWrappedFBONew(ImpellerContext IMPELLER_NULLABLE context, uint64_t fbo, ImpellerPixelFormat format, const ImpellerISize *IMPELLER_NULLABLE size)
Create a new surface by wrapping an existing framebuffer object. The framebuffer must be complete as ...
ImpellerDisplayListBuilderDrawLine
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawLine(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerPoint *IMPELLER_NONNULL from, const ImpellerPoint *IMPELLER_NONNULL to, ImpellerPaint IMPELLER_NONNULL paint)
Draws a line segment.
ImpellerDisplayListRelease
IMPELLER_EXPORT void ImpellerDisplayListRelease(ImpellerDisplayList IMPELLER_NULLABLE display_list)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
ImpellerParagraphStyleSetBackground
IMPELLER_EXPORT void ImpellerParagraphStyleSetBackground(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerPaint IMPELLER_NONNULL paint)
Set the paint used to render the background of the text glyphs.
ImpellerParagraphGetMaxWidth
IMPELLER_EXPORT float ImpellerParagraphGetMaxWidth(ImpellerParagraph IMPELLER_NONNULL paragraph)
ImpellerParagraphBuilderBuildParagraphNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraph IMPELLER_NULLABLE ImpellerParagraphBuilderBuildParagraphNew(ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder, float width)
Layout and build a new paragraph using the specified width. The resulting paragraph is immutable....
ImpellerGetVersion
IMPELLER_EXPORT uint32_t ImpellerGetVersion()
Get the version of Impeller standalone API. This is the API that will be accepted for validity checks...
ImpellerParagraphBuilderPushStyle
IMPELLER_EXPORT void ImpellerParagraphBuilderPushStyle(ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder, ImpellerParagraphStyle IMPELLER_NONNULL style)
Push a new paragraph style onto the paragraph style stack managed by the paragraph builder.
ImpellerMaskFilterRelease
IMPELLER_EXPORT void ImpellerMaskFilterRelease(ImpellerMaskFilter IMPELLER_NULLABLE mask_filter)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
ImpellerColorFilterRetain
IMPELLER_EXPORT void ImpellerColorFilterRetain(ImpellerColorFilter IMPELLER_NULLABLE color_filter)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
ImpellerColorSourceCreateImageNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateImageNew(ImpellerTexture IMPELLER_NONNULL image, ImpellerTileMode horizontal_tile_mode, ImpellerTileMode vertical_tile_mode, ImpellerTextureSampling sampling, const ImpellerMatrix *IMPELLER_NULLABLE transformation)
Create a color source that samples from an image.
ImpellerBlendMode
ImpellerBlendMode
Definition: impeller.h:327
kImpellerBlendModeSaturation
@ kImpellerBlendModeSaturation
Definition: impeller.h:354
kImpellerBlendModeSoftLight
@ kImpellerBlendModeSoftLight
Definition: impeller.h:349
kImpellerBlendModeHardLight
@ kImpellerBlendModeHardLight
Definition: impeller.h:348
kImpellerBlendModeLuminosity
@ kImpellerBlendModeLuminosity
Definition: impeller.h:356
kImpellerBlendModeLighten
@ kImpellerBlendModeLighten
Definition: impeller.h:345
kImpellerBlendModeModulate
@ kImpellerBlendModeModulate
Definition: impeller.h:341
kImpellerBlendModeSourceIn
@ kImpellerBlendModeSourceIn
Definition: impeller.h:333
kImpellerBlendModeDifference
@ kImpellerBlendModeDifference
Definition: impeller.h:350
kImpellerBlendModeClear
@ kImpellerBlendModeClear
Definition: impeller.h:328
kImpellerBlendModeColor
@ kImpellerBlendModeColor
Definition: impeller.h:355
kImpellerBlendModeMultiply
@ kImpellerBlendModeMultiply
Definition: impeller.h:352
kImpellerBlendModeSourceATop
@ kImpellerBlendModeSourceATop
Definition: impeller.h:337
kImpellerBlendModeDestinationOut
@ kImpellerBlendModeDestinationOut
Definition: impeller.h:336
kImpellerBlendModeScreen
@ kImpellerBlendModeScreen
Definition: impeller.h:342
kImpellerBlendModeExclusion
@ kImpellerBlendModeExclusion
Definition: impeller.h:351
kImpellerBlendModeColorBurn
@ kImpellerBlendModeColorBurn
Definition: impeller.h:347
kImpellerBlendModeDarken
@ kImpellerBlendModeDarken
Definition: impeller.h:344
kImpellerBlendModePlus
@ kImpellerBlendModePlus
Definition: impeller.h:340
kImpellerBlendModeOverlay
@ kImpellerBlendModeOverlay
Definition: impeller.h:343
kImpellerBlendModeDestinationIn
@ kImpellerBlendModeDestinationIn
Definition: impeller.h:334
kImpellerBlendModeDestinationATop
@ kImpellerBlendModeDestinationATop
Definition: impeller.h:338
kImpellerBlendModeDestination
@ kImpellerBlendModeDestination
Definition: impeller.h:330
kImpellerBlendModeSourceOver
@ kImpellerBlendModeSourceOver
Definition: impeller.h:331
kImpellerBlendModeXor
@ kImpellerBlendModeXor
Definition: impeller.h:339
kImpellerBlendModeColorDodge
@ kImpellerBlendModeColorDodge
Definition: impeller.h:346
kImpellerBlendModeDestinationOver
@ kImpellerBlendModeDestinationOver
Definition: impeller.h:332
kImpellerBlendModeSource
@ kImpellerBlendModeSource
Definition: impeller.h:329
kImpellerBlendModeSourceOut
@ kImpellerBlendModeSourceOut
Definition: impeller.h:335
kImpellerBlendModeHue
@ kImpellerBlendModeHue
Definition: impeller.h:353
ImpellerImageFilterCreateMatrixNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateMatrixNew(const ImpellerMatrix *IMPELLER_NONNULL matrix, ImpellerTextureSampling sampling)
Creates an image filter that applies a transformation matrix to the underlying image.
ImpellerFontWeight
ImpellerFontWeight
Definition: impeller.h:406
kImpellerFontWeight400
@ kImpellerFontWeight400
Definition: impeller.h:410
kImpellerFontWeight500
@ kImpellerFontWeight500
Definition: impeller.h:411
kImpellerFontWeight700
@ kImpellerFontWeight700
Definition: impeller.h:413
kImpellerFontWeight200
@ kImpellerFontWeight200
Definition: impeller.h:408
kImpellerFontWeight300
@ kImpellerFontWeight300
Definition: impeller.h:409
kImpellerFontWeight900
@ kImpellerFontWeight900
Definition: impeller.h:415
kImpellerFontWeight800
@ kImpellerFontWeight800
Definition: impeller.h:414
kImpellerFontWeight600
@ kImpellerFontWeight600
Definition: impeller.h:412
kImpellerFontWeight100
@ kImpellerFontWeight100
Definition: impeller.h:407
ImpellerParagraphStyleSetFontSize
IMPELLER_EXPORT void ImpellerParagraphStyleSetFontSize(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, float size)
Set the font size.
ImpellerParagraphStyleSetLocale
IMPELLER_EXPORT void ImpellerParagraphStyleSetLocale(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, const char *IMPELLER_NONNULL locale)
Set the paragraph locale.
ImpellerDisplayListRetain
IMPELLER_EXPORT void ImpellerDisplayListRetain(ImpellerDisplayList IMPELLER_NULLABLE display_list)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
ImpellerParagraphStyleSetMaxLines
IMPELLER_EXPORT void ImpellerParagraphStyleSetMaxLines(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, uint32_t max_lines)
Set the maximum line count within the paragraph.
ImpellerDisplayListBuilderDrawPaint
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawPaint(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerPaint IMPELLER_NONNULL paint)
Fills the current clip with the specified paint.
ImpellerPaintSetColorFilter
IMPELLER_EXPORT void ImpellerPaintSetColorFilter(ImpellerPaint IMPELLER_NONNULL paint, ImpellerColorFilter IMPELLER_NONNULL color_filter)
Set the color filter of the paint.
ImpellerColorSourceCreateConicalGradientNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateConicalGradientNew(const ImpellerPoint *IMPELLER_NONNULL start_center, float start_radius, const ImpellerPoint *IMPELLER_NONNULL end_center, float end_radius, uint32_t stop_count, const ImpellerColor *IMPELLER_NONNULL colors, const float *IMPELLER_NONNULL stops, ImpellerTileMode tile_mode, const ImpellerMatrix *IMPELLER_NULLABLE transformation)
Create a color source that forms a conical gradient.
ImpellerPaintSetColorSource
IMPELLER_EXPORT void ImpellerPaintSetColorSource(ImpellerPaint IMPELLER_NONNULL paint, ImpellerColorSource IMPELLER_NONNULL color_source)
Set the color source of the paint.
ImpellerPathBuilderCubicCurveTo
IMPELLER_EXPORT void ImpellerPathBuilderCubicCurveTo(ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerPoint *IMPELLER_NONNULL control_point_1, const ImpellerPoint *IMPELLER_NONNULL control_point_2, const ImpellerPoint *IMPELLER_NONNULL end_point)
Add a cubic curve whose start point is current cursor location to the specified end point using the t...
ImpellerPathBuilderClose
IMPELLER_EXPORT void ImpellerPathBuilderClose(ImpellerPathBuilder IMPELLER_NONNULL builder)
Close the path.
IMPELLER_EXTERN_C_BEGIN
#define IMPELLER_EXTERN_C_BEGIN
Definition: impeller.h:35
ImpellerColorMatrix
struct ImpellerColorMatrix ImpellerColorMatrix
ImpellerDisplayListBuilderGetTransform
IMPELLER_EXPORT void ImpellerDisplayListBuilderGetTransform(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerMatrix *IMPELLER_NONNULL out_transform)
Get the transformation currently built up on the top of the transformation stack.
ImpellerDisplayListBuilderClipOval
IMPELLER_EXPORT void ImpellerDisplayListBuilderClipOval(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL oval_bounds, ImpellerClipOperation op)
Reduces the clip region to the intersection of the current clip and the given oval taking into accoun...
ImpellerParagraphGetIdeographicBaseline
IMPELLER_EXPORT float ImpellerParagraphGetIdeographicBaseline(ImpellerParagraph IMPELLER_NONNULL paragraph)
ImpellerPathRelease
IMPELLER_EXPORT void ImpellerPathRelease(ImpellerPath IMPELLER_NULLABLE path)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
ImpellerDisplayListBuilderSetTransform
IMPELLER_EXPORT void ImpellerDisplayListBuilderSetTransform(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerMatrix *IMPELLER_NONNULL transform)
Clear the transformation on top of the save stack and replace it with a new value.
ImpellerPaintSetMaskFilter
IMPELLER_EXPORT void ImpellerPaintSetMaskFilter(ImpellerPaint IMPELLER_NONNULL paint, ImpellerMaskFilter IMPELLER_NONNULL mask_filter)
Set the mask filter of a paint.
ImpellerContextCreateOpenGLESNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE ImpellerContextCreateOpenGLESNew(uint32_t version, ImpellerProcAddressCallback IMPELLER_NONNULL gl_proc_address_callback, void *IMPELLER_NULLABLE gl_proc_address_callback_user_data)
Create an OpenGL(ES) Impeller context.
ImpellerPathBuilderLineTo
IMPELLER_EXPORT void ImpellerPathBuilderLineTo(ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerPoint *IMPELLER_NONNULL location)
Add a line segment from the current cursor location to the given location. The cursor location is upd...
ImpellerPoint
struct ImpellerPoint ImpellerPoint
ImpellerContextRetain
IMPELLER_EXPORT void ImpellerContextRetain(ImpellerContext IMPELLER_NULLABLE context)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
ImpellerPathBuilderAddRoundedRect
IMPELLER_EXPORT void ImpellerPathBuilderAddRoundedRect(ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect, const ImpellerRoundingRadii *IMPELLER_NONNULL rounding_radii)
Add a rounded rect with potentially non-uniform radii to the path.
ImpellerPathBuilderCopyPathNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPath IMPELLER_NULLABLE ImpellerPathBuilderCopyPathNew(ImpellerPathBuilder IMPELLER_NONNULL builder, ImpellerFillType fill)
Create a new path by copying the existing built-up path. The existing path can continue being added t...
ImpellerTextureCreateWithContentsNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTexture IMPELLER_NULLABLE ImpellerTextureCreateWithContentsNew(ImpellerContext IMPELLER_NONNULL context, const ImpellerTextureDescriptor *IMPELLER_NONNULL descriptor, const ImpellerMapping *IMPELLER_NONNULL contents, void *IMPELLER_NULLABLE contents_on_release_user_data)
Create a texture with decompressed bytes.
ImpellerContextRelease
IMPELLER_EXPORT void ImpellerContextRelease(ImpellerContext IMPELLER_NULLABLE context)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
ImpellerDisplayListBuilderDrawDashedLine
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawDashedLine(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerPoint *IMPELLER_NONNULL from, const ImpellerPoint *IMPELLER_NONNULL to, float on_length, float off_length, ImpellerPaint IMPELLER_NONNULL paint)
Draws a dash line segment.
ImpellerTextureDescriptor
struct ImpellerTextureDescriptor ImpellerTextureDescriptor
ImpellerDisplayListBuilderDrawDisplayList
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawDisplayList(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerDisplayList IMPELLER_NONNULL display_list, float opacity)
Flattens the contents of another display list into the one currently being built.
ImpellerPaintSetStrokeJoin
IMPELLER_EXPORT void ImpellerPaintSetStrokeJoin(ImpellerPaint IMPELLER_NONNULL paint, ImpellerStrokeJoin join)
Sets how strokes rendered using this paint are joined.
ImpellerParagraphStyleSetTextDirection
IMPELLER_EXPORT void ImpellerParagraphStyleSetTextDirection(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerTextDirection direction)
Set the directionality of the text within the paragraph.
ImpellerMatrix
struct ImpellerMatrix ImpellerMatrix
ImpellerPaintSetBlendMode
IMPELLER_EXPORT void ImpellerPaintSetBlendMode(ImpellerPaint IMPELLER_NONNULL paint, ImpellerBlendMode mode)
Set the paint blend mode. The blend mode controls how the new paints contents are mixed with the valu...
ImpellerProcAddressCallback
void *IMPELLER_NULLABLE(* ImpellerProcAddressCallback)(const char *IMPELLER_NONNULL proc_name, void *IMPELLER_NULLABLE user_data)
Definition: impeller.h:310
ImpellerParagraphBuilderRelease
IMPELLER_EXPORT void ImpellerParagraphBuilderRelease(ImpellerParagraphBuilder IMPELLER_NULLABLE paragraph_builder)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
ImpellerDisplayListBuilderDrawTextureRect
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawTextureRect(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerTexture IMPELLER_NONNULL texture, const ImpellerRect *IMPELLER_NONNULL src_rect, const ImpellerRect *IMPELLER_NONNULL dst_rect, ImpellerTextureSampling sampling, ImpellerPaint IMPELLER_NULLABLE paint)
Draw a portion of texture at the specified location.
ImpellerISize
struct ImpellerISize ImpellerISize
ImpellerTextureRetain
IMPELLER_EXPORT void ImpellerTextureRetain(ImpellerTexture IMPELLER_NULLABLE texture)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
ImpellerPathBuilderAddArc
IMPELLER_EXPORT void ImpellerPathBuilderAddArc(ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL oval_bounds, float start_angle_degrees, float end_angle_degrees)
Add an arc to the path.
ImpellerRect
struct ImpellerRect ImpellerRect
ImpellerParagraphGetMaxIntrinsicWidth
IMPELLER_EXPORT float ImpellerParagraphGetMaxIntrinsicWidth(ImpellerParagraph IMPELLER_NONNULL paragraph)
ImpellerStrokeCap
ImpellerStrokeCap
Definition: impeller.h:365
kImpellerStrokeCapButt
@ kImpellerStrokeCapButt
Definition: impeller.h:366
kImpellerStrokeCapRound
@ kImpellerStrokeCapRound
Definition: impeller.h:367
kImpellerStrokeCapSquare
@ kImpellerStrokeCapSquare
Definition: impeller.h:368
ImpellerDrawStyle
ImpellerDrawStyle
Definition: impeller.h:359
kImpellerDrawStyleStroke
@ kImpellerDrawStyleStroke
Definition: impeller.h:361
kImpellerDrawStyleFill
@ kImpellerDrawStyleFill
Definition: impeller.h:360
kImpellerDrawStyleStrokeAndFill
@ kImpellerDrawStyleStrokeAndFill
Definition: impeller.h:362
ImpellerColorSpace
ImpellerColorSpace
Definition: impeller.h:400
kImpellerColorSpaceExtendedSRGB
@ kImpellerColorSpaceExtendedSRGB
Definition: impeller.h:402
kImpellerColorSpaceSRGB
@ kImpellerColorSpaceSRGB
Definition: impeller.h:401
kImpellerColorSpaceDisplayP3
@ kImpellerColorSpaceDisplayP3
Definition: impeller.h:403
ImpellerTileMode
ImpellerTileMode
Definition: impeller.h:386
kImpellerTileModeMirror
@ kImpellerTileModeMirror
Definition: impeller.h:389
kImpellerTileModeClamp
@ kImpellerTileModeClamp
Definition: impeller.h:387
kImpellerTileModeRepeat
@ kImpellerTileModeRepeat
Definition: impeller.h:388
kImpellerTileModeDecal
@ kImpellerTileModeDecal
Definition: impeller.h:390
ImpellerColorSourceCreateSweepGradientNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateSweepGradientNew(const ImpellerPoint *IMPELLER_NONNULL center, float start, float end, uint32_t stop_count, const ImpellerColor *IMPELLER_NONNULL colors, const float *IMPELLER_NONNULL stops, ImpellerTileMode tile_mode, const ImpellerMatrix *IMPELLER_NULLABLE transformation)
Create a color source that forms a sweep gradient.
ImpellerParagraphStyleNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphStyle IMPELLER_NULLABLE ImpellerParagraphStyleNew()
Create a new paragraph style.
ImpellerParagraphStyleSetForeground
IMPELLER_EXPORT void ImpellerParagraphStyleSetForeground(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerPaint IMPELLER_NONNULL paint)
Set the paint used to render the text glyph contents.
ImpellerParagraphRelease
IMPELLER_EXPORT void ImpellerParagraphRelease(ImpellerParagraph IMPELLER_NULLABLE paragraph)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
ImpellerTextAlignment
ImpellerTextAlignment
Definition: impeller.h:423
kImpellerTextAlignmentJustify
@ kImpellerTextAlignmentJustify
Definition: impeller.h:427
kImpellerTextAlignmentLeft
@ kImpellerTextAlignmentLeft
Definition: impeller.h:424
kImpellerTextAlignmentCenter
@ kImpellerTextAlignmentCenter
Definition: impeller.h:426
kImpellerTextAlignmentRight
@ kImpellerTextAlignmentRight
Definition: impeller.h:425
kImpellerTextAlignmentStart
@ kImpellerTextAlignmentStart
Definition: impeller.h:428
kImpellerTextAlignmentEnd
@ kImpellerTextAlignmentEnd
Definition: impeller.h:429
ImpellerColorSourceRetain
IMPELLER_EXPORT void ImpellerColorSourceRetain(ImpellerColorSource IMPELLER_NULLABLE color_source)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
ImpellerParagraphStyleSetHeight
IMPELLER_EXPORT void ImpellerParagraphStyleSetHeight(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, float height)
The height of the text as a multiple of text size.
ImpellerTextureCreateWithOpenGLTextureHandleNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTexture IMPELLER_NULLABLE ImpellerTextureCreateWithOpenGLTextureHandleNew(ImpellerContext IMPELLER_NONNULL context, const ImpellerTextureDescriptor *IMPELLER_NONNULL descriptor, uint64_t handle)
Create a texture with an externally created OpenGL texture handle.
ImpellerTypographyContextNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTypographyContext IMPELLER_NULLABLE ImpellerTypographyContextNew()
Create a new typography contents.
ImpellerFontStyle
ImpellerFontStyle
Definition: impeller.h:418
kImpellerFontStyleItalic
@ kImpellerFontStyleItalic
Definition: impeller.h:420
kImpellerFontStyleNormal
@ kImpellerFontStyleNormal
Definition: impeller.h:419
ImpellerPathBuilderQuadraticCurveTo
IMPELLER_EXPORT void ImpellerPathBuilderQuadraticCurveTo(ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerPoint *IMPELLER_NONNULL control_point, const ImpellerPoint *IMPELLER_NONNULL end_point)
Add a quadratic curve from whose start point is the cursor to the specified end point using the a sin...
ImpellerPathRetain
IMPELLER_EXPORT void ImpellerPathRetain(ImpellerPath IMPELLER_NULLABLE path)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
ImpellerClipOperation
ImpellerClipOperation
Definition: impeller.h:322
kImpellerClipOperationIntersect
@ kImpellerClipOperationIntersect
Definition: impeller.h:324
kImpellerClipOperationDifference
@ kImpellerClipOperationDifference
Definition: impeller.h:323
IMPELLER_NONNULL
#define IMPELLER_NONNULL
Definition: impeller.h:56
ImpellerMaskFilterCreateBlurNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerMaskFilter IMPELLER_NULLABLE ImpellerMaskFilterCreateBlurNew(ImpellerBlurStyle style, float sigma)
Create a mask filter that blurs contents in the masked shape.
ImpellerDisplayListBuilderNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerDisplayListBuilder IMPELLER_NULLABLE ImpellerDisplayListBuilderNew(const ImpellerRect *IMPELLER_NULLABLE cull_rect)
Create a new display list builder.
ImpellerDisplayListBuilderDrawPath
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawPath(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerPath IMPELLER_NONNULL path, ImpellerPaint IMPELLER_NONNULL paint)
Draws the specified shape.
IMPELLER_EXPORT
#define IMPELLER_EXPORT
Definition: impeller.h:46
ImpellerColor
struct ImpellerColor ImpellerColor
ImpellerImageFilterCreateErodeNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateErodeNew(float x_radius, float y_radius)
Creates an image filter that dampens the per-channel pixel values to the minimum value in a circle ar...
ImpellerDisplayListBuilderDrawRoundedRect
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawRoundedRect(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect, const ImpellerRoundingRadii *IMPELLER_NONNULL radii, ImpellerPaint IMPELLER_NONNULL paint)
Draws a rounded rect.
ImpellerPathBuilderAddOval
IMPELLER_EXPORT void ImpellerPathBuilderAddOval(ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL oval_bounds)
Add an oval to the path.
IMPELLER_NODISCARD
#define IMPELLER_NODISCARD
Definition: impeller.h:62
ImpellerParagraphStyleSetTextAlignment
IMPELLER_EXPORT void ImpellerParagraphStyleSetTextAlignment(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerTextAlignment align)
Set the alignment of text within the paragraph.
ImpellerParagraphStyleSetFontFamily
IMPELLER_EXPORT void ImpellerParagraphStyleSetFontFamily(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, const char *IMPELLER_NONNULL family_name)
Set the font family.
ImpellerParagraphStyleRetain
IMPELLER_EXPORT void ImpellerParagraphStyleRetain(ImpellerParagraphStyle IMPELLER_NULLABLE paragraph_style)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
ImpellerParagraphStyleSetFontWeight
IMPELLER_EXPORT void ImpellerParagraphStyleSetFontWeight(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerFontWeight weight)
Set the weight of the font to select when rendering glyphs.
ImpellerColorFilterRelease
IMPELLER_EXPORT void ImpellerColorFilterRelease(ImpellerColorFilter IMPELLER_NULLABLE color_filter)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
ImpellerSize
struct ImpellerSize ImpellerSize
ImpellerBlurStyle
ImpellerBlurStyle
Definition: impeller.h:393
kImpellerBlurStyleNormal
@ kImpellerBlurStyleNormal
Definition: impeller.h:394
kImpellerBlurStyleOuter
@ kImpellerBlurStyleOuter
Definition: impeller.h:396
kImpellerBlurStyleInner
@ kImpellerBlurStyleInner
Definition: impeller.h:397
kImpellerBlurStyleSolid
@ kImpellerBlurStyleSolid
Definition: impeller.h:395
ImpellerPixelFormat
ImpellerPixelFormat
Definition: impeller.h:377
kImpellerPixelFormatRGBA8888
@ kImpellerPixelFormatRGBA8888
Definition: impeller.h:378
ImpellerPaintSetStrokeWidth
IMPELLER_EXPORT void ImpellerPaintSetStrokeWidth(ImpellerPaint IMPELLER_NONNULL paint, float width)
Set the width of the strokes rendered using this paint.
ImpellerColorSourceCreateLinearGradientNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateLinearGradientNew(const ImpellerPoint *IMPELLER_NONNULL start_point, const ImpellerPoint *IMPELLER_NONNULL end_point, uint32_t stop_count, const ImpellerColor *IMPELLER_NONNULL colors, const float *IMPELLER_NONNULL stops, ImpellerTileMode tile_mode, const ImpellerMatrix *IMPELLER_NULLABLE transformation)
Create a color source that forms a linear gradient.
ImpellerTypographyContextRetain
IMPELLER_EXPORT void ImpellerTypographyContextRetain(ImpellerTypographyContext IMPELLER_NULLABLE context)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
ImpellerParagraphBuilderNew
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphBuilder IMPELLER_NULLABLE ImpellerParagraphBuilderNew(ImpellerTypographyContext IMPELLER_NONNULL context)
Create a new paragraph builder.
ImpellerParagraphGetAlphabeticBaseline
IMPELLER_EXPORT float ImpellerParagraphGetAlphabeticBaseline(ImpellerParagraph IMPELLER_NONNULL paragraph)
ImpellerDisplayListBuilderRestoreToCount
IMPELLER_EXPORT void ImpellerDisplayListBuilderRestoreToCount(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, uint32_t count)
Effectively calls ImpellerDisplayListBuilderRestore till the size of the save stack becomes a specifi...
ImpellerPaintRetain
IMPELLER_EXPORT void ImpellerPaintRetain(ImpellerPaint IMPELLER_NULLABLE paint)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
ImpellerPathBuilderRetain
IMPELLER_EXPORT void ImpellerPathBuilderRetain(ImpellerPathBuilder IMPELLER_NULLABLE builder)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
ImpellerColor
Definition: impeller.h:545
ImpellerColor::blue
float blue
Definition: impeller.h:548
ImpellerColor::alpha
float alpha
Definition: impeller.h:549
ImpellerColor::red
float red
Definition: impeller.h:546
ImpellerColor::green
float green
Definition: impeller.h:547
ImpellerColor::color_space
ImpellerColorSpace color_space
Definition: impeller.h:550
ImpellerColorMatrix
Definition: impeller.h:534
ImpellerColorMatrix::m
float m[20]
Definition: impeller.h:535
ImpellerISize
Definition: impeller.h:457
ImpellerISize::height
int64_t height
Definition: impeller.h:459
ImpellerISize::width
int64_t width
Definition: impeller.h:458
ImpellerMapping
Definition: impeller.h:559
ImpellerMapping::on_release
ImpellerCallback IMPELLER_NULLABLE on_release
Definition: impeller.h:562
ImpellerMapping::length
uint64_t length
Definition: impeller.h:561
ImpellerMapping::data
const uint8_t *IMPELLER_NONNULL data
Definition: impeller.h:560
ImpellerMatrix
Definition: impeller.h:472
ImpellerMatrix::m
float m[16]
Definition: impeller.h:473
ImpellerPoint
Definition: impeller.h:447
ImpellerPoint::x
float x
Definition: impeller.h:448
ImpellerPoint::y
float y
Definition: impeller.h:449
ImpellerRect
Definition: impeller.h:440
ImpellerRect::x
float x
Definition: impeller.h:441
ImpellerRect::width
float width
Definition: impeller.h:443
ImpellerRect::height
float height
Definition: impeller.h:444
ImpellerRect::y
float y
Definition: impeller.h:442
ImpellerRoundingRadii
Definition: impeller.h:538
ImpellerRoundingRadii::top_left
ImpellerPoint top_left
Definition: impeller.h:539
ImpellerRoundingRadii::top_right
ImpellerPoint top_right
Definition: impeller.h:541
ImpellerRoundingRadii::bottom_left
ImpellerPoint bottom_left
Definition: impeller.h:540
ImpellerRoundingRadii::bottom_right
ImpellerPoint bottom_right
Definition: impeller.h:542
ImpellerSize
Definition: impeller.h:452
ImpellerSize::height
float height
Definition: impeller.h:454
ImpellerSize::width
float width
Definition: impeller.h:453
ImpellerTextureDescriptor
Definition: impeller.h:553
ImpellerTextureDescriptor::mip_count
uint32_t mip_count
Definition: impeller.h:556
ImpellerTextureDescriptor::pixel_format
ImpellerPixelFormat pixel_format
Definition: impeller.h:554
ImpellerTextureDescriptor::size
ImpellerISize size
Definition: impeller.h:555
data
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:64