Flutter Engine
 
Loading...
Searching...
No Matches
impeller.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Classes

struct  ImpellerRect
 
struct  ImpellerPoint
 
struct  ImpellerSize
 
struct  ImpellerISize
 
struct  ImpellerRange
 
struct  ImpellerMatrix
 
struct  ImpellerColorMatrix
 
struct  ImpellerRoundingRadii
 
struct  ImpellerColor
 
struct  ImpellerTextureDescriptor
 
struct  ImpellerMapping
 
struct  ImpellerContextVulkanSettings
 
struct  ImpellerContextVulkanInfo
 
struct  ImpellerTextDecoration
 

Macros

#define IMPELLER_EXTERN_C
 
#define IMPELLER_EXTERN_C_BEGIN
 
#define IMPELLER_EXTERN_C_END
 
#define IMPELLER_EXPORT_DECORATION   __attribute__((visibility("default")))
 
#define IMPELLER_EXPORT   IMPELLER_EXPORT_DECORATION
 
#define IMPELLER_NULLABLE
 
#define IMPELLER_NONNULL
 
#define IMPELLER_NODISCARD
 
#define IMPELLER_MAKE_VERSION(variant, major, minor, patch)
 Pack a version in a uint32_t.
 
#define IMPELLER_VERSION_VARIANT   1
 
#define IMPELLER_VERSION_MAJOR   1
 
#define IMPELLER_VERSION_MINOR   4
 
#define IMPELLER_VERSION_PATCH   0
 
#define IMPELLER_VERSION
 
#define IMPELLER_VERSION_GET_VARIANT(version)   ((uint32_t)(version) >> 29U)
 
#define IMPELLER_VERSION_GET_MAJOR(version)    (((uint32_t)(version) >> 22U) & 0x7FU)
 
#define IMPELLER_VERSION_GET_MINOR(version)    (((uint32_t)(version) >> 12U) & 0x3FFU)
 
#define IMPELLER_VERSION_GET_PATCH(version)   ((uint32_t)(version) & 0xFFFU)
 
#define IMPELLER_INTERNAL_HANDLE_NAME(handle)   handle##_
 
#define IMPELLER_DEFINE_HANDLE(handle)    typedef struct IMPELLER_INTERNAL_HANDLE_NAME(handle) * handle;
 

Typedefs

typedef void(* ImpellerCallback) (void *IMPELLER_NULLABLE user_data)
 
typedef void *IMPELLER_NULLABLE(* ImpellerProcAddressCallback) (const char *IMPELLER_NONNULL proc_name, void *IMPELLER_NULLABLE user_data)
 
typedef void *IMPELLER_NULLABLE(* ImpellerVulkanProcAddressCallback) (void *IMPELLER_NULLABLE vulkan_instance, const char *IMPELLER_NONNULL vulkan_proc_name, void *IMPELLER_NULLABLE user_data)
 
typedef enum ImpellerFillType ImpellerFillType
 
typedef enum ImpellerClipOperation ImpellerClipOperation
 
typedef enum ImpellerBlendMode ImpellerBlendMode
 
typedef enum ImpellerDrawStyle ImpellerDrawStyle
 
typedef enum ImpellerStrokeCap ImpellerStrokeCap
 
typedef enum ImpellerStrokeJoin ImpellerStrokeJoin
 
typedef enum ImpellerPixelFormat ImpellerPixelFormat
 
typedef enum ImpellerTextureSampling ImpellerTextureSampling
 
typedef enum ImpellerTileMode ImpellerTileMode
 
typedef enum ImpellerBlurStyle ImpellerBlurStyle
 
typedef enum ImpellerColorSpace ImpellerColorSpace
 
typedef enum ImpellerFontWeight ImpellerFontWeight
 
typedef enum ImpellerFontStyle ImpellerFontStyle
 
typedef enum ImpellerTextAlignment ImpellerTextAlignment
 
typedef enum ImpellerTextDirection ImpellerTextDirection
 
typedef enum ImpellerTextDecorationType ImpellerTextDecorationType
 
typedef enum ImpellerTextDecorationStyle ImpellerTextDecorationStyle
 
typedef struct ImpellerRect ImpellerRect
 
typedef struct ImpellerPoint ImpellerPoint
 
typedef struct ImpellerSize ImpellerSize
 
typedef struct ImpellerISize ImpellerISize
 
typedef struct ImpellerRange ImpellerRange
 
typedef struct ImpellerMatrix ImpellerMatrix
 
typedef struct ImpellerColorMatrix ImpellerColorMatrix
 
typedef struct ImpellerRoundingRadii ImpellerRoundingRadii
 
typedef struct ImpellerColor ImpellerColor
 
typedef struct ImpellerTextureDescriptor ImpellerTextureDescriptor
 
typedef struct ImpellerMapping ImpellerMapping
 
typedef struct ImpellerContextVulkanSettings ImpellerContextVulkanSettings
 
typedef struct ImpellerContextVulkanInfo ImpellerContextVulkanInfo
 
typedef struct ImpellerTextDecoration ImpellerTextDecoration
 

Enumerations

enum  ImpellerFillType {
  kImpellerFillTypeNonZero ,
  kImpellerFillTypeOdd
}
 
enum  ImpellerClipOperation {
  kImpellerClipOperationDifference ,
  kImpellerClipOperationIntersect
}
 
enum  ImpellerBlendMode {
  kImpellerBlendModeClear ,
  kImpellerBlendModeSource ,
  kImpellerBlendModeDestination ,
  kImpellerBlendModeSourceOver ,
  kImpellerBlendModeDestinationOver ,
  kImpellerBlendModeSourceIn ,
  kImpellerBlendModeDestinationIn ,
  kImpellerBlendModeSourceOut ,
  kImpellerBlendModeDestinationOut ,
  kImpellerBlendModeSourceATop ,
  kImpellerBlendModeDestinationATop ,
  kImpellerBlendModeXor ,
  kImpellerBlendModePlus ,
  kImpellerBlendModeModulate ,
  kImpellerBlendModeScreen ,
  kImpellerBlendModeOverlay ,
  kImpellerBlendModeDarken ,
  kImpellerBlendModeLighten ,
  kImpellerBlendModeColorDodge ,
  kImpellerBlendModeColorBurn ,
  kImpellerBlendModeHardLight ,
  kImpellerBlendModeSoftLight ,
  kImpellerBlendModeDifference ,
  kImpellerBlendModeExclusion ,
  kImpellerBlendModeMultiply ,
  kImpellerBlendModeHue ,
  kImpellerBlendModeSaturation ,
  kImpellerBlendModeColor ,
  kImpellerBlendModeLuminosity
}
 
enum  ImpellerDrawStyle {
  kImpellerDrawStyleFill ,
  kImpellerDrawStyleStroke ,
  kImpellerDrawStyleStrokeAndFill
}
 
enum  ImpellerStrokeCap {
  kImpellerStrokeCapButt ,
  kImpellerStrokeCapRound ,
  kImpellerStrokeCapSquare
}
 
enum  ImpellerStrokeJoin {
  kImpellerStrokeJoinMiter ,
  kImpellerStrokeJoinRound ,
  kImpellerStrokeJoinBevel
}
 
enum  ImpellerPixelFormat { kImpellerPixelFormatRGBA8888 }
 
enum  ImpellerTextureSampling {
  kImpellerTextureSamplingNearestNeighbor ,
  kImpellerTextureSamplingLinear
}
 
enum  ImpellerTileMode {
  kImpellerTileModeClamp ,
  kImpellerTileModeRepeat ,
  kImpellerTileModeMirror ,
  kImpellerTileModeDecal
}
 
enum  ImpellerBlurStyle {
  kImpellerBlurStyleNormal ,
  kImpellerBlurStyleSolid ,
  kImpellerBlurStyleOuter ,
  kImpellerBlurStyleInner
}
 
enum  ImpellerColorSpace {
  kImpellerColorSpaceSRGB ,
  kImpellerColorSpaceExtendedSRGB ,
  kImpellerColorSpaceDisplayP3
}
 
enum  ImpellerFontWeight {
  kImpellerFontWeight100 ,
  kImpellerFontWeight200 ,
  kImpellerFontWeight300 ,
  kImpellerFontWeight400 ,
  kImpellerFontWeight500 ,
  kImpellerFontWeight600 ,
  kImpellerFontWeight700 ,
  kImpellerFontWeight800 ,
  kImpellerFontWeight900
}
 
enum  ImpellerFontStyle {
  kImpellerFontStyleNormal ,
  kImpellerFontStyleItalic
}
 
enum  ImpellerTextAlignment {
  kImpellerTextAlignmentLeft ,
  kImpellerTextAlignmentRight ,
  kImpellerTextAlignmentCenter ,
  kImpellerTextAlignmentJustify ,
  kImpellerTextAlignmentStart ,
  kImpellerTextAlignmentEnd
}
 
enum  ImpellerTextDirection {
  kImpellerTextDirectionRTL ,
  kImpellerTextDirectionLTR
}
 
enum  ImpellerTextDecorationType {
  kImpellerTextDecorationTypeNone = 0 << 0 ,
  kImpellerTextDecorationTypeUnderline = 1 << 0 ,
  kImpellerTextDecorationTypeOverline = 1 << 1 ,
  kImpellerTextDecorationTypeLineThrough = 1 << 2
}
 
enum  ImpellerTextDecorationStyle {
  kImpellerTextDecorationStyleSolid ,
  kImpellerTextDecorationStyleDouble ,
  kImpellerTextDecorationStyleDotted ,
  kImpellerTextDecorationStyleDashed ,
  kImpellerTextDecorationStyleWavy
}
 

Functions

 IMPELLER_DEFINE_HANDLE (ImpellerContext)
 
 IMPELLER_DEFINE_HANDLE (ImpellerDisplayList)
 
 IMPELLER_DEFINE_HANDLE (ImpellerDisplayListBuilder)
 
 IMPELLER_DEFINE_HANDLE (ImpellerPaint)
 
 IMPELLER_DEFINE_HANDLE (ImpellerColorFilter)
 
 IMPELLER_DEFINE_HANDLE (ImpellerColorSource)
 
 IMPELLER_DEFINE_HANDLE (ImpellerImageFilter)
 
 IMPELLER_DEFINE_HANDLE (ImpellerMaskFilter)
 
 IMPELLER_DEFINE_HANDLE (ImpellerTypographyContext)
 
 IMPELLER_DEFINE_HANDLE (ImpellerParagraph)
 
 IMPELLER_DEFINE_HANDLE (ImpellerParagraphBuilder)
 
 IMPELLER_DEFINE_HANDLE (ImpellerParagraphStyle)
 
 IMPELLER_DEFINE_HANDLE (ImpellerLineMetrics)
 
 IMPELLER_DEFINE_HANDLE (ImpellerGlyphInfo)
 
 IMPELLER_DEFINE_HANDLE (ImpellerPath)
 
 IMPELLER_DEFINE_HANDLE (ImpellerPathBuilder)
 
 IMPELLER_DEFINE_HANDLE (ImpellerSurface)
 
 IMPELLER_DEFINE_HANDLE (ImpellerTexture)
 
 IMPELLER_DEFINE_HANDLE (ImpellerVulkanSwapchain)
 
 IMPELLER_DEFINE_HANDLE (ImpellerFragmentProgram)
 
IMPELLER_EXPORT uint32_t ImpellerGetVersion ()
 Get the version of Impeller standalone API. This is the API that will be accepted for validity checks when provided to the context creation methods.
 
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 IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE ImpellerContextCreateMetalNew (uint32_t version)
 Create a Metal context using the system default Metal device.
 
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE ImpellerContextCreateVulkanNew (uint32_t version, const ImpellerContextVulkanSettings *IMPELLER_NONNULL settings)
 Create a Vulkan context using the provided Vulkan Settings.
 
IMPELLER_EXPORT void 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 ImpellerContextRelease (ImpellerContext IMPELLER_NULLABLE context)
 Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
 
IMPELLER_EXPORT bool ImpellerContextGetVulkanInfo (ImpellerContext IMPELLER_NONNULL context, ImpellerContextVulkanInfo *IMPELLER_NONNULL out_vulkan_info)
 Get internal Vulkan handles managed by the given Vulkan context. Ownership of the handles is still maintained by Impeller. This accessor is just available so embedders can create resources using the same device and instance as Impeller for interop.
 
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerVulkanSwapchain IMPELLER_NULLABLE ImpellerVulkanSwapchainCreateNew (ImpellerContext IMPELLER_NONNULL context, void *IMPELLER_NONNULL vulkan_surface_khr)
 Create a new Vulkan swapchain using a VkSurfaceKHR instance. Ownership of the surface is transferred over to Impeller. The Vulkan instance the surface is created from must the same as the context provided.
 
IMPELLER_EXPORT void ImpellerVulkanSwapchainRetain (ImpellerVulkanSwapchain IMPELLER_NULLABLE swapchain)
 Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
 
IMPELLER_EXPORT void ImpellerVulkanSwapchainRelease (ImpellerVulkanSwapchain IMPELLER_NULLABLE swapchain)
 Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
 
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE ImpellerVulkanSwapchainAcquireNextSurfaceNew (ImpellerVulkanSwapchain IMPELLER_NONNULL swapchain)
 A potentially blocking operation, acquires the next surface to render to. Since this may block, surface acquisition must be delayed for as long as possible to avoid an idle wait on the CPU.
 
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE ImpellerSurfaceCreateWrappedFBONew (ImpellerContext IMPELLER_NONNULL context, uint64_t fbo, ImpellerPixelFormat format, const ImpellerISize *IMPELLER_NONNULL size)
 Create a new surface by wrapping an existing framebuffer object. The framebuffer must be complete as determined by glCheckFramebufferStatus. The framebuffer is still owned by the caller and it must be collected once the surface is collected.
 
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE ImpellerSurfaceCreateWrappedMetalDrawableNew (ImpellerContext IMPELLER_NONNULL context, void *IMPELLER_NONNULL metal_drawable)
 Create a surface by wrapping a Metal drawable. This is useful during WSI when the drawable is the backing store of the Metal layer being drawn to.
 
IMPELLER_EXPORT void ImpellerSurfaceRetain (ImpellerSurface IMPELLER_NULLABLE surface)
 Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
 
IMPELLER_EXPORT void ImpellerSurfaceRelease (ImpellerSurface IMPELLER_NULLABLE surface)
 Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
 
IMPELLER_EXPORT bool ImpellerSurfaceDrawDisplayList (ImpellerSurface IMPELLER_NONNULL surface, ImpellerDisplayList IMPELLER_NONNULL display_list)
 Draw a display list onto the surface. The same display list can be drawn multiple times to different surfaces.
 
IMPELLER_EXPORT bool ImpellerSurfacePresent (ImpellerSurface IMPELLER_NONNULL surface)
 Present the surface to the underlying window system.
 
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.
 
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 method is a no-op.
 
IMPELLER_EXPORT void ImpellerPathGetBounds (ImpellerPath IMPELLER_NONNULL path, ImpellerRect *IMPELLER_NONNULL out_bounds)
 Get the bounds of the path.
 
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 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.
 
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 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 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 updated to be at the endpoint.
 
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 single control point.
 
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 two specified control points.
 
IMPELLER_EXPORT void ImpellerPathBuilderAddRect (ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect)
 Adds a rectangle to the path.
 
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.
 
IMPELLER_EXPORT void ImpellerPathBuilderAddOval (ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL oval_bounds)
 Add an oval to the path.
 
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 void ImpellerPathBuilderClose (ImpellerPathBuilder IMPELLER_NONNULL builder)
 Close 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 to.
 
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 path.
 
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPaint IMPELLER_NULLABLE ImpellerPaintNew ()
 Create a new paint with default values.
 
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 ImpellerPaintRelease (ImpellerPaint IMPELLER_NULLABLE paint)
 Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
 
IMPELLER_EXPORT void ImpellerPaintSetColor (ImpellerPaint IMPELLER_NONNULL paint, const ImpellerColor *IMPELLER_NONNULL color)
 Set the paint color.
 
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 values already drawn using previous draw calls.
 
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 void ImpellerPaintSetStrokeCap (ImpellerPaint IMPELLER_NONNULL paint, ImpellerStrokeCap cap)
 Sets how strokes rendered using this paint are capped.
 
IMPELLER_EXPORT void ImpellerPaintSetStrokeJoin (ImpellerPaint IMPELLER_NONNULL paint, ImpellerStrokeJoin join)
 Sets how strokes rendered using this paint are joined.
 
IMPELLER_EXPORT void ImpellerPaintSetStrokeWidth (ImpellerPaint IMPELLER_NONNULL paint, float width)
 Set the width of the strokes rendered using this paint.
 
IMPELLER_EXPORT void ImpellerPaintSetStrokeMiter (ImpellerPaint IMPELLER_NONNULL paint, float miter)
 Set the miter limit of the strokes rendered using this paint.
 
IMPELLER_EXPORT void ImpellerPaintSetColorFilter (ImpellerPaint IMPELLER_NONNULL paint, ImpellerColorFilter IMPELLER_NONNULL color_filter)
 Set the color filter of the paint.
 
IMPELLER_EXPORT void ImpellerPaintSetColorSource (ImpellerPaint IMPELLER_NONNULL paint, ImpellerColorSource IMPELLER_NONNULL color_source)
 Set the color source of the paint.
 
IMPELLER_EXPORT void ImpellerPaintSetImageFilter (ImpellerPaint IMPELLER_NONNULL paint, ImpellerImageFilter IMPELLER_NONNULL image_filter)
 Set the image filter of a paint.
 
IMPELLER_EXPORT void ImpellerPaintSetMaskFilter (ImpellerPaint IMPELLER_NONNULL paint, ImpellerMaskFilter IMPELLER_NONNULL mask_filter)
 Set the mask filter of a paint.
 
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 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 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 ImpellerTextureRelease (ImpellerTexture IMPELLER_NULLABLE texture)
 Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
 
IMPELLER_EXPORT uint64_t ImpellerTextureGetOpenGLHandle (ImpellerTexture IMPELLER_NONNULL texture)
 Get the OpenGL handle associated with this texture. If this is not an OpenGL texture, this method will always return 0.
 
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerFragmentProgram IMPELLER_NULLABLE ImpellerFragmentProgramNew (const ImpellerMapping *IMPELLER_NONNULL data, void *IMPELLER_NULLABLE data_release_user_data)
 Create a new fragment program using data obtained by compiling a GLSL shader with impellerc.
 
IMPELLER_EXPORT void ImpellerFragmentProgramRetain (ImpellerFragmentProgram IMPELLER_NULLABLE fragment_program)
 Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
 
IMPELLER_EXPORT void ImpellerFragmentProgramRelease (ImpellerFragmentProgram IMPELLER_NULLABLE fragment_program)
 Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
 
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 ImpellerColorSourceRelease (ImpellerColorSource IMPELLER_NULLABLE color_source)
 Release a previously retained 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 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 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.
 
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 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 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.
 
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateFragmentProgramNew (ImpellerContext IMPELLER_NONNULL context, ImpellerFragmentProgram IMPELLER_NONNULL fragment_program, IMPELLER_NONNULL ImpellerTexture *IMPELLER_NULLABLE samplers, size_t samplers_count, const uint8_t *IMPELLER_NULLABLE data, size_t data_bytes_length)
 Create a color source whose pixels are shaded by a fragment program.
 
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 void ImpellerColorFilterRelease (ImpellerColorFilter IMPELLER_NULLABLE color_filter)
 Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
 
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 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 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 ImpellerMaskFilterRelease (ImpellerMaskFilter IMPELLER_NULLABLE mask_filter)
 Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
 
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 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 void ImpellerImageFilterRelease (ImpellerImageFilter IMPELLER_NULLABLE image_filter)
 Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
 
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 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 around the pixel.
 
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 around the pixel.
 
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.
 
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateFragmentProgramNew (ImpellerContext IMPELLER_NONNULL context, ImpellerFragmentProgram IMPELLER_NONNULL fragment_program, IMPELLER_NONNULL ImpellerTexture *IMPELLER_NULLABLE samplers, size_t samplers_count, const uint8_t *IMPELLER_NULLABLE data, size_t data_bytes_length)
 Create an image filter where each pixel is shaded by a fragment program.
 
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 the outer filters.
 
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 ImpellerDisplayListRelease (ImpellerDisplayList IMPELLER_NULLABLE display_list)
 Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
 
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerDisplayListBuilder IMPELLER_NULLABLE ImpellerDisplayListBuilderNew (const ImpellerRect *IMPELLER_NULLABLE cull_rect)
 Create a new display list builder.
 
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 ImpellerDisplayListBuilderRelease (ImpellerDisplayListBuilder IMPELLER_NULLABLE builder)
 Release a previously retained 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. The builder is reset after this call.
 
IMPELLER_EXPORT void ImpellerDisplayListBuilderSave (ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
 Stashes the current transformation and clip state onto a 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 offscreen layer onto which subsequent rendering intent will be directed to.
 
IMPELLER_EXPORT void ImpellerDisplayListBuilderRestore (ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
 Pops the last entry pushed onto the save stack using a call to ImpellerDisplayListBuilderSave or ImpellerDisplayListBuilderSaveLayer.
 
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 ImpellerDisplayListBuilderRotate (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, float angle_degrees)
 Apply a clockwise rotation to the transformation matrix currently on top of the save stack.
 
IMPELLER_EXPORT 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 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 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 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 ImpellerDisplayListBuilderResetTransform (ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
 Reset the transformation on top of the transformation stack to identity.
 
IMPELLER_EXPORT uint32_t ImpellerDisplayListBuilderGetSaveCount (ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
 Get the current size of the save stack.
 
IMPELLER_EXPORT void ImpellerDisplayListBuilderRestoreToCount (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, uint32_t count)
 Effectively calls ImpellerDisplayListBuilderRestore till the size of the save stack becomes a specified count.
 
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 account the clip operation.
 
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 account the clip operation.
 
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 taking into account the clip operation.
 
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 account the clip operation.
 
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawPaint (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerPaint IMPELLER_NONNULL paint)
 Fills the current clip with the specified paint.
 
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 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.
 
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawRect (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect, ImpellerPaint IMPELLER_NONNULL paint)
 Draws a rectangle.
 
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawOval (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL oval_bounds, ImpellerPaint IMPELLER_NONNULL paint)
 Draws an oval.
 
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 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 radii).
 
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawPath (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerPath IMPELLER_NONNULL path, ImpellerPaint IMPELLER_NONNULL paint)
 Draws the specified shape.
 
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 ImpellerDisplayListBuilderDrawParagraph (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerParagraph IMPELLER_NONNULL paragraph, const ImpellerPoint *IMPELLER_NONNULL point)
 Draw a paragraph at the specified point.
 
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawShadow (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerPath IMPELLER_NONNULL path, const ImpellerColor *IMPELLER_NONNULL color, float elevation, bool occluder_is_transparent, float device_pixel_ratio)
 Draw a shadow for a Path given a material elevation. If the occluding object is not opaque, additional hints (via the occluder_is_transparent argument) must be provided to render the shadow correctly.
 
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawTexture (ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerTexture IMPELLER_NONNULL texture, const ImpellerPoint *IMPELLER_NONNULL point, ImpellerTextureSampling sampling, ImpellerPaint IMPELLER_NULLABLE paint)
 Draw a texture at the specified point.
 
IMPELLER_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.
 
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTypographyContext IMPELLER_NULLABLE ImpellerTypographyContextNew ()
 Create a new typography contents.
 
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 void ImpellerTypographyContextRelease (ImpellerTypographyContext IMPELLER_NULLABLE context)
 Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
 
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.
 
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphStyle IMPELLER_NULLABLE ImpellerParagraphStyleNew ()
 Create a new paragraph style.
 
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 ImpellerParagraphStyleRelease (ImpellerParagraphStyle IMPELLER_NULLABLE paragraph_style)
 Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
 
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 ImpellerParagraphStyleSetBackground (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerPaint IMPELLER_NONNULL paint)
 Set the paint used to render the background of the text glyphs.
 
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 ImpellerParagraphStyleSetFontStyle (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerFontStyle style)
 Set whether the glyphs should be bolded or italicized.
 
IMPELLER_EXPORT void ImpellerParagraphStyleSetFontFamily (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, const char *IMPELLER_NONNULL family_name)
 Set the font family.
 
IMPELLER_EXPORT void ImpellerParagraphStyleSetFontSize (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, float size)
 Set the font size.
 
IMPELLER_EXPORT void ImpellerParagraphStyleSetHeight (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, float height)
 The height of the text as a multiple of text size.
 
IMPELLER_EXPORT void ImpellerParagraphStyleSetTextAlignment (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerTextAlignment align)
 Set the alignment of text within the paragraph.
 
IMPELLER_EXPORT void ImpellerParagraphStyleSetTextDirection (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerTextDirection direction)
 Set the directionality of the text within the paragraph.
 
IMPELLER_EXPORT void ImpellerParagraphStyleSetTextDecoration (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, const ImpellerTextDecoration *IMPELLER_NONNULL decoration)
 Set one of more text decorations on the paragraph. Decorations can be underlines, overlines, strikethroughs, etc.. The style of decorations can be set as well (dashed, dotted, wavy, etc..)
 
IMPELLER_EXPORT void ImpellerParagraphStyleSetMaxLines (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, uint32_t max_lines)
 Set the maximum line count within the paragraph.
 
IMPELLER_EXPORT void ImpellerParagraphStyleSetLocale (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, const char *IMPELLER_NONNULL locale)
 Set the paragraph locale.
 
IMPELLER_EXPORT void ImpellerParagraphStyleSetEllipsis (ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, const char *IMPELLER_NULLABLE ellipsis)
 Set the UTF-8 string to use as the ellipsis. Pass nullptr to clear the setting to default.
 
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphBuilder IMPELLER_NULLABLE ImpellerParagraphBuilderNew (ImpellerTypographyContext IMPELLER_NONNULL context)
 Create a new paragraph builder.
 
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 ImpellerParagraphBuilderRelease (ImpellerParagraphBuilder IMPELLER_NULLABLE paragraph_builder)
 Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
 
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 ImpellerParagraphBuilderPopStyle (ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder)
 Pop a previously pushed paragraph style from the paragraph style stack.
 
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 already on top of the paragraph style stack.
 
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. The paragraph builder must be discarded and a new one created to build more paragraphs.
 
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 void ImpellerParagraphRelease (ImpellerParagraph IMPELLER_NULLABLE paragraph)
 Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
 
IMPELLER_EXPORT float ImpellerParagraphGetMaxWidth (ImpellerParagraph IMPELLER_NONNULL paragraph)
 
IMPELLER_EXPORT float ImpellerParagraphGetHeight (ImpellerParagraph IMPELLER_NONNULL paragraph)
 
IMPELLER_EXPORT float ImpellerParagraphGetLongestLineWidth (ImpellerParagraph IMPELLER_NONNULL paragraph)
 
IMPELLER_EXPORT float ImpellerParagraphGetMinIntrinsicWidth (ImpellerParagraph IMPELLER_NONNULL paragraph)
 
IMPELLER_EXPORT float ImpellerParagraphGetMaxIntrinsicWidth (ImpellerParagraph IMPELLER_NONNULL paragraph)
 
IMPELLER_EXPORT float ImpellerParagraphGetIdeographicBaseline (ImpellerParagraph IMPELLER_NONNULL paragraph)
 
IMPELLER_EXPORT float ImpellerParagraphGetAlphabeticBaseline (ImpellerParagraph IMPELLER_NONNULL paragraph)
 
IMPELLER_EXPORT uint32_t ImpellerParagraphGetLineCount (ImpellerParagraph IMPELLER_NONNULL paragraph)
 
IMPELLER_EXPORT void ImpellerParagraphGetWordBoundary (ImpellerParagraph IMPELLER_NONNULL paragraph, size_t code_unit_index, ImpellerRange *IMPELLER_NONNULL out_range)
 Get the range into the UTF-16 code unit buffer that represents the word at the specified caret location in the same buffer.
 
IMPELLER_EXPORT ImpellerLineMetrics IMPELLER_NULLABLE ImpellerParagraphGetLineMetrics (ImpellerParagraph IMPELLER_NONNULL paragraph)
 Get the line metrics of this laid out paragraph. Calculating the line metrics is expensive. The first time line metrics are requested, they will be cached along with the paragraph (which is immutable).
 
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerGlyphInfo IMPELLER_NULLABLE ImpellerParagraphCreateGlyphInfoAtCodeUnitIndexNew (ImpellerParagraph IMPELLER_NONNULL paragraph, size_t code_unit_index)
 Create a new instance of glyph info that can be queried for information about the glyph at the given UTF-16 code unit index. The instance must be freed using ImpellerGlyphInfoRelease.
 
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerGlyphInfo IMPELLER_NULLABLE ImpellerParagraphCreateGlyphInfoAtParagraphCoordinatesNew (ImpellerParagraph IMPELLER_NONNULL paragraph, double x, double y)
 Create a new instance of glyph info that can be queried for information about the glyph closest to the specified coordinates relative to the origin of the paragraph. The instance must be freed using ImpellerGlyphInfoRelease.
 
IMPELLER_EXPORT void ImpellerLineMetricsRetain (ImpellerLineMetrics IMPELLER_NULLABLE line_metrics)
 Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
 
IMPELLER_EXPORT void ImpellerLineMetricsRelease (ImpellerLineMetrics IMPELLER_NULLABLE line_metrics)
 Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
 
IMPELLER_EXPORT double ImpellerLineMetricsGetUnscaledAscent (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
 The rise from the baseline as calculated from the font and style for this line ignoring the height from the text style.
 
IMPELLER_EXPORT double ImpellerLineMetricsGetAscent (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
 The rise from the baseline as calculated from the font and style for this line.
 
IMPELLER_EXPORT double ImpellerLineMetricsGetDescent (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
 The drop from the baseline as calculated from the font and style for this line.
 
IMPELLER_EXPORT double ImpellerLineMetricsGetBaseline (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
 The y coordinate of the baseline for this line from the top of the paragraph.
 
IMPELLER_EXPORT bool ImpellerLineMetricsIsHardbreak (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
 Used to determine if this line ends with an explicit line break (e.g. '
') or is the end of the paragraph.
 
IMPELLER_EXPORT double ImpellerLineMetricsGetWidth (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
 Width of the line from the left edge of the leftmost glyph to the right edge of the rightmost glyph.
 
IMPELLER_EXPORT double ImpellerLineMetricsGetHeight (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
 Total height of the line from the top edge to the bottom edge.
 
IMPELLER_EXPORT double ImpellerLineMetricsGetLeft (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
 The x coordinate of left edge of the line.
 
IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitStartIndex (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
 Fetch the start index in the buffer of UTF-16 code units used to represent the paragraph line.
 
IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitEndIndex (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
 Fetch the end index in the buffer of UTF-16 code units used to represent the paragraph line.
 
IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitEndIndexExcludingWhitespace (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
 Fetch the end index (excluding whitespace) in the buffer of UTF-16 code units used to represent the paragraph line.
 
IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitEndIndexIncludingNewline (ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
 Fetch the end index (including newlines) in the buffer of UTF-16 code units used to represent the paragraph line.
 
IMPELLER_EXPORT void ImpellerGlyphInfoRetain (ImpellerGlyphInfo IMPELLER_NULLABLE glyph_info)
 Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
 
IMPELLER_EXPORT void ImpellerGlyphInfoRelease (ImpellerGlyphInfo IMPELLER_NULLABLE glyph_info)
 Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.
 
IMPELLER_EXPORT size_t ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeBegin (ImpellerGlyphInfo IMPELLER_NONNULL glyph_info)
 Fetch the start index in the buffer of UTF-16 code units used to represent the grapheme cluster for a glyph.
 
IMPELLER_EXPORT size_t ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeEnd (ImpellerGlyphInfo IMPELLER_NONNULL glyph_info)
 Fetch the end index in the buffer of UTF-16 code units used to represent the grapheme cluster for a glyph.
 
IMPELLER_EXPORT void ImpellerGlyphInfoGetGraphemeClusterBounds (ImpellerGlyphInfo IMPELLER_NONNULL glyph_info, ImpellerRect *IMPELLER_NONNULL out_bounds)
 Fetch the bounds of the grapheme cluster for the glyph in the coordinate space of the paragraph.
 
IMPELLER_EXPORT bool ImpellerGlyphInfoIsEllipsis (ImpellerGlyphInfo IMPELLER_NONNULL glyph_info)
 
IMPELLER_EXPORT ImpellerTextDirection ImpellerGlyphInfoGetTextDirection (ImpellerGlyphInfo IMPELLER_NONNULL glyph_info)
 

Macro Definition Documentation

◆ IMPELLER_DEFINE_HANDLE

#define IMPELLER_DEFINE_HANDLE (   handle)     typedef struct IMPELLER_INTERNAL_HANDLE_NAME(handle) * handle;

Definition at line 142 of file impeller.h.

363 {
367
368typedef enum ImpellerClipOperation {
372
373typedef enum ImpellerBlendMode {
404
405typedef enum ImpellerDrawStyle {
410
411typedef enum ImpellerStrokeCap {
416
417typedef enum ImpellerStrokeJoin {
422
423typedef enum ImpellerPixelFormat {
426
427typedef enum ImpellerTextureSampling {
431
432typedef enum ImpellerTileMode {
438
439typedef enum ImpellerBlurStyle {
445
446typedef enum ImpellerColorSpace {
451
452typedef enum ImpellerFontWeight {
454 kImpellerFontWeight200, // Extra-Light
455 kImpellerFontWeight300, // Light
456 kImpellerFontWeight400, // Normal/Regular
457 kImpellerFontWeight500, // Medium
458 kImpellerFontWeight600, // Semi-bold
460 kImpellerFontWeight800, // Extra-Bold
461 kImpellerFontWeight900, // Black
463
464typedef enum ImpellerFontStyle {
468
469typedef enum ImpellerTextAlignment {
477
478typedef enum ImpellerTextDirection {
482
483typedef enum ImpellerTextDecorationType {
489
490typedef enum ImpellerTextDecorationStyle {
497
498//------------------------------------------------------------------------------
499// Non-opaque structs
500// -----------------------------------------------------------------------------
501typedef struct ImpellerRect {
502 float x;
503 float y;
504 float width;
505 float height;
507
508typedef struct ImpellerPoint {
509 float x;
510 float y;
512
513typedef struct ImpellerSize {
514 float width;
515 float height;
517
518typedef struct ImpellerISize {
519 int64_t width;
520 int64_t height;
522
523typedef struct ImpellerRange {
524 uint64_t start;
525 uint64_t end;
527
528//------------------------------------------------------------------------------
529/// A 4x4 transformation matrix using column-major storage.
530///
531/// ```
532/// | m[0] m[4] m[8] m[12] |
533/// | m[1] m[5] m[9] m[13] |
534/// | m[2] m[6] m[10] m[14] |
535/// | m[3] m[7] m[11] m[15] |
536/// ```
537///
538typedef struct ImpellerMatrix {
539 float m[16];
541
542//------------------------------------------------------------------------------
543/// A 4x5 matrix using row-major storage used for transforming color values.
544///
545/// To transform color values, a 5x5 matrix is constructed with the 5th row
546/// being identity. Then the following transformation is performed:
547///
548/// ```
549/// | R' | | m[0] m[1] m[2] m[3] m[4] | | R |
550/// | G' | | m[5] m[6] m[7] m[8] m[9] | | G |
551/// | B' | = | m[10] m[11] m[12] m[13] m[14] | * | B |
552/// | A' | | m[15] m[16] m[17] m[18] m[19] | | A |
553/// | 1 | | 0 0 0 0 1 | | 1 |
554/// ```
555///
556/// The translation column (m[4], m[9], m[14], m[19]) must be specified in
557/// non-normalized 8-bit unsigned integer space (0 to 255). Values outside this
558/// range will produce undefined results.
559///
560/// The identity transformation is thus:
561///
562/// ```
563/// 1, 0, 0, 0, 0,
564/// 0, 1, 0, 0, 0,
565/// 0, 0, 1, 0, 0,
566/// 0, 0, 0, 1, 0,
567/// ```
568///
569/// Some examples:
570///
571/// To invert all colors:
572///
573/// ```
574/// -1, 0, 0, 0, 255,
575/// 0, -1, 0, 0, 255,
576/// 0, 0, -1, 0, 255,
577/// 0, 0, 0, 1, 0,
578/// ```
579///
580/// To apply a sepia filter:
581///
582/// ```
583/// 0.393, 0.769, 0.189, 0, 0,
584/// 0.349, 0.686, 0.168, 0, 0,
585/// 0.272, 0.534, 0.131, 0, 0,
586/// 0, 0, 0, 1, 0,
587/// ```
588///
589/// To apply a grayscale conversion filter:
590///
591/// ```
592/// 0.2126, 0.7152, 0.0722, 0, 0,
593/// 0.2126, 0.7152, 0.0722, 0, 0,
594/// 0.2126, 0.7152, 0.0722, 0, 0,
595/// 0, 0, 0, 1, 0,
596/// ```
597///
598/// @see ImpellerColorFilter
599///
600typedef struct ImpellerColorMatrix {
601 float m[20];
603
604typedef struct ImpellerRoundingRadii {
610
611typedef struct ImpellerColor {
612 float red;
613 float green;
614 float blue;
615 float alpha;
618
619typedef struct ImpellerTextureDescriptor {
622 uint32_t mip_count;
624
625typedef struct ImpellerMapping {
626 const uint8_t* IMPELLER_NONNULL data;
627 uint64_t length;
630
631typedef struct ImpellerContextVulkanSettings {
636
637typedef struct ImpellerContextVulkanInfo {
642 uint32_t graphics_queue_index;
644
645typedef struct ImpellerTextDecoration {
646 /// A mask of `ImpellerTextDecorationType`s to enable.
647 int types;
648 /// The decoration color.
650 /// The decoration style.
652 // The multiplier applied to the default thickness of the font to use for the
653 // decoration.
656
657//------------------------------------------------------------------------------
658// Version
659//------------------------------------------------------------------------------
660
661//------------------------------------------------------------------------------
662/// @brief Get the version of Impeller standalone API. This is the API that
663/// will be accepted for validity checks when provided to the
664/// context creation methods.
665///
666/// The current version of the API is denoted by the
667/// `IMPELLER_VERSION` macro. This version must be passed to APIs
668/// that create top-level objects like graphics contexts.
669/// Construction of the context may fail if the API version expected
670/// by the caller is not supported by the library.
671///
672/// Since there are no API stability guarantees today, passing a
673/// version that is different to the one returned by
674/// `ImpellerGetVersion` will always fail.
675///
676/// @see `ImpellerContextCreateOpenGLESNew`
677///
678/// @return The version of the standalone API.
679///
681uint32_t ImpellerGetVersion();
682
683//------------------------------------------------------------------------------
684// Context
685//------------------------------------------------------------------------------
686
687//------------------------------------------------------------------------------
688/// @brief Create an OpenGL(ES) Impeller context.
689///
690/// @warning Unlike other context types, the OpenGL ES context can only be
691/// created, used, and collected on the calling thread. This
692/// restriction may be lifted in the future once reactor workers are
693/// exposed in the API. No other context types have threading
694/// restrictions. Till reactor workers can be used, using the
695/// context on a background thread will cause a stall of OpenGL
696/// operations.
697///
698/// @param[in] version The version of the Impeller
699/// standalone API. See `ImpellerGetVersion`. If the
700/// specified here is not compatible with the version
701/// of the library, context creation will fail and NULL
702/// context returned from this call.
703/// @param[in] gl_proc_address_callback
704/// The gl proc address callback. For instance,
705/// `eglGetProcAddress`.
706/// @param[in] gl_proc_address_callback_user_data
707/// The gl proc address callback user data baton. This
708/// pointer is not interpreted by Impeller and will be
709/// returned as user data in the proc address callback.
710/// user data.
711///
712/// @return The context or NULL if one cannot be created.
713///
716 uint32_t version,
717 ImpellerProcAddressCallback IMPELLER_NONNULL gl_proc_address_callback,
718 void* IMPELLER_NULLABLE gl_proc_address_callback_user_data);
719
720//------------------------------------------------------------------------------
721/// @brief Create a Metal context using the system default Metal device.
722///
723/// @param[in] version The version specified in the IMPELLER_VERSION macro.
724///
725/// @return The Metal context or NULL if one cannot be created.
726///
728ImpellerContextCreateMetalNew(uint32_t version);
729
730//------------------------------------------------------------------------------
731/// @brief Create a Vulkan context using the provided Vulkan Settings.
732///
733/// @param[in] version The version specified in the IMPELLER_VERSION macro.
734/// @param[in] settings The Vulkan settings.
735///
736/// @return The Vulkan context or NULL if one cannot be created.
737///
740 uint32_t version,
742
743//------------------------------------------------------------------------------
744/// @brief Retain a strong reference to the object. The object can be NULL
745/// in which case this method is a no-op.
746///
747/// @param[in] context The context.
748///
750void ImpellerContextRetain(ImpellerContext IMPELLER_NULLABLE context);
751
752//------------------------------------------------------------------------------
753/// @brief Release a previously retained reference to the object. The
754/// object can be NULL in which case this method is a no-op.
755///
756/// @param[in] context The context.
757///
759void ImpellerContextRelease(ImpellerContext IMPELLER_NULLABLE context);
760
761//------------------------------------------------------------------------------
762/// @brief Get internal Vulkan handles managed by the given Vulkan context.
763/// Ownership of the handles is still maintained by Impeller. This
764/// accessor is just available so embedders can create resources
765/// using the same device and instance as Impeller for interop.
766///
767/// @warning If the context is not a Vulkan context, False is returned with
768/// the [out] argument unaffected.
769///
770/// @param[in] context The context
771/// @param[out] out_vulkan_info The out vulkan information
772///
773/// @return If the Vulkan info could be fetched from the context.
774///
776bool ImpellerContextGetVulkanInfo(ImpellerContext IMPELLER_NONNULL context,
778 out_vulkan_info);
779
780//------------------------------------------------------------------------------
781// Vulkan Swapchain
782//------------------------------------------------------------------------------
783
784//------------------------------------------------------------------------------
785/// @brief Create a new Vulkan swapchain using a VkSurfaceKHR instance.
786/// Ownership of the surface is transferred over to Impeller. The
787/// Vulkan instance the surface is created from must the same as the
788/// context provided.
789///
790/// @param[in] context The context. Must be a Vulkan context whose
791/// instance is the same used to create the
792/// surface passed into the next argument.
793/// @param vulkan_surface_khr The vulkan surface.
794///
795/// @return The vulkan swapchain.
796///
799 void* IMPELLER_NONNULL vulkan_surface_khr);
800
801//------------------------------------------------------------------------------
802/// @brief Retain a strong reference to the object. The object can be NULL
803/// in which case this method is a no-op.
804///
805/// @param[in] swapchain The swapchain.
806///
809 ImpellerVulkanSwapchain IMPELLER_NULLABLE swapchain);
810
811//------------------------------------------------------------------------------
812/// @brief Release a previously retained reference to the object. The
813/// object can be NULL in which case this method is a no-op.
814///
815/// @param[in] swapchain The swapchain.
816///
819 ImpellerVulkanSwapchain IMPELLER_NULLABLE swapchain);
820
821//------------------------------------------------------------------------------
822/// @brief A potentially blocking operation, acquires the next surface to
823/// render to. Since this may block, surface acquisition must be
824/// delayed for as long as possible to avoid an idle wait on the
825/// CPU.
826///
827/// @param[in] swapchain The swapchain.
828///
829/// @return The surface if one could be obtained, NULL otherwise.
830///
833 ImpellerVulkanSwapchain IMPELLER_NONNULL swapchain);
834
835//------------------------------------------------------------------------------
836// Surface
837//------------------------------------------------------------------------------
838
839//------------------------------------------------------------------------------
840/// @brief Create a new surface by wrapping an existing framebuffer object.
841/// The framebuffer must be complete as determined by
842/// `glCheckFramebufferStatus`. The framebuffer is still owned by
843/// the caller and it must be collected once the surface is
844/// collected.
845///
846/// @param[in] context The context.
847/// @param[in] fbo The framebuffer object handle.
848/// @param[in] format The format of the framebuffer.
849/// @param[in] size The size of the framebuffer is texels.
850///
851/// @return The surface if once can be created, NULL otherwise.
852///
855 uint64_t fbo,
856 ImpellerPixelFormat format,
857 const ImpellerISize* IMPELLER_NONNULL size);
858
859//------------------------------------------------------------------------------
860/// @brief Create a surface by wrapping a Metal drawable. This is useful
861/// during WSI when the drawable is the backing store of the Metal
862/// layer being drawn to.
863///
864/// The Metal layer must be using the same device managed by the
865/// underlying context.
866///
867/// @param[in] context The context. The Metal device managed by this
868/// context must be the same used to create the
869/// drawable that is being wrapped.
870/// @param metal_drawable The drawable to wrap as a surface.
871///
872/// @return The surface if one could be wrapped, NULL otherwise.
873///
876 ImpellerContext IMPELLER_NONNULL context,
877 void* IMPELLER_NONNULL metal_drawable);
878
879//------------------------------------------------------------------------------
880/// @brief Retain a strong reference to the object. The object can be NULL
881/// in which case this method is a no-op.
882///
883/// @param[in] surface The surface.
884///
886void ImpellerSurfaceRetain(ImpellerSurface IMPELLER_NULLABLE surface);
887
888//------------------------------------------------------------------------------
889/// @brief Release a previously retained reference to the object. The
890/// object can be NULL in which case this method is a no-op.
891///
892/// @param[in] surface The surface.
893///
895void ImpellerSurfaceRelease(ImpellerSurface IMPELLER_NULLABLE surface);
896
897//------------------------------------------------------------------------------
898/// @brief Draw a display list onto the surface. The same display list can
899/// be drawn multiple times to different surfaces.
900///
901/// @warning In the OpenGL backend, Impeller will not make an effort to
902/// preserve the OpenGL state that is current in the context.
903/// Embedders that perform additional OpenGL operations in the
904/// context should expect the reset state after control transitions
905/// back to them. Key state to watch out for would be the viewports,
906/// stencil rects, test toggles, resource (texture, framebuffer,
907/// buffer) bindings, etc...
908///
909/// @param[in] surface The surface to draw the display list to.
910/// @param[in] display_list The display list to draw onto the surface.
911///
912/// @return If the display list could be drawn onto the surface.
913///
915bool ImpellerSurfaceDrawDisplayList(ImpellerSurface IMPELLER_NONNULL surface,
916 ImpellerDisplayList IMPELLER_NONNULL
917 display_list);
918
919//------------------------------------------------------------------------------
920/// @brief Present the surface to the underlying window system.
921///
922/// @param[in] surface The surface to present.
923///
924/// @return True if the surface could be presented.
925///
927bool ImpellerSurfacePresent(ImpellerSurface IMPELLER_NONNULL surface);
928
929//------------------------------------------------------------------------------
930// Path
931//------------------------------------------------------------------------------
932
933//------------------------------------------------------------------------------
934/// @brief Retain a strong reference to the object. The object can be NULL
935/// in which case this method is a no-op.
936///
937/// @param[in] path The path.
938///
940void ImpellerPathRetain(ImpellerPath IMPELLER_NULLABLE path);
941
942//------------------------------------------------------------------------------
943/// @brief Release a previously retained reference to the object. The
944/// object can be NULL in which case this method is a no-op.
945///
946/// @param[in] path The path.
947///
949void ImpellerPathRelease(ImpellerPath IMPELLER_NULLABLE path);
950
951//------------------------------------------------------------------------------
952/// @brief Get the bounds of the path.
953///
954/// The bounds are conservative. That is, they may be larger than
955/// the actual shape of the path and could include the control
956/// points and isolated calls to move the cursor.
957///
958/// @param[in] path The path
959/// @param[out] out_bounds The conservative bounds of the path.
960///
962void ImpellerPathGetBounds(ImpellerPath IMPELLER_NONNULL path,
963 ImpellerRect* IMPELLER_NONNULL out_bounds);
964
965//------------------------------------------------------------------------------
966// Path Builder
967//------------------------------------------------------------------------------
968
969//------------------------------------------------------------------------------
970/// @brief Create a new path builder. Paths themselves are immutable.
971/// A builder builds these immutable paths.
972///
973/// @return The path builder.
974///
977
978//------------------------------------------------------------------------------
979/// @brief Retain a strong reference to the object. The object can be NULL
980/// in which case this method is a no-op.
981///
982/// @param[in] builder The builder.
983///
985void ImpellerPathBuilderRetain(ImpellerPathBuilder IMPELLER_NULLABLE builder);
986
987//------------------------------------------------------------------------------
988/// @brief Release a previously retained reference to the object. The
989/// object can be NULL in which case this method is a no-op.
990///
991/// @param[in] builder The builder.
992///
994void ImpellerPathBuilderRelease(ImpellerPathBuilder IMPELLER_NULLABLE builder);
995
996//------------------------------------------------------------------------------
997/// @brief Move the cursor to the specified location.
998///
999/// @param[in] builder The builder.
1000/// @param[in] location The location.
1001///
1003void ImpellerPathBuilderMoveTo(ImpellerPathBuilder IMPELLER_NONNULL builder,
1004 const ImpellerPoint* IMPELLER_NONNULL location);
1005
1006//------------------------------------------------------------------------------
1007/// @brief Add a line segment from the current cursor location to the given
1008/// location. The cursor location is updated to be at the endpoint.
1009///
1010/// @param[in] builder The builder.
1011/// @param[in] location The location.
1012///
1014void ImpellerPathBuilderLineTo(ImpellerPathBuilder IMPELLER_NONNULL builder,
1015 const ImpellerPoint* IMPELLER_NONNULL location);
1016
1017//------------------------------------------------------------------------------
1018/// @brief Add a quadratic curve from whose start point is the cursor to
1019/// the specified end point using the a single control point.
1020///
1021/// The new location of the cursor after this call is the end point.
1022///
1023/// @param[in] builder The builder.
1024/// @param[in] control_point The control point.
1025/// @param[in] end_point The end point.
1026///
1029 ImpellerPathBuilder IMPELLER_NONNULL builder,
1030 const ImpellerPoint* IMPELLER_NONNULL control_point,
1031 const ImpellerPoint* IMPELLER_NONNULL end_point);
1032
1033//------------------------------------------------------------------------------
1034/// @brief Add a cubic curve whose start point is current cursor location
1035/// to the specified end point using the two specified control
1036/// points.
1037///
1038/// The new location of the cursor after this call is the end point
1039/// supplied.
1040///
1041/// @param[in] builder The builder
1042/// @param[in] control_point_1 The control point 1
1043/// @param[in] control_point_2 The control point 2
1044/// @param[in] end_point The end point
1045///
1048 ImpellerPathBuilder IMPELLER_NONNULL builder,
1049 const ImpellerPoint* IMPELLER_NONNULL control_point_1,
1050 const ImpellerPoint* IMPELLER_NONNULL control_point_2,
1051 const ImpellerPoint* IMPELLER_NONNULL end_point);
1052
1053//------------------------------------------------------------------------------
1054/// @brief Adds a rectangle to the path.
1055///
1056/// @param[in] builder The builder.
1057/// @param[in] rect The rectangle.
1058///
1060void ImpellerPathBuilderAddRect(ImpellerPathBuilder IMPELLER_NONNULL builder,
1061 const ImpellerRect* IMPELLER_NONNULL rect);
1062
1063//------------------------------------------------------------------------------
1064/// @brief Add an arc to the path.
1065///
1066/// @param[in] builder The builder.
1067/// @param[in] oval_bounds The oval bounds.
1068/// @param[in] start_angle_degrees The start angle in degrees.
1069/// @param[in] end_angle_degrees The end angle in degrees.
1070///
1072void ImpellerPathBuilderAddArc(ImpellerPathBuilder IMPELLER_NONNULL builder,
1073 const ImpellerRect* IMPELLER_NONNULL oval_bounds,
1074 float start_angle_degrees,
1075 float end_angle_degrees);
1076
1077//------------------------------------------------------------------------------
1078/// @brief Add an oval to the path.
1079///
1080/// @param[in] builder The builder.
1081/// @param[in] oval_bounds The oval bounds.
1082///
1084void ImpellerPathBuilderAddOval(ImpellerPathBuilder IMPELLER_NONNULL builder,
1086 oval_bounds);
1087
1088//------------------------------------------------------------------------------
1089/// @brief Add a rounded rect with potentially non-uniform radii to the
1090/// path.
1091///
1092/// @param[in] builder The builder.
1093/// @param[in] rect The rectangle.
1094/// @param[in] rounding_radii The rounding radii.
1095///
1098 ImpellerPathBuilder IMPELLER_NONNULL builder,
1099 const ImpellerRect* IMPELLER_NONNULL rect,
1100 const ImpellerRoundingRadii* IMPELLER_NONNULL rounding_radii);
1101
1102//------------------------------------------------------------------------------
1103/// @brief Close the path.
1104///
1105/// @param[in] builder The builder.
1106///
1108void ImpellerPathBuilderClose(ImpellerPathBuilder IMPELLER_NONNULL builder);
1109
1110//------------------------------------------------------------------------------
1111/// @brief Create a new path by copying the existing built-up path. The
1112/// existing path can continue being added to.
1113///
1114/// @param[in] builder The builder.
1115/// @param[in] fill The fill.
1116///
1117/// @return The impeller path.
1118///
1120ImpellerPathBuilderCopyPathNew(ImpellerPathBuilder IMPELLER_NONNULL builder,
1121 ImpellerFillType fill);
1122
1123//------------------------------------------------------------------------------
1124/// @brief Create a new path using the existing built-up path. The existing
1125/// path builder now contains an empty path.
1126///
1127/// @param[in] builder The builder.
1128/// @param[in] fill The fill.
1129///
1130/// @return The impeller path.
1131///
1133ImpellerPathBuilderTakePathNew(ImpellerPathBuilder IMPELLER_NONNULL builder,
1134 ImpellerFillType fill);
1135
1136//------------------------------------------------------------------------------
1137// Paint
1138//------------------------------------------------------------------------------
1139
1140//------------------------------------------------------------------------------
1141/// @brief Create a new paint with default values.
1142///
1143/// @return The impeller paint.
1144///
1147
1148//------------------------------------------------------------------------------
1149/// @brief Retain a strong reference to the object. The object can be NULL
1150/// in which case this method is a no-op.
1151///
1152/// @param[in] paint The paint.
1153///
1155void ImpellerPaintRetain(ImpellerPaint IMPELLER_NULLABLE paint);
1156
1157//------------------------------------------------------------------------------
1158/// @brief Release a previously retained reference to the object. The
1159/// object can be NULL in which case this method is a no-op.
1160///
1161/// @param[in] paint The paint.
1162///
1164void ImpellerPaintRelease(ImpellerPaint IMPELLER_NULLABLE paint);
1165
1166//------------------------------------------------------------------------------
1167/// @brief Set the paint color.
1168///
1169/// @param[in] paint The paint.
1170/// @param[in] color The color.
1171///
1173void ImpellerPaintSetColor(ImpellerPaint IMPELLER_NONNULL paint,
1174 const ImpellerColor* IMPELLER_NONNULL color);
1175
1176//------------------------------------------------------------------------------
1177/// @brief Set the paint blend mode. The blend mode controls how the new
1178/// paints contents are mixed with the values already drawn using
1179/// previous draw calls.
1180///
1181/// @param[in] paint The paint.
1182/// @param[in] mode The mode.
1183///
1185void ImpellerPaintSetBlendMode(ImpellerPaint IMPELLER_NONNULL paint,
1186 ImpellerBlendMode mode);
1187
1188//------------------------------------------------------------------------------
1189/// @brief Set the paint draw style. The style controls if the closed
1190/// shapes are filled and/or stroked.
1191///
1192/// @param[in] paint The paint.
1193/// @param[in] style The style.
1194///
1196void ImpellerPaintSetDrawStyle(ImpellerPaint IMPELLER_NONNULL paint,
1197 ImpellerDrawStyle style);
1198
1199//------------------------------------------------------------------------------
1200/// @brief Sets how strokes rendered using this paint are capped.
1201///
1202/// @param[in] paint The paint.
1203/// @param[in] cap The stroke cap style.
1204///
1206void ImpellerPaintSetStrokeCap(ImpellerPaint IMPELLER_NONNULL paint,
1207 ImpellerStrokeCap cap);
1208
1209//------------------------------------------------------------------------------
1210/// @brief Sets how strokes rendered using this paint are joined.
1211///
1212/// @param[in] paint The paint.
1213/// @param[in] join The join.
1214///
1216void ImpellerPaintSetStrokeJoin(ImpellerPaint IMPELLER_NONNULL paint,
1217 ImpellerStrokeJoin join);
1218
1219//------------------------------------------------------------------------------
1220/// @brief Set the width of the strokes rendered using this paint.
1221///
1222/// @param[in] paint The paint.
1223/// @param[in] width The width.
1224///
1226void ImpellerPaintSetStrokeWidth(ImpellerPaint IMPELLER_NONNULL paint,
1227 float width);
1228
1229//------------------------------------------------------------------------------
1230/// @brief Set the miter limit of the strokes rendered using this paint.
1231///
1232/// @param[in] paint The paint.
1233/// @param[in] miter The miter limit.
1234///
1236void ImpellerPaintSetStrokeMiter(ImpellerPaint IMPELLER_NONNULL paint,
1237 float miter);
1238
1239//------------------------------------------------------------------------------
1240/// @brief Set the color filter of the paint.
1241///
1242/// Color filters are functions that take two colors and mix them to
1243/// produce a single color. This color is then usually merged with
1244/// the destination during blending.
1245///
1246/// @param[in] paint The paint.
1247/// @param[in] color_filter The color filter.
1248///
1250void ImpellerPaintSetColorFilter(ImpellerPaint IMPELLER_NONNULL paint,
1251 ImpellerColorFilter IMPELLER_NONNULL
1252 color_filter);
1253
1254//------------------------------------------------------------------------------
1255/// @brief Set the color source of the paint.
1256///
1257/// Color sources are functions that generate colors for each
1258/// texture element covered by a draw call.
1259///
1260/// @param[in] paint The paint.
1261/// @param[in] color_source The color source.
1262///
1264void ImpellerPaintSetColorSource(ImpellerPaint IMPELLER_NONNULL paint,
1265 ImpellerColorSource IMPELLER_NONNULL
1266 color_source);
1267
1268//------------------------------------------------------------------------------
1269/// @brief Set the image filter of a paint.
1270///
1271/// Image filters are functions that are applied to regions of a
1272/// texture to produce a single color.
1273///
1274/// @param[in] paint The paint.
1275/// @param[in] image_filter The image filter.
1276///
1278void ImpellerPaintSetImageFilter(ImpellerPaint IMPELLER_NONNULL paint,
1279 ImpellerImageFilter IMPELLER_NONNULL
1280 image_filter);
1281
1282//------------------------------------------------------------------------------
1283/// @brief Set the mask filter of a paint.
1284///
1285/// @param[in] paint The paint.
1286/// @param[in] mask_filter The mask filter.
1287///
1289void ImpellerPaintSetMaskFilter(ImpellerPaint IMPELLER_NONNULL paint,
1290 ImpellerMaskFilter IMPELLER_NONNULL
1291 mask_filter);
1292
1293//------------------------------------------------------------------------------
1294// Texture
1295//------------------------------------------------------------------------------
1296
1297//------------------------------------------------------------------------------
1298/// @brief Create a texture with decompressed bytes.
1299///
1300/// Impeller will do its best to perform the transfer of this data
1301/// to GPU memory with a minimal number of copies. Towards this
1302/// end, it may need to send this data to a different thread for
1303/// preparation and transfer. To facilitate this transfer, it is
1304/// recommended that the content mapping have a release callback
1305/// attach to it. When there is a release callback, Impeller assumes
1306/// that collection of the data can be deferred till texture upload
1307/// is done and can happen on a background thread. When there is no
1308/// release callback, Impeller may try to perform an eager copy of
1309/// the data if it needs to perform data preparation and transfer on
1310/// a background thread.
1311///
1312/// Whether an extra data copy actually occurs will always depend on
1313/// the rendering backend in use. But it is best practice to provide
1314/// a release callback and be resilient to the data being released
1315/// in a deferred manner on a background thread.
1316///
1317/// @warning Do **not** supply compressed image data directly (PNG, JPEG,
1318/// etc...). This function only works with tightly packed
1319/// decompressed data.
1320///
1321/// @param[in] context The context.
1322/// @param[in] descriptor The texture descriptor.
1323/// @param[in] contents The contents.
1324/// @param[in] contents_on_release_user_data The baton passes to the contents
1325/// release callback if one exists.
1326///
1327/// @return The texture if one can be created using the provided data, NULL
1328/// otherwise.
1329///
1332 ImpellerContext IMPELLER_NONNULL context,
1334 const ImpellerMapping* IMPELLER_NONNULL contents,
1335 void* IMPELLER_NULLABLE contents_on_release_user_data);
1336
1337//------------------------------------------------------------------------------
1338/// @brief Create a texture with an externally created OpenGL texture
1339/// handle.
1340///
1341/// Ownership of the handle is transferred over to Impeller after a
1342/// successful call to this method. Impeller is responsible for
1343/// calling glDeleteTextures on this handle. Do **not** collect this
1344/// handle yourself as this will lead to a double-free.
1345///
1346/// The handle must be created in the same context as the one used
1347/// by Impeller. If a different context is used, that context must
1348/// be in the same sharegroup as Impellers OpenGL context and all
1349/// synchronization of texture contents must already be complete.
1350///
1351/// If the context is not an OpenGL context, this call will always
1352/// fail.
1353///
1354/// @param[in] context The context
1355/// @param[in] descriptor The descriptor
1356/// @param[in] handle The handle
1357///
1358/// @return The texture if one could be created by adopting the supplied
1359/// texture handle, NULL otherwise.
1360///
1363 ImpellerContext IMPELLER_NONNULL context,
1365 uint64_t handle // transfer-in ownership
1366);
1367
1368//------------------------------------------------------------------------------
1369/// @brief Retain a strong reference to the object. The object can be NULL
1370/// in which case this method is a no-op.
1371///
1372/// @param[in] texture The texture.
1373///
1375void ImpellerTextureRetain(ImpellerTexture IMPELLER_NULLABLE texture);
1376
1377//------------------------------------------------------------------------------
1378/// @brief Release a previously retained reference to the object. The
1379/// object can be NULL in which case this method is a no-op.
1380///
1381/// @param[in] texture The texture.
1382///
1385
1386//------------------------------------------------------------------------------
1387/// @brief Get the OpenGL handle associated with this texture. If this is
1388/// not an OpenGL texture, this method will always return 0.
1389///
1390/// OpenGL handles are lazily created, this method will return
1391/// GL_NONE is no OpenGL handle is available. To ensure that this
1392/// call eagerly creates an OpenGL texture, call this on a thread
1393/// where Impeller knows there is an OpenGL context available.
1394///
1395/// @param[in] texture The texture.
1396///
1397/// @return The OpenGL handle if one is available, GL_NONE otherwise.
1398///
1401 ImpellerTexture IMPELLER_NONNULL texture);
1402
1403//------------------------------------------------------------------------------
1404// Fragment Program
1405//------------------------------------------------------------------------------
1406
1407//------------------------------------------------------------------------------
1408/// @brief Create a new fragment program using data obtained by compiling a
1409/// GLSL shader with `impellerc`.
1410///
1411/// @warning The data provided must be compiled by `impellerc`. Providing raw
1412/// GLSL strings will lead to a `nullptr` return. Impeller does not
1413/// compile shaders at runtime.
1414///
1415/// @param[in] data The data compiled by `impellerc`.
1416/// @param data_release_user_data A baton passed back to the caller on the
1417/// invocation of the mappings release
1418/// callback. This call can happen on any
1419/// thread.
1420///
1421/// @return The fragment program if one can be created, nullptr otherwise.
1422///
1424IMPELLER_NODISCARD ImpellerFragmentProgram IMPELLER_NULLABLE
1426 void* IMPELLER_NULLABLE data_release_user_data);
1427
1428//------------------------------------------------------------------------------
1429/// @brief Retain a strong reference to the object. The object can be NULL
1430/// in which case this method is a no-op.
1431///
1432/// @param[in] fragment_program The fragment program.
1433///
1436 ImpellerFragmentProgram IMPELLER_NULLABLE fragment_program);
1437
1438//------------------------------------------------------------------------------
1439/// @brief Release a previously retained reference to the object. The
1440/// object can be NULL in which case this method is a no-op.
1441///
1442/// @param[in] fragment_program The fragment program.
1443///
1446 ImpellerFragmentProgram IMPELLER_NULLABLE fragment_program);
1447
1448//------------------------------------------------------------------------------
1449// Color Sources
1450//------------------------------------------------------------------------------
1451
1452//------------------------------------------------------------------------------
1453/// @brief Retain a strong reference to the object. The object can be NULL
1454/// in which case this method is a no-op.
1455///
1456/// @param[in] color_source The color source.
1457///
1458
1461 ImpellerColorSource IMPELLER_NULLABLE color_source);
1462
1463//------------------------------------------------------------------------------
1464/// @brief Release a previously retained reference to the object. The
1465/// object can be NULL in which case this method is a no-op.
1466///
1467/// @param[in] color_source The color source.
1468///
1471 ImpellerColorSource IMPELLER_NULLABLE color_source);
1472
1473//------------------------------------------------------------------------------
1474/// @brief Create a color source that forms a linear gradient.
1475///
1476/// @param[in] start_point The start point.
1477/// @param[in] end_point The end point.
1478/// @param[in] stop_count The stop count.
1479/// @param[in] colors The colors.
1480/// @param[in] stops The stops.
1481/// @param[in] tile_mode The tile mode.
1482/// @param[in] transformation The transformation.
1483///
1484/// @return The color source.
1485///
1488 const ImpellerPoint* IMPELLER_NONNULL start_point,
1489 const ImpellerPoint* IMPELLER_NONNULL end_point,
1490 uint32_t stop_count,
1491 const ImpellerColor* IMPELLER_NONNULL colors,
1492 const float* IMPELLER_NONNULL stops,
1493 ImpellerTileMode tile_mode,
1494 const ImpellerMatrix* IMPELLER_NULLABLE transformation);
1495
1496//------------------------------------------------------------------------------
1497/// @brief Create a color source that forms a radial gradient.
1498///
1499/// @param[in] center The center.
1500/// @param[in] radius The radius.
1501/// @param[in] stop_count The stop count.
1502/// @param[in] colors The colors.
1503/// @param[in] stops The stops.
1504/// @param[in] tile_mode The tile mode.
1505/// @param[in] transformation The transformation.
1506///
1507/// @return The color source.
1508///
1511 const ImpellerPoint* IMPELLER_NONNULL center,
1512 float radius,
1513 uint32_t stop_count,
1514 const ImpellerColor* IMPELLER_NONNULL colors,
1515 const float* IMPELLER_NONNULL stops,
1516 ImpellerTileMode tile_mode,
1517 const ImpellerMatrix* IMPELLER_NULLABLE transformation);
1518
1519//------------------------------------------------------------------------------
1520/// @brief Create a color source that forms a conical gradient.
1521///
1522/// @param[in] start_center The start center.
1523/// @param[in] start_radius The start radius.
1524/// @param[in] end_center The end center.
1525/// @param[in] end_radius The end radius.
1526/// @param[in] stop_count The stop count.
1527/// @param[in] colors The colors.
1528/// @param[in] stops The stops.
1529/// @param[in] tile_mode The tile mode.
1530/// @param[in] transformation The transformation.
1531///
1532/// @return The color source.
1533///
1536 const ImpellerPoint* IMPELLER_NONNULL start_center,
1537 float start_radius,
1538 const ImpellerPoint* IMPELLER_NONNULL end_center,
1539 float end_radius,
1540 uint32_t stop_count,
1541 const ImpellerColor* IMPELLER_NONNULL colors,
1542 const float* IMPELLER_NONNULL stops,
1543 ImpellerTileMode tile_mode,
1544 const ImpellerMatrix* IMPELLER_NULLABLE transformation);
1545
1546//------------------------------------------------------------------------------
1547/// @brief Create a color source that forms a sweep gradient.
1548///
1549/// @param[in] center The center.
1550/// @param[in] start The start.
1551/// @param[in] end The end.
1552/// @param[in] stop_count The stop count.
1553/// @param[in] colors The colors.
1554/// @param[in] stops The stops.
1555/// @param[in] tile_mode The tile mode.
1556/// @param[in] transformation The transformation.
1557///
1558/// @return The color source.
1559///
1562 const ImpellerPoint* IMPELLER_NONNULL center,
1563 float start,
1564 float end,
1565 uint32_t stop_count,
1566 const ImpellerColor* IMPELLER_NONNULL colors,
1567 const float* IMPELLER_NONNULL stops,
1568 ImpellerTileMode tile_mode,
1569 const ImpellerMatrix* IMPELLER_NULLABLE transformation);
1570
1571//------------------------------------------------------------------------------
1572/// @brief Create a color source that samples from an image.
1573///
1574/// @param[in] image The image.
1575/// @param[in] horizontal_tile_mode The horizontal tile mode.
1576/// @param[in] vertical_tile_mode The vertical tile mode.
1577/// @param[in] sampling The sampling.
1578/// @param[in] transformation The transformation.
1579///
1580/// @return The color source.
1581///
1584 ImpellerTileMode horizontal_tile_mode,
1585 ImpellerTileMode vertical_tile_mode,
1586 ImpellerTextureSampling sampling,
1588 transformation);
1589
1590//------------------------------------------------------------------------------
1591/// @brief Create a color source whose pixels are shaded by a fragment
1592/// program.
1593///
1594/// @see https://docs.flutter.dev/ui/design/graphics/fragment-shaders
1595///
1596/// @param[in] context The context.
1597/// @param[in] fragment_program The fragment program.
1598/// @param samplers The samplers.
1599/// @param[in] samplers_count The samplers count.
1600/// @param[in] data The data (copied).
1601/// @param[in] data_bytes_length The data bytes length.
1602///
1603/// @return The color source.
1604///
1607 ImpellerContext IMPELLER_NONNULL context,
1608 ImpellerFragmentProgram IMPELLER_NONNULL fragment_program,
1609 IMPELLER_NONNULL ImpellerTexture* IMPELLER_NULLABLE samplers,
1610 size_t samplers_count,
1611 const uint8_t* IMPELLER_NULLABLE data,
1612 size_t data_bytes_length);
1613
1614//------------------------------------------------------------------------------
1615// Color Filters
1616//------------------------------------------------------------------------------
1617
1618//------------------------------------------------------------------------------
1619/// @brief Retain a strong reference to the object. The object can be NULL
1620/// in which case this method is a no-op.
1621///
1622/// @param[in] color_filter The color filter.
1623///
1626 ImpellerColorFilter IMPELLER_NULLABLE color_filter);
1627
1628//------------------------------------------------------------------------------
1629/// @brief Release a previously retained reference to the object. The
1630/// object can be NULL in which case this method is a no-op.
1631///
1632/// @param[in] color_filter The color filter.
1633///
1636 ImpellerColorFilter IMPELLER_NULLABLE color_filter);
1637
1638//------------------------------------------------------------------------------
1639/// @brief Create a color filter that performs blending of pixel values
1640/// independently.
1641///
1642/// @param[in] color The color.
1643/// @param[in] blend_mode The blend mode.
1644///
1645/// @return The color filter.
1646///
1649 ImpellerBlendMode blend_mode);
1650
1651//------------------------------------------------------------------------------
1652/// @brief Create a color filter that transforms pixel color values
1653/// independently.
1654///
1655/// @param[in] color_matrix The color matrix.
1656///
1657/// @return The color filter.
1658///
1661 const ImpellerColorMatrix* IMPELLER_NONNULL color_matrix);
1662
1663//------------------------------------------------------------------------------
1664// Mask Filters
1665//------------------------------------------------------------------------------
1666
1667//------------------------------------------------------------------------------
1668/// @brief Retain a strong reference to the object. The object can be NULL
1669/// in which case this method is a no-op.
1670///
1671/// @param[in] mask_filter The mask filter.
1672///
1674void ImpellerMaskFilterRetain(ImpellerMaskFilter IMPELLER_NULLABLE mask_filter);
1675
1676//------------------------------------------------------------------------------
1677/// @brief Release a previously retained reference to the object. The
1678/// object can be NULL in which case this method is a no-op.
1679///
1680/// @param[in] mask_filter The mask filter.
1681///
1684 ImpellerMaskFilter IMPELLER_NULLABLE mask_filter);
1685
1686//------------------------------------------------------------------------------
1687/// @brief Create a mask filter that blurs contents in the masked shape.
1688///
1689/// @param[in] style The style.
1690/// @param[in] sigma The sigma.
1691///
1692/// @return The mask filter.
1693///
1696
1697//------------------------------------------------------------------------------
1698// Image Filters
1699//------------------------------------------------------------------------------
1700
1701//------------------------------------------------------------------------------
1702/// @brief Retain a strong reference to the object. The object can be NULL
1703/// in which case this method is a no-op.
1704///
1705/// @param[in] image_filter The image filter.
1706///
1709 ImpellerImageFilter IMPELLER_NULLABLE image_filter);
1710
1711//------------------------------------------------------------------------------
1712/// @brief Release a previously retained reference to the object. The
1713/// object can be NULL in which case this method is a no-op.
1714///
1715/// @param[in] image_filter The image filter.
1716///
1719 ImpellerImageFilter IMPELLER_NULLABLE image_filter);
1720
1721//------------------------------------------------------------------------------
1722/// @brief Creates an image filter that applies a Gaussian blur.
1723///
1724/// The Gaussian blur applied may be an approximation for
1725/// performance.
1726///
1727///
1728/// @param[in] x_sigma The x sigma.
1729/// @param[in] y_sigma The y sigma.
1730/// @param[in] tile_mode The tile mode.
1731///
1732/// @return The image filter.
1733///
1736 float y_sigma,
1737 ImpellerTileMode tile_mode);
1738
1739//------------------------------------------------------------------------------
1740/// @brief Creates an image filter that enhances the per-channel pixel
1741/// values to the maximum value in a circle around the pixel.
1742///
1743/// @param[in] x_radius The x radius.
1744/// @param[in] y_radius The y radius.
1745///
1746/// @return The image filter.
1747///
1748
1750ImpellerImageFilterCreateDilateNew(float x_radius, float y_radius);
1751
1752//------------------------------------------------------------------------------
1753/// @brief Creates an image filter that dampens the per-channel pixel
1754/// values to the minimum value in a circle around the pixel.
1755///
1756/// @param[in] x_radius The x radius.
1757/// @param[in] y_radius The y radius.
1758///
1759/// @return The image filter.
1760///
1762ImpellerImageFilterCreateErodeNew(float x_radius, float y_radius);
1763
1764//------------------------------------------------------------------------------
1765/// @brief Creates an image filter that applies a transformation matrix to
1766/// the underlying image.
1767///
1768/// @param[in] matrix The transformation matrix.
1769/// @param[in] sampling The image sampling mode.
1770///
1771/// @return The image filter.
1772///
1775 matrix,
1776 ImpellerTextureSampling sampling);
1777
1778//------------------------------------------------------------------------------
1779/// @brief Create an image filter where each pixel is shaded by a fragment
1780/// program.
1781///
1782/// @see https://docs.flutter.dev/ui/design/graphics/fragment-shaders
1783///
1784/// @param[in] context The context.
1785/// @param[in] fragment_program The fragment program.
1786/// @param samplers The samplers.
1787/// @param[in] samplers_count The samplers count.
1788/// @param[in] data The data (copied).
1789/// @param[in] data_bytes_length The data bytes length.
1790///
1791/// @return The image filter.
1792///
1795 ImpellerContext IMPELLER_NONNULL context,
1796 ImpellerFragmentProgram IMPELLER_NONNULL fragment_program,
1797 IMPELLER_NONNULL ImpellerTexture* IMPELLER_NULLABLE samplers,
1798 size_t samplers_count,
1799 const uint8_t* IMPELLER_NULLABLE data,
1800 size_t data_bytes_length);
1801
1802//------------------------------------------------------------------------------
1803/// @brief Creates a composed filter that when applied is identical to
1804/// subsequently applying the inner and then the outer filters.
1805///
1806/// ```
1807/// destination = outer_filter(inner_filter(source))
1808/// ```
1809///
1810/// @param[in] outer The outer image filter.
1811/// @param[in] inner The inner image filter.
1812///
1813/// @return The combined image filter.
1814///
1817 ImpellerImageFilter IMPELLER_NONNULL inner);
1818
1819//------------------------------------------------------------------------------
1820// Display List
1821//------------------------------------------------------------------------------
1822
1823//------------------------------------------------------------------------------
1824/// @brief Retain a strong reference to the object. The object can be NULL
1825/// in which case this method is a no-op.
1826///
1827/// @param[in] display_list The display list.
1828///
1831 ImpellerDisplayList IMPELLER_NULLABLE display_list);
1832
1833//------------------------------------------------------------------------------
1834/// @brief Release a previously retained reference to the object. The
1835/// object can be NULL in which case this method is a no-op.
1836///
1837/// @param[in] display_list The display list.
1838///
1841 ImpellerDisplayList IMPELLER_NULLABLE display_list);
1842
1843//------------------------------------------------------------------------------
1844// Display List Builder
1845//------------------------------------------------------------------------------
1846
1847//------------------------------------------------------------------------------
1848/// @brief Create a new display list builder.
1849///
1850/// An optional cull rectangle may be specified. Impeller is allowed
1851/// to treat the contents outside this rectangle as being undefined.
1852/// This may aid performance optimizations.
1853///
1854/// @param[in] cull_rect The cull rectangle or NULL.
1855///
1856/// @return The display list builder.
1857///
1858IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerDisplayListBuilder IMPELLER_NULLABLE
1860
1861//------------------------------------------------------------------------------
1862/// @brief Retain a strong reference to the object. The object can be NULL
1863/// in which case this method is a no-op.
1864///
1865/// @param[in] builder The display list builder.
1866///
1869 ImpellerDisplayListBuilder IMPELLER_NULLABLE builder);
1870
1871//------------------------------------------------------------------------------
1872/// @brief Release a previously retained reference to the object. The
1873/// object can be NULL in which case this method is a no-op.
1874///
1875/// @param[in] builder The display list builder.
1876///
1879 ImpellerDisplayListBuilder IMPELLER_NULLABLE builder);
1880
1881//------------------------------------------------------------------------------
1882/// @brief Create a new display list using the rendering intent already
1883/// encoded in the builder. The builder is reset after this call.
1884///
1885/// @param[in] builder The builder.
1886///
1887/// @return The display list.
1888///
1891 ImpellerDisplayListBuilder IMPELLER_NONNULL builder);
1892
1893//------------------------------------------------------------------------------
1894// Display List Builder: Managing the transformation stack.
1895//------------------------------------------------------------------------------
1896
1897//------------------------------------------------------------------------------
1898/// @brief Stashes the current transformation and clip state onto a save
1899/// stack.
1900///
1901/// @param[in] builder The builder.
1902///
1905 ImpellerDisplayListBuilder IMPELLER_NONNULL builder);
1906
1907//------------------------------------------------------------------------------
1908/// @brief Stashes the current transformation and clip state onto a save
1909/// stack and creates and creates an offscreen layer onto which
1910/// subsequent rendering intent will be directed to.
1911///
1912/// On the balancing call to restore, the supplied paints filters
1913/// and blend modes will be used to composite the offscreen contents
1914/// back onto the display display list.
1915///
1916/// @param[in] builder The builder.
1917/// @param[in] bounds The bounds.
1918/// @param[in] paint The paint.
1919/// @param[in] backdrop The backdrop.
1920///
1923 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1924 const ImpellerRect* IMPELLER_NONNULL bounds,
1925 ImpellerPaint IMPELLER_NULLABLE paint,
1926 ImpellerImageFilter IMPELLER_NULLABLE backdrop);
1927
1928//------------------------------------------------------------------------------
1929/// @brief Pops the last entry pushed onto the save stack using a call to
1930/// `ImpellerDisplayListBuilderSave` or
1931/// `ImpellerDisplayListBuilderSaveLayer`.
1932///
1933/// @param[in] builder The builder.
1934///
1937 ImpellerDisplayListBuilder IMPELLER_NONNULL builder);
1938
1939//------------------------------------------------------------------------------
1940/// @brief Apply a scale to the transformation matrix currently on top of
1941/// the save stack.
1942///
1943/// @param[in] builder The builder.
1944/// @param[in] x_scale The x scale.
1945/// @param[in] y_scale The y scale.
1946///
1948void ImpellerDisplayListBuilderScale(ImpellerDisplayListBuilder IMPELLER_NONNULL
1949 builder,
1950 float x_scale,
1951 float y_scale);
1952
1953//------------------------------------------------------------------------------
1954/// @brief Apply a clockwise rotation to the transformation matrix
1955/// currently on top of the save stack.
1956///
1957/// @param[in] builder The builder.
1958/// @param[in] angle_degrees The angle in degrees.
1959///
1960
1963 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1964 float angle_degrees);
1965
1966//------------------------------------------------------------------------------
1967/// @brief Apply a translation to the transformation matrix currently on
1968/// top of the save stack.
1969///
1970/// @param[in] builder The builder.
1971/// @param[in] x_translation The x translation.
1972/// @param[in] y_translation The y translation.
1973///
1976 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1977 float x_translation,
1978 float y_translation);
1979
1980//------------------------------------------------------------------------------
1981/// @brief Appends the the provided transformation to the transformation
1982/// already on the save stack.
1983///
1984/// @param[in] builder The builder.
1985/// @param[in] transform The transform to append.
1986///
1989 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
1991
1992//------------------------------------------------------------------------------
1993/// @brief Clear the transformation on top of the save stack and replace it
1994/// with a new value.
1995///
1996/// @param[in] builder The builder.
1997/// @param[in] transform The new transform.
1998///
2001 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2003
2004//------------------------------------------------------------------------------
2005/// @brief Get the transformation currently built up on the top of the
2006/// transformation stack.
2007///
2008/// @param[in] builder The builder.
2009/// @param[out] out_transform The transform.
2010///
2013 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2014 ImpellerMatrix* IMPELLER_NONNULL out_transform);
2015
2016//------------------------------------------------------------------------------
2017/// @brief Reset the transformation on top of the transformation stack to
2018/// identity.
2019///
2020/// @param[in] builder The builder.
2021///
2024 ImpellerDisplayListBuilder IMPELLER_NONNULL builder);
2025
2026//------------------------------------------------------------------------------
2027/// @brief Get the current size of the save stack.
2028///
2029/// @param[in] builder The builder.
2030///
2031/// @return The save stack size.
2032///
2035 ImpellerDisplayListBuilder IMPELLER_NONNULL builder);
2036
2037//------------------------------------------------------------------------------
2038/// @brief Effectively calls ImpellerDisplayListBuilderRestore till the
2039/// size of the save stack becomes a specified count.
2040///
2041/// @param[in] builder The builder.
2042/// @param[in] count The count.
2043///
2046 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2047 uint32_t count);
2048
2049//------------------------------------------------------------------------------
2050// Display List Builder: Clipping
2051//------------------------------------------------------------------------------
2052
2053//------------------------------------------------------------------------------
2054/// @brief Reduces the clip region to the intersection of the current clip
2055/// and the given rectangle taking into account the clip operation.
2056///
2057/// @param[in] builder The builder.
2058/// @param[in] rect The rectangle.
2059/// @param[in] op The operation.
2060///
2063 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2064 const ImpellerRect* IMPELLER_NONNULL rect,
2066
2067//------------------------------------------------------------------------------
2068/// @brief Reduces the clip region to the intersection of the current clip
2069/// and the given oval taking into account the clip operation.
2070///
2071/// @param[in] builder The builder.
2072/// @param[in] oval_bounds The oval bounds.
2073/// @param[in] op The operation.
2074///
2077 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2078 const ImpellerRect* IMPELLER_NONNULL oval_bounds,
2080
2081//------------------------------------------------------------------------------
2082/// @brief Reduces the clip region to the intersection of the current clip
2083/// and the given rounded rectangle taking into account the clip
2084/// operation.
2085///
2086/// @param[in] builder The builder.
2087/// @param[in] rect The rectangle.
2088/// @param[in] radii The radii.
2089/// @param[in] op The operation.
2090///
2093 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2094 const ImpellerRect* IMPELLER_NONNULL rect,
2097
2098//------------------------------------------------------------------------------
2099/// @brief Reduces the clip region to the intersection of the current clip
2100/// and the given path taking into account the clip operation.
2101///
2102/// @param[in] builder The builder.
2103/// @param[in] path The path.
2104/// @param[in] op The operation.
2105///
2108 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2109 ImpellerPath IMPELLER_NONNULL path,
2111
2112//------------------------------------------------------------------------------
2113// Display List Builder: Drawing Shapes
2114//------------------------------------------------------------------------------
2115
2116//------------------------------------------------------------------------------
2117/// @brief Fills the current clip with the specified paint.
2118///
2119/// @param[in] builder The builder.
2120/// @param[in] paint The paint.
2121///
2124 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2125 ImpellerPaint IMPELLER_NONNULL paint);
2126
2127//------------------------------------------------------------------------------
2128/// @brief Draws a line segment.
2129///
2130/// @param[in] builder The builder.
2131/// @param[in] from The starting point of the line.
2132/// @param[in] to The end point of the line.
2133/// @param[in] paint The paint.
2134///
2137 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2138 const ImpellerPoint* IMPELLER_NONNULL from,
2140 ImpellerPaint IMPELLER_NONNULL paint);
2141
2142//------------------------------------------------------------------------------
2143/// @brief Draws a dash line segment.
2144///
2145/// @param[in] builder The builder.
2146/// @param[in] from The starting point of the line.
2147/// @param[in] to The end point of the line.
2148/// @param[in] on_length On length.
2149/// @param[in] off_length Off length.
2150/// @param[in] paint The paint.
2151///
2154 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2155 const ImpellerPoint* IMPELLER_NONNULL from,
2157 float on_length,
2158 float off_length,
2159 ImpellerPaint IMPELLER_NONNULL paint);
2160
2161//------------------------------------------------------------------------------
2162/// @brief Draws a rectangle.
2163///
2164/// @param[in] builder The builder.
2165/// @param[in] rect The rectangle.
2166/// @param[in] paint The paint.
2167///
2170 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2171 const ImpellerRect* IMPELLER_NONNULL rect,
2172 ImpellerPaint IMPELLER_NONNULL paint);
2173
2174//------------------------------------------------------------------------------
2175/// @brief Draws an oval.
2176///
2177/// @param[in] builder The builder.
2178/// @param[in] oval_bounds The oval bounds.
2179/// @param[in] paint The paint.
2180///
2183 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2184 const ImpellerRect* IMPELLER_NONNULL oval_bounds,
2185 ImpellerPaint IMPELLER_NONNULL paint);
2186
2187//------------------------------------------------------------------------------
2188/// @brief Draws a rounded rect.
2189///
2190/// @param[in] builder The builder.
2191/// @param[in] rect The rectangle.
2192/// @param[in] radii The radii.
2193/// @param[in] paint The paint.
2194///
2197 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2198 const ImpellerRect* IMPELLER_NONNULL rect,
2200 ImpellerPaint IMPELLER_NONNULL paint);
2201
2202//------------------------------------------------------------------------------
2203/// @brief Draws a shape that is the different between the specified
2204/// rectangles (each with configurable corner radii).
2205///
2206/// @param[in] builder The builder.
2207/// @param[in] outer_rect The outer rectangle.
2208/// @param[in] outer_radii The outer radii.
2209/// @param[in] inner_rect The inner rectangle.
2210/// @param[in] inner_radii The inner radii.
2211/// @param[in] paint The paint.
2212///
2215 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2216 const ImpellerRect* IMPELLER_NONNULL outer_rect,
2217 const ImpellerRoundingRadii* IMPELLER_NONNULL outer_radii,
2218 const ImpellerRect* IMPELLER_NONNULL inner_rect,
2219 const ImpellerRoundingRadii* IMPELLER_NONNULL inner_radii,
2220 ImpellerPaint IMPELLER_NONNULL paint);
2221
2222//------------------------------------------------------------------------------
2223/// @brief Draws the specified shape.
2224///
2225/// @param[in] builder The builder.
2226/// @param[in] path The path.
2227/// @param[in] paint The paint.
2228///
2231 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2232 ImpellerPath IMPELLER_NONNULL path,
2233 ImpellerPaint IMPELLER_NONNULL paint);
2234
2235//------------------------------------------------------------------------------
2236/// @brief Flattens the contents of another display list into the one
2237/// currently being built.
2238///
2239/// @param[in] builder The builder.
2240/// @param[in] display_list The display list.
2241/// @param[in] opacity The opacity.
2242///
2245 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2246 ImpellerDisplayList IMPELLER_NONNULL display_list,
2247 float opacity);
2248
2249//------------------------------------------------------------------------------
2250/// @brief Draw a paragraph at the specified point.
2251///
2252/// @param[in] builder The builder.
2253/// @param[in] paragraph The paragraph.
2254/// @param[in] point The point.
2255///
2258 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2259 ImpellerParagraph IMPELLER_NONNULL paragraph,
2260 const ImpellerPoint* IMPELLER_NONNULL point);
2261
2262//------------------------------------------------------------------------------
2263/// @brief Draw a shadow for a Path given a material elevation. If the
2264/// occluding object is not opaque, additional hints (via the
2265/// `occluder_is_transparent` argument) must be provided to render
2266/// the shadow correctly.
2267///
2268/// @param[in] builder The builder.
2269/// @param[in] path The shadow path.
2270/// @param[in] color The shadow color.
2271/// @param[in] elevation The material elevation.
2272/// @param[in] occluder_is_transparent
2273/// If the object casting the shadow is transparent.
2274/// @param[in] device_pixel_ratio
2275/// The device pixel ratio.
2276///
2279 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2280 ImpellerPath IMPELLER_NONNULL path,
2281 const ImpellerColor* IMPELLER_NONNULL color,
2282 float elevation,
2283 bool occluder_is_transparent,
2284 float device_pixel_ratio);
2285
2286//------------------------------------------------------------------------------
2287// Display List Builder: Drawing Textures
2288//------------------------------------------------------------------------------
2289
2290//------------------------------------------------------------------------------
2291/// @brief Draw a texture at the specified point.
2292///
2293/// @param[in] builder The builder.
2294/// @param[in] texture The texture.
2295/// @param[in] point The point.
2296/// @param[in] sampling The sampling.
2297/// @param[in] paint The paint.
2298///
2301 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2302 ImpellerTexture IMPELLER_NONNULL texture,
2303 const ImpellerPoint* IMPELLER_NONNULL point,
2304 ImpellerTextureSampling sampling,
2305 ImpellerPaint IMPELLER_NULLABLE paint);
2306
2307//------------------------------------------------------------------------------
2308/// @brief Draw a portion of texture at the specified location.
2309///
2310/// @param[in] builder The builder.
2311/// @param[in] texture The texture.
2312/// @param[in] src_rect The source rectangle.
2313/// @param[in] dst_rect The destination rectangle.
2314/// @param[in] sampling The sampling.
2315/// @param[in] paint The paint.
2316///
2319 ImpellerDisplayListBuilder IMPELLER_NONNULL builder,
2320 ImpellerTexture IMPELLER_NONNULL texture,
2321 const ImpellerRect* IMPELLER_NONNULL src_rect,
2322 const ImpellerRect* IMPELLER_NONNULL dst_rect,
2323 ImpellerTextureSampling sampling,
2324 ImpellerPaint IMPELLER_NULLABLE paint);
2325
2326//------------------------------------------------------------------------------
2327// Typography Context
2328//------------------------------------------------------------------------------
2329
2330//------------------------------------------------------------------------------
2331/// @brief Create a new typography contents.
2332///
2333/// @return The typography context.
2334///
2337
2338//------------------------------------------------------------------------------
2339/// @brief Retain a strong reference to the object. The object can be NULL
2340/// in which case this method is a no-op.
2341///
2342/// @param[in] context The typography context.
2343///
2346 ImpellerTypographyContext IMPELLER_NULLABLE context);
2347
2348//------------------------------------------------------------------------------
2349/// @brief Release a previously retained reference to the object. The
2350/// object can be NULL in which case this method is a no-op.
2351///
2352/// @param[in] context The typography context.
2353///
2356 ImpellerTypographyContext IMPELLER_NULLABLE context);
2357
2358//------------------------------------------------------------------------------
2359/// @brief Register a custom font.
2360///
2361/// The following font formats are supported:
2362/// * OpenType font collections (.ttc extension)
2363/// * TrueType fonts: (.ttf extension)
2364/// * OpenType fonts: (.otf extension)
2365///
2366/// @warning Web Open Font Formats (.woff and .woff2 extensions) are **not**
2367/// supported.
2368///
2369/// The font data is specified as a mapping. It is possible for the
2370/// release callback of the mapping to not be called even past the
2371/// destruction of the typography context. Care must be taken to not
2372/// collect the mapping till the release callback is invoked by
2373/// Impeller.
2374///
2375/// The family alias name can be NULL. In such cases, the font
2376/// family specified in paragraph styles must match the family that
2377/// is specified in the font data.
2378///
2379/// If the family name alias is not NULL, that family name must be
2380/// used in the paragraph style to reference glyphs from this font
2381/// instead of the one encoded in the font itself.
2382///
2383/// Multiple fonts (with glyphs for different styles) can be
2384/// specified with the same family.
2385///
2386/// @see `ImpellerParagraphStyleSetFontFamily`
2387///
2388/// @param[in] context The context.
2389/// @param[in] contents The contents.
2390/// @param[in] contents_on_release_user_data The user data baton to be passed
2391/// to the contents release callback.
2392/// @param[in] family_name_alias The family name alias or NULL if
2393/// the one specified in the font
2394/// data is to be used.
2395///
2396/// @return If the font could be successfully registered.
2397///
2400 ImpellerTypographyContext IMPELLER_NONNULL context,
2401 const ImpellerMapping* IMPELLER_NONNULL contents,
2402 void* IMPELLER_NULLABLE contents_on_release_user_data,
2403 const char* IMPELLER_NULLABLE family_name_alias);
2404
2405//------------------------------------------------------------------------------
2406// Paragraph Style
2407//------------------------------------------------------------------------------
2408
2409//------------------------------------------------------------------------------
2410/// @brief Create a new paragraph style.
2411///
2412/// @return The paragraph style.
2413///
2416
2417//------------------------------------------------------------------------------
2418/// @brief Retain a strong reference to the object. The object can be NULL
2419/// in which case this method is a no-op.
2420///
2421/// @param[in] paragraph_style The paragraph style.
2422///
2425 ImpellerParagraphStyle IMPELLER_NULLABLE paragraph_style);
2426
2427//------------------------------------------------------------------------------
2428/// @brief Release a previously retained reference to the object. The
2429/// object can be NULL in which case this method is a no-op.
2430///
2431/// @param[in] paragraph_style The paragraph style.
2432///
2435 ImpellerParagraphStyle IMPELLER_NULLABLE paragraph_style);
2436
2437//------------------------------------------------------------------------------
2438/// @brief Set the paint used to render the text glyph contents.
2439///
2440/// @param[in] paragraph_style The paragraph style.
2441/// @param[in] paint The paint.
2442///
2444void ImpellerParagraphStyleSetForeground(ImpellerParagraphStyle IMPELLER_NONNULL
2445 paragraph_style,
2446 ImpellerPaint IMPELLER_NONNULL paint);
2447
2448//------------------------------------------------------------------------------
2449/// @brief Set the paint used to render the background of the text glyphs.
2450///
2451/// @param[in] paragraph_style The paragraph style.
2452/// @param[in] paint The paint.
2453///
2455void ImpellerParagraphStyleSetBackground(ImpellerParagraphStyle IMPELLER_NONNULL
2456 paragraph_style,
2457 ImpellerPaint IMPELLER_NONNULL paint);
2458
2459//------------------------------------------------------------------------------
2460/// @brief Set the weight of the font to select when rendering glyphs.
2461///
2462/// @param[in] paragraph_style The paragraph style.
2463/// @param[in] weight The weight.
2464///
2466void ImpellerParagraphStyleSetFontWeight(ImpellerParagraphStyle IMPELLER_NONNULL
2467 paragraph_style,
2468 ImpellerFontWeight weight);
2469
2470//------------------------------------------------------------------------------
2471/// @brief Set whether the glyphs should be bolded or italicized.
2472///
2473/// @param[in] paragraph_style The paragraph style.
2474/// @param[in] style The style.
2475///
2477void ImpellerParagraphStyleSetFontStyle(ImpellerParagraphStyle IMPELLER_NONNULL
2478 paragraph_style,
2479 ImpellerFontStyle style);
2480
2481//------------------------------------------------------------------------------
2482/// @brief Set the font family.
2483///
2484/// @param[in] paragraph_style The paragraph style.
2485/// @param[in] family_name The family name.
2486///
2489 ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2490 const char* IMPELLER_NONNULL family_name);
2491
2492//------------------------------------------------------------------------------
2493/// @brief Set the font size.
2494///
2495/// @param[in] paragraph_style The paragraph style.
2496/// @param[in] size The size.
2497///
2499void ImpellerParagraphStyleSetFontSize(ImpellerParagraphStyle IMPELLER_NONNULL
2500 paragraph_style,
2501 float size);
2502
2503//------------------------------------------------------------------------------
2504/// @brief The height of the text as a multiple of text size.
2505///
2506/// When height is 0.0, the line height will be determined by the
2507/// font's metrics directly, which may differ from the font size.
2508/// Otherwise the line height of the text will be a multiple of font
2509/// size, and be exactly fontSize * height logical pixels tall.
2510///
2511/// @param[in] paragraph_style The paragraph style.
2512/// @param[in] height The height.
2513///
2515void ImpellerParagraphStyleSetHeight(ImpellerParagraphStyle IMPELLER_NONNULL
2516 paragraph_style,
2517 float height);
2518
2519//------------------------------------------------------------------------------
2520/// @brief Set the alignment of text within the paragraph.
2521///
2522/// @param[in] paragraph_style The paragraph style.
2523/// @param[in] align The align.
2524///
2527 ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2528 ImpellerTextAlignment align);
2529
2530//------------------------------------------------------------------------------
2531/// @brief Set the directionality of the text within the paragraph.
2532///
2533/// @param[in] paragraph_style The paragraph style.
2534/// @param[in] direction The direction.
2535///
2538 ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2539 ImpellerTextDirection direction);
2540
2541//------------------------------------------------------------------------------
2542/// @brief Set one of more text decorations on the paragraph. Decorations
2543/// can be underlines, overlines, strikethroughs, etc.. The style of
2544/// decorations can be set as well (dashed, dotted, wavy, etc..)
2545///
2546/// @param[in] ImpellerParagraphStyle The paragraph style.
2547/// @param[in] decoration The text decoration.
2548///
2551 ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style,
2552 const ImpellerTextDecoration* IMPELLER_NONNULL decoration);
2553
2554//------------------------------------------------------------------------------
2555/// @brief Set the maximum line count within the paragraph.
2556///
2557/// @param[in] paragraph_style The paragraph style.
2558/// @param[in] max_lines The maximum lines.
2559///
2561void ImpellerParagraphStyleSetMaxLines(ImpellerParagraphStyle IMPELLER_NONNULL
2562 paragraph_style,
2563 uint32_t max_lines);
2564
2565//------------------------------------------------------------------------------
2566/// @brief Set the paragraph locale.
2567///
2568/// @param[in] paragraph_style The paragraph style.
2569/// @param[in] locale The locale.
2570///
2572void ImpellerParagraphStyleSetLocale(ImpellerParagraphStyle IMPELLER_NONNULL
2573 paragraph_style,
2574 const char* IMPELLER_NONNULL locale);
2575
2576//------------------------------------------------------------------------------
2577/// @brief Set the UTF-8 string to use as the ellipsis. Pass `nullptr` to
2578/// clear the setting to default.
2579///
2580/// @param[in] paragraph_style The paragraph style.
2581/// @param[in] data The ellipsis string UTF-8 data, or null.
2582///
2584void ImpellerParagraphStyleSetEllipsis(ImpellerParagraphStyle IMPELLER_NONNULL
2585 paragraph_style,
2586 const char* IMPELLER_NULLABLE ellipsis);
2587
2588//------------------------------------------------------------------------------
2589// Paragraph Builder
2590//------------------------------------------------------------------------------
2591
2592//------------------------------------------------------------------------------
2593/// @brief Create a new paragraph builder.
2594///
2595/// @param[in] context The context.
2596///
2597/// @return The paragraph builder.
2598///
2600ImpellerParagraphBuilderNew(ImpellerTypographyContext IMPELLER_NONNULL context);
2601
2602//------------------------------------------------------------------------------
2603/// @brief Retain a strong reference to the object. The object can be NULL
2604/// in which case this method is a no-op.
2605///
2606/// @param[in] paragraph_builder The paragraph builder.
2607///
2610 ImpellerParagraphBuilder IMPELLER_NULLABLE paragraph_builder);
2611
2612//------------------------------------------------------------------------------
2613/// @brief Release a previously retained reference to the object. The
2614/// object can be NULL in which case this method is a no-op.
2615///
2616/// @param[in] paragraph_builder The paragraph_builder.
2617///
2620 ImpellerParagraphBuilder IMPELLER_NULLABLE paragraph_builder);
2621
2622//------------------------------------------------------------------------------
2623/// @brief Push a new paragraph style onto the paragraph style stack
2624/// managed by the paragraph builder.
2625///
2626/// Not all paragraph styles can be combined. For instance, it does
2627/// not make sense to mix text alignment for different text runs
2628/// within a paragraph. In such cases, the preference of the the
2629/// first paragraph style on the style stack will take hold.
2630///
2631/// If text is pushed onto the paragraph builder without a style
2632/// previously pushed onto the stack, a default paragraph text style
2633/// will be used. This may not always be desirable because some
2634/// style element cannot be overridden. It is recommended that a
2635/// default paragraph style always be pushed onto the stack before
2636/// the addition of any text.
2637///
2638/// @param[in] paragraph_builder The paragraph builder.
2639/// @param[in] style The style.
2640///
2643 ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder,
2644 ImpellerParagraphStyle IMPELLER_NONNULL style);
2645
2646//------------------------------------------------------------------------------
2647/// @brief Pop a previously pushed paragraph style from the paragraph style
2648/// stack.
2649///
2650/// @param[in] paragraph_builder The paragraph builder.
2651///
2654 ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder);
2655
2656//------------------------------------------------------------------------------
2657/// @brief Add UTF-8 encoded text to the paragraph. The text will be styled
2658/// according to the paragraph style already on top of the paragraph
2659/// style stack.
2660///
2661/// @param[in] paragraph_builder The paragraph builder.
2662/// @param[in] data The data.
2663/// @param[in] length The length.
2664///
2666void ImpellerParagraphBuilderAddText(ImpellerParagraphBuilder IMPELLER_NONNULL
2667 paragraph_builder,
2668 const uint8_t* IMPELLER_NULLABLE data,
2669 uint32_t length);
2670
2671//------------------------------------------------------------------------------
2672/// @brief Layout and build a new paragraph using the specified width. The
2673/// resulting paragraph is immutable. The paragraph builder must be
2674/// discarded and a new one created to build more paragraphs.
2675///
2676/// @param[in] paragraph_builder The paragraph builder.
2677/// @param[in] width The paragraph width.
2678///
2679/// @return The paragraph if one can be created, NULL otherwise.
2680///
2683 ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder,
2684 float width);
2685
2686//------------------------------------------------------------------------------
2687// Paragraph
2688//------------------------------------------------------------------------------
2689
2690//------------------------------------------------------------------------------
2691/// @brief Retain a strong reference to the object. The object can be NULL
2692/// in which case this method is a no-op.
2693///
2694/// @param[in] paragraph The paragraph.
2695///
2697void ImpellerParagraphRetain(ImpellerParagraph IMPELLER_NULLABLE paragraph);
2698
2699//------------------------------------------------------------------------------
2700/// @brief Release a previously retained reference to the object. The
2701/// object can be NULL in which case this method is a no-op.
2702///
2703/// @param[in] paragraph The paragraph.
2704///
2706void ImpellerParagraphRelease(ImpellerParagraph IMPELLER_NULLABLE paragraph);
2707
2708//------------------------------------------------------------------------------
2709/// @see `ImpellerParagraphGetMinIntrinsicWidth`
2710///
2711/// @param[in] paragraph The paragraph.
2712///
2713///
2714/// @return The width provided to the paragraph builder during the call to
2715/// layout. This is the maximum width any line in the laid out
2716/// paragraph can occupy. But, it is not necessarily the actual
2717/// width of the paragraph after layout.
2718///
2721 ImpellerParagraph IMPELLER_NONNULL paragraph);
2722
2723//------------------------------------------------------------------------------
2724/// @param[in] paragraph The paragraph.
2725///
2726/// @return The height of the laid out paragraph. This is **not** a tight
2727/// bounding box and some glyphs may not reach the minimum location
2728/// they are allowed to reach.
2729///
2731float ImpellerParagraphGetHeight(ImpellerParagraph IMPELLER_NONNULL paragraph);
2732
2733//------------------------------------------------------------------------------
2734/// @param[in] paragraph The paragraph.
2735///
2736/// @return The length of the longest line in the paragraph. This is the
2737/// horizontal distance between the left edge of the leftmost glyph
2738/// and the right edge of the rightmost glyph, in the longest line
2739/// in the paragraph.
2740///
2743 ImpellerParagraph IMPELLER_NONNULL paragraph);
2744
2745//------------------------------------------------------------------------------
2746/// @see `ImpellerParagraphGetMaxWidth`
2747///
2748/// @param[in] paragraph The paragraph.
2749///
2750/// @return The actual width of the longest line in the paragraph after
2751/// layout. This is expected to be less than or equal to
2752/// `ImpellerParagraphGetMaxWidth`.
2753///
2756 ImpellerParagraph IMPELLER_NONNULL paragraph);
2757
2758//------------------------------------------------------------------------------
2759/// @param[in] paragraph The paragraph.
2760///
2761/// @return The width of the paragraph without line breaking.
2762///
2765 ImpellerParagraph IMPELLER_NONNULL paragraph);
2766
2767//------------------------------------------------------------------------------
2768/// @param[in] paragraph The paragraph.
2769///
2770/// @return The distance from the top of the paragraph to the ideographic
2771/// baseline of the first line when using ideographic fonts
2772/// (Japanese, Korean, etc...).
2773///
2776 ImpellerParagraph IMPELLER_NONNULL paragraph);
2777
2778//------------------------------------------------------------------------------
2779/// @param[in] paragraph The paragraph.
2780///
2781/// @return The distance from the top of the paragraph to the alphabetic
2782/// baseline of the first line when using alphabetic fonts (A-Z,
2783/// a-z, Greek, etc...).
2784///
2787 ImpellerParagraph IMPELLER_NONNULL paragraph);
2788
2789//------------------------------------------------------------------------------
2790/// @param[in] paragraph The paragraph.
2791///
2792/// @return The number of lines visible in the paragraph after line
2793/// breaking.
2794///
2797 ImpellerParagraph IMPELLER_NONNULL paragraph);
2798
2799//------------------------------------------------------------------------------
2800/// @brief Get the range into the UTF-16 code unit buffer that represents
2801/// the word at the specified caret location in the same buffer.
2802///
2803/// Word boundaries are defined more precisely in [Unicode Standard
2804/// Annex #29](http://www.unicode.org/reports/tr29/#Word_Boundaries)
2805///
2806/// @param[in] paragraph The paragraph
2807/// @param[in] code_unit_index The code unit index
2808/// @param[out] code_unit_index The range.
2809///
2812 ImpellerParagraph IMPELLER_NONNULL paragraph,
2813 size_t code_unit_index,
2814 ImpellerRange* IMPELLER_NONNULL out_range);
2815
2816//------------------------------------------------------------------------------
2817/// @brief Get the line metrics of this laid out paragraph. Calculating the
2818/// line metrics is expensive. The first time line metrics are
2819/// requested, they will be cached along with the paragraph (which
2820/// is immutable).
2821///
2822/// @param[in] paragraph The paragraph.
2823///
2824/// @return The line metrics.
2825///
2827ImpellerLineMetrics IMPELLER_NULLABLE
2828ImpellerParagraphGetLineMetrics(ImpellerParagraph IMPELLER_NONNULL paragraph);
2829
2830//------------------------------------------------------------------------------
2831/// @brief Create a new instance of glyph info that can be queried for
2832/// information about the glyph at the given UTF-16 code unit index.
2833/// The instance must be freed using `ImpellerGlyphInfoRelease`.
2834///
2835/// @param[in] paragraph The paragraph.
2836/// @param[in] code_unit_index The UTF-16 code unit index.
2837///
2838/// @return The glyph information.
2839///
2841IMPELLER_NODISCARD ImpellerGlyphInfo IMPELLER_NULLABLE
2843 ImpellerParagraph IMPELLER_NONNULL paragraph,
2844 size_t code_unit_index);
2845
2846//------------------------------------------------------------------------------
2847/// @brief Create a new instance of glyph info that can be queried for
2848/// information about the glyph closest to the specified coordinates
2849/// relative to the origin of the paragraph. The instance must be
2850/// freed using `ImpellerGlyphInfoRelease`.
2851///
2852/// @param[in] paragraph The paragraph.
2853/// @param[in] x The x coordinate relative to paragraph origin.
2854/// @param[in] y The x coordinate relative to paragraph origin.
2855///
2856/// @return The glyph information.
2857///
2859IMPELLER_NODISCARD ImpellerGlyphInfo IMPELLER_NULLABLE
2861 ImpellerParagraph IMPELLER_NONNULL paragraph,
2862 double x,
2863 double y);
2864
2865//------------------------------------------------------------------------------
2866// Line Metrics
2867//------------------------------------------------------------------------------
2868
2869//------------------------------------------------------------------------------
2870/// @brief Retain a strong reference to the object. The object can be NULL
2871/// in which case this method is a no-op.
2872///
2873/// @param[in] line_metrics The line metrics.
2874///
2877 ImpellerLineMetrics IMPELLER_NULLABLE line_metrics);
2878
2879//------------------------------------------------------------------------------
2880/// @brief Release a previously retained reference to the object. The
2881/// object can be NULL in which case this method is a no-op.
2882///
2883/// @param[in] line_metrics The line metrics.
2884///
2887 ImpellerLineMetrics IMPELLER_NULLABLE line_metrics);
2888
2889//------------------------------------------------------------------------------
2890/// @brief The rise from the baseline as calculated from the font and style
2891/// for this line ignoring the height from the text style.
2892///
2893/// @param[in] metrics The metrics.
2894/// @param[in] line The line index (zero based).
2895///
2896/// @return The unscaled ascent.
2897///
2900 metrics,
2901 size_t line);
2902
2903//------------------------------------------------------------------------------
2904/// @brief The rise from the baseline as calculated from the font and style
2905/// for this line.
2906///
2907/// @param[in] metrics The metrics.
2908/// @param[in] line The line index (zero based).
2909///
2910/// @return The ascent.
2911///
2913double ImpellerLineMetricsGetAscent(ImpellerLineMetrics IMPELLER_NONNULL
2914 metrics,
2915 size_t line);
2916
2917//------------------------------------------------------------------------------
2918/// @brief The drop from the baseline as calculated from the font and style
2919/// for this line.
2920///
2921/// @param[in] metrics The metrics.
2922/// @param[in] line The line index (zero based).
2923///
2924/// @return The descent.
2925///
2927double ImpellerLineMetricsGetDescent(ImpellerLineMetrics IMPELLER_NONNULL
2928 metrics,
2929 size_t line);
2930
2931//------------------------------------------------------------------------------
2932/// @brief The y coordinate of the baseline for this line from the top of
2933/// the paragraph.
2934///
2935/// @param[in] metrics The metrics.
2936/// @param[in] line The line index (zero based).
2937///
2938/// @return The baseline.
2939///
2941double ImpellerLineMetricsGetBaseline(ImpellerLineMetrics IMPELLER_NONNULL
2942 metrics,
2943 size_t line);
2944
2945//------------------------------------------------------------------------------
2946/// @brief Used to determine if this line ends with an explicit line break
2947/// (e.g. '\n') or is the end of the paragraph.
2948///
2949/// @param[in] metrics The metrics.
2950/// @param[in] line The line index (zero based).
2951///
2952/// @return True if the line is a hard break.
2953///
2955bool ImpellerLineMetricsIsHardbreak(ImpellerLineMetrics IMPELLER_NONNULL
2956 metrics,
2957 size_t line);
2958
2959//------------------------------------------------------------------------------
2960/// @brief Width of the line from the left edge of the leftmost glyph to
2961/// the right edge of the rightmost glyph.
2962///
2963/// @param[in] metrics The metrics.
2964/// @param[in] line The line index (zero based).
2965///
2966/// @return The width.
2967///
2969double ImpellerLineMetricsGetWidth(ImpellerLineMetrics IMPELLER_NONNULL metrics,
2970 size_t line);
2971
2972//------------------------------------------------------------------------------
2973/// @brief Total height of the line from the top edge to the bottom edge.
2974///
2975/// @param[in] metrics The metrics.
2976/// @param[in] line The line index (zero based).
2977///
2978/// @return The height.
2979///
2981double ImpellerLineMetricsGetHeight(ImpellerLineMetrics IMPELLER_NONNULL
2982 metrics,
2983 size_t line);
2984
2985//------------------------------------------------------------------------------
2986/// @brief The x coordinate of left edge of the line.
2987///
2988/// @param[in] metrics The metrics.
2989/// @param[in] line The line index (zero based).
2990///
2991/// @return The left edge coordinate.
2992///
2994double ImpellerLineMetricsGetLeft(ImpellerLineMetrics IMPELLER_NONNULL metrics,
2995 size_t line);
2996
2997//------------------------------------------------------------------------------
2998/// @brief Fetch the start index in the buffer of UTF-16 code units used to
2999/// represent the paragraph line.
3000///
3001/// @param[in] metrics The metrics.
3002/// @param[in] line The line index (zero based).
3003///
3004/// @return The UTF-16 code units start index.
3005///
3008 ImpellerLineMetrics IMPELLER_NONNULL metrics,
3009 size_t line);
3010
3011//------------------------------------------------------------------------------
3012/// @brief Fetch the end index in the buffer of UTF-16 code units used to
3013/// represent the paragraph line.
3014///
3015/// @param[in] metrics The metrics.
3016/// @param[in] line The line index (zero based).
3017///
3018/// @return The UTF-16 code units end index.
3019///
3022 ImpellerLineMetrics IMPELLER_NONNULL metrics,
3023 size_t line);
3024
3025//------------------------------------------------------------------------------
3026/// @brief Fetch the end index (excluding whitespace) in the buffer of
3027/// UTF-16 code units used to represent the paragraph line.
3028///
3029/// @param[in] metrics The metrics.
3030/// @param[in] line The line index (zero based).
3031///
3032/// @return The UTF-16 code units end index excluding whitespace.
3033///
3036 ImpellerLineMetrics IMPELLER_NONNULL metrics,
3037 size_t line);
3038
3039//------------------------------------------------------------------------------
3040/// @brief Fetch the end index (including newlines) in the buffer of UTF-16
3041/// code units used to represent the paragraph line.
3042///
3043/// @param[in] metrics The metrics.
3044/// @param[in] line The line index (zero based).
3045///
3046/// @return The UTF-16 code units end index including newlines.
3047///
3050 ImpellerLineMetrics IMPELLER_NONNULL metrics,
3051 size_t line);
3052
3053//------------------------------------------------------------------------------
3054// Glyph Info
3055//------------------------------------------------------------------------------
3056
3057//------------------------------------------------------------------------------
3058/// @brief Retain a strong reference to the object. The object can be NULL
3059/// in which case this method is a no-op.
3060///
3061/// @param[in] glyph_info The glyph information.
3062///
3064void ImpellerGlyphInfoRetain(ImpellerGlyphInfo IMPELLER_NULLABLE glyph_info);
3065
3066//------------------------------------------------------------------------------
3067/// @brief Release a previously retained reference to the object. The
3068/// object can be NULL in which case this method is a no-op.
3069///
3070/// @param[in] glyph_info The glyph information.
3071///
3073void ImpellerGlyphInfoRelease(ImpellerGlyphInfo IMPELLER_NULLABLE glyph_info);
3074
3075//------------------------------------------------------------------------------
3076/// @brief Fetch the start index in the buffer of UTF-16 code units used to
3077/// represent the grapheme cluster for a glyph.
3078///
3079/// @param[in] glyph_info The glyph information.
3080///
3081/// @return The UTF-16 code units start index.
3082///
3085 ImpellerGlyphInfo IMPELLER_NONNULL glyph_info);
3086
3087//------------------------------------------------------------------------------
3088/// @brief Fetch the end index in the buffer of UTF-16 code units used to
3089/// represent the grapheme cluster for a glyph.
3090///
3091/// @param[in] glyph_info The glyph information.
3092///
3093/// @return The UTF-16 code units end index.
3094///
3097 ImpellerGlyphInfo IMPELLER_NONNULL glyph_info);
3098
3099//------------------------------------------------------------------------------
3100/// @brief Fetch the bounds of the grapheme cluster for the glyph in the
3101/// coordinate space of the paragraph.
3102///
3103/// @param[in] glyph_info The glyph information.
3104/// @param[out] out_bounds The grapheme cluster bounds.
3105///
3108 ImpellerGlyphInfo IMPELLER_NONNULL glyph_info,
3109 ImpellerRect* IMPELLER_NONNULL out_bounds);
3110
3111//------------------------------------------------------------------------------
3112/// @param[in] glyph_info The glyph information.
3113///
3114/// @return True if the glyph represents an ellipsis. False otherwise.
3115///
3117bool ImpellerGlyphInfoIsEllipsis(ImpellerGlyphInfo IMPELLER_NONNULL glyph_info);
3118
3119//------------------------------------------------------------------------------
3120/// @param[in] glyph_info The glyph information.
3121///
3122/// @return The direction of the run that contains the glyph.
3123///
3126 ImpellerGlyphInfo IMPELLER_NONNULL glyph_info);
3127
3129
3130// NOLINTEND(google-objc-function-naming)
3131
3132#endif // FLUTTER_IMPELLER_TOOLKIT_INTEROP_IMPELLER_H_
int32_t x
FlutterVulkanImage * image
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)
IMPELLER_EXPORT void ImpellerParagraphGetWordBoundary(ImpellerParagraph IMPELLER_NONNULL paragraph, size_t code_unit_index, ImpellerRange *IMPELLER_NONNULL out_range)
Get the range into the UTF-16 code unit buffer that represents the word at the specified caret locati...
ImpellerFillType
Definition impeller.h:364
@ kImpellerFillTypeOdd
Definition impeller.h:366
@ kImpellerFillTypeNonZero
Definition impeller.h:365
IMPELLER_EXPORT float ImpellerParagraphGetLongestLineWidth(ImpellerParagraph IMPELLER_NONNULL paragraph)
ImpellerTextDirection
Definition impeller.h:479
@ kImpellerTextDirectionLTR
Definition impeller.h:481
@ kImpellerTextDirectionRTL
Definition impeller.h:480
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.
IMPELLER_EXPORT void ImpellerGlyphInfoGetGraphemeClusterBounds(ImpellerGlyphInfo IMPELLER_NONNULL glyph_info, ImpellerRect *IMPELLER_NONNULL out_bounds)
Fetch the bounds of the grapheme cluster for the glyph in the coordinate space of the paragraph.
ImpellerTextureSampling
Definition impeller.h:428
@ kImpellerTextureSamplingNearestNeighbor
Definition impeller.h:429
@ kImpellerTextureSamplingLinear
Definition impeller.h:430
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.
ImpellerTextDecorationType
Definition impeller.h:484
@ kImpellerTextDecorationTypeLineThrough
Definition impeller.h:488
@ kImpellerTextDecorationTypeNone
Definition impeller.h:485
@ kImpellerTextDecorationTypeUnderline
Definition impeller.h:486
@ kImpellerTextDecorationTypeOverline
Definition impeller.h:487
IMPELLER_EXPORT void ImpellerPaintRelease(ImpellerPaint IMPELLER_NULLABLE paint)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
IMPELLER_EXPORT void ImpellerPaintSetStrokeCap(ImpellerPaint IMPELLER_NONNULL paint, ImpellerStrokeCap cap)
Sets how strokes rendered using this paint are capped.
IMPELLER_EXPORT void ImpellerImageFilterRelease(ImpellerImageFilter IMPELLER_NULLABLE image_filter)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
IMPELLER_EXPORT bool ImpellerSurfacePresent(ImpellerSurface IMPELLER_NONNULL surface)
Present the surface to the underlying window system.
IMPELLER_EXPORT void ImpellerDisplayListBuilderResetTransform(ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
Reset the transformation on top of the transformation stack to identity.
IMPELLER_EXPORT void ImpellerDisplayListBuilderClipPath(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerPath IMPELLER_NONNULL path, ImpellerClipOperation op)
Reduces the clip region to the intersection of the current clip and the given path taking into accoun...
IMPELLER_EXPORT size_t ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeEnd(ImpellerGlyphInfo IMPELLER_NONNULL glyph_info)
Fetch the end index in the buffer of UTF-16 code units used to represent the grapheme cluster for a g...
IMPELLER_EXPORT double ImpellerLineMetricsGetDescent(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
The drop from the baseline as calculated from the font and style for this line.
IMPELLER_EXPORT void ImpellerParagraphBuilderPopStyle(ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder)
Pop a previously pushed paragraph style from the paragraph style stack.
IMPELLER_EXPORT void ImpellerPaintSetImageFilter(ImpellerPaint IMPELLER_NONNULL paint, ImpellerImageFilter IMPELLER_NONNULL image_filter)
Set the image filter of a paint.
IMPELLER_EXPORT void ImpellerDisplayListBuilderRestore(ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
Pops the last entry pushed onto the save stack using a call to ImpellerDisplayListBuilderSave or Impe...
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateComposeNew(ImpellerImageFilter IMPELLER_NONNULL outer, ImpellerImageFilter IMPELLER_NONNULL inner)
Creates a composed filter that when applied is identical to subsequently applying the inner and then ...
IMPELLER_EXPORT bool ImpellerLineMetricsIsHardbreak(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
Used to determine if this line ends with an explicit line break (e.g. ' ') or is the end of the parag...
IMPELLER_EXPORT void ImpellerParagraphStyleRelease(ImpellerParagraphStyle IMPELLER_NULLABLE paragraph_style)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
IMPELLER_EXPORT void ImpellerPaintSetStrokeMiter(ImpellerPaint IMPELLER_NONNULL paint, float miter)
Set the miter limit of the strokes rendered using this paint.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorFilter IMPELLER_NULLABLE ImpellerColorFilterCreateBlendNew(const ImpellerColor *IMPELLER_NONNULL color, ImpellerBlendMode blend_mode)
Create a color filter that performs blending of pixel values independently.
IMPELLER_EXPORT void ImpellerSurfaceRelease(ImpellerSurface IMPELLER_NULLABLE surface)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE ImpellerContextCreateMetalNew(uint32_t version)
Create a Metal context using the system default Metal device.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateBlurNew(float x_sigma, float y_sigma, ImpellerTileMode tile_mode)
Creates an image filter that applies a Gaussian blur.
IMPELLER_EXPORT void ImpellerFragmentProgramRelease(ImpellerFragmentProgram IMPELLER_NULLABLE fragment_program)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
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 ImpellerFragmentProgramRetain(ImpellerFragmentProgram IMPELLER_NULLABLE fragment_program)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
IMPELLER_EXPORT void ImpellerDisplayListBuilderSave(ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
Stashes the current transformation and clip state onto a save stack.
IMPELLER_EXPORT void ImpellerTypographyContextRelease(ImpellerTypographyContext IMPELLER_NULLABLE context)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
IMPELLER_EXPORT void ImpellerTextureRelease(ImpellerTexture IMPELLER_NULLABLE texture)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
IMPELLER_EXPORT void ImpellerParagraphBuilderRetain(ImpellerParagraphBuilder IMPELLER_NULLABLE paragraph_builder)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
IMPELLER_EXPORT void ImpellerSurfaceRetain(ImpellerSurface IMPELLER_NULLABLE surface)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
#define IMPELLER_NULLABLE
Definition impeller.h:57
IMPELLER_EXPORT void ImpellerDisplayListBuilderTransform(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerMatrix *IMPELLER_NONNULL transform)
Appends the the provided transformation to the transformation already on the save stack.
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawRect(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect, ImpellerPaint IMPELLER_NONNULL paint)
Draws a rectangle.
ImpellerTextDecorationStyle
Definition impeller.h:491
@ kImpellerTextDecorationStyleSolid
Definition impeller.h:492
@ kImpellerTextDecorationStyleWavy
Definition impeller.h:496
@ kImpellerTextDecorationStyleDouble
Definition impeller.h:493
@ kImpellerTextDecorationStyleDotted
Definition impeller.h:494
@ kImpellerTextDecorationStyleDashed
Definition impeller.h:495
IMPELLER_EXPORT bool ImpellerGlyphInfoIsEllipsis(ImpellerGlyphInfo IMPELLER_NONNULL glyph_info)
IMPELLER_EXPORT uint32_t ImpellerDisplayListBuilderGetSaveCount(ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
Get the current size of the save stack.
IMPELLER_EXPORT void ImpellerMaskFilterRetain(ImpellerMaskFilter IMPELLER_NULLABLE mask_filter)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
IMPELLER_EXPORT void ImpellerParagraphStyleSetFontStyle(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerFontStyle style)
Set whether the glyphs should be bolded or italicized.
IMPELLER_EXPORT void ImpellerParagraphBuilderAddText(ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder, const uint8_t *IMPELLER_NULLABLE data, uint32_t length)
Add UTF-8 encoded text to the paragraph. The text will be styled according to the paragraph style alr...
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawTexture(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerTexture IMPELLER_NONNULL texture, const ImpellerPoint *IMPELLER_NONNULL point, ImpellerTextureSampling sampling, ImpellerPaint IMPELLER_NULLABLE paint)
Draw a texture at the specified point.
IMPELLER_EXPORT void ImpellerPathGetBounds(ImpellerPath IMPELLER_NONNULL path, ImpellerRect *IMPELLER_NONNULL out_bounds)
Get the bounds of the path.
#define IMPELLER_EXTERN_C_END
Definition impeller.h:38
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPaint IMPELLER_NULLABLE ImpellerPaintNew()
Create a new paint with default values.
IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitStartIndex(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
Fetch the start index in the buffer of UTF-16 code units used to represent the paragraph line.
IMPELLER_EXPORT void ImpellerDisplayListBuilderClipRoundedRect(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect, const ImpellerRoundingRadii *IMPELLER_NONNULL radii, ImpellerClipOperation op)
Reduces the clip region to the intersection of the current clip and the given rounded rectangle takin...
IMPELLER_EXPORT uint64_t ImpellerTextureGetOpenGLHandle(ImpellerTexture IMPELLER_NONNULL texture)
Get the OpenGL handle associated with this texture. If this is not an OpenGL texture,...
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorFilter IMPELLER_NULLABLE ImpellerColorFilterCreateColorMatrixNew(const ImpellerColorMatrix *IMPELLER_NONNULL color_matrix)
Create a color filter that transforms pixel color values independently.
IMPELLER_EXPORT void ImpellerParagraphRetain(ImpellerParagraph IMPELLER_NULLABLE paragraph)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerDisplayList IMPELLER_NULLABLE ImpellerDisplayListBuilderCreateDisplayListNew(ImpellerDisplayListBuilder IMPELLER_NONNULL builder)
Create a new display list using the rendering intent already encoded in the builder....
IMPELLER_EXPORT double ImpellerLineMetricsGetLeft(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
The x coordinate of left edge of the line.
IMPELLER_EXPORT uint32_t ImpellerParagraphGetLineCount(ImpellerParagraph IMPELLER_NONNULL paragraph)
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateDilateNew(float x_radius, float y_radius)
Creates an image filter that enhances the per-channel pixel values to the maximum value in a circle a...
IMPELLER_EXPORT void ImpellerDisplayListBuilderRelease(ImpellerDisplayListBuilder IMPELLER_NULLABLE builder)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
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.
IMPELLER_EXPORT void ImpellerImageFilterRetain(ImpellerImageFilter IMPELLER_NULLABLE image_filter)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPath IMPELLER_NULLABLE ImpellerPathBuilderTakePathNew(ImpellerPathBuilder IMPELLER_NONNULL builder, ImpellerFillType fill)
Create a new path using the existing built-up path. The existing path builder now contains an empty p...
IMPELLER_EXPORT void ImpellerLineMetricsRetain(ImpellerLineMetrics IMPELLER_NULLABLE line_metrics)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
ImpellerStrokeJoin
Definition impeller.h:418
@ kImpellerStrokeJoinRound
Definition impeller.h:420
@ kImpellerStrokeJoinBevel
Definition impeller.h:421
@ kImpellerStrokeJoinMiter
Definition impeller.h:419
IMPELLER_EXPORT void ImpellerLineMetricsRelease(ImpellerLineMetrics IMPELLER_NULLABLE line_metrics)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE ImpellerVulkanSwapchainAcquireNextSurfaceNew(ImpellerVulkanSwapchain IMPELLER_NONNULL swapchain)
A potentially blocking operation, acquires the next surface to render to. Since this may block,...
IMPELLER_EXPORT void ImpellerPaintSetColor(ImpellerPaint IMPELLER_NONNULL paint, const ImpellerColor *IMPELLER_NONNULL color)
Set the paint color.
IMPELLER_EXPORT void ImpellerPathBuilderAddRect(ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL rect)
Adds a rectangle to the path.
IMPELLER_EXPORT void ImpellerDisplayListBuilderRotate(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, float angle_degrees)
Apply a clockwise rotation to the transformation matrix currently on top of the save stack.
IMPELLER_EXPORT bool ImpellerContextGetVulkanInfo(ImpellerContext IMPELLER_NONNULL context, ImpellerContextVulkanInfo *IMPELLER_NONNULL out_vulkan_info)
Get internal Vulkan handles managed by the given Vulkan context. Ownership of the handles is still ma...
void(* ImpellerCallback)(void *IMPELLER_NULLABLE user_data)
Definition impeller.h:338
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawOval(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL oval_bounds, ImpellerPaint IMPELLER_NONNULL paint)
Draws an oval.
IMPELLER_EXPORT float ImpellerParagraphGetMinIntrinsicWidth(ImpellerParagraph IMPELLER_NONNULL paragraph)
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawLine(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerPoint *IMPELLER_NONNULL from, const ImpellerPoint *IMPELLER_NONNULL to, ImpellerPaint IMPELLER_NONNULL paint)
Draws a line segment.
IMPELLER_EXPORT void ImpellerDisplayListRelease(ImpellerDisplayList IMPELLER_NULLABLE display_list)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
IMPELLER_EXPORT void ImpellerParagraphStyleSetBackground(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, ImpellerPaint IMPELLER_NONNULL paint)
Set the paint used to render the background of the text glyphs.
void *IMPELLER_NULLABLE(* ImpellerVulkanProcAddressCallback)(void *IMPELLER_NULLABLE vulkan_instance, const char *IMPELLER_NONNULL vulkan_proc_name, void *IMPELLER_NULLABLE user_data)
Definition impeller.h:356
IMPELLER_EXPORT float ImpellerParagraphGetMaxWidth(ImpellerParagraph IMPELLER_NONNULL paragraph)
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraph IMPELLER_NULLABLE ImpellerParagraphBuilderBuildParagraphNew(ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder, float width)
Layout and build a new paragraph using the specified width. The resulting paragraph is immutable....
IMPELLER_EXPORT uint32_t ImpellerGetVersion()
Get the version of Impeller standalone API. This is the API that will be accepted for validity checks...
IMPELLER_EXPORT void ImpellerParagraphBuilderPushStyle(ImpellerParagraphBuilder IMPELLER_NONNULL paragraph_builder, ImpellerParagraphStyle IMPELLER_NONNULL style)
Push a new paragraph style onto the paragraph style stack managed by the paragraph builder.
IMPELLER_EXPORT void ImpellerMaskFilterRelease(ImpellerMaskFilter IMPELLER_NULLABLE mask_filter)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerGlyphInfo IMPELLER_NULLABLE ImpellerParagraphCreateGlyphInfoAtParagraphCoordinatesNew(ImpellerParagraph IMPELLER_NONNULL paragraph, double x, double y)
Create a new instance of glyph info that can be queried for information about the glyph closest to th...
IMPELLER_EXPORT void ImpellerColorFilterRetain(ImpellerColorFilter IMPELLER_NULLABLE color_filter)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateImageNew(ImpellerTexture IMPELLER_NONNULL image, ImpellerTileMode horizontal_tile_mode, ImpellerTileMode vertical_tile_mode, ImpellerTextureSampling sampling, const ImpellerMatrix *IMPELLER_NULLABLE transformation)
Create a color source that samples from an image.
ImpellerBlendMode
Definition impeller.h:374
@ kImpellerBlendModeSaturation
Definition impeller.h:401
@ kImpellerBlendModeSoftLight
Definition impeller.h:396
@ kImpellerBlendModeHardLight
Definition impeller.h:395
@ kImpellerBlendModeLuminosity
Definition impeller.h:403
@ kImpellerBlendModeLighten
Definition impeller.h:392
@ kImpellerBlendModeModulate
Definition impeller.h:388
@ kImpellerBlendModeSourceIn
Definition impeller.h:380
@ kImpellerBlendModeDifference
Definition impeller.h:397
@ kImpellerBlendModeClear
Definition impeller.h:375
@ kImpellerBlendModeColor
Definition impeller.h:402
@ kImpellerBlendModeMultiply
Definition impeller.h:399
@ kImpellerBlendModeSourceATop
Definition impeller.h:384
@ kImpellerBlendModeDestinationOut
Definition impeller.h:383
@ kImpellerBlendModeScreen
Definition impeller.h:389
@ kImpellerBlendModeExclusion
Definition impeller.h:398
@ kImpellerBlendModeColorBurn
Definition impeller.h:394
@ kImpellerBlendModeDarken
Definition impeller.h:391
@ kImpellerBlendModePlus
Definition impeller.h:387
@ kImpellerBlendModeOverlay
Definition impeller.h:390
@ kImpellerBlendModeDestinationIn
Definition impeller.h:381
@ kImpellerBlendModeDestinationATop
Definition impeller.h:385
@ kImpellerBlendModeDestination
Definition impeller.h:377
@ kImpellerBlendModeSourceOver
Definition impeller.h:378
@ kImpellerBlendModeXor
Definition impeller.h:386
@ kImpellerBlendModeColorDodge
Definition impeller.h:393
@ kImpellerBlendModeDestinationOver
Definition impeller.h:379
@ kImpellerBlendModeSource
Definition impeller.h:376
@ kImpellerBlendModeSourceOut
Definition impeller.h:382
@ kImpellerBlendModeHue
Definition impeller.h:400
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:453
@ kImpellerFontWeight400
Definition impeller.h:457
@ kImpellerFontWeight500
Definition impeller.h:458
@ kImpellerFontWeight700
Definition impeller.h:460
@ kImpellerFontWeight200
Definition impeller.h:455
@ kImpellerFontWeight300
Definition impeller.h:456
@ kImpellerFontWeight900
Definition impeller.h:462
@ kImpellerFontWeight800
Definition impeller.h:461
@ kImpellerFontWeight600
Definition impeller.h:459
@ kImpellerFontWeight100
Definition impeller.h:454
IMPELLER_EXPORT void ImpellerParagraphStyleSetFontSize(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, float size)
Set the font size.
IMPELLER_EXPORT void ImpellerParagraphStyleSetLocale(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, const char *IMPELLER_NONNULL locale)
Set the paragraph locale.
IMPELLER_EXPORT void ImpellerGlyphInfoRelease(ImpellerGlyphInfo IMPELLER_NULLABLE glyph_info)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
IMPELLER_EXPORT bool ImpellerSurfaceDrawDisplayList(ImpellerSurface IMPELLER_NONNULL surface, ImpellerDisplayList IMPELLER_NONNULL display_list)
Draw a display list onto the surface. The same display list can be drawn multiple times to different ...
IMPELLER_EXPORT void ImpellerDisplayListRetain(ImpellerDisplayList IMPELLER_NULLABLE display_list)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateFragmentProgramNew(ImpellerContext IMPELLER_NONNULL context, ImpellerFragmentProgram IMPELLER_NONNULL fragment_program, IMPELLER_NONNULL ImpellerTexture *IMPELLER_NULLABLE samplers, size_t samplers_count, const uint8_t *IMPELLER_NULLABLE data, size_t data_bytes_length)
Create an image filter where each pixel is shaded by a fragment program.
IMPELLER_EXPORT void ImpellerParagraphStyleSetMaxLines(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, uint32_t max_lines)
Set the maximum line count within the paragraph.
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawPaint(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerPaint IMPELLER_NONNULL paint)
Fills the current clip with the specified paint.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE ImpellerSurfaceCreateWrappedMetalDrawableNew(ImpellerContext IMPELLER_NONNULL context, void *IMPELLER_NONNULL metal_drawable)
Create a surface by wrapping a Metal drawable. This is useful during WSI when the drawable is the bac...
IMPELLER_EXPORT double ImpellerLineMetricsGetWidth(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
Width of the line from the left edge of the leftmost glyph to the right edge of the rightmost glyph.
IMPELLER_EXPORT ImpellerTextDirection ImpellerGlyphInfoGetTextDirection(ImpellerGlyphInfo IMPELLER_NONNULL glyph_info)
IMPELLER_EXPORT void ImpellerPaintSetColorFilter(ImpellerPaint IMPELLER_NONNULL paint, ImpellerColorFilter IMPELLER_NONNULL color_filter)
Set the color filter of the paint.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateConicalGradientNew(const ImpellerPoint *IMPELLER_NONNULL start_center, float start_radius, const ImpellerPoint *IMPELLER_NONNULL end_center, float end_radius, uint32_t stop_count, const ImpellerColor *IMPELLER_NONNULL colors, const float *IMPELLER_NONNULL stops, ImpellerTileMode tile_mode, const ImpellerMatrix *IMPELLER_NULLABLE transformation)
Create a color source that forms a conical gradient.
IMPELLER_EXPORT void ImpellerPaintSetColorSource(ImpellerPaint IMPELLER_NONNULL paint, ImpellerColorSource IMPELLER_NONNULL color_source)
Set the color source of the paint.
IMPELLER_EXPORT void ImpellerPathBuilderCubicCurveTo(ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerPoint *IMPELLER_NONNULL control_point_1, const ImpellerPoint *IMPELLER_NONNULL control_point_2, const ImpellerPoint *IMPELLER_NONNULL end_point)
Add a cubic curve whose start point is current cursor location to the specified end point using the t...
IMPELLER_EXPORT void ImpellerPathBuilderClose(ImpellerPathBuilder IMPELLER_NONNULL builder)
Close the path.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerVulkanSwapchain IMPELLER_NULLABLE ImpellerVulkanSwapchainCreateNew(ImpellerContext IMPELLER_NONNULL context, void *IMPELLER_NONNULL vulkan_surface_khr)
Create a new Vulkan swapchain using a VkSurfaceKHR instance. Ownership of the surface is transferred ...
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawShadow(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerPath IMPELLER_NONNULL path, const ImpellerColor *IMPELLER_NONNULL color, float elevation, bool occluder_is_transparent, float device_pixel_ratio)
Draw a shadow for a Path given a material elevation. If the occluding object is not opaque,...
IMPELLER_EXPORT void ImpellerDisplayListBuilderGetTransform(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerMatrix *IMPELLER_NONNULL out_transform)
Get the transformation currently built up on the top of the transformation stack.
IMPELLER_EXPORT void ImpellerDisplayListBuilderClipOval(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL oval_bounds, ImpellerClipOperation op)
Reduces the clip region to the intersection of the current clip and the given oval taking into accoun...
IMPELLER_EXPORT float ImpellerParagraphGetIdeographicBaseline(ImpellerParagraph IMPELLER_NONNULL paragraph)
IMPELLER_EXPORT double ImpellerLineMetricsGetBaseline(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
The y coordinate of the baseline for this line from the top of the paragraph.
IMPELLER_EXPORT void ImpellerPathRelease(ImpellerPath IMPELLER_NULLABLE path)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
IMPELLER_EXPORT void ImpellerDisplayListBuilderSetTransform(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, const ImpellerMatrix *IMPELLER_NONNULL transform)
Clear the transformation on top of the save stack and replace it with a new value.
IMPELLER_EXPORT void ImpellerPaintSetMaskFilter(ImpellerPaint IMPELLER_NONNULL paint, ImpellerMaskFilter IMPELLER_NONNULL mask_filter)
Set the mask filter of a paint.
IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitEndIndex(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
Fetch the end index in the buffer of UTF-16 code units used to represent the paragraph line.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE ImpellerContextCreateOpenGLESNew(uint32_t version, ImpellerProcAddressCallback IMPELLER_NONNULL gl_proc_address_callback, void *IMPELLER_NULLABLE gl_proc_address_callback_user_data)
Create an OpenGL(ES) Impeller context.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateFragmentProgramNew(ImpellerContext IMPELLER_NONNULL context, ImpellerFragmentProgram IMPELLER_NONNULL fragment_program, IMPELLER_NONNULL ImpellerTexture *IMPELLER_NULLABLE samplers, size_t samplers_count, const uint8_t *IMPELLER_NULLABLE data, size_t data_bytes_length)
Create a color source whose pixels are shaded by a fragment program.
IMPELLER_EXPORT void ImpellerGlyphInfoRetain(ImpellerGlyphInfo IMPELLER_NULLABLE glyph_info)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
IMPELLER_EXPORT void ImpellerPathBuilderLineTo(ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerPoint *IMPELLER_NONNULL location)
Add a line segment from the current cursor location to the given location. The cursor location is upd...
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.
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 ImpellerParagraphStyleSetTextDecoration(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, const ImpellerTextDecoration *IMPELLER_NONNULL decoration)
Set one of more text decorations on the paragraph. Decorations can be underlines, overlines,...
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.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerFragmentProgram IMPELLER_NULLABLE ImpellerFragmentProgramNew(const ImpellerMapping *IMPELLER_NONNULL data, void *IMPELLER_NULLABLE data_release_user_data)
Create a new fragment program using data obtained by compiling a GLSL shader with impellerc.
IMPELLER_EXPORT void ImpellerPaintSetBlendMode(ImpellerPaint IMPELLER_NONNULL paint, ImpellerBlendMode mode)
Set the paint blend mode. The blend mode controls how the new paints contents are mixed with the valu...
IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitEndIndexExcludingWhitespace(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
Fetch the end index (excluding whitespace) in the buffer of UTF-16 code units used to represent the p...
IMPELLER_EXPORT void ImpellerParagraphBuilderRelease(ImpellerParagraphBuilder IMPELLER_NULLABLE paragraph_builder)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawTextureRect(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerTexture IMPELLER_NONNULL texture, const ImpellerRect *IMPELLER_NONNULL src_rect, const ImpellerRect *IMPELLER_NONNULL dst_rect, ImpellerTextureSampling sampling, ImpellerPaint IMPELLER_NULLABLE paint)
Draw a portion of texture at the specified location.
IMPELLER_EXPORT void ImpellerTextureRetain(ImpellerTexture IMPELLER_NULLABLE texture)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE ImpellerSurfaceCreateWrappedFBONew(ImpellerContext IMPELLER_NONNULL context, uint64_t fbo, ImpellerPixelFormat format, const ImpellerISize *IMPELLER_NONNULL size)
Create a new surface by wrapping an existing framebuffer object. The framebuffer must be complete as ...
IMPELLER_EXPORT void ImpellerPathBuilderAddArc(ImpellerPathBuilder IMPELLER_NONNULL builder, const ImpellerRect *IMPELLER_NONNULL oval_bounds, float start_angle_degrees, float end_angle_degrees)
Add an arc to the path.
IMPELLER_EXPORT double ImpellerLineMetricsGetUnscaledAscent(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
The rise from the baseline as calculated from the font and style for this line ignoring the height fr...
IMPELLER_EXPORT float ImpellerParagraphGetMaxIntrinsicWidth(ImpellerParagraph IMPELLER_NONNULL paragraph)
ImpellerStrokeCap
Definition impeller.h:412
@ kImpellerStrokeCapButt
Definition impeller.h:413
@ kImpellerStrokeCapRound
Definition impeller.h:414
@ kImpellerStrokeCapSquare
Definition impeller.h:415
IMPELLER_EXPORT void ImpellerVulkanSwapchainRelease(ImpellerVulkanSwapchain IMPELLER_NULLABLE swapchain)
Release a previously retained reference to the object. The object can be NULL in which case this meth...
IMPELLER_EXPORT double ImpellerLineMetricsGetHeight(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
Total height of the line from the top edge to the bottom edge.
ImpellerDrawStyle
Definition impeller.h:406
@ kImpellerDrawStyleStroke
Definition impeller.h:408
@ kImpellerDrawStyleFill
Definition impeller.h:407
@ kImpellerDrawStyleStrokeAndFill
Definition impeller.h:409
ImpellerColorSpace
Definition impeller.h:447
@ kImpellerColorSpaceExtendedSRGB
Definition impeller.h:449
@ kImpellerColorSpaceSRGB
Definition impeller.h:448
@ kImpellerColorSpaceDisplayP3
Definition impeller.h:450
IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitEndIndexIncludingNewline(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
Fetch the end index (including newlines) in the buffer of UTF-16 code units used to represent the par...
ImpellerTileMode
Definition impeller.h:433
@ kImpellerTileModeMirror
Definition impeller.h:436
@ kImpellerTileModeClamp
Definition impeller.h:434
@ kImpellerTileModeRepeat
Definition impeller.h:435
@ kImpellerTileModeDecal
Definition impeller.h:437
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:470
@ kImpellerTextAlignmentJustify
Definition impeller.h:474
@ kImpellerTextAlignmentLeft
Definition impeller.h:471
@ kImpellerTextAlignmentCenter
Definition impeller.h:473
@ kImpellerTextAlignmentRight
Definition impeller.h:472
@ kImpellerTextAlignmentStart
Definition impeller.h:475
@ kImpellerTextAlignmentEnd
Definition impeller.h:476
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:465
@ kImpellerFontStyleItalic
Definition impeller.h:467
@ kImpellerFontStyleNormal
Definition impeller.h:466
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:369
@ kImpellerClipOperationIntersect
Definition impeller.h:371
@ kImpellerClipOperationDifference
Definition impeller.h:370
#define IMPELLER_NONNULL
Definition impeller.h:58
void *IMPELLER_NULLABLE(* ImpellerProcAddressCallback)(const char *IMPELLER_NONNULL proc_name, void *IMPELLER_NULLABLE user_data)
Definition impeller.h:347
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerMaskFilter IMPELLER_NULLABLE ImpellerMaskFilterCreateBlurNew(ImpellerBlurStyle style, float sigma)
Create a mask filter that blurs contents in the masked shape.
IMPELLER_EXPORT size_t ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeBegin(ImpellerGlyphInfo IMPELLER_NONNULL glyph_info)
Fetch the start index in the buffer of UTF-16 code units used to represent the grapheme cluster for a...
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerDisplayListBuilder IMPELLER_NULLABLE ImpellerDisplayListBuilderNew(const ImpellerRect *IMPELLER_NULLABLE cull_rect)
Create a new display list builder.
IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawPath(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, ImpellerPath IMPELLER_NONNULL path, ImpellerPaint IMPELLER_NONNULL paint)
Draws the specified shape.
#define IMPELLER_EXPORT
Definition impeller.h:48
IMPELLER_EXPORT void ImpellerVulkanSwapchainRetain(ImpellerVulkanSwapchain IMPELLER_NULLABLE swapchain)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
IMPELLER_EXPORT double ImpellerLineMetricsGetAscent(ImpellerLineMetrics IMPELLER_NONNULL metrics, size_t line)
The rise from the baseline as calculated from the font and style for this line.
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 ImpellerParagraphStyleSetEllipsis(ImpellerParagraphStyle IMPELLER_NONNULL paragraph_style, const char *IMPELLER_NULLABLE ellipsis)
Set the UTF-8 string to use as the ellipsis. Pass nullptr to clear the setting to default.
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:64
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerGlyphInfo IMPELLER_NULLABLE ImpellerParagraphCreateGlyphInfoAtCodeUnitIndexNew(ImpellerParagraph IMPELLER_NONNULL paragraph, size_t code_unit_index)
Create a new instance of glyph info that can be queried for information about the glyph at the given ...
IMPELLER_EXPORT ImpellerLineMetrics IMPELLER_NULLABLE ImpellerParagraphGetLineMetrics(ImpellerParagraph IMPELLER_NONNULL paragraph)
Get the line metrics of this laid out paragraph. Calculating the line metrics is expensive....
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...
ImpellerBlurStyle
Definition impeller.h:440
@ kImpellerBlurStyleNormal
Definition impeller.h:441
@ kImpellerBlurStyleOuter
Definition impeller.h:443
@ kImpellerBlurStyleInner
Definition impeller.h:444
@ kImpellerBlurStyleSolid
Definition impeller.h:442
ImpellerPixelFormat
Definition impeller.h:424
@ kImpellerPixelFormatRGBA8888
Definition impeller.h:425
IMPELLER_EXPORT void ImpellerPaintSetStrokeWidth(ImpellerPaint IMPELLER_NONNULL paint, float width)
Set the width of the strokes rendered using this paint.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateLinearGradientNew(const ImpellerPoint *IMPELLER_NONNULL start_point, const ImpellerPoint *IMPELLER_NONNULL end_point, uint32_t stop_count, const ImpellerColor *IMPELLER_NONNULL colors, const float *IMPELLER_NONNULL stops, ImpellerTileMode tile_mode, const ImpellerMatrix *IMPELLER_NULLABLE transformation)
Create a color source that forms a linear gradient.
IMPELLER_EXPORT void ImpellerTypographyContextRetain(ImpellerTypographyContext IMPELLER_NULLABLE context)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphBuilder IMPELLER_NULLABLE ImpellerParagraphBuilderNew(ImpellerTypographyContext IMPELLER_NONNULL context)
Create a new paragraph builder.
IMPELLER_EXPORT float ImpellerParagraphGetAlphabeticBaseline(ImpellerParagraph IMPELLER_NONNULL paragraph)
IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE ImpellerContextCreateVulkanNew(uint32_t version, const ImpellerContextVulkanSettings *IMPELLER_NONNULL settings)
Create a Vulkan context using the provided Vulkan Settings.
IMPELLER_EXPORT void ImpellerDisplayListBuilderRestoreToCount(ImpellerDisplayListBuilder IMPELLER_NONNULL builder, uint32_t count)
Effectively calls ImpellerDisplayListBuilderRestore till the size of the save stack becomes a specifi...
IMPELLER_EXPORT void ImpellerPaintRetain(ImpellerPaint IMPELLER_NULLABLE paint)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
IMPELLER_EXPORT void ImpellerPathBuilderRetain(ImpellerPathBuilder IMPELLER_NULLABLE builder)
Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.
size_t length
FlTexture * texture
double y
int32_t height
int32_t width
ImpellerColorSpace color_space
Definition impeller.h:617
uint32_t graphics_queue_family_index
Definition impeller.h:642
void *IMPELLER_NULLABLE vk_instance
Definition impeller.h:639
void *IMPELLER_NULLABLE vk_logical_device
Definition impeller.h:641
void *IMPELLER_NULLABLE vk_physical_device
Definition impeller.h:640
ImpellerVulkanProcAddressCallback IMPELLER_NONNULL proc_address_callback
Definition impeller.h:634
void *IMPELLER_NULLABLE user_data
Definition impeller.h:633
int64_t height
Definition impeller.h:521
int64_t width
Definition impeller.h:520
ImpellerCallback IMPELLER_NULLABLE on_release
Definition impeller.h:629
uint64_t length
Definition impeller.h:628
const uint8_t *IMPELLER_NONNULL data
Definition impeller.h:627
float m[16]
Definition impeller.h:540
uint64_t end
Definition impeller.h:526
uint64_t start
Definition impeller.h:525
float width
Definition impeller.h:505
float height
Definition impeller.h:506
ImpellerPoint top_left
Definition impeller.h:606
ImpellerPoint top_right
Definition impeller.h:608
ImpellerPoint bottom_left
Definition impeller.h:607
ImpellerPoint bottom_right
Definition impeller.h:609
float height
Definition impeller.h:516
float width
Definition impeller.h:515
ImpellerColor color
The decoration color.
Definition impeller.h:650
ImpellerTextDecorationStyle style
The decoration style.
Definition impeller.h:652
int types
A mask of ImpellerTextDecorationTypes to enable.
Definition impeller.h:648
ImpellerPixelFormat pixel_format
Definition impeller.h:621
const size_t end
std::shared_ptr< const fml::Mapping > data

◆ IMPELLER_EXPORT

#define IMPELLER_EXPORT   IMPELLER_EXPORT_DECORATION

Definition at line 48 of file impeller.h.

◆ IMPELLER_EXPORT_DECORATION

#define IMPELLER_EXPORT_DECORATION   __attribute__((visibility("default")))

Definition at line 44 of file impeller.h.

◆ IMPELLER_EXTERN_C

#define IMPELLER_EXTERN_C

--------------------------------------------------------------------------—

----— ___ _ _ _ ____ ___ -----— ----— |_ _|_ __ ___ _ __ ___| | | ___ _ __ / \ | _ _ _| -----— ----— | || '_ ‘ _ | ’_ \ / _ \ | |/ _ \ '__| / _ \ | |_) | | -----— ----— | || | | | | | |_) | __/ | | __/ | / ___ | __/| | -----— ----— |___|_| |_| |_| .__/ ___|_|_|___|_| /_/ __| |___| -----—

----— |_| -----—


This file describes a high-level, single-header, dependency-free, 2D graphics API.

The API fundamentals that include details about the object model, reference counting, and null-safety are described in the README.

Definition at line 36 of file impeller.h.

◆ IMPELLER_EXTERN_C_BEGIN

#define IMPELLER_EXTERN_C_BEGIN

Definition at line 37 of file impeller.h.

◆ IMPELLER_EXTERN_C_END

#define IMPELLER_EXTERN_C_END

Definition at line 38 of file impeller.h.

◆ IMPELLER_INTERNAL_HANDLE_NAME

#define IMPELLER_INTERNAL_HANDLE_NAME (   handle)    handle##_

Definition at line 141 of file impeller.h.

◆ IMPELLER_MAKE_VERSION

#define IMPELLER_MAKE_VERSION (   variant,
  major,
  minor,
  patch 
)
Value:
((((uint32_t)(variant)) << 29U) | (((uint32_t)(major)) << 22U) | \
(((uint32_t)(minor)) << 12U) | ((uint32_t)(patch)))

Pack a version in a uint32_t.

Parameters
[in]variantThe version variant.
[in]majorThe major version.
[in]minorThe minor version.
[in]patchThe patch version.
Returns
The packed version number.

Definition at line 79 of file impeller.h.

◆ IMPELLER_NODISCARD

#define IMPELLER_NODISCARD

Definition at line 64 of file impeller.h.

◆ IMPELLER_NONNULL

#define IMPELLER_NONNULL

Definition at line 58 of file impeller.h.

◆ IMPELLER_NULLABLE

#define IMPELLER_NULLABLE

Definition at line 57 of file impeller.h.

◆ IMPELLER_VERSION

#define IMPELLER_VERSION
Value:
#define IMPELLER_VERSION_VARIANT
Definition impeller.h:83
#define IMPELLER_MAKE_VERSION(variant, major, minor, patch)
Pack a version in a uint32_t.
Definition impeller.h:79
#define IMPELLER_VERSION_PATCH
Definition impeller.h:86
#define IMPELLER_VERSION_MINOR
Definition impeller.h:85
#define IMPELLER_VERSION_MAJOR
Definition impeller.h:84

The current Impeller API version.

This version must be passed to APIs that create top-level objects like graphics contexts. Construction of the context may fail if the API version expected by the caller is not supported by the library.

The version currently supported by the library is returned by a call to ImpellerGetVersion

Since there are no API stability guarantees today, passing a version that is different to the one returned by ImpellerGetVersion will always fail.

See also
ImpellerGetVersion

Definition at line 103 of file impeller.h.

◆ IMPELLER_VERSION_GET_MAJOR

#define IMPELLER_VERSION_GET_MAJOR (   version)     (((uint32_t)(version) >> 22U) & 0x7FU)
Parameters
[in]versionThe packed version.
Returns
The major version.

Definition at line 119 of file impeller.h.

◆ IMPELLER_VERSION_GET_MINOR

#define IMPELLER_VERSION_GET_MINOR (   version)     (((uint32_t)(version) >> 12U) & 0x3FFU)
Parameters
[in]versionThe packed version.
Returns
The minor version.

Definition at line 127 of file impeller.h.

◆ IMPELLER_VERSION_GET_PATCH

#define IMPELLER_VERSION_GET_PATCH (   version)    ((uint32_t)(version) & 0xFFFU)
Parameters
[in]versionThe packed version.
Returns
The patch version.

Definition at line 135 of file impeller.h.

◆ IMPELLER_VERSION_GET_VARIANT

#define IMPELLER_VERSION_GET_VARIANT (   version)    ((uint32_t)(version) >> 29U)
Parameters
[in]versionThe packed version.
Returns
The version variant.

Definition at line 112 of file impeller.h.

◆ IMPELLER_VERSION_MAJOR

#define IMPELLER_VERSION_MAJOR   1

Definition at line 84 of file impeller.h.

◆ IMPELLER_VERSION_MINOR

#define IMPELLER_VERSION_MINOR   4

Definition at line 85 of file impeller.h.

◆ IMPELLER_VERSION_PATCH

#define IMPELLER_VERSION_PATCH   0

Definition at line 86 of file impeller.h.

◆ IMPELLER_VERSION_VARIANT

#define IMPELLER_VERSION_VARIANT   1

Definition at line 83 of file impeller.h.

Typedef Documentation

◆ ImpellerBlendMode

◆ ImpellerBlurStyle

◆ ImpellerCallback

typedef void(* ImpellerCallback) (void *IMPELLER_NULLABLE user_data)

A callback invoked by Impeller that passes a user supplied baton back to the user. Impeller does not interpret the baton in any way. The way the baton is specified and the thread on which the callback is invoked depends on how the user supplies the callback to Impeller.

Definition at line 338 of file impeller.h.

◆ ImpellerClipOperation

◆ ImpellerColor

typedef struct ImpellerColor ImpellerColor

◆ ImpellerColorMatrix

A 4x5 matrix using row-major storage used for transforming color values.

To transform color values, a 5x5 matrix is constructed with the 5th row being identity. Then the following transformation is performed:

| R' | | m[0] m[1] m[2] m[3] m[4] | | R |
| G' | | m[5] m[6] m[7] m[8] m[9] | | G |
| B' | = | m[10] m[11] m[12] m[13] m[14] | * | B |
| A' | | m[15] m[16] m[17] m[18] m[19] | | A |
| 1 | | 0 0 0 0 1 | | 1 |

The translation column (m[4], m[9], m[14], m[19]) must be specified in non-normalized 8-bit unsigned integer space (0 to 255). Values outside this range will produce undefined results.

The identity transformation is thus:

1, 0, 0, 0, 0,
0, 1, 0, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, 1, 0,

Some examples:

To invert all colors:

-1, 0, 0, 0, 255,
0, -1, 0, 0, 255,
0, 0, -1, 0, 255,
0, 0, 0, 1, 0,

To apply a sepia filter:

0.393, 0.769, 0.189, 0, 0,
0.349, 0.686, 0.168, 0, 0,
0.272, 0.534, 0.131, 0, 0,
0, 0, 0, 1, 0,

To apply a grayscale conversion filter:

0.2126, 0.7152, 0.0722, 0, 0,
0.2126, 0.7152, 0.0722, 0, 0,
0.2126, 0.7152, 0.0722, 0, 0,
0, 0, 0, 1, 0,
See also
ImpellerColorFilter

◆ ImpellerColorSpace

◆ ImpellerContextVulkanInfo

◆ ImpellerContextVulkanSettings

◆ ImpellerDrawStyle

◆ ImpellerFillType

◆ ImpellerFontStyle

◆ ImpellerFontWeight

◆ ImpellerISize

typedef struct ImpellerISize ImpellerISize

◆ ImpellerMapping

◆ ImpellerMatrix

A 4x4 transformation matrix using column-major storage.

| m[0] m[4] m[8] m[12] |
| m[1] m[5] m[9] m[13] |
| m[2] m[6] m[10] m[14] |
| m[3] m[7] m[11] m[15] |

◆ ImpellerPixelFormat

◆ ImpellerPoint

typedef struct ImpellerPoint ImpellerPoint

◆ ImpellerProcAddressCallback

typedef void *IMPELLER_NULLABLE(* ImpellerProcAddressCallback) (const char *IMPELLER_NONNULL proc_name, void *IMPELLER_NULLABLE user_data)

A callback used by Impeller to allow the user to resolve function pointers. A user supplied baton that is uninterpreted by Impeller is passed back to the user in the callback. How the baton is specified to Impeller and the thread on which the callback is invoked depends on how the callback is specified to Impeller.

Definition at line 347 of file impeller.h.

◆ ImpellerRange

typedef struct ImpellerRange ImpellerRange

◆ ImpellerRect

typedef struct ImpellerRect ImpellerRect

◆ ImpellerRoundingRadii

◆ ImpellerSize

typedef struct ImpellerSize ImpellerSize

◆ ImpellerStrokeCap

◆ ImpellerStrokeJoin

◆ ImpellerTextAlignment

◆ ImpellerTextDecoration

◆ ImpellerTextDecorationStyle

◆ ImpellerTextDecorationType

◆ ImpellerTextDirection

◆ ImpellerTextureDescriptor

◆ ImpellerTextureSampling

◆ ImpellerTileMode

◆ ImpellerVulkanProcAddressCallback

typedef void *IMPELLER_NULLABLE(* ImpellerVulkanProcAddressCallback) (void *IMPELLER_NULLABLE vulkan_instance, const char *IMPELLER_NONNULL vulkan_proc_name, void *IMPELLER_NULLABLE user_data)

A callback used by Impeller to allow the user to resolve Vulkan function pointers. A user supplied baton that is uninterpreted by Impeller is passed back to the user in the callback.

Definition at line 356 of file impeller.h.

Enumeration Type Documentation

◆ ImpellerBlendMode

Enumerator
kImpellerBlendModeClear 
kImpellerBlendModeSource 
kImpellerBlendModeDestination 
kImpellerBlendModeSourceOver 
kImpellerBlendModeDestinationOver 
kImpellerBlendModeSourceIn 
kImpellerBlendModeDestinationIn 
kImpellerBlendModeSourceOut 
kImpellerBlendModeDestinationOut 
kImpellerBlendModeSourceATop 
kImpellerBlendModeDestinationATop 
kImpellerBlendModeXor 
kImpellerBlendModePlus 
kImpellerBlendModeModulate 
kImpellerBlendModeScreen 
kImpellerBlendModeOverlay 
kImpellerBlendModeDarken 
kImpellerBlendModeLighten 
kImpellerBlendModeColorDodge 
kImpellerBlendModeColorBurn 
kImpellerBlendModeHardLight 
kImpellerBlendModeSoftLight 
kImpellerBlendModeDifference 
kImpellerBlendModeExclusion 
kImpellerBlendModeMultiply 
kImpellerBlendModeHue 
kImpellerBlendModeSaturation 
kImpellerBlendModeColor 
kImpellerBlendModeLuminosity 

Definition at line 374 of file impeller.h.

◆ ImpellerBlurStyle

Enumerator
kImpellerBlurStyleNormal 
kImpellerBlurStyleSolid 
kImpellerBlurStyleOuter 
kImpellerBlurStyleInner 

Definition at line 440 of file impeller.h.

◆ ImpellerClipOperation

Enumerator
kImpellerClipOperationDifference 
kImpellerClipOperationIntersect 

Definition at line 369 of file impeller.h.

◆ ImpellerColorSpace

Enumerator
kImpellerColorSpaceSRGB 
kImpellerColorSpaceExtendedSRGB 
kImpellerColorSpaceDisplayP3 

Definition at line 447 of file impeller.h.

◆ ImpellerDrawStyle

Enumerator
kImpellerDrawStyleFill 
kImpellerDrawStyleStroke 
kImpellerDrawStyleStrokeAndFill 

Definition at line 406 of file impeller.h.

◆ ImpellerFillType

Enumerator
kImpellerFillTypeNonZero 
kImpellerFillTypeOdd 

Definition at line 364 of file impeller.h.

◆ ImpellerFontStyle

Enumerator
kImpellerFontStyleNormal 
kImpellerFontStyleItalic 

Definition at line 465 of file impeller.h.

◆ ImpellerFontWeight

Enumerator
kImpellerFontWeight100 
kImpellerFontWeight200 
kImpellerFontWeight300 
kImpellerFontWeight400 
kImpellerFontWeight500 
kImpellerFontWeight600 
kImpellerFontWeight700 
kImpellerFontWeight800 
kImpellerFontWeight900 

Definition at line 453 of file impeller.h.

453 {
455 kImpellerFontWeight200, // Extra-Light
456 kImpellerFontWeight300, // Light
457 kImpellerFontWeight400, // Normal/Regular
458 kImpellerFontWeight500, // Medium
459 kImpellerFontWeight600, // Semi-bold
461 kImpellerFontWeight800, // Extra-Bold
462 kImpellerFontWeight900, // Black

◆ ImpellerPixelFormat

Enumerator
kImpellerPixelFormatRGBA8888 

Definition at line 424 of file impeller.h.

◆ ImpellerStrokeCap

Enumerator
kImpellerStrokeCapButt 
kImpellerStrokeCapRound 
kImpellerStrokeCapSquare 

Definition at line 412 of file impeller.h.

◆ ImpellerStrokeJoin

Enumerator
kImpellerStrokeJoinMiter 
kImpellerStrokeJoinRound 
kImpellerStrokeJoinBevel 

Definition at line 418 of file impeller.h.

◆ ImpellerTextAlignment

Enumerator
kImpellerTextAlignmentLeft 
kImpellerTextAlignmentRight 
kImpellerTextAlignmentCenter 
kImpellerTextAlignmentJustify 
kImpellerTextAlignmentStart 
kImpellerTextAlignmentEnd 

Definition at line 470 of file impeller.h.

◆ ImpellerTextDecorationStyle

Enumerator
kImpellerTextDecorationStyleSolid 
kImpellerTextDecorationStyleDouble 
kImpellerTextDecorationStyleDotted 
kImpellerTextDecorationStyleDashed 
kImpellerTextDecorationStyleWavy 

Definition at line 491 of file impeller.h.

◆ ImpellerTextDecorationType

Enumerator
kImpellerTextDecorationTypeNone 
kImpellerTextDecorationTypeUnderline 
kImpellerTextDecorationTypeOverline 
kImpellerTextDecorationTypeLineThrough 

Definition at line 484 of file impeller.h.

◆ ImpellerTextDirection

Enumerator
kImpellerTextDirectionRTL 
kImpellerTextDirectionLTR 

Definition at line 479 of file impeller.h.

◆ ImpellerTextureSampling

Enumerator
kImpellerTextureSamplingNearestNeighbor 
kImpellerTextureSamplingLinear 

Definition at line 428 of file impeller.h.

◆ ImpellerTileMode

Enumerator
kImpellerTileModeClamp 
kImpellerTileModeRepeat 
kImpellerTileModeMirror 
kImpellerTileModeDecal 

Definition at line 433 of file impeller.h.

Function Documentation

◆ IMPELLER_DEFINE_HANDLE() [1/20]

IMPELLER_DEFINE_HANDLE ( ImpellerColorFilter  )

Color filters are functions that take two colors and mix them to produce a single color. This color is then merged with the destination during blending.

◆ IMPELLER_DEFINE_HANDLE() [2/20]

IMPELLER_DEFINE_HANDLE ( ImpellerColorSource  )

Color sources are functions that generate colors for each texture element covered by a draw call. The colors for each element can be generated using a mathematical function (to produce gradients for example) or sampled from a texture.

◆ IMPELLER_DEFINE_HANDLE() [3/20]

IMPELLER_DEFINE_HANDLE ( ImpellerContext  )

An Impeller graphics context. Contexts are platform and client-rendering-API specific.

Contexts are thread-safe objects that are expensive to create. Most applications will only ever create a single context during their lifetimes. Once setup, Impeller is ready to render frames as performantly as possible.

During setup, context create the underlying graphics pipelines, allocators, worker threads, etc...

The general guidance is to create as few contexts as possible (typically just one) and share them as much as possible.

◆ IMPELLER_DEFINE_HANDLE() [4/20]

IMPELLER_DEFINE_HANDLE ( ImpellerDisplayList  )

Display lists represent encoded rendering intent. These objects are immutable, reusable, thread-safe, and context-agnostic.

While it is perfectly fine to create new display lists per frame, there may be opportunities for optimization when display lists are reused multiple times.

◆ IMPELLER_DEFINE_HANDLE() [5/20]

IMPELLER_DEFINE_HANDLE ( ImpellerDisplayListBuilder  )

Display list builders allow for the incremental creation of display lists.

Display list builders are context-agnostic.

◆ IMPELLER_DEFINE_HANDLE() [6/20]

IMPELLER_DEFINE_HANDLE ( ImpellerFragmentProgram  )

A fragment shader is a small program that is authored in GLSL and compiled using impellerc that runs on each pixel covered by a polygon and allows the user to configure how it is shaded.

See also
https://docs.flutter.dev/ui/design/graphics/fragment-shaders

◆ IMPELLER_DEFINE_HANDLE() [7/20]

IMPELLER_DEFINE_HANDLE ( ImpellerGlyphInfo  )

Describes the metrics of glyphs in a paragraph line.

◆ IMPELLER_DEFINE_HANDLE() [8/20]

IMPELLER_DEFINE_HANDLE ( ImpellerImageFilter  )

Image filters are functions that are applied regions of a texture to produce a single color. Contrast this with color filters that operate independently on a per-pixel basis. The generated color is then merged with the destination during blending.

◆ IMPELLER_DEFINE_HANDLE() [9/20]

IMPELLER_DEFINE_HANDLE ( ImpellerLineMetrics  )

Describes the metrics of lines in a fully laid out paragraph.

Regardless of how the string of text is specified to the paragraph builder, offsets into buffers that are returned by line metrics are always assumed to be into buffers of UTF-16 code units.

◆ IMPELLER_DEFINE_HANDLE() [10/20]

IMPELLER_DEFINE_HANDLE ( ImpellerMaskFilter  )

Mask filters are functions that are applied over a shape after it has been drawn but before it has been blended into the final image.

◆ IMPELLER_DEFINE_HANDLE() [11/20]

IMPELLER_DEFINE_HANDLE ( ImpellerPaint  )

Paints control the behavior of draw calls encoded in a display list.

Like display lists, paints are context-agnostic.

◆ IMPELLER_DEFINE_HANDLE() [12/20]

IMPELLER_DEFINE_HANDLE ( ImpellerParagraph  )

An immutable, fully laid out paragraph.

◆ IMPELLER_DEFINE_HANDLE() [13/20]

IMPELLER_DEFINE_HANDLE ( ImpellerParagraphBuilder  )

Paragraph builders allow for the creation of fully laid out paragraphs (which themselves are immutable).

To build a paragraph, users push/pop paragraph styles onto a stack then add UTF-8 encoded text. The properties on the top of paragraph style stack when the text is added are used to layout and shape that subset of the paragraph.

See also
ImpellerParagraphStyle

◆ IMPELLER_DEFINE_HANDLE() [14/20]

IMPELLER_DEFINE_HANDLE ( ImpellerParagraphStyle  )

Specified when building a paragraph, paragraph styles are managed in a stack with specify text properties to apply to text that is added to the paragraph builder.

◆ IMPELLER_DEFINE_HANDLE() [15/20]

IMPELLER_DEFINE_HANDLE ( ImpellerPath  )

Represents a two-dimensional path that is immutable and graphics context agnostic.

Paths in Impeller consist of linear, cubic Bézier curve, and quadratic Bézier curve segments. All other shapes are approximations using these building blocks.

Paths are created using path builder that allow for the configuration of the path segments, how they are filled, and/or stroked.

◆ IMPELLER_DEFINE_HANDLE() [16/20]

IMPELLER_DEFINE_HANDLE ( ImpellerPathBuilder  )

Path builders allow for the incremental building up of paths.

◆ IMPELLER_DEFINE_HANDLE() [17/20]

IMPELLER_DEFINE_HANDLE ( ImpellerSurface  )

A surface represents a render target for Impeller to direct the rendering intent specified the form of display lists to.

Render targets are how Impeller API users perform Window System Integration (WSI). Users wrap swapchain images as surfaces and draw display lists onto these surfaces to present content.

Creating surfaces is typically platform and client-rendering-API specific.

◆ IMPELLER_DEFINE_HANDLE() [18/20]

IMPELLER_DEFINE_HANDLE ( ImpellerTexture  )

A reference to a texture whose data is resident on the GPU. These can be referenced in draw calls and paints.

Creating textures is extremely expensive. Creating a single one can typically comfortably blow the frame budget of an application. Textures should be created on background threads.

Warning
While textures themselves are thread safe, some context types (like OpenGL) may need extra configuration to be able to operate from multiple threads.

◆ IMPELLER_DEFINE_HANDLE() [19/20]

IMPELLER_DEFINE_HANDLE ( ImpellerTypographyContext  )

Typography contexts allow for the layout and rendering of text.

These are typically expensive to create and applications will only ever need to create a single one of these during their lifetimes.

Unlike graphics context, typograhy contexts are not thread-safe. These must be created, used, and collected on a single thread.

◆ IMPELLER_DEFINE_HANDLE() [20/20]

IMPELLER_DEFINE_HANDLE ( ImpellerVulkanSwapchain  )

The primary form of WSI when using a Vulkan context, these swapchains use the VK_KHR_surface Vulkan extension.

Creating a swapchain is extremely expensive. One must be created at application startup and re-used throughout the application lifecycle.

Swapchains are resilient to the underlying surfaces being resized. The swapchain images will be re-created as necessary on-demand.

◆ ImpellerColorFilterCreateBlendNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorFilter IMPELLER_NULLABLE ImpellerColorFilterCreateBlendNew ( const ImpellerColor *IMPELLER_NONNULL  color,
ImpellerBlendMode  blend_mode 
)

Create a color filter that performs blending of pixel values independently.

Parameters
[in]colorThe color.
[in]blend_modeThe blend mode.
Returns
The color filter.

◆ ImpellerColorFilterCreateColorMatrixNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorFilter IMPELLER_NULLABLE ImpellerColorFilterCreateColorMatrixNew ( const ImpellerColorMatrix *IMPELLER_NONNULL  color_matrix)

Create a color filter that transforms pixel color values independently.

Parameters
[in]color_matrixThe color matrix.
Returns
The color filter.

◆ ImpellerColorFilterRelease()

IMPELLER_EXPORT void ImpellerColorFilterRelease ( ImpellerColorFilter IMPELLER_NULLABLE  color_filter)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]color_filterThe color filter.

◆ ImpellerColorFilterRetain()

IMPELLER_EXPORT void ImpellerColorFilterRetain ( ImpellerColorFilter IMPELLER_NULLABLE  color_filter)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]color_filterThe color filter.

◆ ImpellerColorSourceCreateConicalGradientNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateConicalGradientNew ( const ImpellerPoint *IMPELLER_NONNULL  start_center,
float  start_radius,
const ImpellerPoint *IMPELLER_NONNULL  end_center,
float  end_radius,
uint32_t  stop_count,
const ImpellerColor *IMPELLER_NONNULL  colors,
const float *IMPELLER_NONNULL  stops,
ImpellerTileMode  tile_mode,
const ImpellerMatrix *IMPELLER_NULLABLE  transformation 
)

Create a color source that forms a conical gradient.

Parameters
[in]start_centerThe start center.
[in]start_radiusThe start radius.
[in]end_centerThe end center.
[in]end_radiusThe end radius.
[in]stop_countThe stop count.
[in]colorsThe colors.
[in]stopsThe stops.
[in]tile_modeThe tile mode.
[in]transformationThe transformation.
Returns
The color source.

◆ ImpellerColorSourceCreateFragmentProgramNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateFragmentProgramNew ( ImpellerContext IMPELLER_NONNULL  context,
ImpellerFragmentProgram IMPELLER_NONNULL  fragment_program,
IMPELLER_NONNULL ImpellerTexture *IMPELLER_NULLABLE  samplers,
size_t  samplers_count,
const uint8_t *IMPELLER_NULLABLE  data,
size_t  data_bytes_length 
)

Create a color source whose pixels are shaded by a fragment program.

See also
https://docs.flutter.dev/ui/design/graphics/fragment-shaders
Parameters
[in]contextThe context.
[in]fragment_programThe fragment program.
samplersThe samplers.
[in]samplers_countThe samplers count.
[in]dataThe data (copied).
[in]data_bytes_lengthThe data bytes length.
Returns
The color source.

◆ ImpellerColorSourceCreateImageNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateImageNew ( ImpellerTexture IMPELLER_NONNULL  image,
ImpellerTileMode  horizontal_tile_mode,
ImpellerTileMode  vertical_tile_mode,
ImpellerTextureSampling  sampling,
const ImpellerMatrix *IMPELLER_NULLABLE  transformation 
)

Create a color source that samples from an image.

Parameters
[in]imageThe image.
[in]horizontal_tile_modeThe horizontal tile mode.
[in]vertical_tile_modeThe vertical tile mode.
[in]samplingThe sampling.
[in]transformationThe transformation.
Returns
The color source.

◆ ImpellerColorSourceCreateLinearGradientNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateLinearGradientNew ( const ImpellerPoint *IMPELLER_NONNULL  start_point,
const ImpellerPoint *IMPELLER_NONNULL  end_point,
uint32_t  stop_count,
const ImpellerColor *IMPELLER_NONNULL  colors,
const float *IMPELLER_NONNULL  stops,
ImpellerTileMode  tile_mode,
const ImpellerMatrix *IMPELLER_NULLABLE  transformation 
)

Create a color source that forms a linear gradient.

Parameters
[in]start_pointThe start point.
[in]end_pointThe end point.
[in]stop_countThe stop count.
[in]colorsThe colors.
[in]stopsThe stops.
[in]tile_modeThe tile mode.
[in]transformationThe transformation.
Returns
The color source.

◆ ImpellerColorSourceCreateRadialGradientNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateRadialGradientNew ( const ImpellerPoint *IMPELLER_NONNULL  center,
float  radius,
uint32_t  stop_count,
const ImpellerColor *IMPELLER_NONNULL  colors,
const float *IMPELLER_NONNULL  stops,
ImpellerTileMode  tile_mode,
const ImpellerMatrix *IMPELLER_NULLABLE  transformation 
)

Create a color source that forms a radial gradient.

Parameters
[in]centerThe center.
[in]radiusThe radius.
[in]stop_countThe stop count.
[in]colorsThe colors.
[in]stopsThe stops.
[in]tile_modeThe tile mode.
[in]transformationThe transformation.
Returns
The color source.

◆ ImpellerColorSourceCreateSweepGradientNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerColorSource IMPELLER_NULLABLE ImpellerColorSourceCreateSweepGradientNew ( const ImpellerPoint *IMPELLER_NONNULL  center,
float  start,
float  end,
uint32_t  stop_count,
const ImpellerColor *IMPELLER_NONNULL  colors,
const float *IMPELLER_NONNULL  stops,
ImpellerTileMode  tile_mode,
const ImpellerMatrix *IMPELLER_NULLABLE  transformation 
)

Create a color source that forms a sweep gradient.

Parameters
[in]centerThe center.
[in]startThe start.
[in]endThe end.
[in]stop_countThe stop count.
[in]colorsThe colors.
[in]stopsThe stops.
[in]tile_modeThe tile mode.
[in]transformationThe transformation.
Returns
The color source.

◆ ImpellerColorSourceRelease()

IMPELLER_EXPORT void ImpellerColorSourceRelease ( ImpellerColorSource IMPELLER_NULLABLE  color_source)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]color_sourceThe color source.

◆ ImpellerColorSourceRetain()

IMPELLER_EXPORT void ImpellerColorSourceRetain ( ImpellerColorSource IMPELLER_NULLABLE  color_source)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]color_sourceThe color source.

◆ ImpellerContextCreateMetalNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE ImpellerContextCreateMetalNew ( uint32_t  version)

Create a Metal context using the system default Metal device.

Parameters
[in]versionThe version specified in the IMPELLER_VERSION macro.
Returns
The Metal context or NULL if one cannot be created.

Referenced by main().

◆ ImpellerContextCreateOpenGLESNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE ImpellerContextCreateOpenGLESNew ( uint32_t  version,
ImpellerProcAddressCallback IMPELLER_NONNULL  gl_proc_address_callback,
void *IMPELLER_NULLABLE  gl_proc_address_callback_user_data 
)

Create an OpenGL(ES) Impeller context.

Warning
Unlike other context types, the OpenGL ES context can only be created, used, and collected on the calling thread. This restriction may be lifted in the future once reactor workers are exposed in the API. No other context types have threading restrictions. Till reactor workers can be used, using the context on a background thread will cause a stall of OpenGL operations.
Parameters
[in]versionThe version of the Impeller standalone API. See ImpellerGetVersion. If the specified here is not compatible with the version of the library, context creation will fail and NULL context returned from this call.
[in]gl_proc_address_callbackThe gl proc address callback. For instance, eglGetProcAddress.
[in]gl_proc_address_callback_user_dataThe gl proc address callback user data baton. This pointer is not interpreted by Impeller and will be returned as user data in the proc address callback. user data.
Returns
The context or NULL if one cannot be created.

Referenced by main().

◆ ImpellerContextCreateVulkanNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerContext IMPELLER_NULLABLE ImpellerContextCreateVulkanNew ( uint32_t  version,
const ImpellerContextVulkanSettings *IMPELLER_NONNULL  settings 
)

Create a Vulkan context using the provided Vulkan Settings.

Parameters
[in]versionThe version specified in the IMPELLER_VERSION macro.
[in]settingsThe Vulkan settings.
Returns
The Vulkan context or NULL if one cannot be created.

Referenced by main().

◆ ImpellerContextGetVulkanInfo()

IMPELLER_EXPORT bool ImpellerContextGetVulkanInfo ( ImpellerContext IMPELLER_NONNULL  context,
ImpellerContextVulkanInfo *IMPELLER_NONNULL  out_vulkan_info 
)

Get internal Vulkan handles managed by the given Vulkan context. Ownership of the handles is still maintained by Impeller. This accessor is just available so embedders can create resources using the same device and instance as Impeller for interop.

Warning
If the context is not a Vulkan context, False is returned with the [out] argument unaffected.
Parameters
[in]contextThe context
[out]out_vulkan_infoThe out vulkan information
Returns
If the Vulkan info could be fetched from the context.

Referenced by main().

◆ ImpellerContextRelease()

IMPELLER_EXPORT void ImpellerContextRelease ( ImpellerContext IMPELLER_NULLABLE  context)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]contextThe context.

Referenced by main().

◆ ImpellerContextRetain()

IMPELLER_EXPORT void ImpellerContextRetain ( ImpellerContext IMPELLER_NULLABLE  context)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]contextThe context.

◆ ImpellerDisplayListBuilderClipOval()

IMPELLER_EXPORT void ImpellerDisplayListBuilderClipOval ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
const ImpellerRect *IMPELLER_NONNULL  oval_bounds,
ImpellerClipOperation  op 
)

Reduces the clip region to the intersection of the current clip and the given oval taking into account the clip operation.

Parameters
[in]builderThe builder.
[in]oval_boundsThe oval bounds.
[in]opThe operation.

◆ ImpellerDisplayListBuilderClipPath()

IMPELLER_EXPORT void ImpellerDisplayListBuilderClipPath ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
ImpellerPath IMPELLER_NONNULL  path,
ImpellerClipOperation  op 
)

Reduces the clip region to the intersection of the current clip and the given path taking into account the clip operation.

Parameters
[in]builderThe builder.
[in]pathThe path.
[in]opThe operation.

◆ ImpellerDisplayListBuilderClipRect()

IMPELLER_EXPORT void ImpellerDisplayListBuilderClipRect ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
const ImpellerRect *IMPELLER_NONNULL  rect,
ImpellerClipOperation  op 
)

Reduces the clip region to the intersection of the current clip and the given rectangle taking into account the clip operation.

Parameters
[in]builderThe builder.
[in]rectThe rectangle.
[in]opThe operation.

◆ ImpellerDisplayListBuilderClipRoundedRect()

IMPELLER_EXPORT void ImpellerDisplayListBuilderClipRoundedRect ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
const ImpellerRect *IMPELLER_NONNULL  rect,
const ImpellerRoundingRadii *IMPELLER_NONNULL  radii,
ImpellerClipOperation  op 
)

Reduces the clip region to the intersection of the current clip and the given rounded rectangle taking into account the clip operation.

Parameters
[in]builderThe builder.
[in]rectThe rectangle.
[in]radiiThe radii.
[in]opThe operation.

◆ ImpellerDisplayListBuilderCreateDisplayListNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerDisplayList IMPELLER_NULLABLE ImpellerDisplayListBuilderCreateDisplayListNew ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder)

Create a new display list using the rendering intent already encoded in the builder. The builder is reset after this call.

Parameters
[in]builderThe builder.
Returns
The display list.

Referenced by main().

◆ ImpellerDisplayListBuilderDrawDashedLine()

IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawDashedLine ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
const ImpellerPoint *IMPELLER_NONNULL  from,
const ImpellerPoint *IMPELLER_NONNULL  to,
float  on_length,
float  off_length,
ImpellerPaint IMPELLER_NONNULL  paint 
)

Draws a dash line segment.

Parameters
[in]builderThe builder.
[in]fromThe starting point of the line.
[in]toThe end point of the line.
[in]on_lengthOn length.
[in]off_lengthOff length.
[in]paintThe paint.

◆ ImpellerDisplayListBuilderDrawDisplayList()

IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawDisplayList ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
ImpellerDisplayList IMPELLER_NONNULL  display_list,
float  opacity 
)

Flattens the contents of another display list into the one currently being built.

Parameters
[in]builderThe builder.
[in]display_listThe display list.
[in]opacityThe opacity.

◆ ImpellerDisplayListBuilderDrawLine()

IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawLine ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
const ImpellerPoint *IMPELLER_NONNULL  from,
const ImpellerPoint *IMPELLER_NONNULL  to,
ImpellerPaint IMPELLER_NONNULL  paint 
)

Draws a line segment.

Parameters
[in]builderThe builder.
[in]fromThe starting point of the line.
[in]toThe end point of the line.
[in]paintThe paint.

◆ ImpellerDisplayListBuilderDrawOval()

IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawOval ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
const ImpellerRect *IMPELLER_NONNULL  oval_bounds,
ImpellerPaint IMPELLER_NONNULL  paint 
)

Draws an oval.

Parameters
[in]builderThe builder.
[in]oval_boundsThe oval bounds.
[in]paintThe paint.

◆ ImpellerDisplayListBuilderDrawPaint()

IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawPaint ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
ImpellerPaint IMPELLER_NONNULL  paint 
)

Fills the current clip with the specified paint.

Parameters
[in]builderThe builder.
[in]paintThe paint.

Referenced by main().

◆ ImpellerDisplayListBuilderDrawParagraph()

IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawParagraph ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
ImpellerParagraph IMPELLER_NONNULL  paragraph,
const ImpellerPoint *IMPELLER_NONNULL  point 
)

Draw a paragraph at the specified point.

Parameters
[in]builderThe builder.
[in]paragraphThe paragraph.
[in]pointThe point.

◆ ImpellerDisplayListBuilderDrawPath()

IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawPath ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
ImpellerPath IMPELLER_NONNULL  path,
ImpellerPaint IMPELLER_NONNULL  paint 
)

Draws the specified shape.

Parameters
[in]builderThe builder.
[in]pathThe path.
[in]paintThe paint.

◆ ImpellerDisplayListBuilderDrawRect()

IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawRect ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
const ImpellerRect *IMPELLER_NONNULL  rect,
ImpellerPaint IMPELLER_NONNULL  paint 
)

Draws a rectangle.

Parameters
[in]builderThe builder.
[in]rectThe rectangle.
[in]paintThe paint.

Referenced by main().

◆ ImpellerDisplayListBuilderDrawRoundedRect()

IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawRoundedRect ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
const ImpellerRect *IMPELLER_NONNULL  rect,
const ImpellerRoundingRadii *IMPELLER_NONNULL  radii,
ImpellerPaint IMPELLER_NONNULL  paint 
)

Draws a rounded rect.

Parameters
[in]builderThe builder.
[in]rectThe rectangle.
[in]radiiThe radii.
[in]paintThe paint.

◆ ImpellerDisplayListBuilderDrawRoundedRectDifference()

IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawRoundedRectDifference ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
const ImpellerRect *IMPELLER_NONNULL  outer_rect,
const ImpellerRoundingRadii *IMPELLER_NONNULL  outer_radii,
const ImpellerRect *IMPELLER_NONNULL  inner_rect,
const ImpellerRoundingRadii *IMPELLER_NONNULL  inner_radii,
ImpellerPaint IMPELLER_NONNULL  paint 
)

Draws a shape that is the different between the specified rectangles (each with configurable corner radii).

Parameters
[in]builderThe builder.
[in]outer_rectThe outer rectangle.
[in]outer_radiiThe outer radii.
[in]inner_rectThe inner rectangle.
[in]inner_radiiThe inner radii.
[in]paintThe paint.

◆ ImpellerDisplayListBuilderDrawShadow()

IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawShadow ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
ImpellerPath IMPELLER_NONNULL  path,
const ImpellerColor *IMPELLER_NONNULL  color,
float  elevation,
bool  occluder_is_transparent,
float  device_pixel_ratio 
)

Draw a shadow for a Path given a material elevation. If the occluding object is not opaque, additional hints (via the occluder_is_transparent argument) must be provided to render the shadow correctly.

Parameters
[in]builderThe builder.
[in]pathThe shadow path.
[in]colorThe shadow color.
[in]elevationThe material elevation.
[in]occluder_is_transparentIf the object casting the shadow is transparent.
[in]device_pixel_ratioThe device pixel ratio.

◆ ImpellerDisplayListBuilderDrawTexture()

IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawTexture ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
ImpellerTexture IMPELLER_NONNULL  texture,
const ImpellerPoint *IMPELLER_NONNULL  point,
ImpellerTextureSampling  sampling,
ImpellerPaint IMPELLER_NULLABLE  paint 
)

Draw a texture at the specified point.

Parameters
[in]builderThe builder.
[in]textureThe texture.
[in]pointThe point.
[in]samplingThe sampling.
[in]paintThe paint.

◆ ImpellerDisplayListBuilderDrawTextureRect()

IMPELLER_EXPORT void ImpellerDisplayListBuilderDrawTextureRect ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
ImpellerTexture IMPELLER_NONNULL  texture,
const ImpellerRect *IMPELLER_NONNULL  src_rect,
const ImpellerRect *IMPELLER_NONNULL  dst_rect,
ImpellerTextureSampling  sampling,
ImpellerPaint IMPELLER_NULLABLE  paint 
)

Draw a portion of texture at the specified location.

Parameters
[in]builderThe builder.
[in]textureThe texture.
[in]src_rectThe source rectangle.
[in]dst_rectThe destination rectangle.
[in]samplingThe sampling.
[in]paintThe paint.

◆ ImpellerDisplayListBuilderGetSaveCount()

IMPELLER_EXPORT uint32_t ImpellerDisplayListBuilderGetSaveCount ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder)

Get the current size of the save stack.

Parameters
[in]builderThe builder.
Returns
The save stack size.

◆ ImpellerDisplayListBuilderGetTransform()

IMPELLER_EXPORT void ImpellerDisplayListBuilderGetTransform ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
ImpellerMatrix *IMPELLER_NONNULL  out_transform 
)

Get the transformation currently built up on the top of the transformation stack.

Parameters
[in]builderThe builder.
[out]out_transformThe transform.

◆ ImpellerDisplayListBuilderNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerDisplayListBuilder IMPELLER_NULLABLE ImpellerDisplayListBuilderNew ( const ImpellerRect *IMPELLER_NULLABLE  cull_rect)

Create a new display list builder.

        An optional cull rectangle may be specified. Impeller is allowed
        to treat the contents outside this rectangle as being undefined.
        This may aid performance optimizations.
Parameters
[in]cull_rectThe cull rectangle or NULL.
Returns
The display list builder.

Referenced by main().

◆ ImpellerDisplayListBuilderRelease()

IMPELLER_EXPORT void ImpellerDisplayListBuilderRelease ( ImpellerDisplayListBuilder IMPELLER_NULLABLE  builder)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]builderThe display list builder.

Referenced by main().

◆ ImpellerDisplayListBuilderResetTransform()

IMPELLER_EXPORT void ImpellerDisplayListBuilderResetTransform ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder)

Reset the transformation on top of the transformation stack to identity.

Parameters
[in]builderThe builder.

◆ ImpellerDisplayListBuilderRestore()

IMPELLER_EXPORT void ImpellerDisplayListBuilderRestore ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder)

Pops the last entry pushed onto the save stack using a call to ImpellerDisplayListBuilderSave or ImpellerDisplayListBuilderSaveLayer.

Parameters
[in]builderThe builder.

◆ ImpellerDisplayListBuilderRestoreToCount()

IMPELLER_EXPORT void ImpellerDisplayListBuilderRestoreToCount ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
uint32_t  count 
)

Effectively calls ImpellerDisplayListBuilderRestore till the size of the save stack becomes a specified count.

Parameters
[in]builderThe builder.
[in]countThe count.

◆ ImpellerDisplayListBuilderRetain()

IMPELLER_EXPORT void ImpellerDisplayListBuilderRetain ( ImpellerDisplayListBuilder IMPELLER_NULLABLE  builder)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]builderThe display list builder.

◆ ImpellerDisplayListBuilderRotate()

IMPELLER_EXPORT void ImpellerDisplayListBuilderRotate ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
float  angle_degrees 
)

Apply a clockwise rotation to the transformation matrix currently on top of the save stack.

Parameters
[in]builderThe builder.
[in]angle_degreesThe angle in degrees.

◆ ImpellerDisplayListBuilderSave()

IMPELLER_EXPORT void ImpellerDisplayListBuilderSave ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder)

Stashes the current transformation and clip state onto a save stack.

Parameters
[in]builderThe builder.

◆ ImpellerDisplayListBuilderSaveLayer()

IMPELLER_EXPORT void ImpellerDisplayListBuilderSaveLayer ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
const ImpellerRect *IMPELLER_NONNULL  bounds,
ImpellerPaint IMPELLER_NULLABLE  paint,
ImpellerImageFilter IMPELLER_NULLABLE  backdrop 
)

Stashes the current transformation and clip state onto a save stack and creates and creates an offscreen layer onto which subsequent rendering intent will be directed to.

On the balancing call to restore, the supplied paints filters and blend modes will be used to composite the offscreen contents back onto the display display list.

Parameters
[in]builderThe builder.
[in]boundsThe bounds.
[in]paintThe paint.
[in]backdropThe backdrop.

◆ ImpellerDisplayListBuilderScale()

IMPELLER_EXPORT void ImpellerDisplayListBuilderScale ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
float  x_scale,
float  y_scale 
)

Apply a scale to the transformation matrix currently on top of the save stack.

Parameters
[in]builderThe builder.
[in]x_scaleThe x scale.
[in]y_scaleThe y scale.

◆ ImpellerDisplayListBuilderSetTransform()

IMPELLER_EXPORT void ImpellerDisplayListBuilderSetTransform ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
const ImpellerMatrix *IMPELLER_NONNULL  transform 
)

Clear the transformation on top of the save stack and replace it with a new value.

Parameters
[in]builderThe builder.
[in]transformThe new transform.

◆ ImpellerDisplayListBuilderTransform()

IMPELLER_EXPORT void ImpellerDisplayListBuilderTransform ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
const ImpellerMatrix *IMPELLER_NONNULL  transform 
)

Appends the the provided transformation to the transformation already on the save stack.

Parameters
[in]builderThe builder.
[in]transformThe transform to append.

◆ ImpellerDisplayListBuilderTranslate()

IMPELLER_EXPORT void ImpellerDisplayListBuilderTranslate ( ImpellerDisplayListBuilder IMPELLER_NONNULL  builder,
float  x_translation,
float  y_translation 
)

Apply a translation to the transformation matrix currently on top of the save stack.

Parameters
[in]builderThe builder.
[in]x_translationThe x translation.
[in]y_translationThe y translation.

◆ ImpellerDisplayListRelease()

IMPELLER_EXPORT void ImpellerDisplayListRelease ( ImpellerDisplayList IMPELLER_NULLABLE  display_list)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]display_listThe display list.

Referenced by main().

◆ ImpellerDisplayListRetain()

IMPELLER_EXPORT void ImpellerDisplayListRetain ( ImpellerDisplayList IMPELLER_NULLABLE  display_list)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]display_listThe display list.

◆ ImpellerFragmentProgramNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerFragmentProgram IMPELLER_NULLABLE ImpellerFragmentProgramNew ( const ImpellerMapping *IMPELLER_NONNULL  data,
void *IMPELLER_NULLABLE  data_release_user_data 
)

Create a new fragment program using data obtained by compiling a GLSL shader with impellerc.

Warning
The data provided must be compiled by impellerc. Providing raw GLSL strings will lead to a nullptr return. Impeller does not compile shaders at runtime.
Parameters
[in]dataThe data compiled by impellerc.
data_release_user_dataA baton passed back to the caller on the invocation of the mappings release callback. This call can happen on any thread.
Returns
The fragment program if one can be created, nullptr otherwise.

◆ ImpellerFragmentProgramRelease()

IMPELLER_EXPORT void ImpellerFragmentProgramRelease ( ImpellerFragmentProgram IMPELLER_NULLABLE  fragment_program)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]fragment_programThe fragment program.

◆ ImpellerFragmentProgramRetain()

IMPELLER_EXPORT void ImpellerFragmentProgramRetain ( ImpellerFragmentProgram IMPELLER_NULLABLE  fragment_program)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]fragment_programThe fragment program.

◆ ImpellerGetVersion()

IMPELLER_EXPORT uint32_t ImpellerGetVersion ( )

Get the version of Impeller standalone API. This is the API that will be accepted for validity checks when provided to the context creation methods.

The current version of the API is denoted by the IMPELLER_VERSION macro. This version must be passed to APIs that create top-level objects like graphics contexts. Construction of the context may fail if the API version expected by the caller is not supported by the library.

Since there are no API stability guarantees today, passing a version that is different to the one returned by ImpellerGetVersion will always fail.

See also
ImpellerContextCreateOpenGLESNew
Returns
The version of the standalone API.

◆ ImpellerGlyphInfoGetGraphemeClusterBounds()

IMPELLER_EXPORT void ImpellerGlyphInfoGetGraphemeClusterBounds ( ImpellerGlyphInfo IMPELLER_NONNULL  glyph_info,
ImpellerRect *IMPELLER_NONNULL  out_bounds 
)

Fetch the bounds of the grapheme cluster for the glyph in the coordinate space of the paragraph.

Parameters
[in]glyph_infoThe glyph information.
[out]out_boundsThe grapheme cluster bounds.

◆ ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeBegin()

IMPELLER_EXPORT size_t ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeBegin ( ImpellerGlyphInfo IMPELLER_NONNULL  glyph_info)

Fetch the start index in the buffer of UTF-16 code units used to represent the grapheme cluster for a glyph.

Parameters
[in]glyph_infoThe glyph information.
Returns
The UTF-16 code units start index.

◆ ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeEnd()

IMPELLER_EXPORT size_t ImpellerGlyphInfoGetGraphemeClusterCodeUnitRangeEnd ( ImpellerGlyphInfo IMPELLER_NONNULL  glyph_info)

Fetch the end index in the buffer of UTF-16 code units used to represent the grapheme cluster for a glyph.

Parameters
[in]glyph_infoThe glyph information.
Returns
The UTF-16 code units end index.

◆ ImpellerGlyphInfoGetTextDirection()

IMPELLER_EXPORT ImpellerTextDirection ImpellerGlyphInfoGetTextDirection ( ImpellerGlyphInfo IMPELLER_NONNULL  glyph_info)
Parameters
[in]glyph_infoThe glyph information.
Returns
The direction of the run that contains the glyph.

◆ ImpellerGlyphInfoIsEllipsis()

IMPELLER_EXPORT bool ImpellerGlyphInfoIsEllipsis ( ImpellerGlyphInfo IMPELLER_NONNULL  glyph_info)
Parameters
[in]glyph_infoThe glyph information.
Returns
True if the glyph represents an ellipsis. False otherwise.

◆ ImpellerGlyphInfoRelease()

IMPELLER_EXPORT void ImpellerGlyphInfoRelease ( ImpellerGlyphInfo IMPELLER_NULLABLE  glyph_info)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]glyph_infoThe glyph information.

◆ ImpellerGlyphInfoRetain()

IMPELLER_EXPORT void ImpellerGlyphInfoRetain ( ImpellerGlyphInfo IMPELLER_NULLABLE  glyph_info)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]glyph_infoThe glyph information.

◆ ImpellerImageFilterCreateBlurNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateBlurNew ( float  x_sigma,
float  y_sigma,
ImpellerTileMode  tile_mode 
)

Creates an image filter that applies a Gaussian blur.

        The Gaussian blur applied may be an approximation for
        performance.
Parameters
[in]x_sigmaThe x sigma.
[in]y_sigmaThe y sigma.
[in]tile_modeThe tile mode.
Returns
The image filter.

◆ ImpellerImageFilterCreateComposeNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateComposeNew ( ImpellerImageFilter IMPELLER_NONNULL  outer,
ImpellerImageFilter IMPELLER_NONNULL  inner 
)

Creates a composed filter that when applied is identical to subsequently applying the inner and then the outer filters.

destination = outer_filter(inner_filter(source))

Parameters
[in]outerThe outer image filter.
[in]innerThe inner image filter.
Returns
The combined image filter.

◆ ImpellerImageFilterCreateDilateNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateDilateNew ( float  x_radius,
float  y_radius 
)

Creates an image filter that enhances the per-channel pixel values to the maximum value in a circle around the pixel.

Parameters
[in]x_radiusThe x radius.
[in]y_radiusThe y radius.
Returns
The image filter.

◆ ImpellerImageFilterCreateErodeNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateErodeNew ( float  x_radius,
float  y_radius 
)

Creates an image filter that dampens the per-channel pixel values to the minimum value in a circle around the pixel.

Parameters
[in]x_radiusThe x radius.
[in]y_radiusThe y radius.
Returns
The image filter.

◆ ImpellerImageFilterCreateFragmentProgramNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateFragmentProgramNew ( ImpellerContext IMPELLER_NONNULL  context,
ImpellerFragmentProgram IMPELLER_NONNULL  fragment_program,
IMPELLER_NONNULL ImpellerTexture *IMPELLER_NULLABLE  samplers,
size_t  samplers_count,
const uint8_t *IMPELLER_NULLABLE  data,
size_t  data_bytes_length 
)

Create an image filter where each pixel is shaded by a fragment program.

See also
https://docs.flutter.dev/ui/design/graphics/fragment-shaders
Parameters
[in]contextThe context.
[in]fragment_programThe fragment program.
samplersThe samplers.
[in]samplers_countThe samplers count.
[in]dataThe data (copied).
[in]data_bytes_lengthThe data bytes length.
Returns
The image filter.

◆ ImpellerImageFilterCreateMatrixNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerImageFilter IMPELLER_NULLABLE ImpellerImageFilterCreateMatrixNew ( const ImpellerMatrix *IMPELLER_NONNULL  matrix,
ImpellerTextureSampling  sampling 
)

Creates an image filter that applies a transformation matrix to the underlying image.

Parameters
[in]matrixThe transformation matrix.
[in]samplingThe image sampling mode.
Returns
The image filter.

◆ ImpellerImageFilterRelease()

IMPELLER_EXPORT void ImpellerImageFilterRelease ( ImpellerImageFilter IMPELLER_NULLABLE  image_filter)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]image_filterThe image filter.

◆ ImpellerImageFilterRetain()

IMPELLER_EXPORT void ImpellerImageFilterRetain ( ImpellerImageFilter IMPELLER_NULLABLE  image_filter)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]image_filterThe image filter.

◆ ImpellerLineMetricsGetAscent()

IMPELLER_EXPORT double ImpellerLineMetricsGetAscent ( ImpellerLineMetrics IMPELLER_NONNULL  metrics,
size_t  line 
)

The rise from the baseline as calculated from the font and style for this line.

Parameters
[in]metricsThe metrics.
[in]lineThe line index (zero based).
Returns
The ascent.

◆ ImpellerLineMetricsGetBaseline()

IMPELLER_EXPORT double ImpellerLineMetricsGetBaseline ( ImpellerLineMetrics IMPELLER_NONNULL  metrics,
size_t  line 
)

The y coordinate of the baseline for this line from the top of the paragraph.

Parameters
[in]metricsThe metrics.
[in]lineThe line index (zero based).
Returns
The baseline.

◆ ImpellerLineMetricsGetCodeUnitEndIndex()

IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitEndIndex ( ImpellerLineMetrics IMPELLER_NONNULL  metrics,
size_t  line 
)

Fetch the end index in the buffer of UTF-16 code units used to represent the paragraph line.

Parameters
[in]metricsThe metrics.
[in]lineThe line index (zero based).
Returns
The UTF-16 code units end index.

◆ ImpellerLineMetricsGetCodeUnitEndIndexExcludingWhitespace()

IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitEndIndexExcludingWhitespace ( ImpellerLineMetrics IMPELLER_NONNULL  metrics,
size_t  line 
)

Fetch the end index (excluding whitespace) in the buffer of UTF-16 code units used to represent the paragraph line.

Parameters
[in]metricsThe metrics.
[in]lineThe line index (zero based).
Returns
The UTF-16 code units end index excluding whitespace.

◆ ImpellerLineMetricsGetCodeUnitEndIndexIncludingNewline()

IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitEndIndexIncludingNewline ( ImpellerLineMetrics IMPELLER_NONNULL  metrics,
size_t  line 
)

Fetch the end index (including newlines) in the buffer of UTF-16 code units used to represent the paragraph line.

Parameters
[in]metricsThe metrics.
[in]lineThe line index (zero based).
Returns
The UTF-16 code units end index including newlines.

◆ ImpellerLineMetricsGetCodeUnitStartIndex()

IMPELLER_EXPORT size_t ImpellerLineMetricsGetCodeUnitStartIndex ( ImpellerLineMetrics IMPELLER_NONNULL  metrics,
size_t  line 
)

Fetch the start index in the buffer of UTF-16 code units used to represent the paragraph line.

Parameters
[in]metricsThe metrics.
[in]lineThe line index (zero based).
Returns
The UTF-16 code units start index.

◆ ImpellerLineMetricsGetDescent()

IMPELLER_EXPORT double ImpellerLineMetricsGetDescent ( ImpellerLineMetrics IMPELLER_NONNULL  metrics,
size_t  line 
)

The drop from the baseline as calculated from the font and style for this line.

Parameters
[in]metricsThe metrics.
[in]lineThe line index (zero based).
Returns
The descent.

◆ ImpellerLineMetricsGetHeight()

IMPELLER_EXPORT double ImpellerLineMetricsGetHeight ( ImpellerLineMetrics IMPELLER_NONNULL  metrics,
size_t  line 
)

Total height of the line from the top edge to the bottom edge.

Parameters
[in]metricsThe metrics.
[in]lineThe line index (zero based).
Returns
The height.

◆ ImpellerLineMetricsGetLeft()

IMPELLER_EXPORT double ImpellerLineMetricsGetLeft ( ImpellerLineMetrics IMPELLER_NONNULL  metrics,
size_t  line 
)

The x coordinate of left edge of the line.

Parameters
[in]metricsThe metrics.
[in]lineThe line index (zero based).
Returns
The left edge coordinate.

◆ ImpellerLineMetricsGetUnscaledAscent()

IMPELLER_EXPORT double ImpellerLineMetricsGetUnscaledAscent ( ImpellerLineMetrics IMPELLER_NONNULL  metrics,
size_t  line 
)

The rise from the baseline as calculated from the font and style for this line ignoring the height from the text style.

Parameters
[in]metricsThe metrics.
[in]lineThe line index (zero based).
Returns
The unscaled ascent.

◆ ImpellerLineMetricsGetWidth()

IMPELLER_EXPORT double ImpellerLineMetricsGetWidth ( ImpellerLineMetrics IMPELLER_NONNULL  metrics,
size_t  line 
)

Width of the line from the left edge of the leftmost glyph to the right edge of the rightmost glyph.

Parameters
[in]metricsThe metrics.
[in]lineThe line index (zero based).
Returns
The width.

◆ ImpellerLineMetricsIsHardbreak()

IMPELLER_EXPORT bool ImpellerLineMetricsIsHardbreak ( ImpellerLineMetrics IMPELLER_NONNULL  metrics,
size_t  line 
)

Used to determine if this line ends with an explicit line break (e.g. '
') or is the end of the paragraph.

Parameters
[in]metricsThe metrics.
[in]lineThe line index (zero based).
Returns
True if the line is a hard break.

◆ ImpellerLineMetricsRelease()

IMPELLER_EXPORT void ImpellerLineMetricsRelease ( ImpellerLineMetrics IMPELLER_NULLABLE  line_metrics)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]line_metricsThe line metrics.

◆ ImpellerLineMetricsRetain()

IMPELLER_EXPORT void ImpellerLineMetricsRetain ( ImpellerLineMetrics IMPELLER_NULLABLE  line_metrics)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]line_metricsThe line metrics.

◆ ImpellerMaskFilterCreateBlurNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerMaskFilter IMPELLER_NULLABLE ImpellerMaskFilterCreateBlurNew ( ImpellerBlurStyle  style,
float  sigma 
)

Create a mask filter that blurs contents in the masked shape.

Parameters
[in]styleThe style.
[in]sigmaThe sigma.
Returns
The mask filter.

◆ ImpellerMaskFilterRelease()

IMPELLER_EXPORT void ImpellerMaskFilterRelease ( ImpellerMaskFilter IMPELLER_NULLABLE  mask_filter)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]mask_filterThe mask filter.

◆ ImpellerMaskFilterRetain()

IMPELLER_EXPORT void ImpellerMaskFilterRetain ( ImpellerMaskFilter IMPELLER_NULLABLE  mask_filter)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]mask_filterThe mask filter.

◆ ImpellerPaintNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPaint IMPELLER_NULLABLE ImpellerPaintNew ( )

Create a new paint with default values.

Returns
The impeller paint.

Referenced by main().

◆ ImpellerPaintRelease()

IMPELLER_EXPORT void ImpellerPaintRelease ( ImpellerPaint IMPELLER_NULLABLE  paint)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]paintThe paint.

Referenced by main().

◆ ImpellerPaintRetain()

IMPELLER_EXPORT void ImpellerPaintRetain ( ImpellerPaint IMPELLER_NULLABLE  paint)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]paintThe paint.

◆ ImpellerPaintSetBlendMode()

IMPELLER_EXPORT void ImpellerPaintSetBlendMode ( ImpellerPaint IMPELLER_NONNULL  paint,
ImpellerBlendMode  mode 
)

Set the paint blend mode. The blend mode controls how the new paints contents are mixed with the values already drawn using previous draw calls.

Parameters
[in]paintThe paint.
[in]modeThe mode.

◆ ImpellerPaintSetColor()

IMPELLER_EXPORT void ImpellerPaintSetColor ( ImpellerPaint IMPELLER_NONNULL  paint,
const ImpellerColor *IMPELLER_NONNULL  color 
)

Set the paint color.

Parameters
[in]paintThe paint.
[in]colorThe color.

Referenced by main().

◆ ImpellerPaintSetColorFilter()

IMPELLER_EXPORT void ImpellerPaintSetColorFilter ( ImpellerPaint IMPELLER_NONNULL  paint,
ImpellerColorFilter IMPELLER_NONNULL  color_filter 
)

Set the color filter of the paint.

        Color filters are functions that take two colors and mix them to
        produce a single color. This color is then usually merged with
        the destination during blending.
Parameters
[in]paintThe paint.
[in]color_filterThe color filter.

◆ ImpellerPaintSetColorSource()

IMPELLER_EXPORT void ImpellerPaintSetColorSource ( ImpellerPaint IMPELLER_NONNULL  paint,
ImpellerColorSource IMPELLER_NONNULL  color_source 
)

Set the color source of the paint.

        Color sources are functions that generate colors for each
        texture element covered by a draw call.
Parameters
[in]paintThe paint.
[in]color_sourceThe color source.

◆ ImpellerPaintSetDrawStyle()

IMPELLER_EXPORT void ImpellerPaintSetDrawStyle ( ImpellerPaint IMPELLER_NONNULL  paint,
ImpellerDrawStyle  style 
)

Set the paint draw style. The style controls if the closed shapes are filled and/or stroked.

Parameters
[in]paintThe paint.
[in]styleThe style.

◆ ImpellerPaintSetImageFilter()

IMPELLER_EXPORT void ImpellerPaintSetImageFilter ( ImpellerPaint IMPELLER_NONNULL  paint,
ImpellerImageFilter IMPELLER_NONNULL  image_filter 
)

Set the image filter of a paint.

        Image filters are functions that are applied to regions of a
        texture to produce a single color.
Parameters
[in]paintThe paint.
[in]image_filterThe image filter.

◆ ImpellerPaintSetMaskFilter()

IMPELLER_EXPORT void ImpellerPaintSetMaskFilter ( ImpellerPaint IMPELLER_NONNULL  paint,
ImpellerMaskFilter IMPELLER_NONNULL  mask_filter 
)

Set the mask filter of a paint.

Parameters
[in]paintThe paint.
[in]mask_filterThe mask filter.

◆ ImpellerPaintSetStrokeCap()

IMPELLER_EXPORT void ImpellerPaintSetStrokeCap ( ImpellerPaint IMPELLER_NONNULL  paint,
ImpellerStrokeCap  cap 
)

Sets how strokes rendered using this paint are capped.

Parameters
[in]paintThe paint.
[in]capThe stroke cap style.

◆ ImpellerPaintSetStrokeJoin()

IMPELLER_EXPORT void ImpellerPaintSetStrokeJoin ( ImpellerPaint IMPELLER_NONNULL  paint,
ImpellerStrokeJoin  join 
)

Sets how strokes rendered using this paint are joined.

Parameters
[in]paintThe paint.
[in]joinThe join.

◆ ImpellerPaintSetStrokeMiter()

IMPELLER_EXPORT void ImpellerPaintSetStrokeMiter ( ImpellerPaint IMPELLER_NONNULL  paint,
float  miter 
)

Set the miter limit of the strokes rendered using this paint.

Parameters
[in]paintThe paint.
[in]miterThe miter limit.

◆ ImpellerPaintSetStrokeWidth()

IMPELLER_EXPORT void ImpellerPaintSetStrokeWidth ( ImpellerPaint IMPELLER_NONNULL  paint,
float  width 
)

Set the width of the strokes rendered using this paint.

Parameters
[in]paintThe paint.
[in]widthThe width.

◆ ImpellerParagraphBuilderAddText()

IMPELLER_EXPORT void ImpellerParagraphBuilderAddText ( ImpellerParagraphBuilder IMPELLER_NONNULL  paragraph_builder,
const uint8_t *IMPELLER_NULLABLE  data,
uint32_t  length 
)

Add UTF-8 encoded text to the paragraph. The text will be styled according to the paragraph style already on top of the paragraph style stack.

Parameters
[in]paragraph_builderThe paragraph builder.
[in]dataThe data.
[in]lengthThe length.

◆ ImpellerParagraphBuilderBuildParagraphNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraph IMPELLER_NULLABLE ImpellerParagraphBuilderBuildParagraphNew ( ImpellerParagraphBuilder IMPELLER_NONNULL  paragraph_builder,
float  width 
)

Layout and build a new paragraph using the specified width. The resulting paragraph is immutable. The paragraph builder must be discarded and a new one created to build more paragraphs.

Parameters
[in]paragraph_builderThe paragraph builder.
[in]widthThe paragraph width.
Returns
The paragraph if one can be created, NULL otherwise.

◆ ImpellerParagraphBuilderNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphBuilder IMPELLER_NULLABLE ImpellerParagraphBuilderNew ( ImpellerTypographyContext IMPELLER_NONNULL  context)

Create a new paragraph builder.

Parameters
[in]contextThe context.
Returns
The paragraph builder.

◆ ImpellerParagraphBuilderPopStyle()

IMPELLER_EXPORT void ImpellerParagraphBuilderPopStyle ( ImpellerParagraphBuilder IMPELLER_NONNULL  paragraph_builder)

Pop a previously pushed paragraph style from the paragraph style stack.

Parameters
[in]paragraph_builderThe paragraph builder.

◆ ImpellerParagraphBuilderPushStyle()

IMPELLER_EXPORT void ImpellerParagraphBuilderPushStyle ( ImpellerParagraphBuilder IMPELLER_NONNULL  paragraph_builder,
ImpellerParagraphStyle IMPELLER_NONNULL  style 
)

Push a new paragraph style onto the paragraph style stack managed by the paragraph builder.

Not all paragraph styles can be combined. For instance, it does not make sense to mix text alignment for different text runs within a paragraph. In such cases, the preference of the the first paragraph style on the style stack will take hold.

If text is pushed onto the paragraph builder without a style previously pushed onto the stack, a default paragraph text style will be used. This may not always be desirable because some style element cannot be overridden. It is recommended that a default paragraph style always be pushed onto the stack before the addition of any text.

Parameters
[in]paragraph_builderThe paragraph builder.
[in]styleThe style.

◆ ImpellerParagraphBuilderRelease()

IMPELLER_EXPORT void ImpellerParagraphBuilderRelease ( ImpellerParagraphBuilder IMPELLER_NULLABLE  paragraph_builder)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]paragraph_builderThe paragraph_builder.

◆ ImpellerParagraphBuilderRetain()

IMPELLER_EXPORT void ImpellerParagraphBuilderRetain ( ImpellerParagraphBuilder IMPELLER_NULLABLE  paragraph_builder)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]paragraph_builderThe paragraph builder.

◆ ImpellerParagraphCreateGlyphInfoAtCodeUnitIndexNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerGlyphInfo IMPELLER_NULLABLE ImpellerParagraphCreateGlyphInfoAtCodeUnitIndexNew ( ImpellerParagraph IMPELLER_NONNULL  paragraph,
size_t  code_unit_index 
)

Create a new instance of glyph info that can be queried for information about the glyph at the given UTF-16 code unit index. The instance must be freed using ImpellerGlyphInfoRelease.

Parameters
[in]paragraphThe paragraph.
[in]code_unit_indexThe UTF-16 code unit index.
Returns
The glyph information.

◆ ImpellerParagraphCreateGlyphInfoAtParagraphCoordinatesNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerGlyphInfo IMPELLER_NULLABLE ImpellerParagraphCreateGlyphInfoAtParagraphCoordinatesNew ( ImpellerParagraph IMPELLER_NONNULL  paragraph,
double  x,
double  y 
)

Create a new instance of glyph info that can be queried for information about the glyph closest to the specified coordinates relative to the origin of the paragraph. The instance must be freed using ImpellerGlyphInfoRelease.

Parameters
[in]paragraphThe paragraph.
[in]xThe x coordinate relative to paragraph origin.
[in]yThe x coordinate relative to paragraph origin.
Returns
The glyph information.

◆ ImpellerParagraphGetAlphabeticBaseline()

IMPELLER_EXPORT float ImpellerParagraphGetAlphabeticBaseline ( ImpellerParagraph IMPELLER_NONNULL  paragraph)
Parameters
[in]paragraphThe paragraph.
Returns
The distance from the top of the paragraph to the alphabetic baseline of the first line when using alphabetic fonts (A-Z, a-z, Greek, etc...).

◆ ImpellerParagraphGetHeight()

IMPELLER_EXPORT float ImpellerParagraphGetHeight ( ImpellerParagraph IMPELLER_NONNULL  paragraph)
Parameters
[in]paragraphThe paragraph.
Returns
The height of the laid out paragraph. This is not a tight bounding box and some glyphs may not reach the minimum location they are allowed to reach.

◆ ImpellerParagraphGetIdeographicBaseline()

IMPELLER_EXPORT float ImpellerParagraphGetIdeographicBaseline ( ImpellerParagraph IMPELLER_NONNULL  paragraph)
Parameters
[in]paragraphThe paragraph.
Returns
The distance from the top of the paragraph to the ideographic baseline of the first line when using ideographic fonts (Japanese, Korean, etc...).

◆ ImpellerParagraphGetLineCount()

IMPELLER_EXPORT uint32_t ImpellerParagraphGetLineCount ( ImpellerParagraph IMPELLER_NONNULL  paragraph)
Parameters
[in]paragraphThe paragraph.
Returns
The number of lines visible in the paragraph after line breaking.

◆ ImpellerParagraphGetLineMetrics()

IMPELLER_EXPORT ImpellerLineMetrics IMPELLER_NULLABLE ImpellerParagraphGetLineMetrics ( ImpellerParagraph IMPELLER_NONNULL  paragraph)

Get the line metrics of this laid out paragraph. Calculating the line metrics is expensive. The first time line metrics are requested, they will be cached along with the paragraph (which is immutable).

Parameters
[in]paragraphThe paragraph.
Returns
The line metrics.

◆ ImpellerParagraphGetLongestLineWidth()

IMPELLER_EXPORT float ImpellerParagraphGetLongestLineWidth ( ImpellerParagraph IMPELLER_NONNULL  paragraph)
Parameters
[in]paragraphThe paragraph.
Returns
The length of the longest line in the paragraph. This is the horizontal distance between the left edge of the leftmost glyph and the right edge of the rightmost glyph, in the longest line in the paragraph.

◆ ImpellerParagraphGetMaxIntrinsicWidth()

IMPELLER_EXPORT float ImpellerParagraphGetMaxIntrinsicWidth ( ImpellerParagraph IMPELLER_NONNULL  paragraph)
Parameters
[in]paragraphThe paragraph.
Returns
The width of the paragraph without line breaking.

◆ ImpellerParagraphGetMaxWidth()

IMPELLER_EXPORT float ImpellerParagraphGetMaxWidth ( ImpellerParagraph IMPELLER_NONNULL  paragraph)
See also
ImpellerParagraphGetMinIntrinsicWidth
Parameters
[in]paragraphThe paragraph.
Returns
The width provided to the paragraph builder during the call to layout. This is the maximum width any line in the laid out paragraph can occupy. But, it is not necessarily the actual width of the paragraph after layout.

◆ ImpellerParagraphGetMinIntrinsicWidth()

IMPELLER_EXPORT float ImpellerParagraphGetMinIntrinsicWidth ( ImpellerParagraph IMPELLER_NONNULL  paragraph)
See also
ImpellerParagraphGetMaxWidth
Parameters
[in]paragraphThe paragraph.
Returns
The actual width of the longest line in the paragraph after layout. This is expected to be less than or equal to ImpellerParagraphGetMaxWidth.

◆ ImpellerParagraphGetWordBoundary()

IMPELLER_EXPORT void ImpellerParagraphGetWordBoundary ( ImpellerParagraph IMPELLER_NONNULL  paragraph,
size_t  code_unit_index,
ImpellerRange *IMPELLER_NONNULL  out_range 
)

Get the range into the UTF-16 code unit buffer that represents the word at the specified caret location in the same buffer.

Word boundaries are defined more precisely in Unicode Standard Annex #29

Parameters
[in]paragraphThe paragraph
[in]code_unit_indexThe code unit index
[out]code_unit_indexThe range.

◆ ImpellerParagraphRelease()

IMPELLER_EXPORT void ImpellerParagraphRelease ( ImpellerParagraph IMPELLER_NULLABLE  paragraph)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]paragraphThe paragraph.

◆ ImpellerParagraphRetain()

IMPELLER_EXPORT void ImpellerParagraphRetain ( ImpellerParagraph IMPELLER_NULLABLE  paragraph)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]paragraphThe paragraph.

◆ ImpellerParagraphStyleNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerParagraphStyle IMPELLER_NULLABLE ImpellerParagraphStyleNew ( )

Create a new paragraph style.

Returns
The paragraph style.

◆ ImpellerParagraphStyleRelease()

IMPELLER_EXPORT void ImpellerParagraphStyleRelease ( ImpellerParagraphStyle IMPELLER_NULLABLE  paragraph_style)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]paragraph_styleThe paragraph style.

◆ ImpellerParagraphStyleRetain()

IMPELLER_EXPORT void ImpellerParagraphStyleRetain ( ImpellerParagraphStyle IMPELLER_NULLABLE  paragraph_style)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]paragraph_styleThe paragraph style.

◆ ImpellerParagraphStyleSetBackground()

IMPELLER_EXPORT void ImpellerParagraphStyleSetBackground ( ImpellerParagraphStyle IMPELLER_NONNULL  paragraph_style,
ImpellerPaint IMPELLER_NONNULL  paint 
)

Set the paint used to render the background of the text glyphs.

Parameters
[in]paragraph_styleThe paragraph style.
[in]paintThe paint.

◆ ImpellerParagraphStyleSetEllipsis()

IMPELLER_EXPORT void ImpellerParagraphStyleSetEllipsis ( ImpellerParagraphStyle IMPELLER_NONNULL  paragraph_style,
const char *IMPELLER_NULLABLE  ellipsis 
)

Set the UTF-8 string to use as the ellipsis. Pass nullptr to clear the setting to default.

Parameters
[in]paragraph_styleThe paragraph style.
[in]dataThe ellipsis string UTF-8 data, or null.

◆ ImpellerParagraphStyleSetFontFamily()

IMPELLER_EXPORT void ImpellerParagraphStyleSetFontFamily ( ImpellerParagraphStyle IMPELLER_NONNULL  paragraph_style,
const char *IMPELLER_NONNULL  family_name 
)

Set the font family.

Parameters
[in]paragraph_styleThe paragraph style.
[in]family_nameThe family name.

◆ ImpellerParagraphStyleSetFontSize()

IMPELLER_EXPORT void ImpellerParagraphStyleSetFontSize ( ImpellerParagraphStyle IMPELLER_NONNULL  paragraph_style,
float  size 
)

Set the font size.

Parameters
[in]paragraph_styleThe paragraph style.
[in]sizeThe size.

◆ ImpellerParagraphStyleSetFontStyle()

IMPELLER_EXPORT void ImpellerParagraphStyleSetFontStyle ( ImpellerParagraphStyle IMPELLER_NONNULL  paragraph_style,
ImpellerFontStyle  style 
)

Set whether the glyphs should be bolded or italicized.

Parameters
[in]paragraph_styleThe paragraph style.
[in]styleThe style.

◆ ImpellerParagraphStyleSetFontWeight()

IMPELLER_EXPORT void ImpellerParagraphStyleSetFontWeight ( ImpellerParagraphStyle IMPELLER_NONNULL  paragraph_style,
ImpellerFontWeight  weight 
)

Set the weight of the font to select when rendering glyphs.

Parameters
[in]paragraph_styleThe paragraph style.
[in]weightThe weight.

◆ ImpellerParagraphStyleSetForeground()

IMPELLER_EXPORT void ImpellerParagraphStyleSetForeground ( ImpellerParagraphStyle IMPELLER_NONNULL  paragraph_style,
ImpellerPaint IMPELLER_NONNULL  paint 
)

Set the paint used to render the text glyph contents.

Parameters
[in]paragraph_styleThe paragraph style.
[in]paintThe paint.

◆ ImpellerParagraphStyleSetHeight()

IMPELLER_EXPORT void ImpellerParagraphStyleSetHeight ( ImpellerParagraphStyle IMPELLER_NONNULL  paragraph_style,
float  height 
)

The height of the text as a multiple of text size.

        When height is 0.0, the line height will be determined by the
        font's metrics directly, which may differ from the font size.
        Otherwise the line height of the text will be a multiple of font
        size, and be exactly fontSize * height logical pixels tall.
Parameters
[in]paragraph_styleThe paragraph style.
[in]heightThe height.

◆ ImpellerParagraphStyleSetLocale()

IMPELLER_EXPORT void ImpellerParagraphStyleSetLocale ( ImpellerParagraphStyle IMPELLER_NONNULL  paragraph_style,
const char *IMPELLER_NONNULL  locale 
)

Set the paragraph locale.

Parameters
[in]paragraph_styleThe paragraph style.
[in]localeThe locale.

◆ ImpellerParagraphStyleSetMaxLines()

IMPELLER_EXPORT void ImpellerParagraphStyleSetMaxLines ( ImpellerParagraphStyle IMPELLER_NONNULL  paragraph_style,
uint32_t  max_lines 
)

Set the maximum line count within the paragraph.

Parameters
[in]paragraph_styleThe paragraph style.
[in]max_linesThe maximum lines.

◆ ImpellerParagraphStyleSetTextAlignment()

IMPELLER_EXPORT void ImpellerParagraphStyleSetTextAlignment ( ImpellerParagraphStyle IMPELLER_NONNULL  paragraph_style,
ImpellerTextAlignment  align 
)

Set the alignment of text within the paragraph.

Parameters
[in]paragraph_styleThe paragraph style.
[in]alignThe align.

◆ ImpellerParagraphStyleSetTextDecoration()

IMPELLER_EXPORT void ImpellerParagraphStyleSetTextDecoration ( ImpellerParagraphStyle IMPELLER_NONNULL  paragraph_style,
const ImpellerTextDecoration *IMPELLER_NONNULL  decoration 
)

Set one of more text decorations on the paragraph. Decorations can be underlines, overlines, strikethroughs, etc.. The style of decorations can be set as well (dashed, dotted, wavy, etc..)

Parameters
[in]ImpellerParagraphStyleThe paragraph style.
[in]decorationThe text decoration.

◆ ImpellerParagraphStyleSetTextDirection()

IMPELLER_EXPORT void ImpellerParagraphStyleSetTextDirection ( ImpellerParagraphStyle IMPELLER_NONNULL  paragraph_style,
ImpellerTextDirection  direction 
)

Set the directionality of the text within the paragraph.

Parameters
[in]paragraph_styleThe paragraph style.
[in]directionThe direction.

◆ ImpellerPathBuilderAddArc()

IMPELLER_EXPORT void ImpellerPathBuilderAddArc ( ImpellerPathBuilder IMPELLER_NONNULL  builder,
const ImpellerRect *IMPELLER_NONNULL  oval_bounds,
float  start_angle_degrees,
float  end_angle_degrees 
)

Add an arc to the path.

Parameters
[in]builderThe builder.
[in]oval_boundsThe oval bounds.
[in]start_angle_degreesThe start angle in degrees.
[in]end_angle_degreesThe end angle in degrees.

◆ ImpellerPathBuilderAddOval()

IMPELLER_EXPORT void ImpellerPathBuilderAddOval ( ImpellerPathBuilder IMPELLER_NONNULL  builder,
const ImpellerRect *IMPELLER_NONNULL  oval_bounds 
)

Add an oval to the path.

Parameters
[in]builderThe builder.
[in]oval_boundsThe oval bounds.

◆ ImpellerPathBuilderAddRect()

IMPELLER_EXPORT void ImpellerPathBuilderAddRect ( ImpellerPathBuilder IMPELLER_NONNULL  builder,
const ImpellerRect *IMPELLER_NONNULL  rect 
)

Adds a rectangle to the path.

Parameters
[in]builderThe builder.
[in]rectThe rectangle.

◆ ImpellerPathBuilderAddRoundedRect()

IMPELLER_EXPORT void ImpellerPathBuilderAddRoundedRect ( ImpellerPathBuilder IMPELLER_NONNULL  builder,
const ImpellerRect *IMPELLER_NONNULL  rect,
const ImpellerRoundingRadii *IMPELLER_NONNULL  rounding_radii 
)

Add a rounded rect with potentially non-uniform radii to the path.

Parameters
[in]builderThe builder.
[in]rectThe rectangle.
[in]rounding_radiiThe rounding radii.

◆ ImpellerPathBuilderClose()

IMPELLER_EXPORT void ImpellerPathBuilderClose ( ImpellerPathBuilder IMPELLER_NONNULL  builder)

Close the path.

Parameters
[in]builderThe builder.

◆ ImpellerPathBuilderCopyPathNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPath IMPELLER_NULLABLE ImpellerPathBuilderCopyPathNew ( ImpellerPathBuilder IMPELLER_NONNULL  builder,
ImpellerFillType  fill 
)

Create a new path by copying the existing built-up path. The existing path can continue being added to.

Parameters
[in]builderThe builder.
[in]fillThe fill.
Returns
The impeller path.

◆ ImpellerPathBuilderCubicCurveTo()

IMPELLER_EXPORT void ImpellerPathBuilderCubicCurveTo ( ImpellerPathBuilder IMPELLER_NONNULL  builder,
const ImpellerPoint *IMPELLER_NONNULL  control_point_1,
const ImpellerPoint *IMPELLER_NONNULL  control_point_2,
const ImpellerPoint *IMPELLER_NONNULL  end_point 
)

Add a cubic curve whose start point is current cursor location to the specified end point using the two specified control points.

The new location of the cursor after this call is the end point supplied.

Parameters
[in]builderThe builder
[in]control_point_1The control point 1
[in]control_point_2The control point 2
[in]end_pointThe end point

◆ ImpellerPathBuilderLineTo()

IMPELLER_EXPORT void ImpellerPathBuilderLineTo ( ImpellerPathBuilder IMPELLER_NONNULL  builder,
const ImpellerPoint *IMPELLER_NONNULL  location 
)

Add a line segment from the current cursor location to the given location. The cursor location is updated to be at the endpoint.

Parameters
[in]builderThe builder.
[in]locationThe location.

◆ ImpellerPathBuilderMoveTo()

IMPELLER_EXPORT void ImpellerPathBuilderMoveTo ( ImpellerPathBuilder IMPELLER_NONNULL  builder,
const ImpellerPoint *IMPELLER_NONNULL  location 
)

Move the cursor to the specified location.

Parameters
[in]builderThe builder.
[in]locationThe location.

◆ ImpellerPathBuilderNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPathBuilder IMPELLER_NULLABLE ImpellerPathBuilderNew ( )

Create a new path builder. Paths themselves are immutable. A builder builds these immutable paths.

Returns
The path builder.

◆ ImpellerPathBuilderQuadraticCurveTo()

IMPELLER_EXPORT void ImpellerPathBuilderQuadraticCurveTo ( ImpellerPathBuilder IMPELLER_NONNULL  builder,
const ImpellerPoint *IMPELLER_NONNULL  control_point,
const ImpellerPoint *IMPELLER_NONNULL  end_point 
)

Add a quadratic curve from whose start point is the cursor to the specified end point using the a single control point.

The new location of the cursor after this call is the end point.

Parameters
[in]builderThe builder.
[in]control_pointThe control point.
[in]end_pointThe end point.

◆ ImpellerPathBuilderRelease()

IMPELLER_EXPORT void ImpellerPathBuilderRelease ( ImpellerPathBuilder IMPELLER_NULLABLE  builder)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]builderThe builder.

◆ ImpellerPathBuilderRetain()

IMPELLER_EXPORT void ImpellerPathBuilderRetain ( ImpellerPathBuilder IMPELLER_NULLABLE  builder)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]builderThe builder.

◆ ImpellerPathBuilderTakePathNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerPath IMPELLER_NULLABLE ImpellerPathBuilderTakePathNew ( ImpellerPathBuilder IMPELLER_NONNULL  builder,
ImpellerFillType  fill 
)

Create a new path using the existing built-up path. The existing path builder now contains an empty path.

Parameters
[in]builderThe builder.
[in]fillThe fill.
Returns
The impeller path.

◆ ImpellerPathGetBounds()

IMPELLER_EXPORT void ImpellerPathGetBounds ( ImpellerPath IMPELLER_NONNULL  path,
ImpellerRect *IMPELLER_NONNULL  out_bounds 
)

Get the bounds of the path.

        The bounds are conservative. That is, they may be larger than
        the actual shape of the path and could include the control
        points and isolated calls to move the cursor.
Parameters
[in]pathThe path
[out]out_boundsThe conservative bounds of the path.

◆ ImpellerPathRelease()

IMPELLER_EXPORT void ImpellerPathRelease ( ImpellerPath IMPELLER_NULLABLE  path)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]pathThe path.

◆ ImpellerPathRetain()

IMPELLER_EXPORT void ImpellerPathRetain ( ImpellerPath IMPELLER_NULLABLE  path)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]pathThe path.

◆ ImpellerSurfaceCreateWrappedFBONew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE ImpellerSurfaceCreateWrappedFBONew ( ImpellerContext IMPELLER_NONNULL  context,
uint64_t  fbo,
ImpellerPixelFormat  format,
const ImpellerISize *IMPELLER_NONNULL  size 
)

Create a new surface by wrapping an existing framebuffer object. The framebuffer must be complete as determined by glCheckFramebufferStatus. The framebuffer is still owned by the caller and it must be collected once the surface is collected.

Parameters
[in]contextThe context.
[in]fboThe framebuffer object handle.
[in]formatThe format of the framebuffer.
[in]sizeThe size of the framebuffer is texels.
Returns
The surface if once can be created, NULL otherwise.

Referenced by main().

◆ ImpellerSurfaceCreateWrappedMetalDrawableNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE ImpellerSurfaceCreateWrappedMetalDrawableNew ( ImpellerContext IMPELLER_NONNULL  context,
void *IMPELLER_NONNULL  metal_drawable 
)

Create a surface by wrapping a Metal drawable. This is useful during WSI when the drawable is the backing store of the Metal layer being drawn to.

The Metal layer must be using the same device managed by the underlying context.

Parameters
[in]contextThe context. The Metal device managed by this context must be the same used to create the drawable that is being wrapped.
metal_drawableThe drawable to wrap as a surface.
Returns
The surface if one could be wrapped, NULL otherwise.

Referenced by main().

◆ ImpellerSurfaceDrawDisplayList()

IMPELLER_EXPORT bool ImpellerSurfaceDrawDisplayList ( ImpellerSurface IMPELLER_NONNULL  surface,
ImpellerDisplayList IMPELLER_NONNULL  display_list 
)

Draw a display list onto the surface. The same display list can be drawn multiple times to different surfaces.

Warning
In the OpenGL backend, Impeller will not make an effort to preserve the OpenGL state that is current in the context. Embedders that perform additional OpenGL operations in the context should expect the reset state after control transitions back to them. Key state to watch out for would be the viewports, stencil rects, test toggles, resource (texture, framebuffer, buffer) bindings, etc...
Parameters
[in]surfaceThe surface to draw the display list to.
[in]display_listThe display list to draw onto the surface.
Returns
If the display list could be drawn onto the surface.

Referenced by main().

◆ ImpellerSurfacePresent()

IMPELLER_EXPORT bool ImpellerSurfacePresent ( ImpellerSurface IMPELLER_NONNULL  surface)

Present the surface to the underlying window system.

Parameters
[in]surfaceThe surface to present.
Returns
True if the surface could be presented.

Referenced by main().

◆ ImpellerSurfaceRelease()

IMPELLER_EXPORT void ImpellerSurfaceRelease ( ImpellerSurface IMPELLER_NULLABLE  surface)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]surfaceThe surface.

Referenced by main().

◆ ImpellerSurfaceRetain()

IMPELLER_EXPORT void ImpellerSurfaceRetain ( ImpellerSurface IMPELLER_NULLABLE  surface)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]surfaceThe surface.

◆ ImpellerTextureCreateWithContentsNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTexture IMPELLER_NULLABLE ImpellerTextureCreateWithContentsNew ( ImpellerContext IMPELLER_NONNULL  context,
const ImpellerTextureDescriptor *IMPELLER_NONNULL  descriptor,
const ImpellerMapping *IMPELLER_NONNULL  contents,
void *IMPELLER_NULLABLE  contents_on_release_user_data 
)

Create a texture with decompressed bytes.

        Impeller will do its best to perform the transfer of this data
        to GPU memory with a minimal number of copies. Towards this
        end, it may need to send this data to a different thread for
        preparation and transfer. To facilitate this transfer, it is
        recommended that the content mapping have a release callback
        attach to it. When there is a release callback, Impeller assumes
        that collection of the data can be deferred till texture upload
        is done and can happen on a background thread. When there is no
        release callback, Impeller may try to perform an eager copy of
        the data if it needs to perform data preparation and transfer on
        a background thread.

        Whether an extra data copy actually occurs will always depend on
        the rendering backend in use. But it is best practice to provide
        a release callback and be resilient to the data being released
        in a deferred manner on a background thread.
Warning
Do not supply compressed image data directly (PNG, JPEG, etc...). This function only works with tightly packed decompressed data.
Parameters
[in]contextThe context.
[in]descriptorThe texture descriptor.
[in]contentsThe contents.
[in]contents_on_release_user_dataThe baton passes to the contents release callback if one exists.
Returns
The texture if one can be created using the provided data, NULL otherwise.

◆ ImpellerTextureCreateWithOpenGLTextureHandleNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTexture IMPELLER_NULLABLE ImpellerTextureCreateWithOpenGLTextureHandleNew ( ImpellerContext IMPELLER_NONNULL  context,
const ImpellerTextureDescriptor *IMPELLER_NONNULL  descriptor,
uint64_t  handle 
)

Create a texture with an externally created OpenGL texture handle.

Ownership of the handle is transferred over to Impeller after a successful call to this method. Impeller is responsible for calling glDeleteTextures on this handle. Do not collect this handle yourself as this will lead to a double-free.

The handle must be created in the same context as the one used by Impeller. If a different context is used, that context must be in the same sharegroup as Impellers OpenGL context and all synchronization of texture contents must already be complete.

If the context is not an OpenGL context, this call will always fail.

Parameters
[in]contextThe context
[in]descriptorThe descriptor
[in]handleThe handle
Returns
The texture if one could be created by adopting the supplied texture handle, NULL otherwise.

◆ ImpellerTextureGetOpenGLHandle()

IMPELLER_EXPORT uint64_t ImpellerTextureGetOpenGLHandle ( ImpellerTexture IMPELLER_NONNULL  texture)

Get the OpenGL handle associated with this texture. If this is not an OpenGL texture, this method will always return 0.

OpenGL handles are lazily created, this method will return GL_NONE is no OpenGL handle is available. To ensure that this call eagerly creates an OpenGL texture, call this on a thread where Impeller knows there is an OpenGL context available.

Parameters
[in]textureThe texture.
Returns
The OpenGL handle if one is available, GL_NONE otherwise.

◆ ImpellerTextureRelease()

IMPELLER_EXPORT void ImpellerTextureRelease ( ImpellerTexture IMPELLER_NULLABLE  texture)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]textureThe texture.

◆ ImpellerTextureRetain()

IMPELLER_EXPORT void ImpellerTextureRetain ( ImpellerTexture IMPELLER_NULLABLE  texture)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]textureThe texture.

◆ ImpellerTypographyContextNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerTypographyContext IMPELLER_NULLABLE ImpellerTypographyContextNew ( )

Create a new typography contents.

Returns
The typography context.

◆ ImpellerTypographyContextRegisterFont()

IMPELLER_EXPORT bool ImpellerTypographyContextRegisterFont ( ImpellerTypographyContext IMPELLER_NONNULL  context,
const ImpellerMapping *IMPELLER_NONNULL  contents,
void *IMPELLER_NULLABLE  contents_on_release_user_data,
const char *IMPELLER_NULLABLE  family_name_alias 
)

Register a custom font.

        The following font formats are supported:
        * OpenType font collections (.ttc extension)
        * TrueType fonts: (.ttf extension)
        * OpenType fonts: (.otf extension)
Warning
Web Open Font Formats (.woff and .woff2 extensions) are not supported.

The font data is specified as a mapping. It is possible for the release callback of the mapping to not be called even past the destruction of the typography context. Care must be taken to not collect the mapping till the release callback is invoked by Impeller.

The family alias name can be NULL. In such cases, the font family specified in paragraph styles must match the family that is specified in the font data.

If the family name alias is not NULL, that family name must be used in the paragraph style to reference glyphs from this font instead of the one encoded in the font itself.

Multiple fonts (with glyphs for different styles) can be specified with the same family.

See also
ImpellerParagraphStyleSetFontFamily
Parameters
[in]contextThe context.
[in]contentsThe contents.
[in]contents_on_release_user_dataThe user data baton to be passed to the contents release callback.
[in]family_name_aliasThe family name alias or NULL if the one specified in the font data is to be used.
Returns
If the font could be successfully registered.

◆ ImpellerTypographyContextRelease()

IMPELLER_EXPORT void ImpellerTypographyContextRelease ( ImpellerTypographyContext IMPELLER_NULLABLE  context)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]contextThe typography context.

◆ ImpellerTypographyContextRetain()

IMPELLER_EXPORT void ImpellerTypographyContextRetain ( ImpellerTypographyContext IMPELLER_NULLABLE  context)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]contextThe typography context.

◆ ImpellerVulkanSwapchainAcquireNextSurfaceNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerSurface IMPELLER_NULLABLE ImpellerVulkanSwapchainAcquireNextSurfaceNew ( ImpellerVulkanSwapchain IMPELLER_NONNULL  swapchain)

A potentially blocking operation, acquires the next surface to render to. Since this may block, surface acquisition must be delayed for as long as possible to avoid an idle wait on the CPU.

Parameters
[in]swapchainThe swapchain.
Returns
The surface if one could be obtained, NULL otherwise.

Referenced by main().

◆ ImpellerVulkanSwapchainCreateNew()

IMPELLER_EXPORT IMPELLER_NODISCARD ImpellerVulkanSwapchain IMPELLER_NULLABLE ImpellerVulkanSwapchainCreateNew ( ImpellerContext IMPELLER_NONNULL  context,
void *IMPELLER_NONNULL  vulkan_surface_khr 
)

Create a new Vulkan swapchain using a VkSurfaceKHR instance. Ownership of the surface is transferred over to Impeller. The Vulkan instance the surface is created from must the same as the context provided.

Parameters
[in]contextThe context. Must be a Vulkan context whose instance is the same used to create the surface passed into the next argument.
vulkan_surface_khrThe vulkan surface.
Returns
The vulkan swapchain.

Referenced by main().

◆ ImpellerVulkanSwapchainRelease()

IMPELLER_EXPORT void ImpellerVulkanSwapchainRelease ( ImpellerVulkanSwapchain IMPELLER_NULLABLE  swapchain)

Release a previously retained reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]swapchainThe swapchain.

Referenced by main().

◆ ImpellerVulkanSwapchainRetain()

IMPELLER_EXPORT void ImpellerVulkanSwapchainRetain ( ImpellerVulkanSwapchain IMPELLER_NULLABLE  swapchain)

Retain a strong reference to the object. The object can be NULL in which case this method is a no-op.

Parameters
[in]swapchainThe swapchain.