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