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 // NOLINTBEGIN(google-objc-function-naming)
9 
10 #include <stdbool.h>
11 #include <stddef.h>
12 #include <stdint.h>
13 
14 ///-----------------------------------------------------------------------------
15 ///-----------------------------------------------------------------------------
16 /// ------- ___ _ _ _ ____ ___ --------
17 /// ------- |_ _|_ __ ___ _ __ ___| | | ___ _ __ / \ | _ \_ _| --------
18 /// ------- | || '_ ` _ \| '_ \ / _ \ | |/ _ \ '__| / _ \ | |_) | | --------
19 /// ------- | || | | | | | |_) | __/ | | __/ | / ___ \| __/| | --------
20 /// ------- |___|_| |_| |_| .__/ \___|_|_|\___|_| /_/ \_\_| |___| --------
21 /// ------- |_| --------
22 ///-----------------------------------------------------------------------------
23 ///-----------------------------------------------------------------------------
24 ///
25 /// This file describes a high-level, single-header, dependency-free, 2D
26 /// graphics API.
27 ///
28 /// The API fundamentals that include details about the object model, reference
29 /// counting, and null-safety are described in the README.
30 ///
31 #if defined(__cplusplus)
32 #define IMPELLER_EXTERN_C extern "C"
33 #define IMPELLER_EXTERN_C_BEGIN IMPELLER_EXTERN_C {
34 #define IMPELLER_EXTERN_C_END }
35 #else // defined(__cplusplus)
36 #define IMPELLER_EXTERN_C
37 #define IMPELLER_EXTERN_C_BEGIN
38 #define IMPELLER_EXTERN_C_END
39 #endif // defined(__cplusplus)
40 
41 #ifdef _WIN32
42 #define IMPELLER_EXPORT_DECORATION __declspec(dllexport)
43 #else
44 #define IMPELLER_EXPORT_DECORATION __attribute__((visibility("default")))
45 #endif
46 
47 #ifndef IMPELLER_NO_EXPORT
48 #define IMPELLER_EXPORT IMPELLER_EXPORT_DECORATION
49 #else // IMPELLER_NO_EXPORT
50 #define IMPELLER_EXPORT
51 #endif // IMPELLER_NO_EXPORT
52 
53 #ifdef __clang__
54 #define IMPELLER_NULLABLE _Nullable
55 #define IMPELLER_NONNULL _Nonnull
56 #else // __clang__
57 #define IMPELLER_NULLABLE
58 #define IMPELLER_NONNULL
59 #endif // __clang__
60 
61 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202000L)
62 #define IMPELLER_NODISCARD [[nodiscard]]
63 #else // defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202000L)
64 #define IMPELLER_NODISCARD
65 #endif // defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202000L)
66 
68 
69 //------------------------------------------------------------------------------
70 /// @brief Pack a version in a uint32_t.
71 ///
72 /// @param[in] variant The version variant.
73 /// @param[in] major The major version.
74 /// @param[in] minor The minor version.
75 /// @param[in] patch The patch version.
76 ///
77 /// @return The packed version number.
78 ///
79 #define IMPELLER_MAKE_VERSION(variant, major, minor, patch) \
80  ((((uint32_t)(variant)) << 29U) | (((uint32_t)(major)) << 22U) | \
81  (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch)))
82 
83 #define IMPELLER_VERSION_VARIANT 1
84 #define IMPELLER_VERSION_MAJOR 1
85 #define IMPELLER_VERSION_MINOR 3
86 #define IMPELLER_VERSION_PATCH 0
87 
88 //------------------------------------------------------------------------------
89 /// The current Impeller API version.
90 ///
91 /// This version must be passed to APIs that create top-level objects like
92 /// graphics contexts. Construction of the context may fail if the API version
93 /// expected by the caller is not supported by the library.
94 ///
95 /// The version currently supported by the library is returned by a call to
96 /// `ImpellerGetVersion`
97 ///
98 /// Since there are no API stability guarantees today, passing a version that is
99 /// different to the one returned by `ImpellerGetVersion` will always fail.
100 ///
101 /// @see `ImpellerGetVersion`
102 ///
103 #define IMPELLER_VERSION \
104  IMPELLER_MAKE_VERSION(IMPELLER_VERSION_VARIANT, IMPELLER_VERSION_MAJOR, \
105  IMPELLER_VERSION_MINOR, IMPELLER_VERSION_PATCH)
106 
107 //------------------------------------------------------------------------------
108 /// @param[in] version The packed version.
109 ///
110 /// @return The version variant.
111 ///
112 #define IMPELLER_VERSION_GET_VARIANT(version) ((uint32_t)(version) >> 29U)
113 
114 //------------------------------------------------------------------------------
115 /// @param[in] version The packed version.
116 ///
117 /// @return The major version.
118 ///
119 #define IMPELLER_VERSION_GET_MAJOR(version) \
120  (((uint32_t)(version) >> 22U) & 0x7FU)
121 
122 //------------------------------------------------------------------------------
123 /// @param[in] version The packed version.
124 ///
125 /// @return The minor version.
126 ///
127 #define IMPELLER_VERSION_GET_MINOR(version) \
128  (((uint32_t)(version) >> 12U) & 0x3FFU)
129 
130 //------------------------------------------------------------------------------
131 /// @param[in] version The packed version.
132 ///
133 /// @return The patch version.
134 ///
135 #define IMPELLER_VERSION_GET_PATCH(version) ((uint32_t)(version) & 0xFFFU)
136 
137 //------------------------------------------------------------------------------
138 // Handles
139 //------------------------------------------------------------------------------
140 
141 #define IMPELLER_INTERNAL_HANDLE_NAME(handle) handle##_
142 #define IMPELLER_DEFINE_HANDLE(handle) \
143  typedef struct IMPELLER_INTERNAL_HANDLE_NAME(handle) * handle;
144 
145 //------------------------------------------------------------------------------
146 /// An Impeller graphics context. Contexts are platform and client-rendering-API
147 /// specific.
148 ///
149 /// Contexts are thread-safe objects that are expensive to create. Most
150 /// applications will only ever create a single context during their lifetimes.
151 /// Once setup, Impeller is ready to render frames as performantly as possible.
152 ///
153 /// During setup, context create the underlying graphics pipelines, allocators,
154 /// worker threads, etc...
155 ///
156 /// The general guidance is to create as few contexts as possible (typically
157 /// just one) and share them as much as possible.
158 ///
159 IMPELLER_DEFINE_HANDLE(ImpellerContext);
160 
161 //------------------------------------------------------------------------------
162 /// Display lists represent encoded rendering intent. These objects are
163 /// immutable, reusable, thread-safe, and context-agnostic.
164 ///
165 /// While it is perfectly fine to create new display lists per frame, there may
166 /// be opportunities for optimization when display lists are reused multiple
167 /// times.
168 ///
169 IMPELLER_DEFINE_HANDLE(ImpellerDisplayList);
170 
171 //------------------------------------------------------------------------------
172 /// Display list builders allow for the incremental creation of display lists.
173 ///
174 /// Display list builders are context-agnostic.
175 ///
176 IMPELLER_DEFINE_HANDLE(ImpellerDisplayListBuilder);
177 
178 //------------------------------------------------------------------------------
179 /// Paints control the behavior of draw calls encoded in a display list.
180 ///
181 /// Like display lists, paints are context-agnostic.
182 ///
183 IMPELLER_DEFINE_HANDLE(ImpellerPaint);
184 
185 //------------------------------------------------------------------------------
186 /// Color filters are functions that take two colors and mix them to produce a
187 /// single color. This color is then merged with the destination during
188 /// blending.
189 ///
190 IMPELLER_DEFINE_HANDLE(ImpellerColorFilter);
191 
192 //------------------------------------------------------------------------------
193 /// Color sources are functions that generate colors for each texture element
194 /// covered by a draw call. The colors for each element can be generated using a
195 /// mathematical function (to produce gradients for example) or sampled from a
196 /// texture.
197 ///
198 IMPELLER_DEFINE_HANDLE(ImpellerColorSource);
199 
200 //------------------------------------------------------------------------------
201 /// Image filters are functions that are applied regions of a texture to produce
202 /// a single color. Contrast this with color filters that operate independently
203 /// on a per-pixel basis. The generated color is then merged with the
204 /// destination during blending.
205 ///
206 IMPELLER_DEFINE_HANDLE(ImpellerImageFilter);
207 
208 //------------------------------------------------------------------------------
209 /// Mask filters are functions that are applied over a shape after it has been
210 /// drawn but before it has been blended into the final image.
211 ///
212 IMPELLER_DEFINE_HANDLE(ImpellerMaskFilter);
213 
214 //------------------------------------------------------------------------------
215 /// Typography contexts allow for the layout and rendering of text.
216 ///
217 /// These are typically expensive to create and applications will only ever need
218 /// to create a single one of these during their lifetimes.
219 ///
220 /// Unlike graphics context, typograhy contexts are not thread-safe. These must
221 /// be created, used, and collected on a single thread.
222 ///
223 IMPELLER_DEFINE_HANDLE(ImpellerTypographyContext);
224 
225 //------------------------------------------------------------------------------
226 /// An immutable, fully laid out paragraph.
227 ///
228 IMPELLER_DEFINE_HANDLE(ImpellerParagraph);
229 
230 //------------------------------------------------------------------------------
231 /// Paragraph builders allow for the creation of fully laid out paragraphs
232 /// (which themselves are immutable).
233 ///
234 /// To build a paragraph, users push/pop paragraph styles onto a stack then add
235 /// UTF-8 encoded text. The properties on the top of paragraph style stack when
236 /// the text is added are used to layout and shape that subset of the paragraph.
237 ///
238 /// @see `ImpellerParagraphStyle`
239 ///
240 IMPELLER_DEFINE_HANDLE(ImpellerParagraphBuilder);
241 
242 //------------------------------------------------------------------------------
243 /// Specified when building a paragraph, paragraph styles are managed in a stack
244 /// with specify text properties to apply to text that is added to the paragraph
245 /// builder.
246 ///
247 IMPELLER_DEFINE_HANDLE(ImpellerParagraphStyle);
248 
249 //------------------------------------------------------------------------------
250 /// Describes the metrics of lines in a fully laid out paragraph.
251 ///
252 /// Regardless of how the string of text is specified to the paragraph builder,
253 /// offsets into buffers that are returned by line metrics are always assumed to
254 /// be into buffers of UTF-16 code units.
255 ///
256 IMPELLER_DEFINE_HANDLE(ImpellerLineMetrics);
257 
258 //------------------------------------------------------------------------------
259 /// Describes the metrics of glyphs in a paragraph line.
260 ///
261 IMPELLER_DEFINE_HANDLE(ImpellerGlyphInfo);
262 
263 //------------------------------------------------------------------------------
264 /// Represents a two-dimensional path that is immutable and graphics context
265 /// agnostic.
266 ///
267 /// Paths in Impeller consist of linear, cubic Bézier curve, and quadratic
268 /// Bézier curve segments. All other shapes are approximations using these
269 /// building blocks.
270 ///
271 /// Paths are created using path builder that allow for the configuration of the
272 /// path segments, how they are filled, and/or stroked.
273 ///
275 
276 //------------------------------------------------------------------------------
277 /// Path builders allow for the incremental building up of paths.
278 ///
279 IMPELLER_DEFINE_HANDLE(ImpellerPathBuilder);
280 
281 //------------------------------------------------------------------------------
282 /// A surface represents a render target for Impeller to direct the rendering
283 /// intent specified the form of display lists to.
284 ///
285 /// Render targets are how Impeller API users perform Window System Integration
286 /// (WSI). Users wrap swapchain images as surfaces and draw display lists onto
287 /// these surfaces to present content.
288 ///
289 /// Creating surfaces is typically platform and client-rendering-API specific.
290 ///
291 IMPELLER_DEFINE_HANDLE(ImpellerSurface);
292 
293 //------------------------------------------------------------------------------
294 /// A reference to a texture whose data is resident on the GPU. These can be
295 /// referenced in draw calls and paints.
296 ///
297 /// Creating textures is extremely expensive. Creating a single one can
298 /// typically comfortably blow the frame budget of an application. Textures
299 /// should be created on background threads.
300 ///
301 /// @warning While textures themselves are thread safe, some context types
302 /// (like OpenGL) may need extra configuration to be able to operate
303 /// from multiple threads.
304 ///
305 IMPELLER_DEFINE_HANDLE(ImpellerTexture);
306 
307 //------------------------------------------------------------------------------
308 /// The primary form of WSI when using a Vulkan context, these swapchains use
309 /// the `VK_KHR_surface` Vulkan extension.
310 ///
311 /// Creating a swapchain is extremely expensive. One must be created at
312 /// application startup and re-used throughout the application lifecycle.
313 ///
314 /// Swapchains are resilient to the underlying surfaces being resized. The
315 /// swapchain images will be re-created as necessary on-demand.
316 ///
317 IMPELLER_DEFINE_HANDLE(ImpellerVulkanSwapchain);
318 
319 //------------------------------------------------------------------------------
320 // Signatures
321 //------------------------------------------------------------------------------
322 
323 //------------------------------------------------------------------------------
324 /// A callback invoked by Impeller that passes a user supplied baton back to the
325 /// user. Impeller does not interpret the baton in any way. The way the baton is
326 /// specified and the thread on which the callback is invoked depends on how the
327 /// user supplies the callback to Impeller.
328 ///
329 typedef void (*ImpellerCallback)(void* IMPELLER_NULLABLE user_data);
330 
331 //------------------------------------------------------------------------------
332 /// A callback used by Impeller to allow the user to resolve function pointers.
333 /// A user supplied baton that is uninterpreted by Impeller is passed back to
334 /// the user in the callback. How the baton is specified to Impeller and the
335 /// thread on which the callback is invoked depends on how the callback is
336 /// specified to Impeller.
337 ///
339  const char* IMPELLER_NONNULL proc_name,
340  void* IMPELLER_NULLABLE user_data);
341 
342 //------------------------------------------------------------------------------
343 /// A callback used by Impeller to allow the user to resolve Vulkan function
344 /// pointers. A user supplied baton that is uninterpreted by Impeller is passed
345 /// back to the user in the callback.
346 ///
348  void* IMPELLER_NULLABLE vulkan_instance,
349  const char* IMPELLER_NONNULL vulkan_proc_name,
350  void* IMPELLER_NULLABLE user_data);
351 
352 //------------------------------------------------------------------------------
353 // Enumerations
354 // -----------------------------------------------------------------------------
355 typedef enum ImpellerFillType {
359 
360 typedef enum ImpellerClipOperation {
364 
365 typedef enum ImpellerBlendMode {
396 
397 typedef enum ImpellerDrawStyle {
402 
403 typedef enum ImpellerStrokeCap {
408 
409 typedef enum ImpellerStrokeJoin {
414 
415 typedef enum ImpellerPixelFormat {
418 
423 
424 typedef enum ImpellerTileMode {
430 
431 typedef enum ImpellerBlurStyle {
437 
438 typedef enum ImpellerColorSpace {
443 
444 typedef enum ImpellerFontWeight {
446  kImpellerFontWeight200, // Extra-Light
448  kImpellerFontWeight400, // Normal/Regular
452  kImpellerFontWeight800, // Extra-Bold
455 
456 typedef enum ImpellerFontStyle {
460 
461 typedef enum ImpellerTextAlignment {
469 
470 typedef enum ImpellerTextDirection {
474 
475 //------------------------------------------------------------------------------
476 // Non-opaque structs
477 // -----------------------------------------------------------------------------
478 typedef struct ImpellerRect {
479  float x;
480  float y;
481  float width;
482  float height;
484 
485 typedef struct ImpellerPoint {
486  float x;
487  float y;
489 
490 typedef struct ImpellerSize {
491  float width;
492  float height;
494 
495 typedef struct ImpellerISize {
496  int64_t width;
497  int64_t height;
499 
500 typedef struct ImpellerRange {
501  uint64_t start;
502  uint64_t end;
504 
505 //------------------------------------------------------------------------------
506 /// A 4x4 transformation matrix using column-major storage.
507 ///
508 /// ```
509 /// | m[0] m[4] m[8] m[12] |
510 /// | m[1] m[5] m[9] m[13] |
511 /// | m[2] m[6] m[10] m[14] |
512 /// | m[3] m[7] m[11] m[15] |
513 /// ```
514 ///
515 typedef struct ImpellerMatrix {
516  float m[16];
518 
519 //------------------------------------------------------------------------------
520 /// A 4x5 matrix using row-major storage used for transforming color values.
521 ///
522 /// To transform color values, a 5x5 matrix is constructed with the 5th row
523 /// being identity. Then the following transformation is performed:
524 ///
525 /// ```
526 /// | R' | | m[0] m[1] m[2] m[3] m[4] | | R |
527 /// | G' | | m[5] m[6] m[7] m[8] m[9] | | G |
528 /// | B' | = | m[10] m[11] m[12] m[13] m[14] | * | B |
529 /// | A' | | m[15] m[16] m[17] m[18] m[19] | | A |
530 /// | 1 | | 0 0 0 0 1 | | 1 |
531 /// ```
532 ///
533 /// The translation column (m[4], m[9], m[14], m[19]) must be specified in
534 /// non-normalized 8-bit unsigned integer space (0 to 255). Values outside this
535 /// range will produce undefined results.
536 ///
537 /// The identity transformation is thus:
538 ///
539 /// ```
540 /// 1, 0, 0, 0, 0,
541 /// 0, 1, 0, 0, 0,
542 /// 0, 0, 1, 0, 0,
543 /// 0, 0, 0, 1, 0,
544 /// ```
545 ///
546 /// Some examples:
547 ///
548 /// To invert all colors:
549 ///
550 /// ```
551 /// -1, 0, 0, 0, 255,
552 /// 0, -1, 0, 0, 255,
553 /// 0, 0, -1, 0, 255,
554 /// 0, 0, 0, 1, 0,
555 /// ```
556 ///
557 /// To apply a sepia filter:
558 ///
559 /// ```
560 /// 0.393, 0.769, 0.189, 0, 0,
561 /// 0.349, 0.686, 0.168, 0, 0,
562 /// 0.272, 0.534, 0.131, 0, 0,
563 /// 0, 0, 0, 1, 0,
564 /// ```
565 ///
566 /// To apply a grayscale conversion filter:
567 ///
568 /// ```
569 /// 0.2126, 0.7152, 0.0722, 0, 0,
570 /// 0.2126, 0.7152, 0.0722, 0, 0,
571 /// 0.2126, 0.7152, 0.0722, 0, 0,
572 /// 0, 0, 0, 1, 0,
573 /// ```
574 ///
575 /// @see ImpellerColorFilter
576 ///
577 typedef struct ImpellerColorMatrix {
578  float m[20];
580 
581 typedef struct ImpellerRoundingRadii {
587 
588 typedef struct ImpellerColor {
589  float red;
590  float green;
591  float blue;
592  float alpha;
595 
599  uint32_t mip_count;
601 
602 typedef struct ImpellerMapping {
603  const uint8_t* IMPELLER_NONNULL data;
604  uint64_t length;
607 
613 
621 
622 //------------------------------------------------------------------------------
623 // Version
624 //------------------------------------------------------------------------------
625 
626 //------------------------------------------------------------------------------
627 /// @brief Get the version of Impeller standalone API. This is the API that
628 /// will be accepted for validity checks when provided to the
629 /// context creation methods.
630 ///
631 /// The current version of the API is denoted by the
632 /// `IMPELLER_VERSION` macro. This version must be passed to APIs
633 /// that create top-level objects like graphics contexts.
634 /// Construction of the context may fail if the API version expected
635 /// by the caller is not supported by the library.
636 ///
637 /// Since there are no API stability guarantees today, passing a
638 /// version that is different to the one returned by
639 /// `ImpellerGetVersion` will always fail.
640 ///
641 /// @see `ImpellerContextCreateOpenGLESNew`
642 ///
643 /// @return The version of the standalone API.
644 ///
647 
648 //------------------------------------------------------------------------------
649 // Context
650 //------------------------------------------------------------------------------
651 
652 //------------------------------------------------------------------------------
653 /// @brief Create an OpenGL(ES) Impeller context.
654 ///
655 /// @warning Unlike other context types, the OpenGL ES context can only be
656 /// created, used, and collected on the calling thread. This
657 /// restriction may be lifted in the future once reactor workers are
658 /// exposed in the API. No other context types have threading
659 /// restrictions. Till reactor workers can be used, using the
660 /// context on a background thread will cause a stall of OpenGL
661 /// operations.
662 ///
663 /// @param[in] version The version of the Impeller
664 /// standalone API. See `ImpellerGetVersion`. If the
665 /// specified here is not compatible with the version
666 /// of the library, context creation will fail and NULL
667 /// context returned from this call.
668 /// @param[in] gl_proc_address_callback
669 /// The gl proc address callback. For instance,
670 /// `eglGetProcAddress`.
671 /// @param[in] gl_proc_address_callback_user_data
672 /// The gl proc address callback user data baton. This
673 /// pointer is not interpreted by Impeller and will be
674 /// returned as user data in the proc address callback.
675 /// user data.
676 ///
677 /// @return The context or NULL if one cannot be created.
678 ///
681  uint32_t version,
682  ImpellerProcAddressCallback IMPELLER_NONNULL gl_proc_address_callback,
683  void* IMPELLER_NULLABLE gl_proc_address_callback_user_data);
684 
685 //------------------------------------------------------------------------------
686 /// @brief Create a Metal context using the system default Metal device.
687 ///
688 /// @param[in] version The version specified in the IMPELLER_VERSION macro.
689 ///
690 /// @return The Metal context or NULL if one cannot be created.
691 ///
694 
695 //------------------------------------------------------------------------------
696 /// @brief Create a Vulkan context using the provided Vulkan Settings.
697 ///
698 /// @param[in] version The version specified in the IMPELLER_VERSION macro.
699 /// @param[in] settings The Vulkan settings.
700 ///
701 /// @return The Vulkan context or NULL if one cannot be created.
702 ///
705  uint32_t version,
707 
708 //------------------------------------------------------------------------------
709 /// @brief Retain a strong reference to the object. The object can be NULL
710 /// in which case this method is a no-op.
711 ///
712 /// @param[in] context The context.
713 ///
715 void ImpellerContextRetain(ImpellerContext IMPELLER_NULLABLE context);
716 
717 //------------------------------------------------------------------------------
718 /// @brief Release a previously retained reference to the object. The
719 /// object can be NULL in which case this method is a no-op.
720 ///
721 /// @param[in] context The context.
722 ///
724 void ImpellerContextRelease(ImpellerContext IMPELLER_NULLABLE context);
725 
726 //------------------------------------------------------------------------------
727 /// @brief Get internal Vulkan handles managed by the given Vulkan context.
728 /// Ownership of the handles is still maintained by Impeller. This
729 /// accessor is just available so embedders can create resources
730 /// using the same device and instance as Impeller for interop.
731 ///
732 /// @warning If the context is not a Vulkan context, False is returned with
733 /// the [out] argument unaffected.
734 ///
735 /// @param[in] context The context
736 /// @param[out] out_vulkan_info The out vulkan information
737 ///
738 /// @return If the Vulkan info could be fetched from the context.
739 ///
742  ImpellerContext IMPELLER_NONNULL context,
744 
745 //------------------------------------------------------------------------------
746 // Vulkan Swapchain
747 //------------------------------------------------------------------------------
748 
749 //------------------------------------------------------------------------------
750 /// @brief Create a new Vulkan swapchain using a VkSurfaceKHR instance.
751 /// Ownership of the surface is transferred over to Impeller. The
752 /// Vulkan instance the surface is created from must the same as the
753 /// context provided.
754 ///
755 /// @param[in] context The context. Must be a Vulkan context whose
756 /// instance is the same used to create the
757 /// surface passed into the next argument.
758 /// @param vulkan_surface_khr The vulkan surface.
759 ///
760 /// @return The vulkan swapchain.
761 ///
764  void* IMPELLER_NONNULL vulkan_surface_khr);
765 
766 //------------------------------------------------------------------------------
767 /// @brief Retain a strong reference to the object. The object can be NULL
768 /// in which case this method is a no-op.
769 ///
770 /// @param[in] swapchain The swapchain.
771 ///
774  ImpellerVulkanSwapchain IMPELLER_NULLABLE swapchain);
775 
776 //------------------------------------------------------------------------------
777 /// @brief Release a previously retained reference to the object. The
778 /// object can be NULL in which case this method is a no-op.
779 ///
780 /// @param[in] swapchain The swapchain.
781 ///
784  ImpellerVulkanSwapchain IMPELLER_NULLABLE swapchain);
785 
786 //------------------------------------------------------------------------------
787 /// @brief A potentially blocking operation, acquires the next surface to
788 /// render to. Since this may block, surface acquisition must be
789 /// delayed for as long as possible to avoid an idle wait on the
790 /// CPU.
791 ///
792 /// @param[in] swapchain The swapchain.
793 ///
794 /// @return The surface if one could be obtained, NULL otherwise.
795 ///
798  ImpellerVulkanSwapchain IMPELLER_NONNULL swapchain);
799 
800 //------------------------------------------------------------------------------
801 // Surface
802 //------------------------------------------------------------------------------
803 
804 //------------------------------------------------------------------------------
805 /// @brief Create a new surface by wrapping an existing framebuffer object.
806 /// The framebuffer must be complete as determined by
807 /// `glCheckFramebufferStatus`. The framebuffer is still owned by
808 /// the caller and it must be collected once the surface is
809 /// collected.
810 ///
811 /// @param[in] context The context.
812 /// @param[in] fbo The framebuffer object handle.
813 /// @param[in] format The format of the framebuffer.
814 /// @param[in] size The size of the framebuffer is texels.
815 ///
816 /// @return The surface if once can be created, NULL otherwise.
817 ///
820  uint64_t fbo,
821  ImpellerPixelFormat format,
822  const ImpellerISize* IMPELLER_NONNULL size);
823 
824 //------------------------------------------------------------------------------
825 /// @brief Create a surface by wrapping a Metal drawable. This is useful
826 /// during WSI when the drawable is the backing store of the Metal
827 /// layer being drawn to.
828 ///
829 /// The Metal layer must be using the same device managed by the
830 /// underlying context.
831 ///
832 /// @param[in] context The context. The Metal device managed by this
833 /// context must be the same used to create the
834 /// drawable that is being wrapped.
835 /// @param metal_drawable The drawable to wrap as a surface.
836 ///
837 /// @return The surface if one could be wrapped, NULL otherwise.
838 ///
841  ImpellerContext IMPELLER_NONNULL context,
842  void* IMPELLER_NONNULL metal_drawable);
843 
844 //------------------------------------------------------------------------------
845 /// @brief Retain a strong reference to the object. The object can be NULL
846 /// in which case this method is a no-op.
847 ///
848 /// @param[in] surface The surface.
849 ///
851 void ImpellerSurfaceRetain(ImpellerSurface IMPELLER_NULLABLE surface);
852 
853 //------------------------------------------------------------------------------
854 /// @brief Release a previously retained reference to the object. The
855 /// object can be NULL in which case this method is a no-op.
856 ///
857 /// @param[in] surface The surface.
858 ///
860 void ImpellerSurfaceRelease(ImpellerSurface IMPELLER_NULLABLE surface);
861 
862 //------------------------------------------------------------------------------
863 /// @brief Draw a display list onto the surface. The same display list can
864 /// be drawn multiple times to different surfaces.
865 ///
866 /// @warning In the OpenGL backend, Impeller will not make an effort to
867 /// preserve the OpenGL state that is current in the context.
868 /// Embedders that perform additional OpenGL operations in the
869 /// context should expect the reset state after control transitions
870 /// back to them. Key state to watch out for would be the viewports,
871 /// stencil rects, test toggles, resource (texture, framebuffer,
872 /// buffer) bindings, etc...
873 ///
874 /// @param[in] surface The surface to draw the display list to.
875 /// @param[in] display_list The display list to draw onto the surface.
876 ///
877 /// @return If the display list could be drawn onto the surface.
878 ///
881  ImpellerSurface IMPELLER_NONNULL surface,
882  ImpellerDisplayList IMPELLER_NONNULL display_list);
883 
884 //------------------------------------------------------------------------------
885 /// @brief Present the surface to the underlying window system.
886 ///
887 /// @param[in] surface The surface to present.
888 ///
889 /// @return True if the surface could be presented.
890 ///
892 bool ImpellerSurfacePresent(ImpellerSurface IMPELLER_NONNULL surface);
893 
894 //------------------------------------------------------------------------------
895 // Path
896 //------------------------------------------------------------------------------
897 
898 //------------------------------------------------------------------------------
899 /// @brief Retain a strong reference to the object. The object can be NULL
900 /// in which case this method is a no-op.
901 ///
902 /// @param[in] path The path.
903 ///
905 void ImpellerPathRetain(ImpellerPath IMPELLER_NULLABLE path);
906 
907 //------------------------------------------------------------------------------
908 /// @brief Release a previously retained reference to the object. The
909 /// object can be NULL in which case this method is a no-op.
910 ///
911 /// @param[in] path The path.
912 ///
914 void ImpellerPathRelease(ImpellerPath IMPELLER_NULLABLE path);
915 
916 //------------------------------------------------------------------------------
917 // Path Builder
918 //------------------------------------------------------------------------------
919 
920 //------------------------------------------------------------------------------
921 /// @brief Create a new path builder. Paths themselves are immutable.
922 /// A builder builds these immutable paths.
923 ///
924 /// @return The path builder.
925 ///
928 
929 //------------------------------------------------------------------------------
930 /// @brief Retain a strong reference to the object. The object can be NULL
931 /// in which case this method is a no-op.
932 ///
933 /// @param[in] builder The builder.
934 ///
936 void ImpellerPathBuilderRetain(ImpellerPathBuilder IMPELLER_NULLABLE builder);
937 
938 //------------------------------------------------------------------------------
939 /// @brief Release a previously retained reference to the object. The
940 /// object can be NULL in which case this method is a no-op.
941 ///
942 /// @param[in] builder The builder.
943 ///
945 void ImpellerPathBuilderRelease(ImpellerPathBuilder IMPELLER_NULLABLE builder);
946 
947 //------------------------------------------------------------------------------
948 /// @brief Move the cursor to the specified location.
949 ///
950 /// @param[in] builder The builder.
951 /// @param[in] location The location.
952 ///
954 void ImpellerPathBuilderMoveTo(ImpellerPathBuilder IMPELLER_NONNULL builder,
955  const ImpellerPoint* IMPELLER_NONNULL location);
956 
957 //------------------------------------------------------------------------------
958 /// @brief Add a line segment from the current cursor location to the given
959 /// location. The cursor location is updated to be at the endpoint.
960 ///
961 /// @param[in] builder The builder.
962 /// @param[in] location The location.
963 ///
965 void ImpellerPathBuilderLineTo(ImpellerPathBuilder IMPELLER_NONNULL builder,
966  const ImpellerPoint* IMPELLER_NONNULL location);
967 
968 //------------------------------------------------------------------------------
969 /// @brief Add a quadratic curve from whose start point is the cursor to
970 /// the specified end point using the a single control point.
971 ///
972 /// The new location of the cursor after this call is the end point.
973 ///
974 /// @param[in] builder The builder.
975 /// @param[in] control_point The control point.
976 /// @param[in] end_point The end point.
977 ///
980  ImpellerPathBuilder IMPELLER_NONNULL builder,
981  const ImpellerPoint* IMPELLER_NONNULL control_point,
982  const ImpellerPoint* IMPELLER_NONNULL end_point);
983 
984 //------------------------------------------------------------------------------
985 /// @brief Add a cubic curve whose start point is current cursor location
986 /// to the specified end point using the two specified control
987 /// points.
988 ///
989 /// The new location of the cursor after this call is the end point
990 /// supplied.
991 ///
992 /// @param[in] builder The builder
993 /// @param[in] control_point_1 The control point 1
994 /// @param[in] control_point_2 The control point 2
995 /// @param[in] end_point The end point
996 ///
999  ImpellerPathBuilder IMPELLER_NONNULL builder,
1000  const ImpellerPoint* IMPELLER_NONNULL control_point_1,
1001  const ImpellerPoint* IMPELLER_NONNULL control_point_2,
1002  const ImpellerPoint* IMPELLER_NONNULL end_point);
1003 
1004 //------------------------------------------------------------------------------
1005 /// @brief Adds a rectangle to the path.
1006 ///
1007 /// @param[in] builder The builder.
1008 /// @param[in] rect The rectangle.
1009 ///
1011 void ImpellerPathBuilderAddRect(ImpellerPathBuilder IMPELLER_NONNULL builder,
1012  const ImpellerRect* IMPELLER_NONNULL rect);
1013 
1014 //------------------------------------------------------------------------------
1015 /// @brief Add an arc to the path.
1016 ///
1017 /// @param[in] builder The builder.
1018 /// @param[in] oval_bounds The oval bounds.
1019 /// @param[in] start_angle_degrees The start angle in degrees.
1020 /// @param[in] end_angle_degrees The end angle in degrees.
1021 ///
1023 void ImpellerPathBuilderAddArc(ImpellerPathBuilder IMPELLER_NONNULL builder,
1024  const ImpellerRect* IMPELLER_NONNULL oval_bounds,
1025  float start_angle_degrees,
1026  float end_angle_degrees);
1027 
1028 //------------------------------------------------------------------------------
1029 /// @brief Add an oval to the path.
1030 ///
1031 /// @param[in] builder The builder.
1032 /// @param[in] oval_bounds The oval bounds.
1033 ///
1036  ImpellerPathBuilder IMPELLER_NONNULL builder,
1037  const ImpellerRect* IMPELLER_NONNULL oval_bounds);
1038 
1039 //------------------------------------------------------------------------------
1040 /// @brief Add a rounded rect with potentially non-uniform radii to the
1041 /// path.
1042 ///
1043 /// @param[in] builder The builder.
1044 /// @param[in] rect The rectangle.
1045 /// @param[in] rounding_radii The rounding radii.
1046 ///
1049  ImpellerPathBuilder IMPELLER_NONNULL builder,
1050  const ImpellerRect* IMPELLER_NONNULL rect,
1051  const ImpellerRoundingRadii* IMPELLER_NONNULL rounding_radii);
1052 
1053 //------------------------------------------------------------------------------
1054 /// @brief Close the path.
1055 ///
1056 /// @param[in] builder The builder.
1057 ///
1059 void ImpellerPathBuilderClose(ImpellerPathBuilder IMPELLER_NONNULL builder);
1060 
1061 //------------------------------------------------------------------------------
1062 /// @brief Create a new path by copying the existing built-up path. The
1063 /// existing path can continue being added to.
1064 ///
1065 /// @param[in] builder The builder.
1066 /// @param[in] fill The fill.
1067 ///
1068 /// @return The impeller path.
1069 ///
1072  ImpellerFillType fill);
1073 
1074 //------------------------------------------------------------------------------
1075 /// @brief Create a new path using the existing built-up path. The existing
1076 /// path builder now contains an empty path.
1077 ///
1078 /// @param[in] builder The builder.
1079 /// @param[in] fill The fill.
1080 ///
1081 /// @return The impeller path.
1082 ///
1085  ImpellerFillType fill);
1086 
1087 //------------------------------------------------------------------------------
1088 // Paint
1089 //------------------------------------------------------------------------------
1090 
1091 //------------------------------------------------------------------------------
1092 /// @brief Create a new paint with default values.
1093 ///
1094 /// @return The impeller paint.
1095 ///
1098 
1099 //------------------------------------------------------------------------------
1100 /// @brief Retain a strong reference to the object. The object can be NULL
1101 /// in which case this method is a no-op.
1102 ///
1103 /// @param[in] paint The paint.
1104 ///
1106 void ImpellerPaintRetain(ImpellerPaint IMPELLER_NULLABLE paint);
1107 
1108 //------------------------------------------------------------------------------
1109 /// @brief Release a previously retained reference to the object. The
1110 /// object can be NULL in which case this method is a no-op.
1111 ///
1112 /// @param[in] paint The paint.
1113 ///
1115 void ImpellerPaintRelease(ImpellerPaint IMPELLER_NULLABLE paint);
1116 
1117 //------------------------------------------------------------------------------
1118 /// @brief Set the paint color.
1119 ///
1120 /// @param[in] paint The paint.
1121 /// @param[in] color The color.
1122 ///
1124 void ImpellerPaintSetColor(ImpellerPaint IMPELLER_NONNULL paint,
1125  const ImpellerColor* IMPELLER_NONNULL color);
1126 
1127 //------------------------------------------------------------------------------
1128 /// @brief Set the paint blend mode. The blend mode controls how the new
1129 /// paints contents are mixed with the values already drawn using
1130 /// previous draw calls.
1131 ///
1132 /// @param[in] paint The paint.
1133 /// @param[in] mode The mode.
1134 ///
1137  ImpellerBlendMode mode);
1138 
1139 //------------------------------------------------------------------------------
1140 /// @brief Set the paint draw style. The style controls if the closed
1141 /// shapes are filled and/or stroked.
1142 ///
1143 /// @param[in] paint The paint.
1144 /// @param[in] style The style.
1145 ///
1148  ImpellerDrawStyle style);
1149 
1150 //------------------------------------------------------------------------------
1151 /// @brief Sets how strokes rendered using this paint are capped.
1152 ///
1153 /// @param[in] paint The paint.
1154 /// @param[in] cap The stroke cap style.
1155 ///
1158  ImpellerStrokeCap cap);
1159 
1160 //------------------------------------------------------------------------------
1161 /// @brief Sets how strokes rendered using this paint are joined.
1162 ///
1163 /// @param[in] paint The paint.
1164 /// @param[in] join The join.
1165 ///
1168  ImpellerStrokeJoin join);
1169 
1170 //------------------------------------------------------------------------------
1171 /// @brief Set the width of the strokes rendered using this paint.
1172 ///
1173 /// @param[in] paint The paint.
1174 /// @param[in] width The width.
1175 ///
1178  float width);
1179 
1180 //------------------------------------------------------------------------------
1181 /// @brief Set the miter limit of the strokes rendered using this paint.
1182 ///
1183 /// @param[in] paint The paint.
1184 /// @param[in] miter The miter limit.
1185 ///
1188  float miter);
1189 
1190 //------------------------------------------------------------------------------
1191 /// @brief Set the color filter of the paint.
1192 ///
1193 /// Color filters are functions that take two colors and mix them to
1194 /// produce a single color. This color is then usually merged with
1195 /// the destination during blending.
1196 ///
1197 /// @param[in] paint The paint.
1198 /// @param[in] color_filter The color filter.
1199 ///
1202  ImpellerPaint IMPELLER_NONNULL paint,
1203  ImpellerColorFilter IMPELLER_NONNULL color_filter);
1204 
1205 //------------------------------------------------------------------------------
1206 /// @brief Set the color source of the paint.
1207 ///
1208 /// Color sources are functions that generate colors for each
1209 /// texture element covered by a draw call.
1210 ///
1211 /// @param[in] paint The paint.
1212 /// @param[in] color_source The color source.
1213 ///
1216  ImpellerPaint IMPELLER_NONNULL paint,
1217  ImpellerColorSource IMPELLER_NONNULL color_source);
1218 
1219 //------------------------------------------------------------------------------
1220 /// @brief Set the image filter of a paint.
1221 ///
1222 /// Image filters are functions that are applied to regions of a
1223 /// texture to produce a single color.
1224 ///
1225 /// @param[in] paint The paint.
1226 /// @param[in] image_filter The image filter.
1227 ///
1230  ImpellerPaint IMPELLER_NONNULL paint,
1231  ImpellerImageFilter IMPELLER_NONNULL image_filter);
1232 
1233 //------------------------------------------------------------------------------
1234 /// @brief Set the mask filter of a paint.
1235 ///
1236 /// @param[in] paint The paint.
1237 /// @param[in] mask_filter The mask filter.
1238 ///
1241  ImpellerPaint IMPELLER_NONNULL paint,
1242  ImpellerMaskFilter IMPELLER_NONNULL mask_filter);
1243 
1244 //------------------------------------------------------------------------------
1245 // Texture
1246 //------------------------------------------------------------------------------
1247 
1248 //------------------------------------------------------------------------------
1249 /// @brief Create a texture with decompressed bytes.
1250 ///
1251 /// Impeller will do its best to perform the transfer of this data
1252 /// to GPU memory with a minimal number of copies. Towards this
1253 /// end, it may need to send this data to a different thread for
1254 /// preparation and transfer. To facilitate this transfer, it is
1255 /// recommended that the content mapping have a release callback
1256 /// attach to it. When there is a release callback, Impeller assumes
1257 /// that collection of the data can be deferred till texture upload
1258 /// is done and can happen on a background thread. When there is no
1259 /// release callback, Impeller may try to perform an eager copy of
1260 /// the data if it needs to perform data preparation and transfer on
1261 /// a background thread.
1262 ///
1263 /// Whether an extra data copy actually occurs will always depend on
1264 /// the rendering backend in use. But it is best practice to provide
1265 /// a release callback and be resilient to the data being released
1266 /// in a deferred manner on a background thread.
1267 ///
1268 /// @warning Do **not** supply compressed image data directly (PNG, JPEG,
1269 /// etc...). This function only works with tightly packed
1270 /// decompressed data.
1271 ///
1272 /// @param[in] context The context.
1273 /// @param[in] descriptor The texture descriptor.
1274 /// @param[in] contents The contents.
1275 /// @param[in] contents_on_release_user_data The baton passes to the contents
1276 /// release callback if one exists.
1277 ///
1278 /// @return The texture if one can be created using the provided data, NULL
1279 /// otherwise.
1280 ///
1283  ImpellerContext IMPELLER_NONNULL context,
1284  const ImpellerTextureDescriptor* IMPELLER_NONNULL descriptor,
1285  const ImpellerMapping* IMPELLER_NONNULL contents,
1286  void* IMPELLER_NULLABLE contents_on_release_user_data);
1287 
1288 //------------------------------------------------------------------------------
1289 /// @brief Create a texture with an externally created OpenGL texture
1290 /// handle.
1291 ///
1292 /// Ownership of the handle is transferred over to Impeller after a
1293 /// successful call to this method. Impeller is responsible for
1294 /// calling glDeleteTextures on this handle. Do **not** collect this
1295 /// handle yourself as this will lead to a double-free.
1296 ///
1297 /// The handle must be created in the same context as the one used
1298 /// by Impeller. If a different context is used, that context must
1299 /// be in the same sharegroup as Impellers OpenGL context and all
1300 /// synchronization of texture contents must already be complete.
1301 ///
1302 /// If the context is not an OpenGL context, this call will always
1303 /// fail.
1304 ///
1305 /// @param[in] context The context
1306 /// @param[in] descriptor The descriptor
1307 /// @param[in] handle The handle
1308 ///
1309 /// @return The texture if one could be created by adopting the supplied
1310 /// texture handle, NULL otherwise.
1311 ///
1314  ImpellerContext IMPELLER_NONNULL context,
1315  const ImpellerTextureDescriptor* IMPELLER_NONNULL descriptor,
1316  uint64_t handle // transfer-in ownership
1317 );
1318 
1319 //------------------------------------------------------------------------------
1320 /// @brief Retain a strong reference to the object. The object can be NULL
1321 /// in which case this method is a no-op.
1322 ///
1323 /// @param[in] texture The texture.
1324 ///
1326 void ImpellerTextureRetain(ImpellerTexture IMPELLER_NULLABLE texture);
1327 
1328 //------------------------------------------------------------------------------
1329 /// @brief Release a previously retained reference to the object. The
1330 /// object can be NULL in which case this method is a no-op.
1331 ///
1332 /// @param[in] texture The texture.
1333 ///
1335 void ImpellerTextureRelease(ImpellerTexture IMPELLER_NULLABLE texture);
1336 
1337 //------------------------------------------------------------------------------
1338 /// @brief Get the OpenGL handle associated with this texture. If this is
1339 /// not an OpenGL texture, this method will always return 0.
1340 ///
1341 /// OpenGL handles are lazily created, this method will return
1342 /// GL_NONE is no OpenGL handle is available. To ensure that this
1343 /// call eagerly creates an OpenGL texture, call this on a thread
1344 /// where Impeller knows there is an OpenGL context available.
1345 ///
1346 /// @param[in] texture The texture.
1347 ///
1348 /// @return The OpenGL handle if one is available, GL_NONE otherwise.
1349 ///
1352  ImpellerTexture IMPELLER_NONNULL texture);
1353 
1354 //------------------------------------------------------------------------------
1355 // Color Sources
1356 //------------------------------------------------------------------------------
1357 
1358 //------------------------------------------------------------------------------
1359 /// @brief Retain a strong reference to the object. The object can be NULL
1360 /// in which case this method is a no-op.
1361 ///
1362 /// @param[in] color_source The color source.
1363 ///
1364 
1367  ImpellerColorSource IMPELLER_NULLABLE color_source);
1368 
1369 //------------------------------------------------------------------------------
1370 /// @brief Release a previously retained reference to the object. The
1371 /// object can be NULL in which case this method is a no-op.
1372 ///
1373 /// @param[in] color_source The color source.
1374 ///
1377  ImpellerColorSource IMPELLER_NULLABLE color_source);
1378 
1379 //------------------------------------------------------------------------------
1380 /// @brief Create a color source that forms a linear gradient.
1381 ///
1382 /// @param[in] start_point The start point.
1383 /// @param[in] end_point The end point.
1384 /// @param[in] stop_count The stop count.
1385 /// @param[in] colors The colors.
1386 /// @param[in] stops The stops.
1387 /// @param[in] tile_mode The tile mode.
1388 /// @param[in] transformation The transformation.
1389 ///
1390 /// @return The color source.
1391 ///
1394  const ImpellerPoint* IMPELLER_NONNULL start_point,
1395  const ImpellerPoint* IMPELLER_NONNULL end_point,
1396  uint32_t stop_count,
1397  const ImpellerColor* IMPELLER_NONNULL colors,
1398  const float* IMPELLER_NONNULL stops,
1399  ImpellerTileMode tile_mode,
1400  const ImpellerMatrix* IMPELLER_NULLABLE transformation);
1401 
1402 //------------------------------------------------------------------------------
1403 /// @brief Create a color source that forms a radial gradient.
1404 ///
1405 /// @param[in] center The center.
1406 /// @param[in] radius The radius.
1407 /// @param[in] stop_count The stop count.
1408 /// @param[in] colors The colors.
1409 /// @param[in] stops The stops.
1410 /// @param[in] tile_mode The tile mode.
1411 /// @param[in] transformation The transformation.
1412 ///
1413 /// @return The color source.
1414 ///
1417  const ImpellerPoint* IMPELLER_NONNULL center,
1418  float radius,
1419  uint32_t stop_count,
1420  const ImpellerColor* IMPELLER_NONNULL colors,
1421  const float* IMPELLER_NONNULL stops,
1422  ImpellerTileMode tile_mode,
1423  const ImpellerMatrix* IMPELLER_NULLABLE transformation);
1424 
1425 //------------------------------------------------------------------------------
1426 /// @brief Create a color source that forms a conical gradient.
1427 ///
1428 /// @param[in] start_center The start center.
1429 /// @param[in] start_radius The start radius.
1430 /// @param[in] end_center The end center.
1431 /// @param[in] end_radius The end radius.
1432 /// @param[in] stop_count The stop count.
1433 /// @param[in] colors The colors.
1434 /// @param[in] stops The stops.
1435 /// @param[in] tile_mode The tile mode.
1436 /// @param[in] transformation The transformation.
1437 ///
1438 /// @return The color source.
1439 ///
1442  const ImpellerPoint* IMPELLER_NONNULL start_center,
1443  float start_radius,
1444  const ImpellerPoint* IMPELLER_NONNULL end_center,
1445  float end_radius,
1446  uint32_t stop_count,
1447  const ImpellerColor* IMPELLER_NONNULL colors,
1448  const float* IMPELLER_NONNULL stops,
1449  ImpellerTileMode tile_mode,
1450  const ImpellerMatrix* IMPELLER_NULLABLE transformation);
1451 
1452 //------------------------------------------------------------------------------
1453 /// @brief Create a color source that forms a sweep gradient.
1454 ///
1455 /// @param[in] center The center.
1456 /// @param[in] start The start.
1457 /// @param[in] end The end.
1458 /// @param[in] stop_count The stop count.
1459 /// @param[in] colors The colors.
1460 /// @param[in] stops The stops.
1461 /// @param[in] tile_mode The tile mode.
1462 /// @param[in] transformation The transformation.
1463 ///
1464 /// @return The color source.
1465 ///
1468  const ImpellerPoint* IMPELLER_NONNULL center,
1469  float start,
1470  float end,
1471  uint32_t stop_count,
1472  const ImpellerColor* IMPELLER_NONNULL colors,
1473  const float* IMPELLER_NONNULL stops,
1474  ImpellerTileMode tile_mode,
1475  const ImpellerMatrix* IMPELLER_NULLABLE transformation);
1476 
1477 //------------------------------------------------------------------------------
1478 /// @brief Create a color source that samples from an image.
1479 ///
1480 /// @param[in] image The image.
1481 /// @param[in] horizontal_tile_mode The horizontal tile mode.
1482 /// @param[in] vertical_tile_mode The vertical tile mode.
1483 /// @param[in] sampling The sampling.
1484 /// @param[in] transformation The transformation.
1485 ///
1486 /// @return The color source.
1487 ///
1490  ImpellerTexture IMPELLER_NONNULL image,
1491  ImpellerTileMode horizontal_tile_mode,
1492  ImpellerTileMode vertical_tile_mode,
1493  ImpellerTextureSampling sampling,
1494  const ImpellerMatrix* IMPELLER_NULLABLE transformation);
1495 
1496 //------------------------------------------------------------------------------
1497 // Color Filters
1498 //------------------------------------------------------------------------------
1499 
1500 //------------------------------------------------------------------------------
1501 /// @brief Retain a strong reference to the object. The object can be NULL
1502 /// in which case this method is a no-op.
1503 ///
1504 /// @param[in] color_filter The color filter.
1505 ///
1508  ImpellerColorFilter IMPELLER_NULLABLE color_filter);
1509 
1510 //------------------------------------------------------------------------------
1511 /// @brief Release a previously retained reference to the object. The
1512 /// object can be NULL in which case this method is a no-op.
1513 ///
1514 /// @param[in] color_filter The color filter.
1515 ///
1518  ImpellerColorFilter IMPELLER_NULLABLE color_filter);
1519 
1520 //------------------------------------------------------------------------------
1521 /// @brief Create a color filter that performs blending of pixel values
1522 /// independently.
1523 ///
1524 /// @param[in] color The color.
1525 /// @param[in] blend_mode The blend mode.
1526 ///
1527 /// @return The color filter.
1528 ///
1531  ImpellerBlendMode blend_mode);
1532 
1533 //------------------------------------------------------------------------------
1534 /// @brief Create a color filter that transforms pixel color values
1535 /// independently.
1536 ///
1537 /// @param[in] color_matrix The color matrix.
1538 ///
1539 /// @return The color filter.
1540 ///
1543  const ImpellerColorMatrix* IMPELLER_NONNULL color_matrix);
1544 
1545 //------------------------------------------------------------------------------
1546 // Mask Filters
1547 //------------------------------------------------------------------------------
1548 
1549 //------------------------------------------------------------------------------
1550 /// @brief Retain a strong reference to the object. The object can be NULL
1551 /// in which case this method is a no-op.
1552 ///
1553 /// @param[in] mask_filter The mask filter.
1554 ///
1556 void ImpellerMaskFilterRetain(ImpellerMaskFilter IMPELLER_NULLABLE mask_filter);
1557 
1558 //------------------------------------------------------------------------------
1559 /// @brief Release a previously retained reference to the object. The
1560 /// object can be NULL in which case this method is a no-op.
1561 ///
1562 /// @param[in] mask_filter The mask filter.
1563 ///
1566  ImpellerMaskFilter IMPELLER_NULLABLE mask_filter);
1567 
1568 //------------------------------------------------------------------------------
1569 /// @brief Create a mask filter that blurs contents in the masked shape.
1570 ///
1571 /// @param[in] style The style.
1572 /// @param[in] sigma The sigma.
1573 ///
1574 /// @return The mask filter.
1575 ///
1578 
1579 //------------------------------------------------------------------------------
1580 // Image Filters
1581 //------------------------------------------------------------------------------
1582 
1583 //------------------------------------------------------------------------------
1584 /// @brief Retain a strong reference to the object. The object can be NULL
1585 /// in which case this method is a no-op.
1586 ///
1587 /// @param[in] image_filter The image filter.
1588 ///
1591  ImpellerImageFilter IMPELLER_NULLABLE image_filter);
1592 
1593 //------------------------------------------------------------------------------
1594 /// @brief Release a previously retained reference to the object. The
1595 /// object can be NULL in which case this method is a no-op.
1596 ///
1597 /// @param[in] image_filter The image filter.
1598 ///
1601  ImpellerImageFilter IMPELLER_NULLABLE image_filter);
1602 
1603 //------------------------------------------------------------------------------
1604 /// @brief Creates an image filter that applies a Gaussian blur.
1605 ///
1606 /// The Gaussian blur applied may be an approximation for
1607 /// performance.
1608 ///
1609 ///
1610 /// @param[in] x_sigma The x sigma.
1611 /// @param[in] y_sigma The y sigma.
1612 /// @param[in] tile_mode The tile mode.
1613 ///
1614 /// @return The image filter.
1615 ///
1618  float y_sigma,
1619  ImpellerTileMode tile_mode);
1620 
1621 //------------------------------------------------------------------------------
1622 /// @brief Creates an image filter that enhances the per-channel pixel
1623 /// values to the maximum value in a circle around the pixel.
1624 ///
1625 /// @param[in] x_radius The x radius.
1626 /// @param[in] y_radius The y radius.
1627 ///
1628 /// @return The image filter.
1629 ///
1630 
1632 ImpellerImageFilterCreateDilateNew(float x_radius, float y_radius);
1633 
1634 //------------------------------------------------------------------------------
1635 /// @brief Creates an image filter that dampens the per-channel pixel
1636 /// values to the minimum value in a circle around the pixel.
1637 ///
1638 /// @param[in] x_radius The x radius.
1639 /// @param[in] y_radius The y radius.
1640 ///
1641 /// @return The image filter.
1642 ///
1644 ImpellerImageFilterCreateErodeNew(float x_radius, float y_radius);
1645 
1646 //------------------------------------------------------------------------------
1647 /// @brief Creates an image filter that applies a transformation matrix to
1648 /// the underlying image.
1649 ///
1650 /// @param[in] matrix The transformation matrix.
1651 /// @param[in] sampling The image sampling mode.
1652 ///
1653 /// @return The image filter.
1654 ///
1657  const ImpellerMatrix* IMPELLER_NONNULL matrix,
1658  ImpellerTextureSampling sampling);
1659 
1660 //------------------------------------------------------------------------------
1661 /// @brief Creates a composed filter that when applied is identical to
1662 /// subsequently applying the inner and then the outer filters.
1663 ///
1664 /// ```
1665 /// destination = outer_filter(inner_filter(source))
1666 /// ```
1667 ///
1668 /// @param[in] outer The outer image filter.
1669 /// @param[in] inner The inner image filter.
1670 ///
1671 /// @return The combined image filter.
1672 ///
1675  ImpellerImageFilter IMPELLER_NONNULL inner);
1676 
1677 //------------------------------------------------------------------------------
1678 // Display List
1679 //------------------------------------------------------------------------------
1680 
1681 //------------------------------------------------------------------------------
1682 /// @brief Retain a strong reference to the object. The object can be NULL
1683 /// in which case this method is a no-op.
1684 ///
1685 /// @param[in] display_list The display list.
1686 ///
1689  ImpellerDisplayList IMPELLER_NULLABLE display_list);
1690 
1691 //------------------------------------------------------------------------------
1692 /// @brief Release a previously retained reference to the object. The
1693 /// object can be NULL in which case this method is a no-op.
1694 ///
1695 /// @param[in] display_list The display list.
1696 ///
1699  ImpellerDisplayList IMPELLER_NULLABLE display_list);
1700 
1701 //------------------------------------------------------------------------------
1702 // Display List Builder
1703 //------------------------------------------------------------------------------
1704 
1705 //------------------------------------------------------------------------------
1706 /// @brief Create a new display list builder.
1707 ///
1708 /// An optional cull rectangle may be specified. Impeller is allowed
1709 /// to treat the contents outside this rectangle as being undefined.
1710 /// This may aid performance optimizations.
1711 ///
1712 /// @param[in] cull_rect The cull rectangle or NULL.
1713 ///
1714 /// @return The display list builder.
1715 ///
1716 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerDisplayListBuilder IMPELLER_NULLABLE
1718 
1719 //------------------------------------------------------------------------------
1720 /// @brief Retain a strong reference to the object. The object can be NULL
1721 /// in which case this method is a no-op.
1722 ///
1723 /// @param[in] builder The display list builder.
1724 ///
1727  ImpellerDisplayListBuilder IMPELLER_NULLABLE builder);
1728 
1729 //------------------------------------------------------------------------------
1730 /// @brief Release a previously retained reference to the object. The
1731 /// object can be NULL in which case this method is a no-op.
1732 ///
1733 /// @param[in] builder The display list builder.
1734 ///
1737  ImpellerDisplayListBuilder IMPELLER_NULLABLE builder);
1738 
1739 //------------------------------------------------------------------------------
1740 /// @brief Create a new display list using the rendering intent already
1741 /// encoded in the builder. The builder is reset after this call.
1742 ///
1743 /// @param[in] builder The builder.
1744 ///
1745 /// @return The display list.
1746 ///
1749  ImpellerDisplayListBuilder IMPELLER_NONNULL builder);
1750 
1751 //------------------------------------------------------------------------------
1752 // Display List Builder: Managing the transformation stack.
1753 //------------------------------------------------------------------------------
1754 
1755 //------------------------------------------------------------------------------
1756 /// @brief Stashes the current transformation and clip state onto a save
1757 /// stack.
1758 ///
1759 /// @param[in] builder The builder.
1760 ///
1763  ImpellerDisplayListBuilder IMPELLER_NONNULL builder);
1764 
1765 //------------------------------------------------------------------------------
1766 /// @brief Stashes the current transformation and clip state onto a save
1767 /// stack and creates and creates an offscreen layer onto which
1768 /// subsequent rendering intent will be directed to.
1769 ///
1770 /// On the balancing call to restore, the supplied paints filters
1771 /// and blend modes will be used to composite the offscreen contents
1772 /// back onto the display display list.
1773 ///
1774 /// @param[in] builder The builder.
1775 /// @param[in] bounds The bounds.
1776 /// @param[in] paint The paint.
1777 /// @param[in] backdrop The backdrop.
1778 ///
1781  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1782  const ImpellerRect* IMPELLER_NONNULL bounds,
1783  ImpellerPaint IMPELLER_NULLABLE paint,
1784  ImpellerImageFilter IMPELLER_NULLABLE backdrop);
1785 
1786 //------------------------------------------------------------------------------
1787 /// @brief Pops the last entry pushed onto the save stack using a call to
1788 /// `ImpellerDisplayListBuilderSave` or
1789 /// `ImpellerDisplayListBuilderSaveLayer`.
1790 ///
1791 /// @param[in] builder The builder.
1792 ///
1795  ImpellerDisplayListBuilder IMPELLER_NONNULL builder);
1796 
1797 //------------------------------------------------------------------------------
1798 /// @brief Apply a scale to the transformation matrix currently on top of
1799 /// the save stack.
1800 ///
1801 /// @param[in] builder The builder.
1802 /// @param[in] x_scale The x scale.
1803 /// @param[in] y_scale The y scale.
1804 ///
1807  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1808  float x_scale,
1809  float y_scale);
1810 
1811 //------------------------------------------------------------------------------
1812 /// @brief Apply a clockwise rotation to the transformation matrix
1813 /// currently on top of the save stack.
1814 ///
1815 /// @param[in] builder The builder.
1816 /// @param[in] angle_degrees The angle in degrees.
1817 ///
1818 
1821  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1822  float angle_degrees);
1823 
1824 //------------------------------------------------------------------------------
1825 /// @brief Apply a translation to the transformation matrix currently on
1826 /// top of the save stack.
1827 ///
1828 /// @param[in] builder The builder.
1829 /// @param[in] x_translation The x translation.
1830 /// @param[in] y_translation The y translation.
1831 ///
1834  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1835  float x_translation,
1836  float y_translation);
1837 
1838 //------------------------------------------------------------------------------
1839 /// @brief Appends the the provided transformation to the transformation
1840 /// already on the save stack.
1841 ///
1842 /// @param[in] builder The builder.
1843 /// @param[in] transform The transform to append.
1844 ///
1847  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1849 
1850 //------------------------------------------------------------------------------
1851 /// @brief Clear the transformation on top of the save stack and replace it
1852 /// with a new value.
1853 ///
1854 /// @param[in] builder The builder.
1855 /// @param[in] transform The new transform.
1856 ///
1859  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1861 
1862 //------------------------------------------------------------------------------
1863 /// @brief Get the transformation currently built up on the top of the
1864 /// transformation stack.
1865 ///
1866 /// @param[in] builder The builder.
1867 /// @param[out] out_transform The transform.
1868 ///
1871  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1872  ImpellerMatrix* IMPELLER_NONNULL out_transform);
1873 
1874 //------------------------------------------------------------------------------
1875 /// @brief Reset the transformation on top of the transformation stack to
1876 /// identity.
1877 ///
1878 /// @param[in] builder The builder.
1879 ///
1882  ImpellerDisplayListBuilder IMPELLER_NONNULL builder);
1883 
1884 //------------------------------------------------------------------------------
1885 /// @brief Get the current size of the save stack.
1886 ///
1887 /// @param[in] builder The builder.
1888 ///
1889 /// @return The save stack size.
1890 ///
1893  ImpellerDisplayListBuilder IMPELLER_NONNULL builder);
1894 
1895 //------------------------------------------------------------------------------
1896 /// @brief Effectively calls ImpellerDisplayListBuilderRestore till the
1897 /// size of the save stack becomes a specified count.
1898 ///
1899 /// @param[in] builder The builder.
1900 /// @param[in] count The count.
1901 ///
1904  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1905  uint32_t count);
1906 
1907 //------------------------------------------------------------------------------
1908 // Display List Builder: Clipping
1909 //------------------------------------------------------------------------------
1910 
1911 //------------------------------------------------------------------------------
1912 /// @brief Reduces the clip region to the intersection of the current clip
1913 /// and the given rectangle taking into account the clip operation.
1914 ///
1915 /// @param[in] builder The builder.
1916 /// @param[in] rect The rectangle.
1917 /// @param[in] op The operation.
1918 ///
1921  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1922  const ImpellerRect* IMPELLER_NONNULL rect,
1924 
1925 //------------------------------------------------------------------------------
1926 /// @brief Reduces the clip region to the intersection of the current clip
1927 /// and the given oval taking into account the clip operation.
1928 ///
1929 /// @param[in] builder The builder.
1930 /// @param[in] oval_bounds The oval bounds.
1931 /// @param[in] op The operation.
1932 ///
1935  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1936  const ImpellerRect* IMPELLER_NONNULL oval_bounds,
1938 
1939 //------------------------------------------------------------------------------
1940 /// @brief Reduces the clip region to the intersection of the current clip
1941 /// and the given rounded rectangle taking into account the clip
1942 /// operation.
1943 ///
1944 /// @param[in] builder The builder.
1945 /// @param[in] rect The rectangle.
1946 /// @param[in] radii The radii.
1947 /// @param[in] op The operation.
1948 ///
1951  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1952  const ImpellerRect* IMPELLER_NONNULL rect,
1955 
1956 //------------------------------------------------------------------------------
1957 /// @brief Reduces the clip region to the intersection of the current clip
1958 /// and the given path taking into account the clip operation.
1959 ///
1960 /// @param[in] builder The builder.
1961 /// @param[in] path The path.
1962 /// @param[in] op The operation.
1963 ///
1966  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1967  ImpellerPath IMPELLER_NONNULL path,
1969 
1970 //------------------------------------------------------------------------------
1971 // Display List Builder: Drawing Shapes
1972 //------------------------------------------------------------------------------
1973 
1974 //------------------------------------------------------------------------------
1975 /// @brief Fills the current clip with the specified paint.
1976 ///
1977 /// @param[in] builder The builder.
1978 /// @param[in] paint The paint.
1979 ///
1982  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1983  ImpellerPaint IMPELLER_NONNULL paint);
1984 
1985 //------------------------------------------------------------------------------
1986 /// @brief Draws a line segment.
1987 ///
1988 /// @param[in] builder The builder.
1989 /// @param[in] from The starting point of the line.
1990 /// @param[in] to The end point of the line.
1991 /// @param[in] paint The paint.
1992 ///
1995  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1996  const ImpellerPoint* IMPELLER_NONNULL from,
1997  const ImpellerPoint* IMPELLER_NONNULL to,
1998  ImpellerPaint IMPELLER_NONNULL paint);
1999 
2000 //------------------------------------------------------------------------------
2001 /// @brief Draws a dash line segment.
2002 ///
2003 /// @param[in] builder The builder.
2004 /// @param[in] from The starting point of the line.
2005 /// @param[in] to The end point of the line.
2006 /// @param[in] on_length On length.
2007 /// @param[in] off_length Off length.
2008 /// @param[in] paint The paint.
2009 ///
2012  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2013  const ImpellerPoint* IMPELLER_NONNULL from,
2014  const ImpellerPoint* IMPELLER_NONNULL to,
2015  float on_length,
2016  float off_length,
2017  ImpellerPaint IMPELLER_NONNULL paint);
2018 
2019 //------------------------------------------------------------------------------
2020 /// @brief Draws a rectangle.
2021 ///
2022 /// @param[in] builder The builder.
2023 /// @param[in] rect The rectangle.
2024 /// @param[in] paint The paint.
2025 ///
2028  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2029  const ImpellerRect* IMPELLER_NONNULL rect,
2030  ImpellerPaint IMPELLER_NONNULL paint);
2031 
2032 //------------------------------------------------------------------------------
2033 /// @brief Draws an oval.
2034 ///
2035 /// @param[in] builder The builder.
2036 /// @param[in] oval_bounds The oval bounds.
2037 /// @param[in] paint The paint.
2038 ///
2041  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2042  const ImpellerRect* IMPELLER_NONNULL oval_bounds,
2043  ImpellerPaint IMPELLER_NONNULL paint);
2044 
2045 //------------------------------------------------------------------------------
2046 /// @brief Draws a rounded rect.
2047 ///
2048 /// @param[in] builder The builder.
2049 /// @param[in] rect The rectangle.
2050 /// @param[in] radii The radii.
2051 /// @param[in] paint The paint.
2052 ///
2055  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2056  const ImpellerRect* IMPELLER_NONNULL rect,
2058  ImpellerPaint IMPELLER_NONNULL paint);
2059 
2060 //------------------------------------------------------------------------------
2061 /// @brief Draws a shape that is the different between the specified
2062 /// rectangles (each with configurable corner radii).
2063 ///
2064 /// @param[in] builder The builder.
2065 /// @param[in] outer_rect The outer rectangle.
2066 /// @param[in] outer_radii The outer radii.
2067 /// @param[in] inner_rect The inner rectangle.
2068 /// @param[in] inner_radii The inner radii.
2069 /// @param[in] paint The paint.
2070 ///
2073  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2074  const ImpellerRect* IMPELLER_NONNULL outer_rect,
2075  const ImpellerRoundingRadii* IMPELLER_NONNULL outer_radii,
2076  const ImpellerRect* IMPELLER_NONNULL inner_rect,
2077  const ImpellerRoundingRadii* IMPELLER_NONNULL inner_radii,
2078  ImpellerPaint IMPELLER_NONNULL paint);
2079 
2080 //------------------------------------------------------------------------------
2081 /// @brief Draws the specified shape.
2082 ///
2083 /// @param[in] builder The builder.
2084 /// @param[in] path The path.
2085 /// @param[in] paint The paint.
2086 ///
2089  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2090  ImpellerPath IMPELLER_NONNULL path,
2091  ImpellerPaint IMPELLER_NONNULL paint);
2092 
2093 //------------------------------------------------------------------------------
2094 /// @brief Flattens the contents of another display list into the one
2095 /// currently being built.
2096 ///
2097 /// @param[in] builder The builder.
2098 /// @param[in] display_list The display list.
2099 /// @param[in] opacity The opacity.
2100 ///
2103  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2104  ImpellerDisplayList IMPELLER_NONNULL display_list,
2105  float opacity);
2106 
2107 //------------------------------------------------------------------------------
2108 /// @brief Draw a paragraph at the specified point.
2109 ///
2110 /// @param[in] builder The builder.
2111 /// @param[in] paragraph The paragraph.
2112 /// @param[in] point The point.
2113 ///
2116  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2117  ImpellerParagraph IMPELLER_NONNULL paragraph,
2118  const ImpellerPoint* IMPELLER_NONNULL point);
2119 
2120 //------------------------------------------------------------------------------
2121 /// @brief Draw a shadow for a Path given a material elevation. If the
2122 /// occluding object is not opaque, additional hints (via the
2123 /// `occluder_is_transparent` argument) must be provided to render
2124 /// the shadow correctly.
2125 ///
2126 /// @param[in] builder The builder.
2127 /// @param[in] path The shadow path.
2128 /// @param[in] color The shadow color.
2129 /// @param[in] elevation The material elevation.
2130 /// @param[in] occluder_is_transparent
2131 /// If the object casting the shadow is transparent.
2132 /// @param[in] device_pixel_ratio
2133 /// The device pixel ratio.
2134 ///
2137  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2138  ImpellerPath IMPELLER_NONNULL path,
2139  const ImpellerColor* IMPELLER_NONNULL color,
2140  float elevation,
2141  bool occluder_is_transparent,
2142  float device_pixel_ratio);
2143 
2144 //------------------------------------------------------------------------------
2145 // Display List Builder: Drawing Textures
2146 //------------------------------------------------------------------------------
2147 
2148 //------------------------------------------------------------------------------
2149 /// @brief Draw a texture at the specified point.
2150 ///
2151 /// @param[in] builder The builder.
2152 /// @param[in] texture The texture.
2153 /// @param[in] point The point.
2154 /// @param[in] sampling The sampling.
2155 /// @param[in] paint The paint.
2156 ///
2159  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2160  ImpellerTexture IMPELLER_NONNULL texture,
2161  const ImpellerPoint* IMPELLER_NONNULL point,
2162  ImpellerTextureSampling sampling,
2163  ImpellerPaint IMPELLER_NULLABLE paint);
2164 
2165 //------------------------------------------------------------------------------
2166 /// @brief Draw a portion of texture at the specified location.
2167 ///
2168 /// @param[in] builder The builder.
2169 /// @param[in] texture The texture.
2170 /// @param[in] src_rect The source rectangle.
2171 /// @param[in] dst_rect The destination rectangle.
2172 /// @param[in] sampling The sampling.
2173 /// @param[in] paint The paint.
2174 ///
2177  ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2178  ImpellerTexture IMPELLER_NONNULL texture,
2179  const ImpellerRect* IMPELLER_NONNULL src_rect,
2180  const ImpellerRect* IMPELLER_NONNULL dst_rect,
2181  ImpellerTextureSampling sampling,
2182  ImpellerPaint IMPELLER_NULLABLE paint);
2183 
2184 //------------------------------------------------------------------------------
2185 // Typography Context
2186 //------------------------------------------------------------------------------
2187 
2188 //------------------------------------------------------------------------------
2189 /// @brief Create a new typography contents.
2190 ///
2191 /// @return The typography context.
2192 ///
2193 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTypographyContext IMPELLER_NULLABLE
2195 
2196 //------------------------------------------------------------------------------
2197 /// @brief Retain a strong reference to the object. The object can be NULL
2198 /// in which case this method is a no-op.
2199 ///
2200 /// @param[in] context The typography context.
2201 ///
2204  ImpellerTypographyContext IMPELLER_NULLABLE context);
2205 
2206 //------------------------------------------------------------------------------
2207 /// @brief Release a previously retained reference to the object. The
2208 /// object can be NULL in which case this method is a no-op.
2209 ///
2210 /// @param[in] context The typography context.
2211 ///
2214  ImpellerTypographyContext IMPELLER_NULLABLE context);
2215 
2216 //------------------------------------------------------------------------------
2217 /// @brief Register a custom font.
2218 ///
2219 /// The following font formats are supported:
2220 /// * OpenType font collections (.ttc extension)
2221 /// * TrueType fonts: (.ttf extension)
2222 /// * OpenType fonts: (.otf extension)
2223 ///
2224 /// @warning Web Open Font Formats (.woff and .woff2 extensions) are **not**
2225 /// supported.
2226 ///
2227 /// The font data is specified as a mapping. It is possible for the
2228 /// release callback of the mapping to not be called even past the
2229 /// destruction of the typography context. Care must be taken to not
2230 /// collect the mapping till the release callback is invoked by
2231 /// Impeller.
2232 ///
2233 /// The family alias name can be NULL. In such cases, the font
2234 /// family specified in paragraph styles must match the family that
2235 /// is specified in the font data.
2236 ///
2237 /// If the family name alias is not NULL, that family name must be
2238 /// used in the paragraph style to reference glyphs from this font
2239 /// instead of the one encoded in the font itself.
2240 ///
2241 /// Multiple fonts (with glyphs for different styles) can be
2242 /// specified with the same family.
2243 ///
2244 /// @see `ImpellerParagraphStyleSetFontFamily`
2245 ///
2246 /// @param[in] context The context.
2247 /// @param[in] contents The contents.
2248 /// @param[in] contents_on_release_user_data The user data baton to be passed
2249 /// to the contents release callback.
2250 /// @param[in] family_name_alias The family name alias or NULL if
2251 /// the one specified in the font
2252 /// data is to be used.
2253 ///
2254 /// @return If the font could be successfully registered.
2255 ///
2258  ImpellerTypographyContext IMPELLER_NONNULL context,
2259  const ImpellerMapping* IMPELLER_NONNULL contents,
2260  void* IMPELLER_NULLABLE contents_on_release_user_data,
2261  const char* IMPELLER_NULLABLE family_name_alias);
2262 
2263 //------------------------------------------------------------------------------
2264 // Paragraph Style
2265 //------------------------------------------------------------------------------
2266 
2267 //------------------------------------------------------------------------------
2268 /// @brief Create a new paragraph style.
2269 ///
2270 /// @return The paragraph style.
2271 ///
2274 
2275 //------------------------------------------------------------------------------
2276 /// @brief Retain a strong reference to the object. The object can be NULL
2277 /// in which case this method is a no-op.
2278 ///
2279 /// @param[in] paragraph_style The paragraph style.
2280 ///
2283  ImpellerParagraphStyle IMPELLER_NULLABLE paragraph_style);
2284 
2285 //------------------------------------------------------------------------------
2286 /// @brief Release a previously retained reference to the object. The
2287 /// object can be NULL in which case this method is a no-op.
2288 ///
2289 /// @param[in] paragraph_style The paragraph style.
2290 ///
2293  ImpellerParagraphStyle IMPELLER_NULLABLE paragraph_style);
2294 
2295 //------------------------------------------------------------------------------
2296 /// @brief Set the paint used to render the text glyph contents.
2297 ///
2298 /// @param[in] paragraph_style The paragraph style.
2299 /// @param[in] paint The paint.
2300 ///
2303  ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2304  ImpellerPaint IMPELLER_NONNULL paint);
2305 
2306 //------------------------------------------------------------------------------
2307 /// @brief Set the paint used to render the background of the text glyphs.
2308 ///
2309 /// @param[in] paragraph_style The paragraph style.
2310 /// @param[in] paint The paint.
2311 ///
2314  ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2315  ImpellerPaint IMPELLER_NONNULL paint);
2316 
2317 //------------------------------------------------------------------------------
2318 /// @brief Set the weight of the font to select when rendering glyphs.
2319 ///
2320 /// @param[in] paragraph_style The paragraph style.
2321 /// @param[in] weight The weight.
2322 ///
2325  ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2326  ImpellerFontWeight weight);
2327 
2328 //------------------------------------------------------------------------------
2329 /// @brief Set whether the glyphs should be bolded or italicized.
2330 ///
2331 /// @param[in] paragraph_style The paragraph style.
2332 /// @param[in] style The style.
2333 ///
2336  ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2337  ImpellerFontStyle style);
2338 
2339 //------------------------------------------------------------------------------
2340 /// @brief Set the font family.
2341 ///
2342 /// @param[in] paragraph_style The paragraph style.
2343 /// @param[in] family_name The family name.
2344 ///
2347  ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2348  const char* IMPELLER_NONNULL family_name);
2349 
2350 //------------------------------------------------------------------------------
2351 /// @brief Set the font size.
2352 ///
2353 /// @param[in] paragraph_style The paragraph style.
2354 /// @param[in] size The size.
2355 ///
2358  ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2359  float size);
2360 
2361 //------------------------------------------------------------------------------
2362 /// @brief The height of the text as a multiple of text size.
2363 ///
2364 /// When height is 0.0, the line height will be determined by the
2365 /// font's metrics directly, which may differ from the font size.
2366 /// Otherwise the line height of the text will be a multiple of font
2367 /// size, and be exactly fontSize * height logical pixels tall.
2368 ///
2369 /// @param[in] paragraph_style The paragraph style.
2370 /// @param[in] height The height.
2371 ///
2374  ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2375  float height);
2376 
2377 //------------------------------------------------------------------------------
2378 /// @brief Set the alignment of text within the paragraph.
2379 ///
2380 /// @param[in] paragraph_style The paragraph style.
2381 /// @param[in] align The align.
2382 ///
2385  ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2386  ImpellerTextAlignment align);
2387 
2388 //------------------------------------------------------------------------------
2389 /// @brief Set the directionality of the text within the paragraph.
2390 ///
2391 /// @param[in] paragraph_style The paragraph style.
2392 /// @param[in] direction The direction.
2393 ///
2396  ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2397  ImpellerTextDirection direction);
2398 
2399 //------------------------------------------------------------------------------
2400 /// @brief Set the maximum line count within the paragraph.
2401 ///
2402 /// @param[in] paragraph_style The paragraph style.
2403 /// @param[in] max_lines The maximum lines.
2404 ///
2407  ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2408  uint32_t max_lines);
2409 
2410 //------------------------------------------------------------------------------
2411 /// @brief Set the paragraph locale.
2412 ///
2413 /// @param[in] paragraph_style The paragraph style.
2414 /// @param[in] locale The locale.
2415 ///
2418  ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2419  const char* IMPELLER_NONNULL locale);
2420 
2421 //------------------------------------------------------------------------------
2422 // Paragraph Builder
2423 //------------------------------------------------------------------------------
2424 
2425 //------------------------------------------------------------------------------
2426 /// @brief Create a new paragraph builder.
2427 ///
2428 /// @param[in] context The context.
2429 ///
2430 /// @return The paragraph builder.
2431 ///
2432 IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphBuilder IMPELLER_NULLABLE
2433 ImpellerParagraphBuilderNew(ImpellerTypographyContext IMPELLER_NONNULL context);
2434 
2435 //------------------------------------------------------------------------------
2436 /// @brief Retain a strong reference to the object. The object can be NULL
2437 /// in which case this method is a no-op.
2438 ///
2439 /// @param[in] paragraph_builder The paragraph builder.
2440 ///
2443  ImpellerParagraphBuilder IMPELLER_NULLABLE paragraph_builder);
2444 
2445 //------------------------------------------------------------------------------
2446 /// @brief Release a previously retained reference to the object. The
2447 /// object can be NULL in which case this method is a no-op.
2448 ///
2449 /// @param[in] paragraph_builder The paragraph_builder.
2450 ///
2453  ImpellerParagraphBuilder IMPELLER_NULLABLE paragraph_builder);
2454 
2455 //------------------------------------------------------------------------------
2456 /// @brief Push a new paragraph style onto the paragraph style stack
2457 /// managed by the paragraph builder.
2458 ///
2459 /// Not all paragraph styles can be combined. For instance, it does
2460 /// not make sense to mix text alignment for different text runs
2461 /// within a paragraph. In such cases, the preference of the the
2462 /// first paragraph style on the style stack will take hold.
2463 ///
2464 /// If text is pushed onto the paragraph builder without a style
2465 /// previously pushed onto the stack, a default paragraph text style
2466 /// will be used. This may not always be desirable because some
2467 /// style element cannot be overridden. It is recommended that a
2468 /// default paragraph style always be pushed onto the stack before
2469 /// the addition of any text.
2470 ///
2471 /// @param[in] paragraph_builder The paragraph builder.
2472 /// @param[in] style The style.
2473 ///
2476  ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder,
2477  ImpellerParagraphStyle IMPELLER_NONNULL style);
2478 
2479 //------------------------------------------------------------------------------
2480 /// @brief Pop a previously pushed paragraph style from the paragraph style
2481 /// stack.
2482 ///
2483 /// @param[in] paragraph_builder The paragraph builder.
2484 ///
2487  ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder);
2488 
2489 //------------------------------------------------------------------------------
2490 /// @brief Add UTF-8 encoded text to the paragraph. The text will be styled
2491 /// according to the paragraph style already on top of the paragraph
2492 /// style stack.
2493 ///
2494 /// @param[in] paragraph_builder The paragraph builder.
2495 /// @param[in] data The data.
2496 /// @param[in] length The length.
2497 ///
2500  ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder,
2501  const uint8_t* IMPELLER_NULLABLE data,
2502  uint32_t length);
2503 
2504 //------------------------------------------------------------------------------
2505 /// @brief Layout and build a new paragraph using the specified width. The
2506 /// resulting paragraph is immutable. The paragraph builder must be
2507 /// discarded and a new one created to build more paragraphs.
2508 ///
2509 /// @param[in] paragraph_builder The paragraph builder.
2510 /// @param[in] width The paragraph width.
2511 ///
2512 /// @return The paragraph if one can be created, NULL otherwise.
2513 ///
2516  ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder,
2517  float width);
2518 
2519 //------------------------------------------------------------------------------
2520 // Paragraph
2521 //------------------------------------------------------------------------------
2522 
2523 //------------------------------------------------------------------------------
2524 /// @brief Retain a strong reference to the object. The object can be NULL
2525 /// in which case this method is a no-op.
2526 ///
2527 /// @param[in] paragraph The paragraph.
2528 ///
2530 void ImpellerParagraphRetain(ImpellerParagraph IMPELLER_NULLABLE paragraph);
2531 
2532 //------------------------------------------------------------------------------
2533 /// @brief Release a previously retained reference to the object. The
2534 /// object can be NULL in which case this method is a no-op.
2535 ///
2536 /// @param[in] paragraph The paragraph.
2537 ///
2539 void ImpellerParagraphRelease(ImpellerParagraph IMPELLER_NULLABLE paragraph);
2540 
2541 //------------------------------------------------------------------------------
2542 /// @see `ImpellerParagraphGetMinIntrinsicWidth`
2543 ///
2544 /// @param[in] paragraph The paragraph.
2545 ///
2546 ///
2547 /// @return The width provided to the paragraph builder during the call to
2548 /// layout. This is the maximum width any line in the laid out
2549 /// paragraph can occupy. But, it is not necessarily the actual
2550 /// width of the paragraph after layout.
2551 ///
2554  ImpellerParagraph IMPELLER_NONNULL paragraph);
2555 
2556 //------------------------------------------------------------------------------
2557 /// @param[in] paragraph The paragraph.
2558 ///
2559 /// @return The height of the laid out paragraph. This is **not** a tight
2560 /// bounding box and some glyphs may not reach the minimum location
2561 /// they are allowed to reach.
2562 ///
2564 float ImpellerParagraphGetHeight(ImpellerParagraph IMPELLER_NONNULL paragraph);
2565 
2566 //------------------------------------------------------------------------------
2567 /// @param[in] paragraph The paragraph.
2568 ///
2569 /// @return The length of the longest line in the paragraph. This is the
2570 /// horizontal distance between the left edge of the leftmost glyph
2571 /// and the right edge of the rightmost glyph, in the longest line
2572 /// in the paragraph.
2573 ///
2576  ImpellerParagraph IMPELLER_NONNULL paragraph);
2577 
2578 //------------------------------------------------------------------------------
2579 /// @see `ImpellerParagraphGetMaxWidth`
2580 ///
2581 /// @param[in] paragraph The paragraph.
2582 ///
2583 /// @return The actual width of the longest line in the paragraph after
2584 /// layout. This is expected to be less than or equal to
2585 /// `ImpellerParagraphGetMaxWidth`.
2586 ///
2589  ImpellerParagraph IMPELLER_NONNULL paragraph);
2590 
2591 //------------------------------------------------------------------------------
2592 /// @param[in] paragraph The paragraph.
2593 ///
2594 /// @return The width of the paragraph without line breaking.
2595 ///
2598  ImpellerParagraph IMPELLER_NONNULL paragraph);
2599 
2600 //------------------------------------------------------------------------------
2601 /// @param[in] paragraph The paragraph.
2602 ///
2603 /// @return The distance from the top of the paragraph to the ideographic
2604 /// baseline of the first line when using ideographic fonts
2605 /// (Japanese, Korean, etc...).
2606 ///
2609  ImpellerParagraph IMPELLER_NONNULL paragraph);
2610 
2611 //------------------------------------------------------------------------------
2612 /// @param[in] paragraph The paragraph.
2613 ///
2614 /// @return The distance from the top of the paragraph to the alphabetic
2615 /// baseline of the first line when using alphabetic fonts (A-Z,
2616 /// a-z, Greek, etc...).
2617 ///
2620  ImpellerParagraph IMPELLER_NONNULL paragraph);
2621 
2622 //------------------------------------------------------------------------------
2623 /// @param[in] paragraph The paragraph.
2624 ///
2625 /// @return The number of lines visible in the paragraph after line
2626 /// breaking.
2627 ///
2630  ImpellerParagraph IMPELLER_NONNULL paragraph);
2631 
2632 //------------------------------------------------------------------------------
2633 /// @brief Get the range into the UTF-16 code unit buffer that represents
2634 /// the word at the specified caret location in the same buffer.
2635 ///
2636 /// Word boundaries are defined more precisely in [Unicode Standard
2637 /// Annex #29](http://www.unicode.org/reports/tr29/#Word_Boundaries)
2638 ///
2639 /// @param[in] paragraph The paragraph
2640 /// @param[in] code_unit_index The code unit index
2641 ///
2642 /// @return The impeller range.
2643 ///
2646  ImpellerParagraph IMPELLER_NONNULL paragraph,
2647  size_t code_unit_index);
2648 
2649 //------------------------------------------------------------------------------
2650 /// @brief Get the line metrics of this laid out paragraph. Calculating the
2651 /// line metrics is expensive. The first time line metrics are
2652 /// requested, they will be cached along with the paragraph (which
2653 /// is immutable).
2654 ///
2655 /// @param[in] paragraph The paragraph.
2656 ///
2657 /// @return The line metrics.
2658 ///
2661  ImpellerParagraph IMPELLER_NONNULL paragraph);
2662 
2663 //------------------------------------------------------------------------------
2664 /// @brief Create a new instance of glyph info that can be queried for
2665 /// information about the glyph at the given UTF-16 code unit index.
2666 /// The instance must be freed using `ImpellerGlyphInfoRelease`.
2667 ///
2668 /// @param[in] paragraph The paragraph.
2669 /// @param[in] code_unit_index The UTF-16 code unit index.
2670 ///
2671 /// @return The glyph information.
2672 ///
2674 IMPELLER_NODISCARD ImpellerGlyphInfo IMPELLER_NULLABLE
2676  ImpellerParagraph IMPELLER_NONNULL paragraph,
2677  size_t code_unit_index);
2678 
2679 //------------------------------------------------------------------------------
2680 /// @brief Create a new instance of glyph info that can be queried for
2681 /// information about the glyph closest to the specified coordinates
2682 /// relative to the origin of the paragraph. The instance must be
2683 /// freed using `ImpellerGlyphInfoRelease`.
2684 ///
2685 /// @param[in] paragraph The paragraph.
2686 /// @param[in] x The x coordinate relative to paragraph origin.
2687 /// @param[in] y The x coordinate relative to paragraph origin.
2688 ///
2689 /// @return The glyph information.
2690 ///
2692 IMPELLER_NODISCARD ImpellerGlyphInfo IMPELLER_NULLABLE
2694  ImpellerParagraph IMPELLER_NONNULL paragraph,
2695  double x,
2696  double y);
2697 
2698 //------------------------------------------------------------------------------
2699 // Line Metrics
2700 //------------------------------------------------------------------------------
2701 
2702 //------------------------------------------------------------------------------
2703 /// @brief Retain a strong reference to the object. The object can be NULL
2704 /// in which case this method is a no-op.
2705 ///
2706 /// @param[in] line_metrics The line metrics.
2707 ///
2710  ImpellerLineMetrics IMPELLER_NULLABLE line_metrics);
2711 
2712 //------------------------------------------------------------------------------
2713 /// @brief Release a previously retained reference to the object. The
2714 /// object can be NULL in which case this method is a no-op.
2715 ///
2716 /// @param[in] line_metrics The line metrics.
2717 ///
2720  ImpellerLineMetrics IMPELLER_NULLABLE line_metrics);
2721 
2722 //------------------------------------------------------------------------------
2723 /// @brief The rise from the baseline as calculated from the font and style
2724 /// for this line ignoring the height from the text style.
2725 ///
2726 /// @param[in] metrics The metrics.
2727 /// @param[in] line The line index (zero based).
2728 ///
2729 /// @return The unscaled ascent.
2730 ///
2733  ImpellerLineMetrics IMPELLER_NONNULL metrics,
2734  size_t line);
2735 
2736 //------------------------------------------------------------------------------
2737 /// @brief The rise from the baseline as calculated from the font and style
2738 /// for this line.
2739 ///
2740 /// @param[in] metrics The metrics.
2741 /// @param[in] line The line index (zero based).
2742 ///
2743 /// @return The ascent.
2744 ///
2747  ImpellerLineMetrics IMPELLER_NONNULL metrics,
2748  size_t line);
2749 
2750 //------------------------------------------------------------------------------
2751 /// @brief The drop from the baseline as calculated from the font and style
2752 /// for this line.
2753 ///
2754 /// @param[in] metrics The metrics.
2755 /// @param[in] line The line index (zero based).
2756 ///
2757 /// @return The descent.
2758 ///
2761  ImpellerLineMetrics IMPELLER_NONNULL metrics,
2762  size_t line);
2763 
2764 //------------------------------------------------------------------------------
2765 /// @brief The y coordinate of the baseline for this line from the top of
2766 /// the paragraph.
2767 ///
2768 /// @param[in] metrics The metrics.
2769 /// @param[in] line The line index (zero based).
2770 ///
2771 /// @return The baseline.
2772 ///
2775  ImpellerLineMetrics IMPELLER_NONNULL metrics,
2776  size_t line);
2777 
2778 //------------------------------------------------------------------------------
2779 /// @brief Used to determine if this line ends with an explicit line break
2780 /// (e.g. '\n') or is the end of the paragraph.
2781 ///
2782 /// @param[in] metrics The metrics.
2783 /// @param[in] line The line index (zero based).
2784 ///
2785 /// @return True if the line is a hard break.
2786 ///
2789  ImpellerLineMetrics IMPELLER_NONNULL metrics,
2790  size_t line);
2791 
2792 //------------------------------------------------------------------------------
2793 /// @brief Width of the line from the left edge of the leftmost glyph to
2794 /// the right edge of the rightmost glyph.
2795 ///
2796 /// @param[in] metrics The metrics.
2797 /// @param[in] line The line index (zero based).
2798 ///
2799 /// @return The width.
2800 ///
2802 double ImpellerLineMetricsGetWidth(ImpellerLineMetrics IMPELLER_NONNULL metrics,
2803  size_t line);
2804 
2805 //------------------------------------------------------------------------------
2806 /// @brief Total height of the line from the top edge to the bottom edge.
2807 ///
2808 /// @param[in] metrics The metrics.
2809 /// @param[in] line The line index (zero based).
2810 ///
2811 /// @return The height.
2812 ///
2815  ImpellerLineMetrics IMPELLER_NONNULL metrics,
2816  size_t line);
2817 
2818 //------------------------------------------------------------------------------
2819 /// @brief The x coordinate of left edge of the line.
2820 ///
2821 /// @param[in] metrics The metrics.
2822 /// @param[in] line The line index (zero based).
2823 ///
2824 /// @return The left edge coordinate.
2825 ///
2827 double ImpellerLineMetricsGetLeft(ImpellerLineMetrics IMPELLER_NONNULL metrics,
2828  size_t line);
2829 
2830 //------------------------------------------------------------------------------
2831 /// @brief Fetch the start index in the buffer of UTF-16 code units used to
2832 /// represent the paragraph line.
2833 ///
2834 /// @param[in] metrics The metrics.
2835 /// @param[in] line The line index (zero based).
2836 ///
2837 /// @return The UTF-16 code units start index.
2838 ///
2841  ImpellerLineMetrics IMPELLER_NONNULL metrics,
2842  size_t line);
2843 
2844 //------------------------------------------------------------------------------
2845 /// @brief Fetch the end index in the buffer of UTF-16 code units used to
2846 /// represent the paragraph line.
2847 ///
2848 /// @param[in] metrics The metrics.
2849 /// @param[in] line The line index (zero based).
2850 ///
2851 /// @return The UTF-16 code units end index.
2852 ///
2855  ImpellerLineMetrics IMPELLER_NONNULL metrics,
2856  size_t line);
2857 
2858 //------------------------------------------------------------------------------
2859 /// @brief Fetch the end index (excluding whitespace) in the buffer of
2860 /// UTF-16 code units used to represent the paragraph line.
2861 ///
2862 /// @param[in] metrics The metrics.
2863 /// @param[in] line The line index (zero based).
2864 ///
2865 /// @return The UTF-16 code units end index excluding whitespace.
2866 ///
2869  ImpellerLineMetrics IMPELLER_NONNULL metrics,
2870  size_t line);
2871 
2872 //------------------------------------------------------------------------------
2873 /// @brief Fetch the end index (including newlines) in the buffer of UTF-16
2874 /// code units used to represent the paragraph line.
2875 ///
2876 /// @param[in] metrics The metrics.
2877 /// @param[in] line The line index (zero based).
2878 ///
2879 /// @return The UTF-16 code units end index including newlines.
2880 ///
2883  ImpellerLineMetrics IMPELLER_NONNULL metrics,
2884  size_t line);
2885 
2886 //------------------------------------------------------------------------------
2887 // Glyph Info
2888 //------------------------------------------------------------------------------
2889 
2890 //------------------------------------------------------------------------------
2891 /// @brief Retain a strong reference to the object. The object can be NULL
2892 /// in which case this method is a no-op.
2893 ///
2894 /// @param[in] glyph_info The glyph information.
2895 ///
2897 void ImpellerGlyphInfoRetain(ImpellerGlyphInfo IMPELLER_NULLABLE glyph_info);
2898 
2899 //------------------------------------------------------------------------------
2900 /// @brief Release a previously retained reference to the object. The
2901 /// object can be NULL in which case this method is a no-op.
2902 ///
2903 /// @param[in] glyph_info The glyph information.
2904 ///
2906 void ImpellerGlyphInfoRelease(ImpellerGlyphInfo IMPELLER_NULLABLE glyph_info);
2907 
2908 //------------------------------------------------------------------------------
2909 /// @brief Fetch the start index in the buffer of UTF-16 code units used to
2910 /// represent the grapheme cluster for a glyph.
2911 ///
2912 /// @param[in] glyph_info The glyph information.
2913 ///
2914 /// @return The UTF-16 code units start index.
2915 ///
2918  ImpellerGlyphInfo IMPELLER_NONNULL glyph_info);
2919 
2920 //------------------------------------------------------------------------------
2921 /// @brief Fetch the end index in the buffer of UTF-16 code units used to
2922 /// represent the grapheme cluster for a glyph.
2923 ///
2924 /// @param[in] glyph_info The glyph information.
2925 ///
2926 /// @return The UTF-16 code units end index.
2927 ///
2930  ImpellerGlyphInfo IMPELLER_NONNULL glyph_info);
2931 
2932 //------------------------------------------------------------------------------
2933 /// @brief Fetch the bounds of the grapheme cluster for the glyph in the
2934 /// coordinate space of the paragraph.
2935 ///
2936 /// @param[in] glyph_info The glyph information.
2937 ///
2938 /// @return The grapheme cluster bounds.
2939 ///
2942  ImpellerGlyphInfo IMPELLER_NONNULL glyph_info);
2943 
2944 //------------------------------------------------------------------------------
2945 /// @param[in] glyph_info The glyph information.
2946 ///
2947 /// @return True if the glyph represents an ellipsis. False otherwise.
2948 ///
2950 bool ImpellerGlyphInfoIsEllipsis(ImpellerGlyphInfo IMPELLER_NONNULL glyph_info);
2951 
2952 //------------------------------------------------------------------------------
2953 /// @param[in] glyph_info The glyph information.
2954 ///
2955 /// @return The direction of the run that contains the glyph.
2956 ///
2959  ImpellerGlyphInfo IMPELLER_NONNULL glyph_info);
2960 
2962 
2963 // NOLINTEND(google-objc-function-naming)
2964 
2965 #endif // FLUTTER_IMPELLER_TOOLKIT_INTEROP_IMPELLER_H_
int32_t x
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...
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.
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawParagraph(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerParagraph IMPELLER_NONNULL paragraph, const ImpellerPoint *IMPELLER_NONNULL point)
Draw a paragraph at the specified point.
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...
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.
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...
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...
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.
IMPELLER_EXPORT float ImpellerParagraphGetHeight(ImpellerParagraph IMPELLER_NONNULL paragraph)
ImpellerFillType
Definition: impeller.h:355
@ kImpellerFillTypeOdd
Definition: impeller.h:357
@ kImpellerFillTypeNonZero
Definition: impeller.h:356
IMPELLER_EXPORT float ImpellerParagraphGetLongestLineWidth(ImpellerParagraph IMPELLER_NONNULL paragraph)
ImpellerTextDirection
Definition: impeller.h:470
@ kImpellerTextDirectionLTR
Definition: impeller.h:472
@ kImpellerTextDirectionRTL
Definition: impeller.h:471
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
Definition: impeller.h:419
@ kImpellerTextureSamplingNearestNeighbor
Definition: impeller.h:420
@ kImpellerTextureSamplingLinear
Definition: impeller.h:421
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...
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.
IMPELLER_EXPORT void ImpellerPathBuilderMoveTo(ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerPoint *IMPELLER_NONNULL location)
Move the cursor to the specified location.
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...
IMPELLER_EXPORT void ImpellerPaintSetStrokeCap(ImpellerPaint IMPELLER_NONNULL paint, ImpellerStrokeCap cap)
Sets how strokes rendered using this paint are capped.
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...
IMPELLER_EXPORT bool ImpellerSurfacePresent(ImpellerSurface IMPELLER_NONNULL surface)
Present the surface to the underlying window system.
IMPELLER_EXPORT void ImpellerDisplayListBuilderResetTransform(ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
Reset the transformation on top of the transformation stack to identity.
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...
IMPELLER_EXPORT size_t ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeEnd(ImpellerGlyphInfo IMPELLER_NONNULL glyph_info)
Fetch the end index in the buffer of UTF-16 code units used to represent the grapheme cluster for a g...
IMPELLER_EXPORT double ImpellerLineMetricsGetDescent(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
The drop from the baseline as calculated from the font and style for this line.
IMPELLER_EXPORT void ImpellerParagraphBuilderPopStyle(ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder)
Pop a previously pushed paragraph style from the paragraph style stack.
IMPELLER_EXPORT void ImpellerPaintSetImageFilter(ImpellerPaint IMPELLER_NONNULL paint, ImpellerImageFilter IMPELLER_NONNULL image_filter)
Set the image filter of a paint.
IMPELLER_EXPORT void ImpellerDisplayListBuilderRestore(ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
Pops the last entry pushed onto the save stack using a call to ImpellerDisplayListBuilderSave or Impe...
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 ...
IMPELLER_EXPORT bool ImpellerLineMetricsIsHardbreak(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
Used to determine if this line ends with an explicit line break (e.g. ' ') or is the end of the parag...
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...
#define IMPELLER_DEFINE_HANDLE(handle)
Definition: impeller.h:142
IMPELLER_EXPORT void ImpellerPaintSetStrokeMiter(ImpellerPaint IMPELLER_NONNULL paint, float miter)
Set the miter limit of the strokes rendered using this paint.
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.
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...
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE ImpellerContextCreateMetalNew(uint32_t version)
Create a Metal context using the system default Metal device.
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.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPathBuilder IMPELLER_NULLABLE ImpellerPathBuilderNew()
Create a new path builder. Paths themselves are immutable. A builder builds these immutable paths.
IMPELLER_EXPORT void ImpellerDisplayListBuilderSave(ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
Stashes the current transformation and clip state onto a save stack.
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...
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...
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.
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.
#define IMPELLER_NULLABLE
Definition: impeller.h:57
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.
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawRect(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect, ImpellerPaint IMPELLER_NONNULL paint)
Draws a rectangle.
IMPELLER_EXPORT bool ImpellerGlyphInfoIsEllipsis(ImpellerGlyphInfo IMPELLER_NONNULL glyph_info)
IMPELLER_EXPORT uint32_t ImpellerDisplayListBuilderGetSaveCount(ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
Get the current size of the save stack.
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.
IMPELLER_EXPORT void ImpellerParagraphStyleSetFontStyle(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerFontStyle style)
Set whether the glyphs should be bolded or italicized.
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...
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.
#define IMPELLER_EXTERN_C_END
Definition: impeller.h:38
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPaint IMPELLER_NULLABLE ImpellerPaintNew()
Create a new paint with default values.
IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitStartIndex(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
Fetch the start index in the buffer of UTF-16 code units used to represent the paragraph line.
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...
IMPELLER_EXPORT uint64_t ImpellerTextureGetOpenGLHandle(ImpellerTexture IMPELLER_NONNULL texture)
Get the OpenGL handle associated with this texture. If this is not an OpenGL texture,...
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorFilter IMPELLER_NULLABLE ImpellerColorFilterCreateColorMatrixNew(const ImpellerColorMatrix *IMPELLER_NONNULL color_matrix)
Create a color filter that transforms pixel color values independently.
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.
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....
IMPELLER_EXPORT double ImpellerLineMetricsGetLeft(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
The x coordinate of left edge of the line.
IMPELLER_EXPORT uint32_t ImpellerParagraphGetLineCount(ImpellerParagraph IMPELLER_NONNULL paragraph)
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...
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...
struct ImpellerContextVulkanSettings ImpellerContextVulkanSettings
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.
struct ImpellerRoundingRadii ImpellerRoundingRadii
struct ImpellerMapping ImpellerMapping
struct ImpellerRange ImpellerRange
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.
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...
IMPELLER_EXPORT void ImpellerLineMetricsRetain(ImpellerLineMetrics IMPELLER_NULLABLE line_metrics)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
ImpellerStrokeJoin
Definition: impeller.h:409
@ kImpellerStrokeJoinRound
Definition: impeller.h:411
@ kImpellerStrokeJoinBevel
Definition: impeller.h:412
@ kImpellerStrokeJoinMiter
Definition: impeller.h:410
IMPELLER_EXPORT void ImpellerLineMetricsRelease(ImpellerLineMetrics IMPELLER_NULLABLE line_metrics)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE ImpellerVulkanSwapchainAcquireNextSurfaceNew(ImpellerVulkanSwapchain IMPELLER_NONNULL swapchain)
A potentially blocking operation, acquires the next surface to render to. Since this may block,...
IMPELLER_EXPORT void ImpellerPaintSetColor(ImpellerPaint IMPELLER_NONNULL paint, const ImpellerColor *IMPELLER_NONNULL color)
Set the paint color.
IMPELLER_EXPORT void ImpellerPathBuilderAddRect(ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect)
Adds a rectangle to the path.
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.
IMPELLER_EXPORT bool ImpellerContextGetVulkanInfo(ImpellerContext IMPELLER_NONNULL context, ImpellerContextVulkanInfo *IMPELLER_NONNULL out_vulkan_info)
Get internal Vulkan handles managed by the given Vulkan context. Ownership of the handles is still ma...
void(* ImpellerCallback)(void *IMPELLER_NULLABLE user_data)
Definition: impeller.h:329
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawOval(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL oval_bounds, ImpellerPaint IMPELLER_NONNULL paint)
Draws an oval.
IMPELLER_EXPORT float ImpellerParagraphGetMinIntrinsicWidth(ImpellerParagraph IMPELLER_NONNULL paragraph)
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.
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...
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.
IMPELLER_EXPORT float ImpellerParagraphGetMaxWidth(ImpellerParagraph IMPELLER_NONNULL paragraph)
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....
IMPELLER_EXPORT uint32_t ImpellerGetVersion()
Get the version of Impeller standalone API. This is the API that will be accepted for validity checks...
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.
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...
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerGlyphInfo IMPELLER_NULLABLE ImpellerParagraphCreateGlyphInfoAtParagraphCoordinatesNew(ImpellerParagraph IMPELLER_NONNULL paragraph, double x, double y)
Create a new instance of glyph info that can be queried for information about the glyph closest to th...
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.
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
Definition: impeller.h:365
@ kImpellerBlendModeSaturation
Definition: impeller.h:392
@ kImpellerBlendModeSoftLight
Definition: impeller.h:387
@ kImpellerBlendModeHardLight
Definition: impeller.h:386
@ kImpellerBlendModeLuminosity
Definition: impeller.h:394
@ kImpellerBlendModeLighten
Definition: impeller.h:383
@ kImpellerBlendModeModulate
Definition: impeller.h:379
@ kImpellerBlendModeSourceIn
Definition: impeller.h:371
@ kImpellerBlendModeDifference
Definition: impeller.h:388
@ kImpellerBlendModeClear
Definition: impeller.h:366
@ kImpellerBlendModeColor
Definition: impeller.h:393
@ kImpellerBlendModeMultiply
Definition: impeller.h:390
@ kImpellerBlendModeSourceATop
Definition: impeller.h:375
@ kImpellerBlendModeDestinationOut
Definition: impeller.h:374
@ kImpellerBlendModeScreen
Definition: impeller.h:380
@ kImpellerBlendModeExclusion
Definition: impeller.h:389
@ kImpellerBlendModeColorBurn
Definition: impeller.h:385
@ kImpellerBlendModeDarken
Definition: impeller.h:382
@ kImpellerBlendModePlus
Definition: impeller.h:378
@ kImpellerBlendModeOverlay
Definition: impeller.h:381
@ kImpellerBlendModeDestinationIn
Definition: impeller.h:372
@ kImpellerBlendModeDestinationATop
Definition: impeller.h:376
@ kImpellerBlendModeDestination
Definition: impeller.h:368
@ kImpellerBlendModeSourceOver
Definition: impeller.h:369
@ kImpellerBlendModeXor
Definition: impeller.h:377
@ kImpellerBlendModeColorDodge
Definition: impeller.h:384
@ kImpellerBlendModeDestinationOver
Definition: impeller.h:370
@ kImpellerBlendModeSource
Definition: impeller.h:367
@ kImpellerBlendModeSourceOut
Definition: impeller.h:373
@ kImpellerBlendModeHue
Definition: impeller.h:391
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
Definition: impeller.h:444
@ kImpellerFontWeight400
Definition: impeller.h:448
@ kImpellerFontWeight500
Definition: impeller.h:449
@ kImpellerFontWeight700
Definition: impeller.h:451
@ kImpellerFontWeight200
Definition: impeller.h:446
@ kImpellerFontWeight300
Definition: impeller.h:447
@ kImpellerFontWeight900
Definition: impeller.h:453
@ kImpellerFontWeight800
Definition: impeller.h:452
@ kImpellerFontWeight600
Definition: impeller.h:450
@ kImpellerFontWeight100
Definition: impeller.h:445
struct ImpellerContextVulkanInfo ImpellerContextVulkanInfo
IMPELLER_EXPORT void ImpellerParagraphStyleSetFontSize(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, float size)
Set the font size.
IMPELLER_EXPORT void ImpellerParagraphStyleSetLocale(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, const char *IMPELLER_NONNULL locale)
Set the paragraph locale.
IMPELLER_EXPORT void ImpellerGlyphInfoRelease(ImpellerGlyphInfo IMPELLER_NULLABLE glyph_info)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
IMPELLER_EXPORT bool ImpellerSurfaceDrawDisplayList(ImpellerSurface IMPELLER_NONNULL surface, ImpellerDisplayList IMPELLER_NONNULL display_list)
Draw a display list onto the surface. The same display list can be drawn multiple times to different ...
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.
IMPELLER_EXPORT void ImpellerParagraphStyleSetMaxLines(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, uint32_t max_lines)
Set the maximum line count within the paragraph.
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawPaint(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerPaint IMPELLER_NONNULL paint)
Fills the current clip with the specified paint.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE ImpellerSurfaceCreateWrappedMetalDrawableNew(ImpellerContext IMPELLER_NONNULL context, void *IMPELLER_NONNULL metal_drawable)
Create a surface by wrapping a Metal drawable. This is useful during WSI when the drawable is the bac...
IMPELLER_EXPORT double ImpellerLineMetricsGetWidth(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
Width of the line from the left edge of the leftmost glyph to the right edge of the rightmost glyph.
IMPELLER_EXPORT ImpellerTextDirection ImpellerGlyphInfoGetTextDirection(ImpellerGlyphInfo IMPELLER_NONNULL glyph_info)
IMPELLER_EXPORT void ImpellerPaintSetColorFilter(ImpellerPaint IMPELLER_NONNULL paint, ImpellerColorFilter IMPELLER_NONNULL color_filter)
Set the color filter of the paint.
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.
IMPELLER_EXPORT void ImpellerPaintSetColorSource(ImpellerPaint IMPELLER_NONNULL paint, ImpellerColorSource IMPELLER_NONNULL color_source)
Set the color source of the paint.
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...
IMPELLER_EXPORT void ImpellerPathBuilderClose(ImpellerPathBuilder IMPELLER_NONNULL builder)
Close the path.
#define IMPELLER_EXTERN_C_BEGIN
Definition: impeller.h:37
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerVulkanSwapchain IMPELLER_NULLABLE ImpellerVulkanSwapchainCreateNew(ImpellerContext IMPELLER_NONNULL context, void *IMPELLER_NONNULL vulkan_surface_khr)
Create a new Vulkan swapchain using a VkSurfaceKHR instance. Ownership of the surface is transferred ...
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawShadow(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerPath IMPELLER_NONNULL path, const ImpellerColor *IMPELLER_NONNULL color, float elevation, bool occluder_is_transparent, float device_pixel_ratio)
Draw a shadow for a Path given a material elevation. If the occluding object is not opaque,...
struct ImpellerColorMatrix ImpellerColorMatrix
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.
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...
IMPELLER_EXPORT float ImpellerParagraphGetIdeographicBaseline(ImpellerParagraph IMPELLER_NONNULL paragraph)
IMPELLER_EXPORT double ImpellerLineMetricsGetBaseline(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
The y coordinate of the baseline for this line from the top of the paragraph.
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...
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.
IMPELLER_EXPORT void ImpellerPaintSetMaskFilter(ImpellerPaint IMPELLER_NONNULL paint, ImpellerMaskFilter IMPELLER_NONNULL mask_filter)
Set the mask filter of a paint.
IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitEndIndex(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
Fetch the end index in the buffer of UTF-16 code units used to represent the paragraph line.
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.
IMPELLER_EXPORT void ImpellerGlyphInfoRetain(ImpellerGlyphInfo IMPELLER_NULLABLE glyph_info)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
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...
struct ImpellerPoint ImpellerPoint
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.
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.
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...
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.
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...
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.
struct ImpellerTextureDescriptor ImpellerTextureDescriptor
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.
IMPELLER_EXPORT void ImpellerPaintSetStrokeJoin(ImpellerPaint IMPELLER_NONNULL paint, ImpellerStrokeJoin join)
Sets how strokes rendered using this paint are joined.
IMPELLER_EXPORT void ImpellerParagraphStyleSetTextDirection(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerTextDirection direction)
Set the directionality of the text within the paragraph.
struct ImpellerMatrix ImpellerMatrix
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...
IMPELLER_EXPORT ImpellerRange ImpellerParagraphGetWordBoundary(ImpellerParagraph IMPELLER_NONNULL paragraph, size_t code_unit_index)
Get the range into the UTF-16 code unit buffer that represents the word at the specified caret locati...
void *IMPELLER_NULLABLE(* ImpellerProcAddressCallback)(const char *IMPELLER_NONNULL proc_name, void *IMPELLER_NULLABLE user_data)
Definition: impeller.h:338
IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitEndIndexExcludingWhitespace(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
Fetch the end index (excluding whitespace) in the buffer of UTF-16 code units used to represent the p...
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...
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.
struct ImpellerISize ImpellerISize
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.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE ImpellerSurfaceCreateWrappedFBONew(ImpellerContext IMPELLER_NONNULL context, uint64_t fbo, ImpellerPixelFormat format, const ImpellerISize *IMPELLER_NONNULL size)
Create a new surface by wrapping an existing framebuffer object. The framebuffer must be complete as ...
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.
struct ImpellerRect ImpellerRect
IMPELLER_EXPORT double ImpellerLineMetricsGetUnscaledAscent(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
The rise from the baseline as calculated from the font and style for this line ignoring the height fr...
IMPELLER_EXPORT float ImpellerParagraphGetMaxIntrinsicWidth(ImpellerParagraph IMPELLER_NONNULL paragraph)
ImpellerStrokeCap
Definition: impeller.h:403
@ kImpellerStrokeCapButt
Definition: impeller.h:404
@ kImpellerStrokeCapRound
Definition: impeller.h:405
@ kImpellerStrokeCapSquare
Definition: impeller.h:406
IMPELLER_EXPORT void ImpellerVulkanSwapchainRelease(ImpellerVulkanSwapchain IMPELLER_NULLABLE swapchain)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
IMPELLER_EXPORT double ImpellerLineMetricsGetHeight(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
Total height of the line from the top edge to the bottom edge.
ImpellerDrawStyle
Definition: impeller.h:397
@ kImpellerDrawStyleStroke
Definition: impeller.h:399
@ kImpellerDrawStyleFill
Definition: impeller.h:398
@ kImpellerDrawStyleStrokeAndFill
Definition: impeller.h:400
ImpellerColorSpace
Definition: impeller.h:438
@ kImpellerColorSpaceExtendedSRGB
Definition: impeller.h:440
@ kImpellerColorSpaceSRGB
Definition: impeller.h:439
@ kImpellerColorSpaceDisplayP3
Definition: impeller.h:441
IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitEndIndexIncludingNewline(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
Fetch the end index (including newlines) in the buffer of UTF-16 code units used to represent the par...
ImpellerTileMode
Definition: impeller.h:424
@ kImpellerTileModeMirror
Definition: impeller.h:427
@ kImpellerTileModeClamp
Definition: impeller.h:425
@ kImpellerTileModeRepeat
Definition: impeller.h:426
@ kImpellerTileModeDecal
Definition: impeller.h:428
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.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphStyle IMPELLER_NULLABLE ImpellerParagraphStyleNew()
Create a new paragraph style.
IMPELLER_EXPORT void ImpellerParagraphStyleSetForeground(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerPaint IMPELLER_NONNULL paint)
Set the paint used to render the text glyph contents.
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
Definition: impeller.h:461
@ kImpellerTextAlignmentJustify
Definition: impeller.h:465
@ kImpellerTextAlignmentLeft
Definition: impeller.h:462
@ kImpellerTextAlignmentCenter
Definition: impeller.h:464
@ kImpellerTextAlignmentRight
Definition: impeller.h:463
@ kImpellerTextAlignmentStart
Definition: impeller.h:466
@ kImpellerTextAlignmentEnd
Definition: impeller.h:467
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.
IMPELLER_EXPORT void ImpellerParagraphStyleSetHeight(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, float height)
The height of the text as a multiple of text size.
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.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTypographyContext IMPELLER_NULLABLE ImpellerTypographyContextNew()
Create a new typography contents.
ImpellerFontStyle
Definition: impeller.h:456
@ kImpellerFontStyleItalic
Definition: impeller.h:458
@ kImpellerFontStyleNormal
Definition: impeller.h:457
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...
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
Definition: impeller.h:360
@ kImpellerClipOperationIntersect
Definition: impeller.h:362
@ kImpellerClipOperationDifference
Definition: impeller.h:361
#define IMPELLER_NONNULL
Definition: impeller.h:58
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerMaskFilter IMPELLER_NULLABLE ImpellerMaskFilterCreateBlurNew(ImpellerBlurStyle style, float sigma)
Create a mask filter that blurs contents in the masked shape.
IMPELLER_EXPORT size_t ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeBegin(ImpellerGlyphInfo IMPELLER_NONNULL glyph_info)
Fetch the start index in the buffer of UTF-16 code units used to represent the grapheme cluster for a...
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerDisplayListBuilder IMPELLER_NULLABLE ImpellerDisplayListBuilderNew(const ImpellerRect *IMPELLER_NULLABLE cull_rect)
Create a new display list builder.
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawPath(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerPath IMPELLER_NONNULL path, ImpellerPaint IMPELLER_NONNULL paint)
Draws the specified shape.
#define IMPELLER_EXPORT
Definition: impeller.h:48
IMPELLER_EXPORT void ImpellerVulkanSwapchainRetain(ImpellerVulkanSwapchain IMPELLER_NULLABLE swapchain)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
IMPELLER_EXPORT double ImpellerLineMetricsGetAscent(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
The rise from the baseline as calculated from the font and style for this line.
struct ImpellerColor ImpellerColor
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...
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.
IMPELLER_EXPORT void ImpellerPathBuilderAddOval(ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL oval_bounds)
Add an oval to the path.
IMPELLER_EXPORT ImpellerRect ImpellerGlyphInfoGetGraphemeClusterBounds(ImpellerGlyphInfo IMPELLER_NONNULL glyph_info)
Fetch the bounds of the grapheme cluster for the glyph in the coordinate space of the paragraph.
#define IMPELLER_NODISCARD
Definition: impeller.h:64
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerGlyphInfo IMPELLER_NULLABLE ImpellerParagraphCreateGlyphInfoAtCodeUnitIndexNew(ImpellerParagraph IMPELLER_NONNULL paragraph, size_t code_unit_index)
Create a new instance of glyph info that can be queried for information about the glyph at the given ...
IMPELLER_EXPORT ImpellerLineMetrics IMPELLER_NULLABLE ImpellerParagraphGetLineMetrics(ImpellerParagraph IMPELLER_NONNULL paragraph)
Get the line metrics of this laid out paragraph. Calculating the line metrics is expensive....
void *IMPELLER_NULLABLE(* ImpellerVulkanProcAddressCallback)(void *IMPELLER_NULLABLE vulkan_instance, const char *IMPELLER_NONNULL vulkan_proc_name, void *IMPELLER_NULLABLE user_data)
Definition: impeller.h:347
IMPELLER_EXPORT void ImpellerParagraphStyleSetTextAlignment(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerTextAlignment align)
Set the alignment of text within the paragraph.
IMPELLER_EXPORT void ImpellerParagraphStyleSetFontFamily(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, const char *IMPELLER_NONNULL family_name)
Set the font family.
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.
IMPELLER_EXPORT void ImpellerParagraphStyleSetFontWeight(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerFontWeight weight)
Set the weight of the font to select when rendering glyphs.
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...
struct ImpellerSize ImpellerSize
ImpellerBlurStyle
Definition: impeller.h:431
@ kImpellerBlurStyleNormal
Definition: impeller.h:432
@ kImpellerBlurStyleOuter
Definition: impeller.h:434
@ kImpellerBlurStyleInner
Definition: impeller.h:435
@ kImpellerBlurStyleSolid
Definition: impeller.h:433
ImpellerPixelFormat
Definition: impeller.h:415
@ kImpellerPixelFormatRGBA8888
Definition: impeller.h:416
IMPELLER_EXPORT void ImpellerPaintSetStrokeWidth(ImpellerPaint IMPELLER_NONNULL paint, float width)
Set the width of the strokes rendered using this paint.
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.
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.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphBuilder IMPELLER_NULLABLE ImpellerParagraphBuilderNew(ImpellerTypographyContext IMPELLER_NONNULL context)
Create a new paragraph builder.
IMPELLER_EXPORT float ImpellerParagraphGetAlphabeticBaseline(ImpellerParagraph IMPELLER_NONNULL paragraph)
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE ImpellerContextCreateVulkanNew(uint32_t version, const ImpellerContextVulkanSettings *IMPELLER_NONNULL settings)
Create a Vulkan context using the provided Vulkan Settings.
IMPELLER_EXPORT void ImpellerDisplayListBuilderRestoreToCount(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, uint32_t count)
Effectively calls ImpellerDisplayListBuilderRestore till the size of the save stack becomes a specifi...
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.
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.
float blue
Definition: impeller.h:591
float alpha
Definition: impeller.h:592
float green
Definition: impeller.h:590
ImpellerColorSpace color_space
Definition: impeller.h:593
uint32_t graphics_queue_index
Definition: impeller.h:619
uint32_t graphics_queue_family_index
Definition: impeller.h:618
void *IMPELLER_NULLABLE vk_instance
Definition: impeller.h:615
void *IMPELLER_NULLABLE vk_logical_device
Definition: impeller.h:617
void *IMPELLER_NULLABLE vk_physical_device
Definition: impeller.h:616
ImpellerVulkanProcAddressCallback IMPELLER_NONNULL proc_address_callback
Definition: impeller.h:610
void *IMPELLER_NULLABLE user_data
Definition: impeller.h:609
int64_t height
Definition: impeller.h:497
int64_t width
Definition: impeller.h:496
ImpellerCallback IMPELLER_NULLABLE on_release
Definition: impeller.h:605
uint64_t length
Definition: impeller.h:604
const uint8_t *IMPELLER_NONNULL data
Definition: impeller.h:603
float m[16]
Definition: impeller.h:516
uint64_t end
Definition: impeller.h:502
uint64_t start
Definition: impeller.h:501
float width
Definition: impeller.h:481
float height
Definition: impeller.h:482
ImpellerPoint top_left
Definition: impeller.h:582
ImpellerPoint top_right
Definition: impeller.h:584
ImpellerPoint bottom_left
Definition: impeller.h:583
ImpellerPoint bottom_right
Definition: impeller.h:585
float height
Definition: impeller.h:492
float width
Definition: impeller.h:491
ImpellerPixelFormat pixel_format
Definition: impeller.h:597
ImpellerISize size
Definition: impeller.h:598
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:67