| Flutter Impeller |

Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
impeller Namespace Reference

## Namespaces
| allocation_size_literals
| android
| compiler
| egl
| glvk
| interop
| saturated
| skia_conversions
| testing

## Classes
struct | AbslHashAdapter
struct | AbslHashAdapterCombiner
| Helper for AbslHashAdapter. Tallies a hash value with fml::HashCombine. More...
class | AHBSwapchainImplVK
| The implementation of a swapchain at a specific size. Resizes to the surface will cause the instance of the swapchain impl at that size to be discarded along with all its caches and transients. More...
class | AHBSwapchainVK
| The implementation of a swapchain that uses hardware buffers presented to a given surface control on Android. More...
class | AHBTexturePoolVK
| Maintains a bounded pool of hardware buffer backed texture sources that can be used as swapchain images. More...
class | AHBTextureSourceVK
| A texture source that wraps an instance of AHardwareBuffer. More...
class | AiksContext
class | AiksPlayground
class | AllocatedTextureSourceVK
class | Allocation
| Describes an allocation on the heap. More...
class | AllocationSize
| Represents the size of an allocation in different units. More...
class | Allocator
| An object that allocates device memory. More...
class | AllocatorGLES
class | AllocatorMTL
class | AllocatorVK
struct | AllocatorVMATraits
class | AnonymousContents
class | AtlasContents
class | AtlasGeometry
struct | Attachment
struct | AutoErrorCheck
struct | BackdropData
class | BackendCast
class | BackgroundCommandPoolVK
class | BackgroundDescriptorPoolVK
struct | BarrierVK
| Defines an operations and memory access barrier on a resource. More...
class | BlendFilterContents
struct | BlitCommand
struct | BlitCopyBufferToTextureCommand
struct | BlitCopyBufferToTextureCommandGLES
struct | BlitCopyTextureToBufferCommand
struct | BlitCopyTextureToBufferCommandGLES
struct | BlitCopyTextureToTextureCommand
struct | BlitCopyTextureToTextureCommandGLES
struct | BlitEncodeGLES
| Mixin for dispatching GLES commands. More...
struct | BlitGenerateMipmapCommand
struct | BlitGenerateMipmapCommandGLES
class | BlitPass
| Blit passes encode blit into the underlying command buffer. More...
class | BlitPassGLES
class | BlitPassMTL
class | BlitPassVK
struct | BlitResizeTextureCommand
struct | BlitResizeTextureCommandGLES
struct | BlurParameters
class | BorderMaskBlurFilterContents
class | BufferBindingsGLES
| Sets up stage bindings for single draw call in the OpenGLES backend. More...
struct | BufferView
struct | BufferVMA
struct | BufferVMATraits
class | Canvas
class | CanvasDlDispatcher
struct | CanvasStackEntry
class | Capabilities
class | CapabilitiesBuilder
class | CapabilitiesGLES
| The Vulkan layers and extensions wrangler. More...
class | CapabilitiesVK
| The Vulkan layers and extensions wrangler. More...
class | CircleGeometry
class | ClipContents
struct | ClipCoverage
struct | ClipCoverageLayer
struct | Color
struct | ColorAttachment
struct | ColorAttachmentDescriptor
| Describe the color attachment that will be used with this pipeline. More...
class | ColorFilterContents
struct | ColorMatrix
class | ColorMatrixFilterContents
class | ColorSourceContents
struct | Command
| An object used to specify work to the GPU along with references to resources the GPU will used when doing said work. More...
class | CommandBuffer
| A collection of encoded commands to be submitted to the GPU for execution. A command buffer is obtained from a graphics `Context`. More...
class | CommandBufferGLES
class | CommandBufferMTL
class | CommandBufferVK
class | CommandPoolRecyclerVK
| Creates and manages the lifecycle of |vk::CommandPool| objects. More...
class | CommandPoolVK
| Manages the lifecycle of a single |vk::CommandPool|. More...
class | CommandQueue
| An interface for submitting command buffers to the GPU for encoding and execution. More...
class | CommandQueueVK
class | Comparable
class | ComparableBase
struct | ComparableEqual
struct | ComparableHash
class | CompressedImage
class | CompressedImageSkia
class | ComputePass
| Compute passes encode compute shader into the underlying command buffer. More...
struct | ComputePassBindingsCacheMTL
| Ensures that bindings on the pass are not redundantly set or updated. Avoids making the driver do additional checks and makes the frame insights during profiling and instrumentation not complain about the same. More...
class | ComputePassMTL
class | ComputePassVK
struct | ComputePipelineBuilder
| An optional (but highly recommended) utility for creating pipelines from reflected shader information. More...
class | ComputePipelineDescriptor
class | ComputePipelineHandle
class | ComputePipelineMTL
class | ComputePipelineVK
class | ComputePlaygroundTest
class | ConditionVariable
| A condition variable exactly similar to the one in libcxx with two major differences: More...
class | ConicalGradientContents
class | ContentContext
struct | ContentContextOptions
class | Contents
class | ContentsFilterInput
class | Context
| To do anything rendering related with Impeller, you need a context. More...
class | ContextGLES
class | ContextMTL
class | ContextVK
struct | ContourComponent
class | CoverGeometry
| A geometry that implements "drawPaint" like behavior by covering the entire render pass area. More...
struct | CubicPathComponent
class | DebugAllocatorStats
class | DebugReportVK
class | DecompressedImage
struct | Degrees
struct | DepthAttachment
struct | DepthAttachmentDescriptor
struct | DepthRange
class | DescriptionGLES
class | DescriptorPoolRecyclerVK
| Creates and manages the lifecycle of |vk::DescriptorPoolVK| objects. More...
struct | DescriptorPoolSize
class | DescriptorPoolVK
| A per-frame descriptor pool. Descriptors from this pool don't need to be freed individually. Instead, the pool must be collected after all the descriptors allocated from it are done being used. More...
struct | DescriptorSetLayout
class | DeviceBuffer
struct | DeviceBufferDescriptor
class | DeviceBufferGLES
class | DeviceBufferMTL
class | DeviceBufferVK
class | DeviceHolderVK
| Holds a strong reference to the underlying logical Vulkan device. This comes in handy when the context is being torn down and the various components on different threads may need to orchestrate safe shutdown. More...
class | DirectionalMorphologyFilterContents
class | DlAtlasGeometry
| A wrapper around data provided by a drawAtlas call. More...
class | DlDispatcherBase
class | DlImageImpeller
class | DlPlayground
class | DlVerticesGeometry
| A geometry that is created from a DlVertices object. More...
class | DrawOrderResolver
class | DriverInfoVK
| Get information about the Vulkan driver. More...
struct | EGLImageKHRWithDisplay
struct | EGLImageKHRWithDisplayTraits
struct | EGLImageWithDisplay
struct | EGLImageWithDisplayTraits
class | EllipseGeometry
class | Entity
class | EntityPassClipStack
| A class that tracks all clips that have been recorded in the current entity pass stencil. More...
class | EntityPassTarget
class | EntityPlayground
class | ExternalFenceVK
| A Vulkan fence that can be exported as a platform specific file descriptor. More...
class | FanVertexWriter
| A vertex writer that generates a triangle fan and requires primitive restart. More...
class | FenceWaiterVK
class | FillPathGeometry
| A geometry that is created from a filled path object. More...
class | FilterContents
class | FilterContentsFilterInput
class | FilterInput
class | FirstPassDispatcher
class | Font
| Describes a typeface along with any modifications to its intrinsic properties. More...
class | FontGlyphAtlas
| An object that can look up glyph locations within the GlyphAtlas for a particular typeface. More...
struct | FontGlyphPair
| A font along with a glyph in that font rendered at a particular scale and subpixel position. More...
struct | FrameBounds
class | FramebufferBlendContents
struct | FRCFormatDescriptor
| A pixel format and usage that is sufficient to check if images of that format and usage are suitable for use with fixed-rate compression. More...
class | GaussianBlurFilterContents
class | Geometry
struct | GeometryResult
class | GLESVertexWriter
| A vertex writer that has no hardware requirements. More...
struct | GLProc
struct | GLTexture
struct | GLTextureTraits
struct | Glyph
| The glyph index in the typeface. More...
class | GlyphAtlas
| A texture containing the bitmap representation of glyphs in different fonts along with the ability to query the location of specific font glyphs within the texture. More...
class | GlyphAtlasContext
| A container for caching a glyph atlas across frames. More...
struct | GlyphProperties
class | GoldenPlaygroundTest
class | GPUProbe
class | GPUTracerGLES
| Trace GPU execution times using GL_EXT_disjoint_timer_query on GLES. More...
class | GPUTracerMTL
| Approximate the GPU frame time by computing a difference between the smallest GPUStartTime and largest GPUEndTime for all command buffers submitted in a frame workload. More...
class | GPUTracerVK
| A class that uses timestamp queries to record the approximate GPU execution time. More...
struct | GradientData
struct | Half
| A storage only class for half precision floating point. More...
struct | HalfVector2
| A storage only class for half precision floating point vector 2. More...
struct | HalfVector3
| A storage only class for half precision floating point vector 3. More...
struct | HalfVector4
| A storage only class for half precision floating point vector 4. More...
class | HandleGLES
| Represents a handle to an underlying OpenGL object. Unlike OpenGL object handles, these handles can be collected on any thread as long as their destruction is scheduled in a reactor. More...
class | HostBuffer
class | IdleWaiter
class | IdleWaiterVK
struct | ImageVMA
struct | ImageVMATraits
struct | ImmutableSamplerKeyVK
class | ImpellerBenchmarkAccessor
class | ImpellerEntityUnitTestAccessor
class | ImpellerMetalCaptureManager
| Creates and manages a Metal capture scope that supports frame capture when using the FlutterMetalLayer backed drawable. More...
class | InlinePassContext
struct | IPoint16
struct | KernelSample
struct | KernelSamples
struct | KHRFrameSynchronizerVK
class | KHRSwapchainImageVK
class | KHRSwapchainImplVK
| An instance of a swapchain that does NOT adapt to going out of date with the underlying surface. Errors will be indicated when the next drawable is acquired from this implementation of the swapchain. If the error is due the swapchain going out of date, the caller must recreate another instance by optionally stealing this implementations guts. More...
class | KHRSwapchainVK
| A swapchain implemented backed by VK_KHR_swapchain and VK_KHR_surface. More...
class | LazyGlyphAtlas
struct | LazyRenderingConfig
class | LinearGradientContents
struct | LinearPathComponent
class | LinearToSrgbFilterContents
class | LineGeometry
class | LineStripVertexWriter
| A vertex writer that generates a line strip topology. More...
class | LocalMatrixFilterContents
class | Lock
struct | Mask
| A mask of typed enums. More...
struct | MaskTraits
struct | Matrix
| A 4x4 matrix using column-major storage. More...
struct | MatrixDecomposition
class | MatrixFilterContents
struct | MixedOp_
class | NinePatchConverter
class | NoExceptionPromise
struct | Padded
| Struct used for padding uniform buffer array elements. More...
struct | Padding
struct | Paint
struct | PassBindingsCacheMTL
| Ensures that bindings on the pass are not redundantly set or updated. Avoids making the driver do additional checks and makes the frame insights during profiling and instrumentation not complain about the same. More...
class | Path
| Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments. These segments may be broken up by move commands, which are effectively linear commands that pick up the pen rather than continuing to draw. More...
class | PathBuilder
class | Pipeline
| Describes the fixed function and programmable aspects of rendering and compute operations performed by commands submitted to the GPU via a command buffer. More...
struct | PipelineBuilder
| An optional (but highly recommended) utility for creating pipelines from reflected shader information. More...
struct | PipelineCacheHeaderVK
| An Impeller specific header prepended to all pipeline cache information that is persisted on disk. This information is used to perform additional integrity checks that may have been missed by the Vulkan driver. More...
class | PipelineCacheVK
class | PipelineDescriptor
struct | PipelineFuture
class | PipelineGLES
class | PipelineLibrary
class | PipelineLibraryGLES
class | PipelineLibraryMTL
class | PipelineLibraryVK
class | PipelineMTL
class | PipelineVK
class | PlaceholderFilterInput
class | Playground
class | PlaygroundImpl
class | PlaygroundImplGLES
class | PlaygroundImplMTL
class | PlaygroundImplVK
struct | PlaygroundPoint
struct | PlaygroundSwitches
class | PlaygroundTest
class | PointFieldGeometry
| A geometry class specialized for Canvas::DrawPoints. More...
class | Pool
| A thread-safe pool with a limited byte size. More...
struct | PoolVMA
struct | PoolVMATraits
class | ProcTableGLES
struct | QuadraticPathComponent
struct | Quaternion
struct | QueueIndexVK
struct | QueuesVK
| The collection of queues used by the context. The queues may all be the same. More...
class | QueueVK
| A thread safe object that can be used to access device queues. If multiple objects are created with the same underlying queue, then the external synchronization guarantees of Vulkan queues cannot be met. So care must be taken the same device queue doesn't form the basis of multiple `QueueVK`s. More...
class | RadialGradientContents
struct | Radians
struct | Radius
| For convolution filters, the "radius" is the size of the convolution kernel to use on the local space pixel grid of the filter input. For Gaussian blur kernels, this unit has a linear relationship with `Sigma`. See `kKernelRadiusPerSigma` for details on how this relationship works. More...
struct | Range
class | raw_ptr
| A wrapper around a raw ptr that adds additional unopt mode only checks. More...
class | ReactorGLES
| The reactor attempts to make thread-safe usage of OpenGL ES easier to reason about. More...
class | ReaderLock
class | RectanglePacker
| Packs rectangles into a specified area without rotating them. More...
class | RectGeometry
class | RenderPass
| Render passes encode render commands directed as one specific render target into an underlying command buffer. More...
class | RenderPassBuilderVK
struct | RenderPassData
| Encapsulates data that will be needed in the reactor for the encoding of commands for this render pass. More...
class | RenderPassGLES
class | RenderPassMTL
class | RenderPassVK
class | RenderPipelineHandle
class | RenderTarget
class | RenderTargetAllocator
| a wrapper around the impeller [Allocator] instance that can be used to provide caching of allocated render target textures. More...
class | RenderTargetCache
| An implementation of the [RenderTargetAllocator] that caches all allocated texture data for one frame. More...
struct | RenderTargetConfig
class | Resource
struct | ResourceBinder
| An interface for binding resources. This is implemented by |Command| and |ComputeCommand| to make GPU resources available to a given command's pipeline. More...
class | ResourceManagerVK
| A resource manager controls how resources are allocated and reclaimed. More...
class | ResourceVK
| A resource that may be reclaimed by a |ResourceManagerVK|. More...
class | ResourceVKT
| An internal type that is used to move a resource reference. More...
struct | RoundingRadii
struct | RoundRect
class | RoundRectGeometry
class | RoundSuperellipseGeometry
struct | RSTransform
class | RuntimeEffectContents
class | RuntimeEffectFilterContents
| A filter that applies a runtime effect shader. More...
class | RuntimeStage
class | RuntimeStagePlayground
struct | RuntimeUniformDescription
struct | RuntimeUniformDimensions
struct | SampledImageSlot
| Metadata required to bind a combined texture and sampler. More...
class | Sampler
struct | SamplerDescriptor
class | SamplerGLES
class | SamplerLibrary
class | SamplerLibraryGLES
class | SamplerLibraryMTL
class | SamplerLibraryVK
class | SamplerMTL
class | SamplerVK
struct | ScaledFont
| A font and a scale. Used as a key that represents a typeface within a glyph atlas. More...
struct | ScopedValidationDisable
struct | ScopedValidationFatal
struct | SeparatedVector2
| A Vector2, broken down as a separate magnitude and direction. Assumes that the direction given is normalized. More...
class | ShaderArchive
class | ShaderArchiveWriter
class | ShaderFunction
class | ShaderFunctionGLES
class | ShaderFunctionMTL
class | ShaderFunctionVK
struct | ShaderKey
class | ShaderLibrary
class | ShaderLibraryGLES
class | ShaderLibraryMTL
class | ShaderLibraryVK
struct | ShaderMetadata
struct | ShaderStageBufferLayout
class | ShaderStageCompatibilityChecker
| Checks, at C++ compile-time, if the two pipeline stages are compatible. More...
struct | ShaderStageIOSlot
struct | ShaderStructMemberMetadata
struct | ShaderUniformSlot
| Metadata required to bind a buffer. More...
class | SharedObjectVK
class | SharedObjectVKT
struct | Shear
struct | Sigma
| In filters that use Gaussian distributions, "sigma" is a size of one standard deviation in terms of the local space pixel grid of the filter input. In other words, this determines how wide the distribution stretches. More...
class | SkylineRectanglePacker
struct | Snapshot
| Represents a texture and its intended draw transform/sampler configuration. More...
class | SolidColorContents
class | SolidRRectBlurContents
| Draws a fast solid color blur of an rounded rectangle. Only supports RRects with fully symmetrical radii. Also produces correct results for rectangles (corner_radius=0) and circles (corner_radius=width/2=height/2). More...
class | SrgbToLinearFilterContents
class | StandardCapabilities
struct | StencilAttachment
struct | StencilAttachmentDescriptor
struct | StopData
class | StripVertexWriter
| A vertex writer that generates a triangle strip and requires primitive restart. More...
class | StrokePathGeometry
| A geometry that is created from a stroked path object. More...
struct | SubpixelGlyph
| A glyph and its subpixel position. More...
class | SuperellipseGeometry
class | Surface
class | SurfaceContextVK
class | SurfaceGLES
class | SurfaceMTL
class | SurfaceVK
class | SwapchainTransientsMTL
| A cache for the onscreen texture attachments used in surface_mtl. More...
class | SwapchainTransientsVK
| Resources, meant to be memoized by the texture descriptor of the wrapped swapchain images, that are intuitively cheap to create but have been observed to be time consuming to construct on some Vulkan drivers. This includes the device-transient MSAA and depth-stencil textures. More...
class | SwapchainVK
| A swapchain that adapts to the underlying surface going out of date. If the caller cannot acquire the next drawable, it is due to an unrecoverable error and the swapchain must be recreated with a new surface. More...
class | SweepGradientContents
class | Tessellator
| A utility that generates triangles of the specified fill type given a polyline. This happens on the CPU. More...
class | TessellatorLibtess
| An extended tessellator that offers arbitrary/concave tessellation via the libtess2 library. More...
class | TextContents
class | TextFrame
| Represents a collection of shaped text runs. More...
class | TextRun
| Represents a collection of positioned glyphs from a specific font. More...
class | Texture
struct | TextureAndSampler
| combines the texture, sampler and sampler slot information. More...
class | TextureContents
struct | TextureDescriptor
| A lightweight object that describes the attributes of a texture that can then used an allocator to create that texture. More...
class | TextureFilterInput
class | TextureGLES
class | TextureMTL
class | TextureSourceVK
| Abstract base class that represents a vkImage and an vkImageView. More...
class | TextureVK
class | TiledTextureContents
struct | TPoint
class | TrackedObjectsVK
| A per-frame object used to track resource lifetimes and allocate command buffers and descriptor sets. More...
struct | TRect
struct | Trig
| A structure to store the sine and cosine of an angle. More...
struct | TSize
class | Typeface
| A typeface, usually obtained from a font-file, on disk describes the intrinsic properties of the font. Typefaces are rarely used directly. Instead, font refer to typefaces along with any modifications applied to its intrinsic properties. More...
class | TypefaceSkia
class | TypographerContext
| The graphics context necessary to render text. More...
class | TypographerContextSkia
class | UniqueHandleGLES
| A unique handle to an OpenGL object. The collection of this handle scheduled the destruction of the associated OpenGL object in the reactor. More...
struct | UniqueID
class | UniqueResourceVKT
| A unique handle to a resource which will be reclaimed by the specified resource manager. More...
class | ValidationLog
struct | Vector3
struct | Vector4
struct | Version
struct | VertexBuffer
class | VertexBufferBuilder
class | VertexDescriptor
| Describes the format and layout of vertices expected by the pipeline. While it is possible to construct these descriptors manually, it would be tedious to do so. These are usually constructed using shader information reflected using `impellerc`. The usage of this class is indirectly via `PipelineBuilder<VS, FS>`. More...
class | VertexDescriptorMTL
class | VertexWriter
| An interface for generating a multi contour polyline as a triangle strip. More...
struct | Vertices
class | VerticesGeometry
| A geometry that is created from a vertices object. More...
class | VerticesSimpleBlendContents
struct | Viewport
class | WaitSetEntry
struct | WorkaroundsVK
| A non-exhaustive set of driver specific workarounds. More...
class | WriterLock
struct | YUVConversionDescriptorVKEqual
struct | YUVConversionDescriptorVKHash
class | YUVConversionLibraryVK
| Due the way the Vulkan spec. treats "identically defined" conversions, creating two conversion with identical descriptors, using one with the image and the other with the sampler, is invalid use. More...
class | YUVConversionVK
| It is sometimes necessary to deal with formats not native to Vulkan. In such cases, extra information is necessary to access images. A YUV conversion object is needed in such instances. More...
class | YUVToRGBFilterContents

## Typedefs
using | Bytes = AllocationSize< 1u >
using | KiloBytes = AllocationSize< 1 '000u >
using | MegaBytes = AllocationSize< 1 '000u *1 '000u >
using | GigaBytes = AllocationSize< 1 '000u *1 '000u *1 '000u >
using | KibiBytes = AllocationSize< 1 '024u >
using | MebiBytes = AllocationSize< 1 '024u *1 '024u >
using | GibiBytes = AllocationSize< 1 '024u *1 '024u *1 '024u >
using | MyMask = Mask< MyMaskBits >
using | MillisecondsF = std::chrono::duration< float, std::milli >
using | SecondsF = std::chrono::duration< float >
using | Clock = std::chrono::high_resolution_clock
using | TimePoint = std::chrono::time_point< std::chrono::high_resolution_clock >
using | ValidationFailureCallback = std::function< bool(const char *message, const char *file, int line)>
using | TextureUsageMask = Mask< TextureUsage >
using | ColorWriteMask = Mask< ColorWriteMaskBits >
using | ColorFilterProc = std::function< Color(Color)>
using | DlScalar = flutter::DlScalar
using | DlPoint = flutter::DlPoint
using | DlRect = flutter::DlRect
using | DlIRect = flutter::DlIRect
using | DlRoundRect = flutter::DlRoundRect
using | DlPath = flutter::DlPath
using | FastGradientPipeline = RenderPipelineHandle< FastGradientVertexShader, FastGradientFragmentShader >
using | LinearGradientFillPipeline = RenderPipelineHandle< GradientFillVertexShader, LinearGradientFillFragmentShader >
using | SolidFillPipeline = RenderPipelineHandle< SolidFillVertexShader, SolidFillFragmentShader >
using | RadialGradientFillPipeline = RenderPipelineHandle< GradientFillVertexShader, RadialGradientFillFragmentShader >
using | ConicalGradientFillPipeline = RenderPipelineHandle< GradientFillVertexShader, ConicalGradientFillFragmentShader >
using | SweepGradientFillPipeline = RenderPipelineHandle< GradientFillVertexShader, SweepGradientFillFragmentShader >
using | LinearGradientUniformFillPipeline = RenderPipelineHandle< GradientFillVertexShader, LinearGradientUniformFillFragmentShader >
using | ConicalGradientUniformFillPipeline = RenderPipelineHandle< GradientFillVertexShader, ConicalGradientUniformFillFragmentShader >
using | RadialGradientUniformFillPipeline = RenderPipelineHandle< GradientFillVertexShader, RadialGradientUniformFillFragmentShader >
using | SweepGradientUniformFillPipeline = RenderPipelineHandle< GradientFillVertexShader, SweepGradientUniformFillFragmentShader >
using | LinearGradientSSBOFillPipeline = RenderPipelineHandle< GradientFillVertexShader, LinearGradientSsboFillFragmentShader >
using | ConicalGradientSSBOFillPipeline = RenderPipelineHandle< GradientFillVertexShader, ConicalGradientSsboFillFragmentShader >
using | RadialGradientSSBOFillPipeline = RenderPipelineHandle< GradientFillVertexShader, RadialGradientSsboFillFragmentShader >
using | SweepGradientSSBOFillPipeline = RenderPipelineHandle< GradientFillVertexShader, SweepGradientSsboFillFragmentShader >
using | RRectBlurPipeline = RenderPipelineHandle< RrectBlurVertexShader, RrectBlurFragmentShader >
using | TexturePipeline = RenderPipelineHandle< TextureFillVertexShader, TextureFillFragmentShader >
using | TextureDownsamplePipeline = RenderPipelineHandle< TextureFillVertexShader, TextureDownsampleFragmentShader >
using | TextureStrictSrcPipeline = RenderPipelineHandle< TextureFillVertexShader, TextureFillStrictSrcFragmentShader >
using | TiledTexturePipeline = RenderPipelineHandle< TextureUvFillVertexShader, TiledTextureFillFragmentShader >
using | GaussianBlurPipeline = RenderPipelineHandle< FilterPositionUvVertexShader, GaussianFragmentShader >
using | BorderMaskBlurPipeline = RenderPipelineHandle< FilterPositionUvVertexShader, BorderMaskBlurFragmentShader >
using | MorphologyFilterPipeline = RenderPipelineHandle< FilterPositionUvVertexShader, MorphologyFilterFragmentShader >
using | ColorMatrixColorFilterPipeline = RenderPipelineHandle< FilterPositionVertexShader, ColorMatrixColorFilterFragmentShader >
using | LinearToSrgbFilterPipeline = RenderPipelineHandle< FilterPositionVertexShader, LinearToSrgbFilterFragmentShader >
using | SrgbToLinearFilterPipeline = RenderPipelineHandle< FilterPositionVertexShader, SrgbToLinearFilterFragmentShader >
using | YUVToRGBFilterPipeline = RenderPipelineHandle< FilterPositionVertexShader, YuvToRgbFilterFragmentShader >
using | GlyphAtlasPipeline = RenderPipelineHandle< GlyphAtlasVertexShader, GlyphAtlasFragmentShader >
using | PorterDuffBlendPipeline = RenderPipelineHandle< PorterDuffBlendVertexShader, PorterDuffBlendFragmentShader >
using | ClipPipeline = RenderPipelineHandle< ClipVertexShader, ClipFragmentShader >
using | BlendColorPipeline = RenderPipelineHandle< AdvancedBlendVertexShader, AdvancedBlendFragmentShader >
using | BlendColorBurnPipeline = RenderPipelineHandle< AdvancedBlendVertexShader, AdvancedBlendFragmentShader >
using | BlendColorDodgePipeline = RenderPipelineHandle< AdvancedBlendVertexShader, AdvancedBlendFragmentShader >
using | BlendDarkenPipeline = RenderPipelineHandle< AdvancedBlendVertexShader, AdvancedBlendFragmentShader >
using | BlendDifferencePipeline = RenderPipelineHandle< AdvancedBlendVertexShader, AdvancedBlendFragmentShader >
using | BlendExclusionPipeline = RenderPipelineHandle< AdvancedBlendVertexShader, AdvancedBlendFragmentShader >
using | BlendHardLightPipeline = RenderPipelineHandle< AdvancedBlendVertexShader, AdvancedBlendFragmentShader >
using | BlendHuePipeline = RenderPipelineHandle< AdvancedBlendVertexShader, AdvancedBlendFragmentShader >
using | BlendLightenPipeline = RenderPipelineHandle< AdvancedBlendVertexShader, AdvancedBlendFragmentShader >
using | BlendLuminosityPipeline = RenderPipelineHandle< AdvancedBlendVertexShader, AdvancedBlendFragmentShader >
using | BlendMultiplyPipeline = RenderPipelineHandle< AdvancedBlendVertexShader, AdvancedBlendFragmentShader >
using | BlendOverlayPipeline = RenderPipelineHandle< AdvancedBlendVertexShader, AdvancedBlendFragmentShader >
using | BlendSaturationPipeline = RenderPipelineHandle< AdvancedBlendVertexShader, AdvancedBlendFragmentShader >
using | BlendScreenPipeline = RenderPipelineHandle< AdvancedBlendVertexShader, AdvancedBlendFragmentShader >
using | BlendSoftLightPipeline = RenderPipelineHandle< AdvancedBlendVertexShader, AdvancedBlendFragmentShader >
using | FramebufferBlendColorPipeline = RenderPipelineHandle< FramebufferBlendVertexShader, FramebufferBlendFragmentShader >
using | FramebufferBlendColorBurnPipeline = RenderPipelineHandle< FramebufferBlendVertexShader, FramebufferBlendFragmentShader >
using | FramebufferBlendColorDodgePipeline = RenderPipelineHandle< FramebufferBlendVertexShader, FramebufferBlendFragmentShader >
using | FramebufferBlendDarkenPipeline = RenderPipelineHandle< FramebufferBlendVertexShader, FramebufferBlendFragmentShader >
using | FramebufferBlendDifferencePipeline = RenderPipelineHandle< FramebufferBlendVertexShader, FramebufferBlendFragmentShader >
using | FramebufferBlendExclusionPipeline = RenderPipelineHandle< FramebufferBlendVertexShader, FramebufferBlendFragmentShader >
using | FramebufferBlendHardLightPipeline = RenderPipelineHandle< FramebufferBlendVertexShader, FramebufferBlendFragmentShader >
using | FramebufferBlendHuePipeline = RenderPipelineHandle< FramebufferBlendVertexShader, FramebufferBlendFragmentShader >
using | FramebufferBlendLightenPipeline = RenderPipelineHandle< FramebufferBlendVertexShader, FramebufferBlendFragmentShader >
using | FramebufferBlendLuminosityPipeline = RenderPipelineHandle< FramebufferBlendVertexShader, FramebufferBlendFragmentShader >
using | FramebufferBlendMultiplyPipeline = RenderPipelineHandle< FramebufferBlendVertexShader, FramebufferBlendFragmentShader >
using | FramebufferBlendOverlayPipeline = RenderPipelineHandle< FramebufferBlendVertexShader, FramebufferBlendFragmentShader >
using | FramebufferBlendSaturationPipeline = RenderPipelineHandle< FramebufferBlendVertexShader, FramebufferBlendFragmentShader >
using | FramebufferBlendScreenPipeline = RenderPipelineHandle< FramebufferBlendVertexShader, FramebufferBlendFragmentShader >
using | FramebufferBlendSoftLightPipeline = RenderPipelineHandle< FramebufferBlendVertexShader, FramebufferBlendFragmentShader >
using | VerticesUberShader = RenderPipelineHandle< PorterDuffBlendVertexShader, VerticesUberFragmentShader >
| Draw Vertices/Atlas Uber Shader. More...
using | PipelineProc = PipelineRef(ContentContext::*)(ContentContextOptions) const
using | GaussianBlurVertexShader = GaussianBlurPipeline::VertexShader
using | GaussianBlurFragmentShader = GaussianBlurPipeline::FragmentShader
using | VS = GlyphAtlasPipeline::VertexShader
using | FS = GlyphAtlasPipeline::FragmentShader
using | Point = TPoint< Scalar >
using | IPoint = TPoint< int64_t >
using | IPoint32 = TPoint< int32_t >
using | UintPoint32 = TPoint< uint32_t >
using | Vector2 = Point
using | Quad = std::array< Point, 4 >
using | Rect = TRect< Scalar >
using | IRect32 = TRect< int32_t >
using | IRect64 = TRect< int64_t >
using | IRect = IRect64
using | Scalar = float
using | Size = TSize< Scalar >
using | ISize32 = TSize< int32_t >
using | ISize64 = TSize< int64_t >
using | ISize = ISize64
template<class F , class I >
using | MixedOp = typename MixedOp_< F, I >::type
using | Callback = std::function< void(MTLRenderPipelineDescriptor *)>
using | AHBProperties = vk::StructureChain< vk::AndroidHardwareBufferPropertiesANDROID, vk::AndroidHardwareBufferFormatPropertiesANDROID >
using | CommandPoolMap = std::unordered_map< uint64_t, std::shared_ptr< CommandPoolVK > >
using | WaitSet = std::vector< std::shared_ptr< WaitSetEntry > >
template<class T >
using | SharedHandleVK = std::shared_ptr< SharedObjectVKT< T > >
using | UniqueAllocatorVMA = fml::UniqueObject< VmaAllocator, AllocatorVMATraits >
using | UniquePoolVMA = fml::UniqueObject< PoolVMA, PoolVMATraits >
using | UniqueBufferVMA = fml::UniqueObject< BufferVMA, BufferVMATraits >
using | UniqueImageVMA = fml::UniqueObject< ImageVMA, ImageVMATraits >
using | YUVConversionDescriptorVK = vk::StructureChain< vk::SamplerYcbcrConversionCreateInfo >
using | BufferResource = Resource< BufferView >
using | TextureResource = Resource< std::shared_ptr< const Texture > >
using | PipelineRef = raw_ptr< Pipeline< PipelineDescriptor > >
| A raw ptr to a pipeline object. More...
using | PipelineMap = std::unordered_map< PipelineDescriptor, PipelineFuture< PipelineDescriptor >, ComparableHash< PipelineDescriptor >, ComparableEqual< PipelineDescriptor > >
using | ComputePipelineMap = std::unordered_map< ComputePipelineDescriptor, PipelineFuture< ComputePipelineDescriptor >, ComparableHash< ComputePipelineDescriptor >, ComparableEqual< ComputePipelineDescriptor > >
using | ShaderFunctionMap = std::unordered_map< ShaderKey, std::shared_ptr< const ShaderFunction >, ShaderKey::Hash, ShaderKey::Equal >
using | TessellatedVertexProc = Tessellator::TessellatedVertexProc
using | EllipticalVertexGenerator = Tessellator::EllipticalVertexGenerator
using | CTessellator = std::unique_ptr< TESStesselator, decltype(&DestroyTessellator)>
using | UniqueEGLImage = fml::UniqueObject< EGLImageWithDisplay, EGLImageWithDisplayTraits >
using | UniqueEGLImageKHR = fml::UniqueObject< EGLImageKHRWithDisplay, EGLImageKHRWithDisplayTraits >
using | UniqueGLTexture = fml::UniqueObject< GLTexture, GLTextureTraits >

## Enumerations
enum | FromBytesTag { FromBytesTag::kFromBytes }
enum | MyMaskBits : uint32_t { MyMaskBits::kFoo = 0, MyMaskBits::kBar = 1 << 0, MyMaskBits::kBaz = 1 << 1, MyMaskBits::kBang = 1 << 2 }
enum | WindingOrder { WindingOrder::kClockwise, WindingOrder::kCounterClockwise }
enum | StorageMode { StorageMode::kHostVisible, StorageMode::kDevicePrivate, StorageMode::kDeviceTransient }
| Specified where the allocation resides and how it is used. More...
enum | PixelFormat : uint8_t { PixelFormat::kUnknown, PixelFormat::kA8UNormInt, PixelFormat::kR8UNormInt, PixelFormat::kR8G8UNormInt, PixelFormat::kR8G8B8A8UNormInt, PixelFormat::kR8G8B8A8UNormIntSRGB, PixelFormat::kB8G8R8A8UNormInt, PixelFormat::kB8G8R8A8UNormIntSRGB, PixelFormat::kR32G32B32A32Float, PixelFormat::kR16G16B16A16Float, PixelFormat::kB10G10R10XR, PixelFormat::kB10G10R10XRSRGB, PixelFormat::kB10G10R10A10XR, PixelFormat::kS8UInt, PixelFormat::kD24UnormS8Uint, PixelFormat::kD32FloatS8UInt }
| The Pixel formats supported by Impeller. The naming convention denotes the usage of the component, the bit width of that component, and then one or more qualifiers to its interpretation. More...
enum | BlendFactor { BlendFactor::kZero, BlendFactor::kOne, BlendFactor::kSourceColor, BlendFactor::kOneMinusSourceColor, BlendFactor::kSourceAlpha, BlendFactor::kOneMinusSourceAlpha, BlendFactor::kDestinationColor, BlendFactor::kOneMinusDestinationColor, BlendFactor::kDestinationAlpha, BlendFactor::kOneMinusDestinationAlpha, BlendFactor::kSourceAlphaSaturated, BlendFactor::kBlendColor, BlendFactor::kOneMinusBlendColor, BlendFactor::kBlendAlpha, BlendFactor::kOneMinusBlendAlpha }
enum | BlendOperation { BlendOperation::kAdd, BlendOperation::kSubtract, BlendOperation::kReverseSubtract }
enum | LoadAction { LoadAction::kDontCare, LoadAction::kLoad, LoadAction::kClear }
enum | StoreAction { StoreAction::kDontCare, StoreAction::kStore, StoreAction::kMultisampleResolve, StoreAction::kStoreAndMultisampleResolve }
enum | TextureType { TextureType::kTexture2D, TextureType::kTexture2DMultisample, TextureType::kTextureCube, TextureType::kTextureExternalOES }
enum | SampleCount : uint8_t { SampleCount::kCount1 = 1, SampleCount::kCount4 = 4 }
enum | TextureUsage { TextureUsage::kUnknown = 0, TextureUsage::kShaderRead = 1 << 0, TextureUsage::kShaderWrite = 1 << 1, TextureUsage::kRenderTarget = 1 << 2 }
enum | TextureCoordinateSystem { TextureCoordinateSystem::kUploadFromHost, TextureCoordinateSystem::kRenderToTexture }
enum | CullMode { CullMode::kNone, CullMode::kFrontFace, CullMode::kBackFace }
enum | IndexType { IndexType::kUnknown, IndexType::k16bit, IndexType::k32bit, IndexType::kNone }
enum | PrimitiveType : uint8_t { PrimitiveType::kTriangle, PrimitiveType::kTriangleStrip, PrimitiveType::kLine, PrimitiveType::kLineStrip, PrimitiveType::kPoint, PrimitiveType::kTriangleFan }
| Decides how backend draws pixels based on input vertices. More...
enum | PolygonMode { PolygonMode::kFill, PolygonMode::kLine }
enum | MinMagFilter : uint8_t { MinMagFilter::kNearest, MinMagFilter::kLinear }
| Describes how the texture should be sampled when the texture is being shrunk (minified) or expanded (magnified) to fit to the sample point. More...
enum | MipFilter : uint8_t { MipFilter::kBase, MipFilter::kNearest, MipFilter::kLinear }
| Options for selecting and filtering between mipmap levels. More...
enum | SamplerAddressMode : uint8_t { SamplerAddressMode::kClampToEdge, SamplerAddressMode::kRepeat, SamplerAddressMode::kMirror, SamplerAddressMode::kDecal }
enum | ColorWriteMaskBits : uint64_t { ColorWriteMaskBits::kNone = 0, ColorWriteMaskBits::kRed = 1 << 0, ColorWriteMaskBits::kGreen = 1 << 1, ColorWriteMaskBits::kBlue = 1 << 2, ColorWriteMaskBits::kAlpha = 1 << 3, ColorWriteMaskBits::kAll = kRed | kGreen | kBlue | kAlpha }
enum | CompareFunction : uint8_t { CompareFunction::kNever, CompareFunction::kAlways, CompareFunction::kLess, CompareFunction::kEqual, CompareFunction::kLessEqual, CompareFunction::kGreater, CompareFunction::kNotEqual, CompareFunction::kGreaterEqual }
enum | StencilOperation : uint8_t { StencilOperation::kKeep, StencilOperation::kZero, StencilOperation::kSetToReferenceValue, StencilOperation::kIncrementClamp, StencilOperation::kDecrementClamp, StencilOperation::kInvert, StencilOperation::kIncrementWrap, StencilOperation::kDecrementWrap }
enum | RuntimeStageBackend { RuntimeStageBackend::kSkSL, RuntimeStageBackend::kMetal, RuntimeStageBackend::kOpenGLES, RuntimeStageBackend::kOpenGLES3, RuntimeStageBackend::kVulkan }
enum | RuntimeUniformType { kFloat, kSampledImage, kStruct }
enum | RuntimeShaderStage { RuntimeShaderStage::kVertex, RuntimeShaderStage::kFragment, RuntimeShaderStage::kCompute }
enum | ShaderStage { ShaderStage::kUnknown, ShaderStage::kVertex, ShaderStage::kFragment, ShaderStage::kCompute }
enum | ShaderType { ShaderType::kUnknown, ShaderType::kVoid, ShaderType::kBoolean, ShaderType::kSignedByte, ShaderType::kUnsignedByte, ShaderType::kSignedShort, ShaderType::kUnsignedShort, ShaderType::kSignedInt, ShaderType::kUnsignedInt, ShaderType::kSignedInt64, ShaderType::kUnsignedInt64, ShaderType::kAtomicCounter, ShaderType::kHalfFloat, ShaderType::kFloat, ShaderType::kDouble, ShaderType::kStruct, ShaderType::kImage, ShaderType::kSampledImage, ShaderType::kSampler }
enum | DescriptorType { DescriptorType::kSampler = 0, DescriptorType::kSampledImage = 1, DescriptorType::kImage = 2, DescriptorType::kUniformBuffer = 6, DescriptorType::kStorageBuffer = 7, DescriptorType::kInputAttachment = 10 }
enum | CompressionType { CompressionType::kLossless, CompressionType::kLossy }
| Additional compression to apply to a texture. This value is ignored on platforms which do not support it. More...
enum | PointStyle { PointStyle::kRound, PointStyle::kSquare }
enum | SourceRectConstraint { SourceRectConstraint::kFast, SourceRectConstraint::kStrict }
| Controls the behavior of the source rectangle given to DrawImageRect. More...
enum | ContentBoundsPromise { ContentBoundsPromise::kUnknown, ContentBoundsPromise::kContainsContents, ContentBoundsPromise::kMayClipContents }
enum | BlendSelectValues { BlendSelectValues::kScreen = 0, BlendSelectValues::kOverlay, BlendSelectValues::kDarken, BlendSelectValues::kLighten, BlendSelectValues::kColorDodge, BlendSelectValues::kColorBurn, BlendSelectValues::kHardLight, BlendSelectValues::kSoftLight, BlendSelectValues::kDifference, BlendSelectValues::kExclusion, BlendSelectValues::kMultiply, BlendSelectValues::kHue, BlendSelectValues::kSaturation, BlendSelectValues::kColor, BlendSelectValues::kLuminosity }
enum | YUVColorSpace { YUVColorSpace::kBT601LimitedRange, YUVColorSpace::kBT601FullRange }
enum | BlendMode : uint8_t { BlendMode::kClear = 0, BlendMode::kSource, BlendMode::kDestination, BlendMode::kSourceOver, BlendMode::kDestinationOver, BlendMode::kSourceIn, BlendMode::kDestinationIn, BlendMode::kSourceOut, BlendMode::kDestinationOut, BlendMode::kSourceATop, BlendMode::kDestinationATop, BlendMode::kXor, BlendMode::kPlus, BlendMode::kModulate, BlendMode::kScreen, BlendMode::kOverlay, BlendMode::kDarken, BlendMode::kLighten, BlendMode::kColorDodge, BlendMode::kColorBurn, BlendMode::kHardLight, BlendMode::kSoftLight, BlendMode::kDifference, BlendMode::kExclusion, BlendMode::kMultiply, BlendMode::kHue, BlendMode::kSaturation, BlendMode::kColor, BlendMode::kLuminosity, BlendMode::kLast = kLuminosity }
enum | Cap { Cap::kButt, Cap::kRound, Cap::kSquare }
enum | Join { Join::kMiter, Join::kRound, Join::kBevel }
enum | FillType { FillType::kNonZero, FillType::kOdd }
enum | Convexity { Convexity::kUnknown, Convexity::kConvex }
enum | PlaygroundBackend { PlaygroundBackend::kMetal, PlaygroundBackend::kOpenGLES, PlaygroundBackend::kVulkan }
enum | HandleType { HandleType::kUnknown, HandleType::kTexture, HandleType::kBuffer, HandleType::kProgram, HandleType::kRenderBuffer, HandleType::kFrameBuffer, HandleType::kFence }
enum | DebugResourceType { DebugResourceType::kTexture, DebugResourceType::kBuffer, DebugResourceType::kProgram, DebugResourceType::kShader, DebugResourceType::kRenderBuffer, DebugResourceType::kFrameBuffer, DebugResourceType::kFence }
enum | RequiredCommonDeviceExtensionVK : uint32_t { RequiredCommonDeviceExtensionVK::kKHRSwapchain, RequiredCommonDeviceExtensionVK::kLast }
| A device extension available on all platforms. Without the presence of these extensions, context creation will fail. More...
enum | RequiredAndroidDeviceExtensionVK : uint32_t { RequiredAndroidDeviceExtensionVK::kANDROIDExternalMemoryAndroidHardwareBuffer, RequiredAndroidDeviceExtensionVK::kKHRSamplerYcbcrConversion, RequiredAndroidDeviceExtensionVK::kKHRExternalMemory, RequiredAndroidDeviceExtensionVK::kEXTQueueFamilyForeign, RequiredAndroidDeviceExtensionVK::kKHRDedicatedAllocation, RequiredAndroidDeviceExtensionVK::kKHRExternalFenceFd, RequiredAndroidDeviceExtensionVK::kKHRExternalFence, RequiredAndroidDeviceExtensionVK::kKHRExternalSemaphoreFd, RequiredAndroidDeviceExtensionVK::kKHRExternalSemaphore, RequiredAndroidDeviceExtensionVK::kLast }
| A device extension available on all Android platforms. Without the presence of these extensions on Android, context creation will fail. More...
enum | OptionalDeviceExtensionVK : uint32_t { OptionalDeviceExtensionVK::kEXTPipelineCreationFeedback, OptionalDeviceExtensionVK::kVKKHRPortabilitySubset, OptionalDeviceExtensionVK::kEXTImageCompressionControl, OptionalDeviceExtensionVK::kLast }
| A device extension enabled if available. Subsystems cannot assume availability and must check if these extensions are available. More...
enum | AdrenoGPU { AdrenoGPU::kAdreno504, AdrenoGPU::kAdreno505, AdrenoGPU::kAdreno506, AdrenoGPU::kAdreno508, AdrenoGPU::kAdreno509, AdrenoGPU::kAdreno510, AdrenoGPU::kAdreno512, AdrenoGPU::kAdreno530, AdrenoGPU::kAdreno540, AdrenoGPU::kAdreno605, AdrenoGPU::kAdreno608, AdrenoGPU::kAdreno610, AdrenoGPU::kAdreno612, AdrenoGPU::kAdreno613, AdrenoGPU::kAdreno615, AdrenoGPU::kAdreno616, AdrenoGPU::kAdreno618, AdrenoGPU::kAdreno619L, AdrenoGPU::kAdreno619, AdrenoGPU::kAdreno620, AdrenoGPU::kAdreno630, AdrenoGPU::kAdreno640, AdrenoGPU::kAdreno642L, AdrenoGPU::kAdreno642, AdrenoGPU::kAdreno643L, AdrenoGPU::kAdreno644, AdrenoGPU::kAdreno650, AdrenoGPU::kAdreno660, AdrenoGPU::kAdreno663, AdrenoGPU::kAdreno675, AdrenoGPU::kAdreno680, AdrenoGPU::kAdreno685, AdrenoGPU::kAdreno690, AdrenoGPU::kAdreno695, AdrenoGPU::kAdreno702, AdrenoGPU::kAdreno710, AdrenoGPU::kAdreno720, AdrenoGPU::kAdreno725, AdrenoGPU::kAdreno730, AdrenoGPU::kAdreno732, AdrenoGPU::kAdreno735, AdrenoGPU::kAdreno740, AdrenoGPU::kAdreno750, AdrenoGPU::kAdrenoX145, AdrenoGPU::kAdrenoX185, AdrenoGPU::kUnknown }
enum | MaliGPU { MaliGPU::kT760, MaliGPU::kT820, MaliGPU::kT830, MaliGPU::kT860, MaliGPU::kT880, MaliGPU::kG31, MaliGPU::kG51, MaliGPU::kG71, MaliGPU::kG52, MaliGPU::kG72, MaliGPU::kG76, MaliGPU::kG57, MaliGPU::kG77, MaliGPU::kG68, MaliGPU::kG78, MaliGPU::kG310, MaliGPU::kG510, MaliGPU::kG610, MaliGPU::kG710, MaliGPU::kG615, MaliGPU::kG715, MaliGPU::kG620, MaliGPU::kG720, MaliGPU::kG625, MaliGPU::kG725, MaliGPU::kG925, MaliGPU::kUnknown }
enum | VendorVK { VendorVK::kUnknown, VendorVK::kGoogle, VendorVK::kQualcomm, VendorVK::kARM, VendorVK::kImgTec, VendorVK::kPowerVR = kImgTec, VendorVK::kAMD, VendorVK::kNvidia, VendorVK::kIntel, VendorVK::kHuawei, VendorVK::kSamsung, VendorVK::kMesa, VendorVK::kApple }
enum | DeviceTypeVK { DeviceTypeVK::kUnknown, DeviceTypeVK::kIntegratedGPU, DeviceTypeVK::kDiscreteGPU, DeviceTypeVK::kVirtualGPU, DeviceTypeVK::kCPU }
enum | ArchiveShaderType { ArchiveShaderType::kVertex, ArchiveShaderType::kFragment, ArchiveShaderType::kCompute }
enum | AxisAlignment : uint8_t { AxisAlignment::kNone, AxisAlignment::kX, AxisAlignment::kY, AxisAlignment::kAll }
| Determines the axis along which there is subpixel positioning. More...

## Functions
std::shared_ptr< fml::Mapping > | CreateMappingWithCopy (const uint8_t *contents, Bytes length)
| Creates a mapping with copy of the bytes. More...
std::shared_ptr< fml::Mapping > | CreateMappingFromAllocation (const std::shared_ptr< Allocation > &allocation)
| Creates a mapping from allocation. More...
std::shared_ptr< fml::Mapping > | CreateMappingWithString (std::string string)
| Creates a mapping with string data. More...
std::shared_ptr< fml::Mapping > | CreateMappingWithString (std::shared_ptr< const std::string > string)
| Creates a mapping with string data. More...
constexpr Bytes | operator""_bytes (unsigned long long int size)
constexpr KiloBytes | operator""_kb (unsigned long long int size)
constexpr MegaBytes | operator""_mb (unsigned long long int size)
constexpr GigaBytes | operator""_gb (unsigned long long int size)
constexpr KibiBytes | operator""_kib (unsigned long long int size)
constexpr MebiBytes | operator""_mib (unsigned long long int size)
constexpr GibiBytes | operator""_gib (unsigned long long int size)
| IMPELLER_ENUM_IS_MASK (MyMaskBits)
template<class ComparableType , class = std::enable_if_t<std::is_base_of_v<ComparableBase, ComparableType>>>
bool | DeepComparePointer (const std::shared_ptr< ComparableType > &lhs, const std::shared_ptr< ComparableType > &rhs)
template<class Key , class ComparableType , class = std::enable_if_t<std::is_base_of_v<ComparableBase, ComparableType>>>
bool | DeepCompareMap (const std::map< Key, std::shared_ptr< ComparableType >> &lhs, const std::map< Key, std::shared_ptr< ComparableType >> &rhs)
void | ImpellerUnimplemented (const char *method, const char *file, int line)
template<typename EnumType , typename std::enable_if< MaskTraits< EnumType >::kIsMask, bool >::type = true>
constexpr Mask< EnumType > | operator| (const EnumType &lhs, const EnumType &rhs)
template<typename EnumType , typename std::enable_if< MaskTraits< EnumType >::kIsMask, bool >::type = true>
constexpr Mask< EnumType > | operator& (const EnumType &lhs, const EnumType &rhs)
template<typename EnumType , typename std::enable_if< MaskTraits< EnumType >::kIsMask, bool >::type = true>
constexpr Mask< EnumType > | operator^ (const EnumType &lhs, const EnumType &rhs)
template<typename EnumType , typename std::enable_if< MaskTraits< EnumType >::kIsMask, bool >::type = true>
constexpr Mask< EnumType > | operator~ (const EnumType &other)
template<typename EnumType , typename std::enable_if< MaskTraits< EnumType >::kIsMask, bool >::type = true>
constexpr Mask< EnumType > | operator| (const EnumType &lhs, const Mask< EnumType > &rhs)
template<typename EnumType , typename std::enable_if< MaskTraits< EnumType >::kIsMask, bool >::type = true>
constexpr Mask< EnumType > | operator& (const EnumType &lhs, const Mask< EnumType > &rhs)
template<typename EnumType , typename std::enable_if< MaskTraits< EnumType >::kIsMask, bool >::type = true>
constexpr Mask< EnumType > | operator^ (const EnumType &lhs, const Mask< EnumType > &rhs)
template<typename EnumType , typename std::enable_if_t< MaskTraits< EnumType >::kIsMask, bool > = true>
constexpr bool | operator< (const EnumType &lhs, const Mask< EnumType > &rhs)
template<typename EnumType , typename std::enable_if_t< MaskTraits< EnumType >::kIsMask, bool > = true>
constexpr bool | operator> (const EnumType &lhs, const Mask< EnumType > &rhs)
template<typename EnumType , typename std::enable_if_t< MaskTraits< EnumType >::kIsMask, bool > = true>
constexpr bool | operator<= (const EnumType &lhs, const Mask< EnumType > &rhs)
template<typename EnumType , typename std::enable_if_t< MaskTraits< EnumType >::kIsMask, bool > = true>
constexpr bool | operator>= (const EnumType &lhs, const Mask< EnumType > &rhs)
template<typename EnumType , typename std::enable_if_t< MaskTraits< EnumType >::kIsMask, bool > = true>
constexpr bool | operator== (const EnumType &lhs, const Mask< EnumType > &rhs)
template<typename EnumType , typename std::enable_if_t< MaskTraits< EnumType >::kIsMask, bool > = true>
constexpr bool | operator!= (const EnumType &lhs, const Mask< EnumType > &rhs)
template<class T >
std::future< T > | RealizedFuture (T t)
std::string | SPrintF (const char *format,...)
bool | HasPrefix (const std::string &string, const std::string &prefix)
bool | HasSuffix (const std::string &string, const std::string &suffix)
std::string | StripPrefix (const std::string &string, const std::string &to_strip)
class | IPLR_CAPABILITY ("mutex") Mutex
void | ImpellerValidationErrorsSetFatal (bool fatal)
void | ImpellerValidationErrorsSetCallback (ValidationFailureCallback callback)
| Sets a callback that callers (usually tests) can set to intercept validation failures. More...
void | ImpellerValidationBreak (const char *message, const char *file, int line)
bool | ImpellerValidationErrorsAreFatal ()
std::vector< spirv_cross::ID > | SortUniforms (const spirv_cross::ParsedIR *ir, const spirv_cross::Compiler *compiler, std::optional< spirv_cross::SPIRType::BaseType > type_filter=std::nullopt, bool include=true)
| Sorts uniform declarations in an IR according to decoration order. More...
constexpr bool | StoreActionNeedsResolveTexture (StoreAction action)
std::string | TextureUsageMaskToString (TextureUsageMask mask)
std::string | AttachmentToString (const Attachment &attachment)
std::string | ColorAttachmentToString (const ColorAttachment &color)
std::string | DepthAttachmentToString (const DepthAttachment &depth)
std::string | StencilAttachmentToString (const StencilAttachment &stencil)
constexpr const char * | StorageModeToString (StorageMode mode)
constexpr bool | IsDepthWritable (PixelFormat format)
constexpr bool | IsStencilWritable (PixelFormat format)
constexpr const char * | PixelFormatToString (PixelFormat format)
constexpr const char * | LoadActionToString (LoadAction action)
constexpr const char * | StoreActionToString (StoreAction action)
constexpr bool | CanClearAttachment (LoadAction action)
constexpr bool | CanDiscardAttachmentWhenDone (StoreAction action)
constexpr const char * | TextureTypeToString (TextureType type)
constexpr bool | IsMultisampleCapable (TextureType type)
| IMPELLER_ENUM_IS_MASK (TextureUsage)
constexpr const char * | TextureUsageToString (TextureUsage usage)
| IMPELLER_ENUM_IS_MASK (ColorWriteMaskBits)
constexpr size_t | BytesPerPixelForPixelFormat (PixelFormat format)
constexpr size_t | DefaultUniformAlignment ()
constexpr ShaderStage | ToShaderStage (RuntimeShaderStage stage)
constexpr Vector4 | ToVector (Color color)
std::string | TextureDescriptorToString (const TextureDescriptor &desc)
constexpr const char * | CompressionTypeToString (CompressionType type)
std::shared_ptr< ColorFilterContents > | WrapWithInvertColors (const std::shared_ptr< FilterInput > &input, ColorFilterContents::AbsorbOpacity absorb_opacity)
std::shared_ptr< ColorFilterContents > | WrapWithGPUColorFilter (const flutter::DlColorFilter *filter, const std::shared_ptr< FilterInput > &input, ColorFilterContents::AbsorbOpacity absorb_opacity)
ColorFilterProc | GetCPUColorFilterProc (const flutter::DlColorFilter *filter)
static impeller::SamplerDescriptor | ToSamplerDescriptor (const flutter::DlFilterMode options)
static Paint::Style | ToStyle (flutter::DlDrawStyle style)
static FilterContents::BlurStyle | ToBlurStyle (flutter::DlBlurStyle blur_style)
static Entity::ClipOperation | ToClipOperation (flutter::DlCanvas::ClipOp clip_op)
static bool | RequiresReadbackForBlends (const ContentContext &renderer, flutter::DlBlendMode max_root_blend_mode)
| Subclasses. More...
std::shared_ptr< Texture > | DisplayListToTexture (const sk_sp< flutter::DisplayList > &display_list, ISize size, AiksContext &context, bool reset_host_buffer=true, bool generate_mips=false)
| Render the provided display list to a texture with the given size. More...
bool | RenderToTarget (ContentContext &context, RenderTarget render_target, const sk_sp< flutter::DisplayList > &display_list, SkIRect cull_rect, bool reset_host_buffer, bool is_onscreen=true)
| Render the provided display list to the render target. More...
std::shared_ptr< FilterContents > | WrapInput (const flutter::DlImageFilter *filter, const FilterInput::Ref &input)
| Generate a new FilterContents using this filter's configuration. More...
static Scalar | GetShaderClipDepth (uint32_t clip_depth)
bool | RenderClipRestore (const ContentContext &renderer, RenderPass &pass, uint32_t clip_depth, std::optional< Rect > restore_coverage)
| Render a restore clip. More...
std::array< std::vector< Scalar >, 15 > | GetPorterDuffSpecConstants (bool supports_decal)
template<typename PipelineT >
static std::unique_ptr< PipelineT > | CreateDefaultPipeline (const Context &context)
ContentContextOptions | OptionsFromPass (const RenderPass &pass)
ContentContextOptions | OptionsFromPassAndEntity (const RenderPass &pass, const Entity &entity)
std::optional< BlendMode > | InvertPorterDuffBlend (BlendMode blend_mode)
template<typename TPipeline >
static std::optional< Entity > | AdvancedBlend (const FilterInput::Vector &inputs, const ContentContext &renderer, const Entity &entity, const Rect &coverage, BlendMode blend_mode, std::optional< Color > foreground_color, ColorFilterContents::AbsorbOpacity absorb_opacity, PipelineProc pipeline_proc, std::optional< Scalar > alpha)
static std::optional< Entity > | PipelineBlend (const FilterInput::Vector &inputs, const ContentContext &renderer, const Entity &entity, const Rect &coverage, BlendMode blend_mode, std::optional< Color > foreground_color, ColorFilterContents::AbsorbOpacity absorb_opacity, std::optional< Scalar > alpha)
KernelSamples | GenerateBlurInfo (BlurParameters parameters)
GaussianBlurPipeline::FragmentShader::KernelSamples | LerpHackKernelSamples (KernelSamples parameters)
std::shared_ptr< Texture > | CreateGradientTexture (const GradientData &gradient_data, const std::shared_ptr< impeller::Context > &context)
| Create a host visible texture that contains the gradient defined by the provided gradient data. More...
std::vector< StopData > | CreateGradientColors (const std::vector< Color > &colors, const std::vector< Scalar > &stops)
| Populate a vector with the color and stop data for a gradient. More...
int | PopulateUniformGradientColors (const std::vector< Color > &colors, const std::vector< Scalar > &stops, Vector4 frag_info_colors[kMaxUniformGradientStops], Vector4 frag_info_stop_pairs[kMaxUniformGradientStops/2])
| Populate 2 arrays with the colors and stop data for a gradient. More...
static ShaderType | GetShaderType (RuntimeUniformType type)
static std::unique_ptr< ShaderMetadata > | MakeShaderMetadata (const RuntimeUniformDescription &uniform)
static Point | eccentricity (Point v, double sInverse)
static Scalar | computeErf7 (Scalar x)
static Point | NegPos (Scalar v)
static bool | SetupFragInfo (RRectBlurPipeline::FragmentShader::FragInfo &frag_info, Scalar blurSigma, Point center, Point rSize, Scalar radius)
Point | SizeToPoint (Size size)
static std::optional< SamplerAddressMode > | TileModeToAddressMode (Entity::TileMode tile_mode, const Capabilities &capabilities)
std::optional< Rect > | ComputeSaveLayerCoverage (const Rect &content_coverage, const Matrix &effect_transform, const Rect &coverage_limit, const std::shared_ptr< FilterContents > &image_filter, bool flood_output_coverage=false, bool flood_input_coverage=false)
| Compute the coverage of a subpass in the global coordinate space. More...
static constexpr bool | ValidateBlendModes ()
const char * | BlendModeToString (BlendMode blend_mode)
static constexpr Color | Min (Color c, float threshold)
static constexpr Scalar | Luminosity (Vector3 color)
static constexpr Vector3 | ClipColor (Vector3 color)
static constexpr Vector3 | SetLuminosity (Vector3 color, Scalar luminosity)
static constexpr Scalar | Saturation (Vector3 color)
static constexpr Vector3 | SetSaturation (Vector3 color, Scalar saturation)
static constexpr Vector3 | ComponentChoose (Vector3 a, Vector3 b, Vector3 value, Scalar cutoff)
static constexpr Vector3 | ToRGB (Color color)
static constexpr Color | FromRGB (Vector3 color, Scalar alpha)
static constexpr Color | ApplyBlendedColor (Color dst, Color src, Vector3 blend_result)
static constexpr Color | DoColorBlend (Color dst, Color src, const std::function< Vector3(Vector3, Vector3)> &blend_rgb_func)
static constexpr Color | DoColorBlendComponents (Color dst, Color src, const std::function< Scalar(Scalar, Scalar)> &blend_func)
std::string | ColorToString (const Color &color)
template<class T , class = std::enable_if_t<std::is_arithmetic_v<T>>>
constexpr Color | operator+ (T value, const Color &c)
template<class T , class = std::enable_if_t<std::is_arithmetic_v<T>>>
constexpr Color | operator- (T value, const Color &c)
template<class T , class = std::enable_if_t<std::is_arithmetic_v<T>>>
constexpr Color | operator* (T value, const Color &c)
template<class T , class = std::enable_if_t<std::is_arithmetic_v<T>>>
constexpr Color | operator/ (T value, const Color &c)
template<class... Args>
static void | BM_Polyline (benchmark::State &state, Args &&... args)
template<class... Args>
static void | BM_StrokePolyline (benchmark::State &state, Args &&... args)
template<class... Args>
static void | BM_Convex (benchmark::State &state, Args &&... args)
| BENCHMARK_CAPTURE (BM_Polyline, cubic_polyline, CreateCubic(true))
| BENCHMARK_CAPTURE (BM_Polyline, unclosed_cubic_polyline, CreateCubic(false))
| MAKE_STROKE_BENCHMARK_CAPTURE_ALL_CAPS_JOINS (Cubic, false)
| BENCHMARK_CAPTURE (BM_Polyline, quad_polyline, CreateQuadratic(true))
| BENCHMARK_CAPTURE (BM_Polyline, unclosed_quad_polyline, CreateQuadratic(false))
| MAKE_STROKE_BENCHMARK_CAPTURE_ALL_CAPS_JOINS (Quadratic, false)
| BENCHMARK_CAPTURE (BM_Convex, rrect_convex, CreateRRect(), true)
| MAKE_STROKE_BENCHMARK_CAPTURE (RRect, Butt, Bevel,)
| MAKE_STROKE_BENCHMARK_CAPTURE (RRect, Butt, Miter,)
| MAKE_STROKE_BENCHMARK_CAPTURE (RRect, Butt, Round,)
static void | AppendColor (const Color &color, GradientData *data)
GradientData | CreateGradientBuffer (const std::vector< Color > &colors, const std::vector< Scalar > &stops)
| Populate a vector with the interpolated color bytes for the linear gradient described by colors and stops. More...
constexpr InternalHalf | ScalarToHalf (Scalar f)
| Convert a scalar to a half precision float. More...
static Scalar | LinearSolve (Scalar t, Scalar p0, Scalar p1)
static Scalar | QuadraticSolve (Scalar t, Scalar p0, Scalar p1, Scalar p2)
static Scalar | QuadraticSolveDerivative (Scalar t, Scalar p0, Scalar p1, Scalar p2)
static Scalar | CubicSolve (Scalar t, Scalar p0, Scalar p1, Scalar p2, Scalar p3)
static Scalar | CubicSolveDerivative (Scalar t, Scalar p0, Scalar p1, Scalar p2, Scalar p3)
static bool | NearEqual (Scalar a, Scalar b, Scalar epsilon)
static bool | NearZero (Scalar a)
static void | CubicPathBoundingPopulateValues (std::vector< Scalar > &values, Scalar p1, Scalar p2, Scalar p3, Scalar p4)
template<class F , class I , class = MixedOp<F, I>>
constexpr TPoint< F > | operator+ (const TPoint< F > &p1, const TPoint< I > &p2)
template<class F , class I , class = MixedOp<F, I>>
constexpr TPoint< F > | operator+ (const TPoint< I > &p1, const TPoint< F > &p2)
template<class F , class I , class = MixedOp<F, I>>
constexpr TPoint< F > | operator- (const TPoint< F > &p1, const TPoint< I > &p2)
template<class F , class I , class = MixedOp<F, I>>
constexpr TPoint< F > | operator- (const TPoint< I > &p1, const TPoint< F > &p2)
template<class F , class I , class = MixedOp<F, I>>
constexpr TPoint< F > | operator* (const TPoint< F > &p1, const TPoint< I > &p2)
template<class F , class I , class = MixedOp<F, I>>
constexpr TPoint< F > | operator* (const TPoint< I > &p1, const TPoint< F > &p2)
template<class F , class I , class = MixedOp<F, I>>
constexpr TPoint< F > | operator/ (const TPoint< F > &p1, const TPoint< I > &p2)
template<class F , class I , class = MixedOp<F, I>>
constexpr TPoint< F > | operator/ (const TPoint< I > &p1, const TPoint< F > &p2)
template<class T , class U , class = std::enable_if_t<std::is_arithmetic_v<U>>>
constexpr TPoint< T > | operator* (U s, const TPoint< T > &p)
template<class T , class U , class = std::enable_if_t<std::is_arithmetic_v<U>>>
constexpr TPoint< T > | operator/ (U s, const TPoint< T > &p)
template<class T , class U >
constexpr TPoint< T > | operator+ (const TSize< U > &s, const TPoint< T > &p)
template<class T , class U >
constexpr TPoint< T > | operator- (const TSize< U > &s, const TPoint< T > &p)
template<class T , class U >
constexpr TPoint< T > | operator* (const TSize< U > &s, const TPoint< T > &p)
template<class T , class U >
constexpr TPoint< T > | operator/ (const TSize< U > &s, const TPoint< T > &p)
template<class T >
constexpr TPoint< T > | operator- (const TPoint< T > &p, T v)
static bool | CornerContains (const Point &p, const Point &corner, const Point &direction, const Size &radii)
static constexpr Point | kUpperLeftDirection (-1.0f, -1.0f)
static constexpr Point | kUpperRightDirection (1.0f, -1.0f)
static constexpr Point | kLowerLeftDirection (-1.0f, 1.0f)
static constexpr Point | kLowerRightDirection (1.0f, 1.0f)
static void | NormalizeEmptyToZero (Size &radii)
static void | AdjustScale (Scalar &radius1, Scalar &radius2, Scalar dimension, Scalar &scale)
template<class T , class = std::enable_if_t<std::is_arithmetic_v<T>>>
constexpr T | Absolute (const T &val)
template<>
constexpr Scalar | Absolute< Scalar > (const float &val)
constexpr bool | ScalarNearlyZero (Scalar x, Scalar tolerance=kEhCloseEnough)
constexpr bool | ScalarNearlyEqual (Scalar x, Scalar y, Scalar tolerance=kEhCloseEnough)
template<class T , class U , class = std::enable_if_t<std::is_arithmetic_v<U>>>
constexpr TSize< T > | operator* (U s, const TSize< T > &p)
template<class T , class U , class = std::enable_if_t<std::is_arithmetic_v<U>>>
constexpr TSize< T > | operator/ (U s, const TSize< T > &p)
template<class U , class = std::enable_if_t<std::is_arithmetic_v<U>>>
constexpr Vector3 | operator* (U s, const Vector3 &p)
template<class U , class = std::enable_if_t<std::is_arithmetic_v<U>>>
constexpr Vector3 | operator+ (U s, const Vector3 &p)
template<class U , class = std::enable_if_t<std::is_arithmetic_v<U>>>
constexpr Vector3 | operator- (U s, const Vector3 &p)
template<class U , class = std::enable_if_t<std::is_arithmetic_v<U>>>
constexpr Vector3 | operator/ (U s, const Vector3 &p)
Scalar | ComputeCubicSubdivisions (Scalar scale_factor, Point p0, Point p1, Point p2, Point p3)
Scalar | ComputeQuadradicSubdivisions (Scalar scale_factor, Point p0, Point p1, Point p2)
Scalar | ComputeQuadradicSubdivisions (Scalar scale_factor, const QuadraticPathComponent &quad)
Scalar | ComputeCubicSubdivisions (float scale_factor, const CubicPathComponent &cub)
| TEST (ValidationTest, IsFatal)
static std::vector< std::shared_ptr< fml::Mapping > > | ShaderLibraryMappingsForPlayground ()
static std::vector< std::shared_ptr< fml::Mapping > > | ShaderLibraryMappingsForPlayground ()
static std::vector< std::shared_ptr< fml::Mapping > > | ShaderLibraryMappingsForPlayground ()
static void | FindSwiftShaderICDAtKnownPaths ()
void | SetupSwiftshaderOnce (bool use_swiftshader)
| Find and setup the installable client driver for a locally built SwiftShader at known paths. The option to use SwiftShader can only be used once in the process. While calling this method multiple times is fine, specifying a different use_swiftshader value will trip an assertion. More...
static std::string | FormatWindowTitle (const std::string &test_name)
static size_t | GetBytesPerPixel (DecompressedImage::Format format)
std::string | PlaygroundBackendToString (PlaygroundBackend backend)
static void | InitializeGLFWOnce ()
static void | PlaygroundKeyCallback (GLFWwindow *window, int key, int scancode, int action, int mods)
static std::shared_ptr< Texture > | CreateTextureForDecompressedImage (const std::shared_ptr< Context > &context, DecompressedImage &decompressed_image, bool enable_mipmapping)
constexpr RuntimeStageBackend | PlaygroundBackendToRuntimeStageBackend (PlaygroundBackend backend)
Point | DrawPlaygroundPoint (PlaygroundPoint &point)
std::tuple< Point, Point > | DrawPlaygroundLine (PlaygroundPoint &point_a, PlaygroundPoint &point_b)
static void | DeleteFBO (const ProcTableGLES &gl, GLuint fbo, GLenum type)
static std::optional< GLuint > | ConfigureFBO (const ProcTableGLES &gl, const std::shared_ptr< Texture > &texture, GLenum fbo_type)
bool | EncodeCommandsInReactor (const ReactorGLES &reactor, const std::vector< std::unique_ptr< BlitEncodeGLES >> &commands, const std::string &label)
static std::string | NormalizeUniformKey (const std::string &key)
static std::string | CreateUniformMemberKey (const std::string &struct_name, const std::string &member, bool is_array)
static std::string | CreateUniformMemberKey (const std::string &non_struct_member)
static std::string | GetGLString (const ProcTableGLES &gl, GLenum name)
static std::string | GetGLStringi (const ProcTableGLES &gl, GLenum name, int index)
static bool | DetermineIfES (const std::string &version)
static bool | DetermineIfANGLE (const std::string &version)
static std::optional< Version > | DetermineVersion (std::string version)
static GLenum | ToTarget (DeviceBufferGLES::BindingType type)
std::string | DebugToFramebufferError (int status)
constexpr GLenum | ToMode (PrimitiveType primitive_type)
constexpr GLenum | ToIndexType (IndexType type)
constexpr GLenum | ToStencilOp (StencilOperation op)
constexpr GLenum | ToCompareFunction (CompareFunction func)
constexpr GLenum | ToBlendFactor (BlendFactor factor)
constexpr GLenum | ToBlendOperation (BlendOperation op)
constexpr std::optional< GLenum > | ToVertexAttribType (ShaderType type)
constexpr GLenum | ToTextureType (TextureType type)
constexpr std::optional< GLenum > | ToTextureTarget (TextureType type)
std::string | HandleTypeToString (HandleType type)
static std::string | GetShaderInfoLog (const ProcTableGLES &gl, GLuint shader)
static std::string | GetShaderSource (const ProcTableGLES &gl, GLuint shader)
static void | LogShaderCompilationFailure (const ProcTableGLES &gl, GLuint shader, std::string_view name, const fml::Mapping &source_mapping, ShaderStage stage)
static bool | LinkProgram (const ReactorGLES &reactor, const std::shared_ptr< PipelineGLES > &pipeline, const std::shared_ptr< const ShaderFunction > &vert_function, const std::shared_ptr< const ShaderFunction > &frag_function)
const char * | GLErrorToString (GLenum value)
bool | GLErrorIsFatal (GLenum value)
ProcTableGLES::Resolver | WrappedResolver (const ProcTableGLES::Resolver &resolver)
static const char * | FramebufferStatusToString (GLenum status)
static const char * | AttachmentTypeString (GLint type)
static std::string | DescribeFramebufferAttachment (const ProcTableGLES &gl, GLenum attachment)
static std::optional< GLenum > | ToDebugIdentifier (DebugResourceType type)
static bool | ResourceIsLive (const ProcTableGLES &gl, DebugResourceType type, GLint name)
template<class Type >
void | BuildGLArgumentsStream (std::stringstream &stream, Type arg)
constexpr void | BuildGLArgumentsStream (std::stringstream &stream)
template<class Type , class... Rest>
void | BuildGLArgumentsStream (std::stringstream &stream, Type arg, Rest... other_args)
template<class... Type>
std::string | BuildGLArguments (Type... args)
void() | glClearDepthf (GLfloat depth)
void() | glDepthRangef (GLfloat n, GLfloat f)
void() | glClearDepth (GLdouble depth)
void() | glDepthRange (GLdouble n, GLdouble f)
static DebugResourceType | ToDebugResourceType (HandleType type)
void | ConfigureBlending (const ProcTableGLES &gl, const ColorAttachmentDescriptor *color)
void | ConfigureStencil (GLenum face, const ProcTableGLES &gl, const StencilAttachmentDescriptor &stencil, uint32_t stencil_reference)
void | ConfigureStencil (const ProcTableGLES &gl, const PipelineDescriptor &pipeline, uint32_t stencil_reference)
static bool | BindVertexBuffer (const ProcTableGLES &gl, BufferBindingsGLES *vertex_desc_gles, const BufferView &vertex_buffer_view, size_t buffer_index)
bool | EncodeCommandsInReactor (const RenderPassData &pass_data, const ReactorGLES &reactor, const std::vector< Command > &commands, const std::vector< BufferView > &vertex_buffers, const std::vector< TextureAndSampler > &bound_textures, const std::vector< BufferResource > &bound_buffers, const std::shared_ptr< GPUTracerGLES > &tracer)
static GLint | ToParam (MinMagFilter minmag_filter)
static GLint | ToParam (MinMagFilter minmag_filter, MipFilter mip_filter)
static GLint | ToAddressMode (SamplerAddressMode mode, bool supports_decal_sampler_address_mode)
static ShaderStage | ToShaderStage (ArchiveShaderType type)
static std::string | GLESShaderNameToShaderKeyName (const std::string &name, ShaderStage stage)
HandleType | ToHandleType (TextureGLES::Type type)
static std::optional< GLenum > | ToRenderBufferFormat (PixelFormat format)
static GLenum | ToAttachmentType (TextureGLES::AttachmentType point)
ISize | DeviceMaxTextureSizeSupported (id< MTLDevice > device)
static bool | DeviceSupportsDeviceTransientTargets (id< MTLDevice > device)
static bool | DeviceHasUnifiedMemoryArchitecture (id< MTLDevice > device)
static bool | SupportsLossyTextureCompression (id< MTLDevice > device)
static MTLResourceOptions | ToMTLResourceOptions (StorageMode type, bool supports_memoryless_targets, bool supports_uma)
static MTLStorageMode | ToMTLStorageMode (StorageMode mode, bool supports_memoryless_targets, bool supports_uma)
| API_AVAILABLE (ios(14.0), macos(11.0)) static NSString *MTLCommandEncoderErrorStateToString(MTLCommandEncoderErrorState state)
static NSString * | MTLCommandBufferErrorToString (MTLCommandBufferError code)
static bool | LogMTLCommandBufferErrorIfPresent (id< MTLCommandBuffer > buffer)
static id< MTLCommandBuffer > | CreateCommandBuffer (id< MTLCommandQueue > queue)
static CommandBuffer::Status | ToCommitResult (MTLCommandBufferStatus status)
static bool | DeviceSupportsFramebufferFetch (id< MTLDevice > device)
static bool | DeviceSupportsComputeSubgroups (id< MTLDevice > device)
static std::unique_ptr< Capabilities > | InferMetalCapabilities (id< MTLDevice > device, PixelFormat color_format)
static NSArray< id< MTLLibrary > > * | MTLShaderLibraryFromFilePaths (id< MTLDevice > device, const std::vector< std::string > &libraries_paths)
static NSArray< id< MTLLibrary > > * | MTLShaderLibraryFromFileData (id< MTLDevice > device, const std::vector< std::shared_ptr< fml::Mapping >> &libraries_data, const std::string &label)
static id< MTLDevice > | CreateMetalDevice ()
static id< MTLCommandQueue > | CreateMetalCommandQueue (id< MTLDevice > device)
constexpr PixelFormat | FromMTLPixelFormat (MTLPixelFormat format)
MTLPixelFormat | SafeMTLPixelFormatDepth24Unorm_Stencil8 ()
MTLPixelFormat | SafeMTLPixelFormatBGR10_XR_sRGB ()
MTLPixelFormat | SafeMTLPixelFormatBGR10_XR ()
MTLPixelFormat | SafeMTLPixelFormatBGRA10_XR ()
constexpr MTLPixelFormat | ToMTLPixelFormat (PixelFormat format)
constexpr MTLBlendFactor | ToMTLBlendFactor (BlendFactor type)
constexpr MTLPrimitiveType | ToMTLPrimitiveType (PrimitiveType type)
constexpr MTLTriangleFillMode | ToMTLTriangleFillMode (PolygonMode mode)
constexpr MTLIndexType | ToMTLIndexType (IndexType type)
constexpr MTLCullMode | ToMTLCullMode (CullMode mode)
constexpr MTLBlendOperation | ToMTLBlendOperation (BlendOperation type)
constexpr MTLColorWriteMask | ToMTLColorWriteMask (ColorWriteMask type)
constexpr MTLCompareFunction | ToMTLCompareFunction (CompareFunction func)
constexpr MTLStencilOperation | ToMTLStencilOperation (StencilOperation op)
constexpr MTLLoadAction | ToMTLLoadAction (LoadAction action)
constexpr LoadAction | FromMTLLoadAction (MTLLoadAction action)
constexpr MTLStoreAction | ToMTLStoreAction (StoreAction action)
constexpr StoreAction | FromMTLStoreAction (MTLStoreAction action)
constexpr MTLSamplerMinMagFilter | ToMTLSamplerMinMagFilter (MinMagFilter filter)
constexpr MTLSamplerMipFilter | ToMTLSamplerMipFilter (MipFilter filter)
constexpr MTLSamplerAddressMode | ToMTLSamplerAddressMode (SamplerAddressMode mode)
MTLClearColor | ToMTLClearColor (const Color &color)
constexpr MTLTextureType | ToMTLTextureType (TextureType type)
MTLRenderPipelineColorAttachmentDescriptor * | ToMTLRenderPipelineColorAttachmentDescriptor (ColorAttachmentDescriptor descriptor)
MTLDepthStencilDescriptor * | ToMTLDepthStencilDescriptor (std::optional< DepthAttachmentDescriptor > depth, std::optional< StencilAttachmentDescriptor > front, std::optional< StencilAttachmentDescriptor > back)
MTLTextureDescriptor * | ToMTLTextureDescriptor (const TextureDescriptor &desc)
MTLStencilDescriptor * | ToMTLStencilDescriptor (const StencilAttachmentDescriptor &descriptor)
std::shared_future< id< CAMetalDrawable > > | GetDrawableDeferred (CAMetalLayer *layer)
| Create a deferred drawable from a CAMetalLayer. More...
std::shared_ptr< TextureMTL > | CreateTextureFromDrawableFuture (TextureDescriptor desc, const std::shared_future< id< CAMetalDrawable >> &drawble_future)
| Create a TextureMTL from a deferred drawable. More...
static void | GetMTLRenderPipelineDescriptor (const PipelineDescriptor &desc, const Callback &callback)
static MTLComputePipelineDescriptor * | GetMTLComputePipelineDescriptor (const ComputePipelineDescriptor &desc)
static id< MTLDepthStencilState > | CreateDepthStencilDescriptor (const PipelineDescriptor &desc, id< MTLDevice > device)
static bool | ConfigureResolveTextureAttachment (const Attachment &desc, MTLRenderPassAttachmentDescriptor *attachment)
static bool | ConfigureAttachment (const Attachment &desc, MTLRenderPassAttachmentDescriptor *attachment)
static bool | ConfigureColorAttachment (const ColorAttachment &desc, MTLRenderPassColorAttachmentDescriptor *attachment)
static bool | ConfigureDepthAttachment (const DepthAttachment &desc, MTLRenderPassDepthAttachmentDescriptor *attachment)
static bool | ConfigureStencilAttachment (const StencilAttachment &desc, MTLRenderPassStencilAttachmentDescriptor *attachment)
static MTLRenderPassDescriptor * | ToMTLRenderPassDescriptor (const RenderTarget &desc)
static bool | Bind (PassBindingsCacheMTL &pass, ShaderStage stage, size_t bind_index, const BufferView &view)
static bool | Bind (PassBindingsCacheMTL &pass, ShaderStage stage, size_t bind_index, raw_ptr< const Sampler > sampler, const Texture &texture)
static MTLFunctionType | ToMTLFunctionType (ShaderStage stage)
static std::optional< RenderTarget > | WrapTextureWithRenderTarget (const std::shared_ptr< SwapchainTransientsMTL > &transients, id< MTLTexture > texture, bool requires_blit, std::optional< IRect > clip_rect)
std::shared_ptr< Texture > | WrapperMTL (TextureDescriptor desc, const void *mtl_texture, std::function< void()> deletion_proc)
std::shared_ptr< Texture > | WrapTextureMTL (TextureDescriptor desc, const void *mtl_texture, std::function< void()> deletion_proc=nullptr)
static MTLVertexFormat | ReadStageInputFormat (const ShaderStageIOSlot &input)
static constexpr vk::Flags< vk::MemoryPropertyFlagBits > | ToVKBufferMemoryPropertyFlags (StorageMode mode)
static VmaAllocationCreateFlags | ToVmaAllocationBufferCreateFlags (StorageMode mode, bool readback)
static PoolVMA | CreateBufferPool (VmaAllocator allocator)
static constexpr VmaMemoryUsage | ToVMAMemoryUsage ()
static constexpr vk::Flags< vk::MemoryPropertyFlagBits > | ToVKTextureMemoryPropertyFlags (StorageMode mode, bool supports_memoryless_textures)
static VmaAllocationCreateFlags | ToVmaAllocationCreateFlags (StorageMode mode)
static vk::UniqueImage | CreateVKImageWrapperForAndroidHarwareBuffer (const vk::Device &device, const AHBProperties &ahb_props, const AHardwareBuffer_Desc &ahb_desc)
static vk::UniqueDeviceMemory | ImportVKDeviceMemoryFromAndroidHarwareBuffer (const vk::Device &device, const vk::PhysicalDevice &physical_device, const vk::Image &image, struct AHardwareBuffer *hardware_buffer, const AHBProperties &ahb_props)
static std::shared_ptr< YUVConversionVK > | CreateYUVConversion (const ContextVK &context, const AHBProperties &ahb_props)
static vk::UniqueImageView | CreateVKImageView (const vk::Device &device, const vk::Image &image, const vk::SamplerYcbcrConversion &yuv_conversion, const AHBProperties &ahb_props, const AHardwareBuffer_Desc &ahb_desc)
static PixelFormat | ToPixelFormat (AHardwareBuffer_Format format)
static TextureType | ToTextureType (const AHardwareBuffer_Desc &ahb_desc)
static TextureDescriptor | ToTextureDescriptor (const AHardwareBuffer_Desc &ahb_desc)
static void | InsertImageMemoryBarrier (const vk::CommandBuffer &cmd, const vk::Image &image, vk::AccessFlags src_access_mask, vk::AccessFlags dst_access_mask, vk::ImageLayout old_layout, vk::ImageLayout new_layout, vk::PipelineStageFlags src_stage, vk::PipelineStageFlags dst_stage, uint32_t base_mip_level, uint32_t mip_level_count=1u)
static const char * | GetExtensionName (RequiredCommonDeviceExtensionVK ext)
static const char * | GetExtensionName (RequiredAndroidDeviceExtensionVK ext)
static const char * | GetExtensionName (OptionalDeviceExtensionVK ext)
template<class T >
static bool | IterateExtensions (const std::function< bool(T)> &it)
static std::optional< std::set< std::string > > | GetSupportedDeviceExtensions (const vk::PhysicalDevice &physical_device)
static bool | HasSuitableColorFormat (const vk::PhysicalDevice &device, vk::Format format)
static bool | HasSuitableDepthStencilFormat (const vk::PhysicalDevice &device, vk::Format format)
static bool | PhysicalDeviceSupportsRequiredFormats (const vk::PhysicalDevice &device)
static bool | HasRequiredProperties (const vk::PhysicalDevice &physical_device)
static bool | HasRequiredQueues (const vk::PhysicalDevice &physical_device)
template<class ExtensionEnum >
static bool | IsExtensionInList (const std::vector< std::string > &list, ExtensionEnum ext)
static std::unordered_map< const ContextVK *, std::vector< std::weak_ptr< CommandPoolVK > > > g_all_pools_map | IPLR_GUARDED_BY (g_all_pools_map_mutex)
bool | HasValidationLayers ()
static std::optional< vk::PhysicalDevice > | PickPhysicalDevice (const CapabilitiesVK &caps, const vk::Instance &instance)
static std::vector< vk::DeviceQueueCreateInfo > | GetQueueCreateInfos (std::initializer_list< QueueIndexVK > queues)
static std::optional< QueueIndexVK > | PickQueue (const vk::PhysicalDevice &device, vk::QueueFlagBits flags)
static std::string | JoinLabels (const VkDebugUtilsLabelEXT *labels, size_t count)
static std::string | JoinVKDebugUtilsObjectNameInfoEXT (const VkDebugUtilsObjectNameInfoEXT *names, size_t count)
AdrenoGPU | GetAdrenoVersion (std::string_view version)
MaliGPU | GetMaliVersion (std::string_view version)
constexpr VendorVK | IdentifyVendor (uint32_t vendor)
constexpr const char * | VendorToString (VendorVK vendor)
constexpr const char * | DeviceTypeToString (DeviceTypeVK type)
constexpr DeviceTypeVK | ToDeviceType (const vk::PhysicalDeviceType &type)
static std::vector< vk::Fence > | GetFencesForWaitSet (const WaitSet &set)
vk::PipelineDepthStencilStateCreateInfo | ToVKPipelineDepthStencilStateCreateInfo (std::optional< DepthAttachmentDescriptor > depth, std::optional< StencilAttachmentDescriptor > front, std::optional< StencilAttachmentDescriptor > back)
constexpr std::optional< PixelFormat > | VkFormatToImpellerFormat (vk::Format format)
constexpr vk::SampleCountFlagBits | ToVKSampleCountFlagBits (SampleCount count)
constexpr vk::BlendFactor | ToVKBlendFactor (BlendFactor factor)
constexpr vk::BlendOp | ToVKBlendOp (BlendOperation op)
constexpr vk::ColorComponentFlags | ToVKColorComponentFlags (ColorWriteMask type)
constexpr vk::PipelineColorBlendAttachmentState | ToVKPipelineColorBlendAttachmentState (const ColorAttachmentDescriptor &desc)
constexpr std::optional< vk::ShaderStageFlagBits > | ToVKShaderStageFlagBits (ShaderStage stage)
constexpr vk::Format | ToVKImageFormat (PixelFormat format)
constexpr PixelFormat | ToPixelFormat (vk::Format format)
constexpr vk::SampleCountFlagBits | ToVKSampleCount (SampleCount sample_count)
constexpr vk::Filter | ToVKSamplerMinMagFilter (MinMagFilter filter)
constexpr vk::SamplerMipmapMode | ToVKSamplerMipmapMode (MipFilter filter)
constexpr vk::SamplerAddressMode | ToVKSamplerAddressMode (SamplerAddressMode mode)
constexpr vk::ShaderStageFlags | ToVkShaderStage (ShaderStage stage)
constexpr vk::DescriptorType | ToVKDescriptorType (DescriptorType type)
constexpr vk::DescriptorSetLayoutBinding | ToVKDescriptorSetLayoutBinding (const DescriptorSetLayout &layout)
constexpr vk::AttachmentLoadOp | ToVKAttachmentLoadOp (LoadAction load_action)
constexpr vk::AttachmentStoreOp | ToVKAttachmentStoreOp (StoreAction store_action, bool is_resolve_texture)
constexpr bool | StoreActionPerformsResolve (StoreAction store_action)
constexpr vk::IndexType | ToVKIndexType (IndexType index_type)
constexpr vk::PolygonMode | ToVKPolygonMode (PolygonMode mode)
constexpr bool | PrimitiveTopologySupportsPrimitiveRestart (PrimitiveType primitive)
constexpr vk::PrimitiveTopology | ToVKPrimitiveTopology (PrimitiveType primitive)
constexpr bool | PixelFormatIsDepthStencil (PixelFormat format)
constexpr vk::CullModeFlags | ToVKCullModeFlags (CullMode mode)
constexpr vk::CompareOp | ToVKCompareOp (CompareFunction op)
constexpr vk::StencilOp | ToVKStencilOp (StencilOperation op)
constexpr vk::StencilOpState | ToVKStencilOpState (const StencilAttachmentDescriptor &desc)
constexpr vk::ImageAspectFlags | ToVKImageAspectFlags (PixelFormat format)
constexpr uint32_t | ToArrayLayerCount (TextureType type)
constexpr vk::ImageViewType | ToVKImageViewType (TextureType type)
constexpr vk::ImageCreateFlags | ToVKImageCreateFlags (TextureType type)
constexpr vk::ImageAspectFlags | ToImageAspectFlags (PixelFormat format)
bool | PipelineCacheDataPersist (const fml::UniqueFD &cache_directory, const VkPhysicalDeviceProperties &props, const vk::UniquePipelineCache &cache)
| Persist the pipeline cache to a file in the given cache directory. This function performs integrity checks the Vulkan driver may have missed. More...
std::unique_ptr< fml::Mapping > | PipelineCacheDataRetrieve (const fml::UniqueFD &cache_directory, const VkPhysicalDeviceProperties &props)
| Retrieve the previously persisted pipeline cache data. This function provides integrity checks the Vulkan driver may have missed. More...
static vk::PipelineCreationFeedbackEXT | EmptyFeedback ()
constexpr vk::FrontFace | ToVKFrontFace (WindingOrder order)
static void | ReportPipelineCreationFeedbackToLog (std::stringstream &stream, const vk::PipelineCreationFeedbackEXT &feedback)
static void | ReportPipelineCreationFeedbackToLog (const PipelineDescriptor &desc, const vk::PipelineCreationFeedbackCreateInfoEXT &feedback)
static void | ReportPipelineCreationFeedbackToTrace (const PipelineDescriptor &desc, const vk::PipelineCreationFeedbackCreateInfoEXT &feedback)
static void | ReportPipelineCreationFeedback (const PipelineDescriptor &desc, const vk::PipelineCreationFeedbackCreateInfoEXT &feedback)
static vk::UniqueRenderPass | CreateCompatRenderPassForPipeline (const vk::Device &device, const PipelineDescriptor &desc)
void | InsertBarrierForInputAttachmentRead (const vk::CommandBuffer &buffer, const vk::Image &image)
| Inserts the appropriate barriers to ensure that subsequent commands can read from the specified image (itself a framebuffer attachment) as an input attachment. More...
static vk::ClearColorValue | VKClearValueFromColor (Color color)
static vk::ClearDepthStencilValue | VKClearValueFromDepthStencil (uint32_t stencil, Scalar depth)
static size_t | GetVKClearValues (const RenderTarget &target, std::array< vk::ClearValue, kMaxAttachments > &values)
static vk::UniqueSampler | CreateSampler (const vk::Device &device, const SamplerDescriptor &desc, const std::shared_ptr< YUVConversionVK > &yuv_conversion)
static ShaderStage | ToShaderStage (ArchiveShaderType type)
static std::string | VKShaderNameToShaderKeyName (const std::string &name, ShaderStage stage)
static bool | IsMappingSPIRV (const fml::Mapping &mapping)
template<class T >
auto | MakeSharedVK (vk::UniqueHandle< T, VULKAN_HPP_DEFAULT_DISPATCHER_TYPE > handle)
constexpr PixelFormat | ToPixelFormat (android::HardwareBufferFormat format)
static TextureDescriptor | ToSwapchainTextureDescriptor (const android::HardwareBufferDescriptor &ahb_desc)
static bool | ContainsFormat (const std::vector< vk::SurfaceFormatKHR > &formats, vk::SurfaceFormatKHR format)
static std::optional< vk::SurfaceFormatKHR > | ChooseSurfaceFormat (const std::vector< vk::SurfaceFormatKHR > &formats, PixelFormat preference)
static std::optional< vk::CompositeAlphaFlagBitsKHR > | ChooseAlphaCompositionMode (vk::CompositeAlphaFlagsKHR flags)
vk::Format | ToVertexDescriptorFormat (const ShaderStageIOSlot &input)
WorkaroundsVK | GetWorkaroundsFromDriverInfo (DriverInfoVK &driver_info)
PipelineFuture< PipelineDescriptor > | CreatePipelineFuture (const Context &context, std::optional< PipelineDescriptor > desc)
PipelineFuture< ComputePipelineDescriptor > | CreatePipelineFuture (const Context &context, std::optional< ComputePipelineDescriptor > desc)
fml::Status | AddMipmapGeneration (const std::shared_ptr< CommandBuffer > &command_buffer, const std::shared_ptr< Context > &context, const std::shared_ptr< Texture > &texture)
| Adds a blit command to the render pass. More...
template<class VertexType , size_t size>
VertexBuffer | CreateVertexBuffer (std::array< VertexType, size > input, HostBuffer &host_buffer)
| Create an index-less vertex buffer from a fixed size array. More...
static RuntimeUniformType | ToType (fb::UniformDataType type)
static RuntimeShaderStage | ToShaderStage (fb::Stage stage)
constexpr ArchiveShaderType | ToShaderType (fb::Stage stage)
bool | Main (const fml::CommandLine &command_line)
std::optional< ArchiveShaderType > | InferShaderTypefromFileExtension (const std::filesystem::path &path)
constexpr fb::Stage | ToStage (ArchiveShaderType type)
PathBuilder * | CreatePathBuilder ()
void | DestroyPathBuilder (PathBuilder *builder)
void | MoveTo (PathBuilder *builder, Scalar x, Scalar y)
void | LineTo (PathBuilder *builder, Scalar x, Scalar y)
void | CubicTo (PathBuilder *builder, Scalar x1, Scalar y1, Scalar x2, Scalar y2, Scalar x3, Scalar y3)
void | Close (PathBuilder *builder)
struct Vertices * | Tessellate (PathBuilder *builder, int fill_type, Scalar tolerance)
void | DestroyVertices (Vertices *vertices)
static size_t | ComputeQuadrantDivisions (Scalar pixel_radius)
static void * | HeapAlloc (void *userData, unsigned int size)
static void * | HeapRealloc (void *userData, void *ptr, unsigned int size)
static void | HeapFree (void *userData, void *ptr)
static int | ToTessWindingRule (FillType fill_type)
void | DestroyTessellator (TESStesselator *tessellator)
| IMPELLER_ENUM_IS_MASK (android::HardwareBufferUsageFlags)
static Font | ToFont (const SkTextBlobRunIterator &run, AxisAlignment alignment)
static Rect | ToRect (const SkRect &rect)
std::shared_ptr< TextFrame > | MakeTextFrameFromTextBlobSkia (const sk_sp< SkTextBlob > &blob)
static SkImageInfo | GetImageInfo (const GlyphAtlas &atlas, Size size)
static size_t | AppendToExistingAtlas (const std::shared_ptr< GlyphAtlas > &atlas, const std::vector< FontGlyphPair > &extra_pairs, std::vector< Rect > &glyph_positions, const std::vector< Rect > &glyph_sizes, ISize atlas_size, int64_t height_adjustment, const std::shared_ptr< RectanglePacker > &rect_packer)
static size_t | PairsFitInAtlasOfSize (const std::vector< FontGlyphPair > &pairs, const ISize &atlas_size, std::vector< Rect > &glyph_positions, const std::vector< Rect > &glyph_sizes, int64_t height_adjustment, const std::shared_ptr< RectanglePacker > &rect_packer, size_t start_index)
static ISize | ComputeNextAtlasSize (const std::shared_ptr< GlyphAtlasContext > &atlas_context, const std::vector< FontGlyphPair > &extra_pairs, std::vector< Rect > &glyph_positions, const std::vector< Rect > &glyph_sizes, size_t glyph_index_start, int64_t max_texture_height)
static void | DrawGlyph (SkCanvas *canvas, const SkPoint position, const ScaledFont &scaled_font, const SubpixelGlyph &glyph, const Rect &scaled_bounds, const std::optional< GlyphProperties > &prop, bool has_color)
static bool | BulkUpdateAtlasBitmap (const GlyphAtlas &atlas, std::shared_ptr< BlitPass > &blit_pass, HostBuffer &host_buffer, const std::shared_ptr< Texture > &texture, const std::vector< FontGlyphPair > &new_pairs, size_t start_index, size_t end_index)
| Batch render to a single surface. More...
static bool | UpdateAtlasBitmap (const GlyphAtlas &atlas, std::shared_ptr< BlitPass > &blit_pass, HostBuffer &host_buffer, const std::shared_ptr< Texture > &texture, const std::vector< FontGlyphPair > &new_pairs, size_t start_index, size_t end_index)
static Rect | ComputeGlyphSize (const SkFont &font, const SubpixelGlyph &glyph, Scalar scale)
static constexpr Scalar | ComputeFractionalPosition (Scalar value)

## Variables
static std::atomic_size_t | sLastID
static std::atomic_int32_t | sValidationLogsDisabledCount = 0
static std::atomic_int32_t | sValidationLogsAreFatal = 0
static ValidationFailureCallback | sValidationFailureCallback
constexpr size_t | kAllocatorBlockSize = 1024000
static const constexpr size_t | kHostBufferArenaSize = 4u
| Approximately the same size as the max frames in flight. More...
constexpr size_t | kMaxVertexBuffers = 16
static const constexpr ColorMatrix | kColorInversion
| A color matrix which inverts colors. More...
constexpr std::array< std::array< Scalar, 5 >, 15 > | kPorterDuffCoefficients
static constexpr int32_t | kGaussianBlurMaxKernelSize = 50
constexpr Matrix | kMatrixBT601LimitedRange
constexpr Matrix | kMatrixBT601FullRange
static constexpr uint32_t | kMaxUniformGradientStops = 256u
static Scalar | kTwoOverSqrtPi = 2.0 / std::sqrt(kPi)
static constexpr Scalar | kMinStrokeSize = 1.0f
static const GeometryResult | kEmptyResult
static constexpr const char * | kBlendModeNames []
constexpr float | kE = 2.7182818284590452354f
constexpr float | kLog2E = 1.4426950408889634074f
constexpr float | kLog10E = 0.43429448190325182765f
constexpr float | kLogE2 = 0.69314718055994530942f
constexpr float | kLogE10 = 2.30258509299404568402f
constexpr float | kPi = 3.14159265358979323846f
constexpr float | k2Pi = 6.28318530717958647693f
constexpr float | kPiOver2 = 1.57079632679489661923f
constexpr float | kPiOver4 = 0.78539816339744830962f
constexpr float | k1OverPi = 0.31830988618379067154f
constexpr float | k2OverPi = 0.63661977236758134308f
constexpr float | k2OverSqrtPi = 1.12837916709551257390f
constexpr float | kSqrt2 = 1.41421356237309504880f
constexpr float | k1OverSqrt2 = 0.70710678118654752440f
constexpr float | kPhi = 1.61803398874989484820f
constexpr float | kEhCloseEnough = 1e-3f
static TessellatorLibtess | tess
constexpr static float | kKernelRadiusPerSigma = 1.73205080757
static const std::vector< std::string > | kSkipTests
static std::atomic_bool | gShouldOpenNewPlaygrounds = true
static constexpr std::string_view | kAngleInputAttachmentPrefix
static const constexpr char * | kFramebufferFetchExt
static const constexpr char * | kTextureBorderClampExt
static const constexpr char * | kNvidiaTextureBorderClampExt
static const constexpr char * | kMultisampledRenderToTextureExt
static const constexpr char * | kMultisampledRenderToTexture2Ext
static constexpr const char * | kInstanceLayer = "ImpellerInstance"
static thread_local std::unique_ptr< CommandPoolMap > | tls_command_pool_map
static Mutex | g_all_pools_map_mutex
static bool | gHasValidationLayers = false
static const constexpr DescriptorPoolSize | kDefaultBindingSize
| Descriptor pools are always allocated with the following sizes. More...
const std::unordered_map< std::string_view, AdrenoGPU > | kAdrenoVersions
const std::unordered_map< std::string_view, MaliGPU > | kMaliVersions
static constexpr vk::AttachmentReference | kUnusedAttachmentReference
static constexpr uint32_t | kPoolSize = 128u
constexpr size_t | kImageSizeThresholdForDedicatedMemoryAllocation
static constexpr const char * | kPipelineCacheFileName
static constexpr size_t | kMaxBindings = 32
constexpr auto | kSelfDependencySrcStageMask
constexpr auto | kSelfDependencySrcAccessMask
constexpr auto | kSelfDependencyDstStageMask
constexpr auto | kSelfDependencyDstAccessMask
constexpr auto | kSelfDependencyFlags = vk::DependencyFlagBits::eByRegion
static constexpr size_t | kMaxColorAttachments = 16
static constexpr size_t | kMaxAttachments
static constexpr size_t | kMagicSubpassInputBinding = 64u
static constexpr const size_t | kMaxPendingPresents = 3u
static constexpr size_t | kMaxFramesInFlight = 2u
static constexpr int | kPrecomputedDivisionCount = 1024
static int | kPrecomputedDivisions [kPrecomputedDivisionCount]
static constexpr size_t | kPointArenaSize = 4096u
| The size of the point arena buffer stored on the tessellator. More...
static const TESSalloc | kAlloc
constexpr auto | kPadding = 2
static const std::shared_ptr< GlyphAtlas > | kNullGlyphAtlas = nullptr

## Typedef Documentation

## ◆ AHBProperties

using impeller::AHBProperties = typedef vk::StructureChain< vk::AndroidHardwareBufferPropertiesANDROID, vk::AndroidHardwareBufferFormatPropertiesANDROID>

Definition at line 18 of file ahb_texture_source_vk.cc.

## ◆ BlendColorBurnPipeline

using impeller::BlendColorBurnPipeline = typedef RenderPipelineHandle<AdvancedBlendVertexShader, AdvancedBlendFragmentShader>

Definition at line 172 of file content_context.h.

## ◆ BlendColorDodgePipeline

using impeller::BlendColorDodgePipeline = typedef RenderPipelineHandle<AdvancedBlendVertexShader, AdvancedBlendFragmentShader>

Definition at line 175 of file content_context.h.

## ◆ BlendColorPipeline

using impeller::BlendColorPipeline = typedef RenderPipelineHandle<AdvancedBlendVertexShader, AdvancedBlendFragmentShader>

Definition at line 169 of file content_context.h.

## ◆ BlendDarkenPipeline

using impeller::BlendDarkenPipeline = typedef RenderPipelineHandle<AdvancedBlendVertexShader, AdvancedBlendFragmentShader>

Definition at line 177 of file content_context.h.

## ◆ BlendDifferencePipeline

using impeller::BlendDifferencePipeline = typedef RenderPipelineHandle<AdvancedBlendVertexShader, AdvancedBlendFragmentShader>

Definition at line 180 of file content_context.h.

## ◆ BlendExclusionPipeline

using impeller::BlendExclusionPipeline = typedef RenderPipelineHandle<AdvancedBlendVertexShader, AdvancedBlendFragmentShader>

Definition at line 183 of file content_context.h.

## ◆ BlendHardLightPipeline

using impeller::BlendHardLightPipeline = typedef RenderPipelineHandle<AdvancedBlendVertexShader, AdvancedBlendFragmentShader>

Definition at line 186 of file content_context.h.

## ◆ BlendHuePipeline

using impeller::BlendHuePipeline = typedef RenderPipelineHandle<AdvancedBlendVertexShader, AdvancedBlendFragmentShader>

Definition at line 188 of file content_context.h.

## ◆ BlendLightenPipeline

using impeller::BlendLightenPipeline = typedef RenderPipelineHandle<AdvancedBlendVertexShader, AdvancedBlendFragmentShader>

Definition at line 190 of file content_context.h.

## ◆ BlendLuminosityPipeline

using impeller::BlendLuminosityPipeline = typedef RenderPipelineHandle<AdvancedBlendVertexShader, AdvancedBlendFragmentShader>

Definition at line 193 of file content_context.h.

## ◆ BlendMultiplyPipeline

using impeller::BlendMultiplyPipeline = typedef RenderPipelineHandle<AdvancedBlendVertexShader, AdvancedBlendFragmentShader>

Definition at line 195 of file content_context.h.

## ◆ BlendOverlayPipeline

using impeller::BlendOverlayPipeline = typedef RenderPipelineHandle<AdvancedBlendVertexShader, AdvancedBlendFragmentShader>

Definition at line 197 of file content_context.h.

## ◆ BlendSaturationPipeline

using impeller::BlendSaturationPipeline = typedef RenderPipelineHandle<AdvancedBlendVertexShader, AdvancedBlendFragmentShader>

Definition at line 200 of file content_context.h.

## ◆ BlendScreenPipeline

using impeller::BlendScreenPipeline = typedef RenderPipelineHandle<AdvancedBlendVertexShader, AdvancedBlendFragmentShader>

Definition at line 202 of file content_context.h.

## ◆ BlendSoftLightPipeline

using impeller::BlendSoftLightPipeline = typedef RenderPipelineHandle<AdvancedBlendVertexShader, AdvancedBlendFragmentShader>

Definition at line 205 of file content_context.h.

## ◆ BorderMaskBlurPipeline

using impeller::BorderMaskBlurPipeline = typedef RenderPipelineHandle<FilterPositionUvVertexShader, BorderMaskBlurFragmentShader>

Definition at line 142 of file content_context.h.

## ◆ BufferResource

using impeller::BufferResource = typedef Resource<BufferView>

Definition at line 54 of file command.h.

## ◆ Bytes

using impeller::Bytes = typedef AllocationSize<1u>

Definition at line 151 of file allocation_size.h.

## ◆ Callback

using impeller::Callback = typedef std::function<void(MTLRenderPipelineDescriptor*)>

Definition at line 30 of file pipeline_library_mtl.mm.

## ◆ ClipPipeline

using impeller::ClipPipeline = typedef RenderPipelineHandle<ClipVertexShader, ClipFragmentShader>

Definition at line 165 of file content_context.h.

## ◆ Clock

using impeller::Clock = typedef std::chrono::high_resolution_clock

Definition at line 14 of file timing.h.

## ◆ ColorFilterProc

using impeller::ColorFilterProc = typedef std::function<Color(Color)>

A procedure that filters a given unpremultiplied color to produce a new unpremultiplied color.

Definition at line 36 of file color_filter.h.

## ◆ ColorMatrixColorFilterPipeline

using impeller::ColorMatrixColorFilterPipeline = typedef RenderPipelineHandle<FilterPositionVertexShader, ColorMatrixColorFilterFragmentShader>

Definition at line 148 of file content_context.h.

## ◆ ColorWriteMask

using impeller::ColorWriteMask = typedef Mask<ColorWriteMaskBits>

Definition at line 464 of file formats.h.

## ◆ CommandPoolMap

using impeller::CommandPoolMap = typedef std::unordered_map<uint64_t, std::shared_ptr<CommandPoolVK> >

Definition at line 158 of file command_pool_vk.cc.

## ◆ ComputePipelineMap

using impeller::ComputePipelineMap = typedef std::unordered_map<ComputePipelineDescriptor, PipelineFuture<ComputePipelineDescriptor>, ComparableHash<ComputePipelineDescriptor>, ComparableEqual<ComputePipelineDescriptor> >

Definition at line 27 of file pipeline_library.h.

## ◆ ConicalGradientFillPipeline

using impeller::ConicalGradientFillPipeline = typedef RenderPipelineHandle<GradientFillVertexShader, ConicalGradientFillFragmentShader>

Definition at line 97 of file content_context.h.

## ◆ ConicalGradientSSBOFillPipeline

using impeller::ConicalGradientSSBOFillPipeline = typedef RenderPipelineHandle<GradientFillVertexShader, ConicalGradientSsboFillFragmentShader>

Definition at line 118 of file content_context.h.

## ◆ ConicalGradientUniformFillPipeline

using impeller::ConicalGradientUniformFillPipeline = typedef RenderPipelineHandle<GradientFillVertexShader, ConicalGradientUniformFillFragmentShader>

Definition at line 106 of file content_context.h.

## ◆ CTessellator

using impeller::CTessellator = typedef std::unique_ptr<TESStesselator, decltype(&DestroyTessellator)>

Definition at line 20 of file tessellator_libtess.h.

## ◆ DlIRect

typedef flutter::DlIRect impeller::DlIRect

Definition at line 26 of file dl_dispatcher.h.

## ◆ DlPath

typedef flutter::DlPath impeller::DlPath

Definition at line 28 of file dl_dispatcher.h.

## ◆ DlPoint

typedef flutter::DlPoint impeller::DlPoint

Definition at line 24 of file dl_dispatcher.h.

## ◆ DlRect

typedef flutter::DlRect impeller::DlRect

Definition at line 25 of file dl_dispatcher.h.

## ◆ DlRoundRect

using impeller::DlRoundRect = typedef flutter::DlRoundRect

Definition at line 27 of file dl_dispatcher.h.

## ◆ DlScalar

typedef flutter::DlScalar impeller::DlScalar

Definition at line 23 of file dl_dispatcher.h.

## ◆ EllipticalVertexGenerator

using impeller::EllipticalVertexGenerator = typedef Tessellator::EllipticalVertexGenerator

Definition at line 326 of file tessellator.cc.

## ◆ FastGradientPipeline

using impeller::FastGradientPipeline = typedef RenderPipelineHandle<FastGradientVertexShader, FastGradientFragmentShader>

Definition at line 86 of file content_context.h.

## ◆ FramebufferBlendColorBurnPipeline

using impeller::FramebufferBlendColorBurnPipeline = typedef RenderPipelineHandle<FramebufferBlendVertexShader, FramebufferBlendFragmentShader>

Definition at line 212 of file content_context.h.

## ◆ FramebufferBlendColorDodgePipeline

using impeller::FramebufferBlendColorDodgePipeline = typedef RenderPipelineHandle<FramebufferBlendVertexShader, FramebufferBlendFragmentShader>

Definition at line 215 of file content_context.h.

## ◆ FramebufferBlendColorPipeline

using impeller::FramebufferBlendColorPipeline = typedef RenderPipelineHandle<FramebufferBlendVertexShader, FramebufferBlendFragmentShader>

Definition at line 209 of file content_context.h.

## ◆ FramebufferBlendDarkenPipeline

using impeller::FramebufferBlendDarkenPipeline = typedef RenderPipelineHandle<FramebufferBlendVertexShader, FramebufferBlendFragmentShader>

Definition at line 218 of file content_context.h.

## ◆ FramebufferBlendDifferencePipeline

using impeller::FramebufferBlendDifferencePipeline = typedef RenderPipelineHandle<FramebufferBlendVertexShader, FramebufferBlendFragmentShader>

Definition at line 221 of file content_context.h.

## ◆ FramebufferBlendExclusionPipeline

using impeller::FramebufferBlendExclusionPipeline = typedef RenderPipelineHandle<FramebufferBlendVertexShader, FramebufferBlendFragmentShader>

Definition at line 224 of file content_context.h.

## ◆ FramebufferBlendHardLightPipeline

using impeller::FramebufferBlendHardLightPipeline = typedef RenderPipelineHandle<FramebufferBlendVertexShader, FramebufferBlendFragmentShader>

Definition at line 227 of file content_context.h.

## ◆ FramebufferBlendHuePipeline

using impeller::FramebufferBlendHuePipeline = typedef RenderPipelineHandle<FramebufferBlendVertexShader, FramebufferBlendFragmentShader>

Definition at line 230 of file content_context.h.

## ◆ FramebufferBlendLightenPipeline

using impeller::FramebufferBlendLightenPipeline = typedef RenderPipelineHandle<FramebufferBlendVertexShader, FramebufferBlendFragmentShader>

Definition at line 233 of file content_context.h.

## ◆ FramebufferBlendLuminosityPipeline

using impeller::FramebufferBlendLuminosityPipeline = typedef RenderPipelineHandle<FramebufferBlendVertexShader, FramebufferBlendFragmentShader>

Definition at line 236 of file content_context.h.

## ◆ FramebufferBlendMultiplyPipeline

using impeller::FramebufferBlendMultiplyPipeline = typedef RenderPipelineHandle<FramebufferBlendVertexShader, FramebufferBlendFragmentShader>

Definition at line 239 of file content_context.h.

## ◆ FramebufferBlendOverlayPipeline

using impeller::FramebufferBlendOverlayPipeline = typedef RenderPipelineHandle<FramebufferBlendVertexShader, FramebufferBlendFragmentShader>

Definition at line 242 of file content_context.h.

## ◆ FramebufferBlendSaturationPipeline

using impeller::FramebufferBlendSaturationPipeline = typedef RenderPipelineHandle<FramebufferBlendVertexShader, FramebufferBlendFragmentShader>

Definition at line 245 of file content_context.h.

## ◆ FramebufferBlendScreenPipeline

using impeller::FramebufferBlendScreenPipeline = typedef RenderPipelineHandle<FramebufferBlendVertexShader, FramebufferBlendFragmentShader>

Definition at line 248 of file content_context.h.

## ◆ FramebufferBlendSoftLightPipeline

using impeller::FramebufferBlendSoftLightPipeline = typedef RenderPipelineHandle<FramebufferBlendVertexShader, FramebufferBlendFragmentShader>

Definition at line 251 of file content_context.h.

## ◆ FS

using impeller::FS = typedef GlyphAtlasPipeline::FragmentShader

Definition at line 26 of file text_contents.cc.

## ◆ GaussianBlurFragmentShader

using impeller::GaussianBlurFragmentShader = typedef GaussianBlurPipeline::FragmentShader

Definition at line 23 of file gaussian_blur_filter_contents.cc.

## ◆ GaussianBlurPipeline

using impeller::GaussianBlurPipeline = typedef RenderPipelineHandle<FilterPositionUvVertexShader, GaussianFragmentShader>

Definition at line 139 of file content_context.h.

## ◆ GaussianBlurVertexShader

using impeller::GaussianBlurVertexShader = typedef GaussianBlurPipeline::VertexShader

Definition at line 22 of file gaussian_blur_filter_contents.cc.

## ◆ GibiBytes

using impeller::GibiBytes = typedef AllocationSize<1'024u * 1'024u * 1'024u>

Definition at line 159 of file allocation_size.h.

## ◆ GigaBytes

using impeller::GigaBytes = typedef AllocationSize<1'000u * 1'000u * 1'000u>

Definition at line 155 of file allocation_size.h.

## ◆ GlyphAtlasPipeline

using impeller::GlyphAtlasPipeline = typedef RenderPipelineHandle<GlyphAtlasVertexShader, GlyphAtlasFragmentShader>

Definition at line 160 of file content_context.h.

## ◆ IPoint

using impeller::IPoint = typedef TPoint<int64_t>

Definition at line 328 of file point.h.

## ◆ IPoint32

using impeller::IPoint32 = typedef TPoint<int32_t>

Definition at line 329 of file point.h.

## ◆ IRect

using impeller::IRect = typedef IRect64

Definition at line 795 of file rect.h.

## ◆ IRect32

using impeller::IRect32 = typedef TRect<int32_t>

Definition at line 793 of file rect.h.

## ◆ IRect64

using impeller::IRect64 = typedef TRect<int64_t>

Definition at line 794 of file rect.h.

## ◆ ISize

using impeller::ISize = typedef ISize64

Definition at line 174 of file size.h.

## ◆ ISize32

using impeller::ISize32 = typedef TSize<int32_t>

Definition at line 172 of file size.h.

## ◆ ISize64

using impeller::ISize64 = typedef TSize<int64_t>

Definition at line 173 of file size.h.

## ◆ KibiBytes

using impeller::KibiBytes = typedef AllocationSize<1'024u>

Definition at line 157 of file allocation_size.h.

## ◆ KiloBytes

using impeller::KiloBytes = typedef AllocationSize<1'000u>

Definition at line 153 of file allocation_size.h.

## ◆ LinearGradientFillPipeline

using impeller::LinearGradientFillPipeline = typedef RenderPipelineHandle<GradientFillVertexShader, LinearGradientFillFragmentShader>

Definition at line 89 of file content_context.h.

## ◆ LinearGradientSSBOFillPipeline

using impeller::LinearGradientSSBOFillPipeline = typedef RenderPipelineHandle<GradientFillVertexShader, LinearGradientSsboFillFragmentShader>

Definition at line 115 of file content_context.h.

## ◆ LinearGradientUniformFillPipeline

using impeller::LinearGradientUniformFillPipeline = typedef RenderPipelineHandle<GradientFillVertexShader, LinearGradientUniformFillFragmentShader>

Definition at line 103 of file content_context.h.

## ◆ LinearToSrgbFilterPipeline

using impeller::LinearToSrgbFilterPipeline = typedef RenderPipelineHandle<FilterPositionVertexShader, LinearToSrgbFilterFragmentShader>

Definition at line 151 of file content_context.h.

## ◆ MebiBytes

using impeller::MebiBytes = typedef AllocationSize<1'024u * 1'024u>

Definition at line 158 of file allocation_size.h.

## ◆ MegaBytes

using impeller::MegaBytes = typedef AllocationSize<1'000u * 1'000u>

Definition at line 154 of file allocation_size.h.

## ◆ MillisecondsF

using impeller::MillisecondsF = typedef std::chrono::duration<float, std::milli>

Definition at line 12 of file timing.h.

## ◆ MixedOp

template<class F , class I >

using impeller::MixedOp = typedef typename MixedOp_<F, I>::type

Definition at line 19 of file type_traits.h.

## ◆ MorphologyFilterPipeline

using impeller::MorphologyFilterPipeline = typedef RenderPipelineHandle<FilterPositionUvVertexShader, MorphologyFilterFragmentShader>

Definition at line 145 of file content_context.h.

## ◆ MyMask

using impeller::MyMask = typedef Mask<MyMaskBits>

Definition at line 20 of file base_unittests.cc.

## ◆ PipelineMap

using impeller::PipelineMap = typedef std::unordered_map<PipelineDescriptor, PipelineFuture<PipelineDescriptor>, ComparableHash<PipelineDescriptor>, ComparableEqual<PipelineDescriptor> >

Definition at line 21 of file pipeline_library.h.

## ◆ PipelineProc

using impeller::PipelineProc = typedef PipelineRef (ContentContext::*)(ContentContextOptions) const

Definition at line 93 of file blend_filter_contents.cc.

## ◆ PipelineRef

using impeller::PipelineRef = typedef raw_ptr<Pipeline<PipelineDescriptor> >

A raw ptr to a pipeline object.

These pipeline refs are safe to use as the context will keep the pipelines alive throughout rendering.

Definition at line 86 of file pipeline.h.

## ◆ Point

using impeller::Point = typedef TPoint<Scalar>

Definition at line 327 of file point.h.

## ◆ PorterDuffBlendPipeline

using impeller::PorterDuffBlendPipeline = typedef RenderPipelineHandle<PorterDuffBlendVertexShader, PorterDuffBlendFragmentShader>

Definition at line 164 of file content_context.h.

## ◆ Quad

using impeller::Quad = typedef std::array<Point, 4>

Definition at line 332 of file point.h.

## ◆ RadialGradientFillPipeline

using impeller::RadialGradientFillPipeline = typedef RenderPipelineHandle<GradientFillVertexShader, RadialGradientFillFragmentShader>

Definition at line 94 of file content_context.h.

## ◆ RadialGradientSSBOFillPipeline

using impeller::RadialGradientSSBOFillPipeline = typedef RenderPipelineHandle<GradientFillVertexShader, RadialGradientSsboFillFragmentShader>

Definition at line 121 of file content_context.h.

## ◆ RadialGradientUniformFillPipeline

using impeller::RadialGradientUniformFillPipeline = typedef RenderPipelineHandle<GradientFillVertexShader, RadialGradientUniformFillFragmentShader>

Definition at line 109 of file content_context.h.

## ◆ Rect

using impeller::Rect = typedef TRect<Scalar>

Definition at line 792 of file rect.h.

## ◆ RRectBlurPipeline

using impeller::RRectBlurPipeline = typedef RenderPipelineHandle<RrectBlurVertexShader, RrectBlurFragmentShader>

Definition at line 126 of file content_context.h.

## ◆ Scalar

using impeller::Scalar = typedef float

Definition at line 18 of file scalar.h.

## ◆ SecondsF

using impeller::SecondsF = typedef std::chrono::duration<float>

Definition at line 13 of file timing.h.

## ◆ ShaderFunctionMap

using impeller::ShaderFunctionMap = typedef std::unordered_map<ShaderKey, std::shared_ptr<const ShaderFunction>, ShaderKey::Hash, ShaderKey::Equal>

Definition at line 43 of file shader_key.h.

## ◆ SharedHandleVK

template<class T >

using impeller::SharedHandleVK = typedef std::shared_ptr<SharedObjectVKT<T> >

Definition at line 53 of file shared_object_vk.h.

## ◆ Size

using impeller::Size = typedef TSize<Scalar>

Definition at line 171 of file size.h.

## ◆ SolidFillPipeline

using impeller::SolidFillPipeline = typedef RenderPipelineHandle<SolidFillVertexShader, SolidFillFragmentShader>

Definition at line 91 of file content_context.h.

## ◆ SrgbToLinearFilterPipeline

using impeller::SrgbToLinearFilterPipeline = typedef RenderPipelineHandle<FilterPositionVertexShader, SrgbToLinearFilterFragmentShader>

Definition at line 154 of file content_context.h.

## ◆ SweepGradientFillPipeline

using impeller::SweepGradientFillPipeline = typedef RenderPipelineHandle<GradientFillVertexShader, SweepGradientFillFragmentShader>

Definition at line 100 of file content_context.h.

## ◆ SweepGradientSSBOFillPipeline

using impeller::SweepGradientSSBOFillPipeline = typedef RenderPipelineHandle<GradientFillVertexShader, SweepGradientSsboFillFragmentShader>

Definition at line 124 of file content_context.h.

## ◆ SweepGradientUniformFillPipeline

using impeller::SweepGradientUniformFillPipeline = typedef RenderPipelineHandle<GradientFillVertexShader, SweepGradientUniformFillFragmentShader>

Definition at line 112 of file content_context.h.

## ◆ TessellatedVertexProc

using impeller::TessellatedVertexProc = typedef Tessellator::TessellatedVertexProc

Definition at line 325 of file tessellator.cc.

## ◆ TextureDownsamplePipeline

using impeller::TextureDownsamplePipeline = typedef RenderPipelineHandle<TextureFillVertexShader, TextureDownsampleFragmentShader>

Definition at line 131 of file content_context.h.

## ◆ TexturePipeline

using impeller::TexturePipeline = typedef RenderPipelineHandle<TextureFillVertexShader, TextureFillFragmentShader>

Definition at line 128 of file content_context.h.

## ◆ TextureResource

using impeller::TextureResource = typedef Resource<std::shared_ptr<const Texture> >

Definition at line 55 of file command.h.

## ◆ TextureStrictSrcPipeline

using impeller::TextureStrictSrcPipeline = typedef RenderPipelineHandle<TextureFillVertexShader, TextureFillStrictSrcFragmentShader>

Definition at line 134 of file content_context.h.

## ◆ TextureUsageMask

using impeller::TextureUsageMask = typedef Mask<TextureUsage>

Definition at line 308 of file formats.h.

## ◆ TiledTexturePipeline

using impeller::TiledTexturePipeline = typedef RenderPipelineHandle<TextureUvFillVertexShader, TiledTextureFillFragmentShader>

Definition at line 137 of file content_context.h.

## ◆ TimePoint

using impeller::TimePoint = typedef std::chrono::time_point<std::chrono::high_resolution_clock>

Definition at line 15 of file timing.h.

## ◆ UintPoint32

using impeller::UintPoint32 = typedef TPoint<uint32_t>

Definition at line 330 of file point.h.

## ◆ UniqueAllocatorVMA

using impeller::UniqueAllocatorVMA = typedef fml::UniqueObject<VmaAllocator, AllocatorVMATraits>

Definition at line 31 of file vma.h.

## ◆ UniqueBufferVMA

using impeller::UniqueBufferVMA = typedef fml::UniqueObject<BufferVMA, BufferVMATraits>

Definition at line 98 of file vma.h.

## ◆ UniqueEGLImage

using impeller::UniqueEGLImage = typedef fml::UniqueObject<EGLImageWithDisplay, EGLImageWithDisplayTraits>

Definition at line 42 of file image.h.

## ◆ UniqueEGLImageKHR

using impeller::UniqueEGLImageKHR = typedef fml::UniqueObject<EGLImageKHRWithDisplay, EGLImageKHRWithDisplayTraits>

Definition at line 73 of file image.h.

## ◆ UniqueGLTexture

using impeller::UniqueGLTexture = typedef fml::UniqueObject<GLTexture, GLTextureTraits>

Definition at line 38 of file texture.h.

## ◆ UniqueImageVMA

using impeller::UniqueImageVMA = typedef fml::UniqueObject<ImageVMA, ImageVMATraits>

Definition at line 133 of file vma.h.

## ◆ UniquePoolVMA

using impeller::UniquePoolVMA = typedef fml::UniqueObject<PoolVMA, PoolVMATraits>

Definition at line 63 of file vma.h.

## ◆ ValidationFailureCallback

using impeller::ValidationFailureCallback = typedef std::function<bool(const char* message, const char* file, int line)>

Definition at line 42 of file validation.h.

## ◆ Vector2

using impeller::Vector2 = typedef Point

Definition at line 331 of file point.h.

## ◆ VerticesUberShader

using impeller::VerticesUberShader = typedef RenderPipelineHandle<PorterDuffBlendVertexShader, VerticesUberFragmentShader>

Draw Vertices/Atlas Uber Shader.

Definition at line 255 of file content_context.h.

## ◆ VS

using impeller::VS = typedef GlyphAtlasPipeline::VertexShader

Definition at line 25 of file text_contents.cc.

## ◆ WaitSet

using impeller::WaitSet = typedef std::vector<std::shared_ptr<WaitSetEntry> >

Definition at line 21 of file fence_waiter_vk.h.

## ◆ YUVConversionDescriptorVK

using impeller::YUVConversionDescriptorVK = typedef vk::StructureChain<vk::SamplerYcbcrConversionCreateInfo >

A descriptor used to create a new YUV conversion in a conversion library.

Definition at line 30 of file yuv_conversion_vk.h.

## ◆ YUVToRGBFilterPipeline

using impeller::YUVToRGBFilterPipeline = typedef RenderPipelineHandle<FilterPositionVertexShader, YuvToRgbFilterFragmentShader>

Definition at line 157 of file content_context.h.

## Enumeration Type Documentation

## ◆ AdrenoGPU

enum impeller::AdrenoGPU
| strong

Enumerator
kAdreno504 |
kAdreno505 |
kAdreno506 |
kAdreno508 |
kAdreno509 |
kAdreno510 |
kAdreno512 |
kAdreno530 |
kAdreno540 |
kAdreno605 |
kAdreno608 |
kAdreno610 |
kAdreno612 |
kAdreno613 |
kAdreno615 |
kAdreno616 |
kAdreno618 |
kAdreno619L |
kAdreno619 |
kAdreno620 |
kAdreno630 |
kAdreno640 |
kAdreno642L |
kAdreno642 |
kAdreno643L |
kAdreno644 |
kAdreno650 |
kAdreno660 |
kAdreno663 |
kAdreno675 |
kAdreno680 |
kAdreno685 |
kAdreno690 |
kAdreno695 |
kAdreno702 |
kAdreno710 |
kAdreno720 |
kAdreno725 |
kAdreno730 |
kAdreno732 |
kAdreno735 |
kAdreno740 |
kAdreno750 |
kAdrenoX145 |
kAdrenoX185 |
kUnknown |

Definition at line 14 of file driver_info_vk.h.

14 {
15 // I don't think the 400 series will ever run Vulkan, but if some show up we
16 // can add them here.
17 // 500s
18 kAdreno504,
19 kAdreno505,
20 kAdreno506,
21 kAdreno508,
22 kAdreno509,
23 kAdreno510,
24 kAdreno512,
25 kAdreno530,
26 kAdreno540,
27 // 600s
28 kAdreno605,
29 kAdreno608,
30 kAdreno610,
31 kAdreno612,
32 kAdreno613,
33 kAdreno615,
34 kAdreno616,
35 kAdreno618,
36 kAdreno619L,
37 kAdreno619,
38 kAdreno620,
39 kAdreno630,
40 // The 640 is the first GPU inside an Android device with upgradable drivers.
41 // Anything before this point exhibiting broken behavior is broken forever.
42 kAdreno640,
43 kAdreno642L,
44 kAdreno642,
45 kAdreno643L,
46 kAdreno644,
47 kAdreno650,
48 kAdreno660,
49 kAdreno663,
50 kAdreno675,
51 kAdreno680,
52 kAdreno685,
53 kAdreno690,
54 kAdreno695,
55 // 700s
56 kAdreno702,
57 kAdreno710,
58 kAdreno720,
59 kAdreno725,
60 kAdreno730,
61 kAdreno732,
62 kAdreno735,
63 kAdreno740,
64 kAdreno750,
65 // X
66 kAdrenoX145,
67 kAdrenoX185,
68 // Unknown GPU, likely newer model.
69 kUnknown,
70 };

## ◆ ArchiveShaderType

enum impeller::ArchiveShaderType
| strong

Enumerator
kVertex |
kFragment |
kCompute |

Definition at line 10 of file shader_archive_types.h.

10 {
11 kVertex,
12 kFragment,
13 kCompute,
14 };

## ◆ AxisAlignment

enum impeller::AxisAlignment : uint8_t
| strong

Determines the axis along which there is subpixel positioning.

Enumerator
kNone |
kX |
kY |
kAll |

Definition at line 20 of file font.h.

20 : uint8_t {
21 // No subpixel positioning.
22 kNone,
23 // Subpixel positioning in the X axis only.
24 kX,
25 // Subpixel positioning in the Y axis only.
26 kY,
27 // No specific axis, subpixel positioning in each direction.
28 kAll,
29 };

## ◆ BlendFactor

enum impeller::BlendFactor
| strong

Enumerator
kZero |
kOne |
kSourceColor |
kOneMinusSourceColor |
kSourceAlpha |
kOneMinusSourceAlpha |
kDestinationColor |
kOneMinusDestinationColor |
kDestinationAlpha |
kOneMinusDestinationAlpha |
kSourceAlphaSaturated |
kBlendColor |
kOneMinusBlendColor |
kBlendAlpha |
kOneMinusBlendAlpha |

Definition at line 178 of file formats.h.

178 {
179 kZero,
180 kOne,
181 kSourceColor,
182 kOneMinusSourceColor,
183 kSourceAlpha,
184 kOneMinusSourceAlpha,
185 kDestinationColor,
186 kOneMinusDestinationColor,
187 kDestinationAlpha,
188 kOneMinusDestinationAlpha,
189 kSourceAlphaSaturated,
190 kBlendColor,
191 kOneMinusBlendColor,
192 kBlendAlpha,
193 kOneMinusBlendAlpha,
194 };

## ◆ BlendMode

enum impeller::BlendMode : uint8_t
| strong

All blend modes assume that both the source (fragment output) and destination (first color attachment) have colors with premultiplied alpha.

Enumerator
kClear |
kSource |
kDestination |
kSourceOver |
kDestinationOver |
kSourceIn |
kDestinationIn |
kSourceOut |
kDestinationOut |
kSourceATop |
kDestinationATop |
kXor |
kPlus |
kModulate |
kScreen |
kOverlay |
kDarken |
kLighten |
kColorDodge |
kColorBurn |
kHardLight |
kSoftLight |
kDifference |
kExclusion |
kMultiply |
kHue |
kSaturation |
kColor |
kLuminosity |
kLast |

Definition at line 58 of file color.h.

58 : uint8_t {
59 // The following blend modes are able to be used as pipeline blend modes or
60 // via `BlendFilterContents`.
61 kClear = 0,
62 kSource,
63 kDestination,
64 kSourceOver,
65 kDestinationOver,
66 kSourceIn,
67 kDestinationIn,
68 kSourceOut,
69 kDestinationOut,
70 kSourceATop,
71 kDestinationATop,
72 kXor,
73 kPlus,
74 kModulate,
75
76 // The following blend modes use equations that are not available for
77 // pipelines on most graphics devices without extensions, and so they are
78 // only able to be used via `BlendFilterContents`.
79 kScreen,
80 kOverlay,
81 kDarken,
82 kLighten,
83 kColorDodge,
84 kColorBurn,
85 kHardLight,
86 kSoftLight,
87 kDifference,
88 kExclusion,
89 kMultiply,
90 kHue,
91 kSaturation,
92 kColor,
93 kLuminosity,
94
95 kLast = kLuminosity,
96 };

## ◆ BlendOperation

enum impeller::BlendOperation
| strong

Enumerator
kAdd |
kSubtract |
kReverseSubtract |

Definition at line 196 of file formats.h.

196 {
197 kAdd,
198 kSubtract,
199 kReverseSubtract,
200 };

## ◆ BlendSelectValues

enum impeller::BlendSelectValues
| strong

Enumerator
kScreen |
kOverlay |
kDarken |
kLighten |
kColorDodge |
kColorBurn |
kHardLight |
kSoftLight |
kDifference |
kExclusion |
kMultiply |
kHue |
kSaturation |
kColor |
kLuminosity |

Definition at line 15 of file framebuffer_blend_contents.h.

15 {
16 kScreen = 0,
17 kOverlay,
18 kDarken,
19 kLighten,
20 kColorDodge,
21 kColorBurn,
22 kHardLight,
23 kSoftLight,
24 kDifference,
25 kExclusion,
26 kMultiply,
27 kHue,
28 kSaturation,
29 kColor,
30 kLuminosity,
31 };

## ◆ Cap

enum impeller::Cap
| strong

Enumerator
kButt |
kRound |
kSquare |

Definition at line 19 of file path.h.

19 {
20 kButt,
21 kRound,
22 kSquare,
23 };

## ◆ ColorWriteMaskBits

enum impeller::ColorWriteMaskBits : uint64_t
| strong

Enumerator
kNone |
kRed |
kGreen |
kBlue |
kAlpha |
kAll |

Definition at line 454 of file formats.h.

454 : uint64_t {
455 kNone = 0,
456 kRed = 1 << 0,
457 kGreen = 1 << 1,
458 kBlue = 1 << 2,
459 kAlpha = 1 << 3,
460 kAll = kRed | kGreen | kBlue | kAlpha,
461 };

## ◆ CompareFunction

enum impeller::CompareFunction : uint8_t
| strong

Enumerator
kNever | Comparison test never passes.
kAlways | Comparison test passes always passes.
kLess | Comparison test passes if new_value < current_value.
kEqual | Comparison test passes if new_value == current_value.
kLessEqual | Comparison test passes if new_value <= current_value.
kGreater | Comparison test passes if new_value > current_value.
kNotEqual | Comparison test passes if new_value != current_value.
kGreaterEqual | Comparison test passes if new_value >= current_value.

Definition at line 552 of file formats.h.

552 : uint8_t {
553 /// Comparison test never passes.
554 kNever,
555 /// Comparison test passes always passes.
556 kAlways,
557 /// Comparison test passes if new_value < current_value.
558 kLess,
559 /// Comparison test passes if new_value == current_value.
560 kEqual,
561 /// Comparison test passes if new_value <= current_value.
562 kLessEqual,
563 /// Comparison test passes if new_value > current_value.
564 kGreater,
565 /// Comparison test passes if new_value != current_value.
566 kNotEqual,
567 /// Comparison test passes if new_value >= current_value.
568 kGreaterEqual,
569 };

## ◆ CompressionType

enum impeller::CompressionType
| strong

Additional compression to apply to a texture. This value is ignored on platforms which do not support it.

Lossy compression is only supported on iOS 15+ on A15 chips.

Enumerator
kLossless |
kLossy |

Definition at line 19 of file texture_descriptor.h.

19 {
20 kLossless,
21 kLossy,
22 };

## ◆ ContentBoundsPromise

enum impeller::ContentBoundsPromise
| strong

Specifies how much to trust the bounds rectangle provided for a list of contents. Used by both |EntityPass| and |Canvas::SaveLayer|.

Enumerator
kUnknown | The caller makes no claims related to the size of the bounds.
kContainsContents | The caller claims the bounds are a reasonably tight estimate of the coverage of the contents and should contain all of the contents.
kMayClipContents | The caller claims the bounds are a subset of an estimate of the reasonably tight bounds but likely clips off some of the contents.

Definition at line 79 of file canvas.h.

79 {
80 /// @brief The caller makes no claims related to the size of the bounds.
81 kUnknown,
82
83 /// @brief The caller claims the bounds are a reasonably tight estimate
84 /// of the coverage of the contents and should contain all of the
85 /// contents.
86 kContainsContents,
87
88 /// @brief The caller claims the bounds are a subset of an estimate of
89 /// the reasonably tight bounds but likely clips off some of the
90 /// contents.
91 kMayClipContents,
92 };

## ◆ Convexity

enum impeller::Convexity
| strong

Enumerator
kUnknown |
kConvex |

Definition at line 36 of file path.h.

36 {
37 kUnknown,
38 kConvex,
39 };

## ◆ CullMode

enum impeller::CullMode
| strong

Enumerator
kNone |
kFrontFace |
kBackFace |

Definition at line 337 of file formats.h.

337 {
338 kNone,
339 kFrontFace,
340 kBackFace,
341 };

## ◆ DebugResourceType

enum impeller::DebugResourceType
| strong

Enumerator
kTexture |
kBuffer |
kProgram |
kShader |
kRenderBuffer |
kFrameBuffer |
kFence |

Definition at line 267 of file proc_table_gles.h.

267 {
268 kTexture,
269 kBuffer,
270 kProgram,
271 kShader,
272 kRenderBuffer,
273 kFrameBuffer,
274 kFence,
275 };

## ◆ DescriptorType

enum impeller::DescriptorType
| strong

Enumerator
kSampler |
kSampledImage |
kImage |
kUniformBuffer |
kStorageBuffer |
kInputAttachment |

Definition at line 158 of file shader_types.h.

158 {
159 kSampler = 0,
160 kSampledImage = 1,
161 kImage = 2,
162 kUniformBuffer = 6,
163 kStorageBuffer = 7,
164 kInputAttachment = 10,
165 };

## ◆ DeviceTypeVK

enum impeller::DeviceTypeVK
| strong

Enumerator
kUnknown |
kIntegratedGPU | The device is an integrated GPU. Typically mobile GPUs.
kDiscreteGPU | The device is a discrete GPU. Typically desktop GPUs.
kVirtualGPU | The device is a GPU in a virtualized environment.
kCPU | There is no GPU. Vulkan is implemented on the CPU. This is typically emulators like SwiftShader and LLVMPipe.

Definition at line 136 of file driver_info_vk.h.

136 {
137 kUnknown,
138 //----------------------------------------------------------------------------
139 /// The device is an integrated GPU. Typically mobile GPUs.
140 ///
141 kIntegratedGPU,
142 //----------------------------------------------------------------------------
143 /// The device is a discrete GPU. Typically desktop GPUs.
144 ///
145 kDiscreteGPU,
146 //----------------------------------------------------------------------------
147 /// The device is a GPU in a virtualized environment.
148 ///
149 kVirtualGPU,
150 //----------------------------------------------------------------------------
151 /// There is no GPU. Vulkan is implemented on the CPU. This is typically
152 /// emulators like SwiftShader and LLVMPipe.
153 ///
154 kCPU,
155 };

## ◆ FillType

enum impeller::FillType
| strong

Enumerator
kNonZero |
kOdd |

Definition at line 31 of file path.h.

31 {
32 kNonZero, // The default winding order.
33 kOdd,
34 };

## ◆ FromBytesTag

enum impeller::FromBytesTag
| strong

Enumerator
kFromBytes |

Definition at line 15 of file allocation_size.h.

15 { kFromBytes };

## ◆ HandleType

enum impeller::HandleType
| strong

Enumerator
kUnknown |
kTexture |
kBuffer |
kProgram |
kRenderBuffer |
kFrameBuffer |
kFence |

Definition at line 18 of file handle_gles.h.

18 {
19 kUnknown,
20 kTexture,
21 kBuffer,
22 kProgram,
23 kRenderBuffer,
24 kFrameBuffer,
25 kFence,
26 };

## ◆ IndexType

enum impeller::IndexType
| strong

Enumerator
kUnknown |
k16bit |
k32bit |
kNone | Does not use the index buffer.

Definition at line 343 of file formats.h.

343 {
344 kUnknown,
345 k16bit,
346 k32bit,
347 /// Does not use the index buffer.
348 kNone,
349 };

## ◆ Join

enum impeller::Join
| strong

Enumerator
kMiter |
kRound |
kBevel |

Definition at line 25 of file path.h.

25 {
26 kMiter,
27 kRound,
28 kBevel,
29 };

## ◆ LoadAction

enum impeller::LoadAction
| strong

Enumerator
kDontCare |
kLoad |
kClear |

Definition at line 202 of file formats.h.

202 {
203 kDontCare,
204 kLoad,
205 kClear,
206 };

## ◆ MaliGPU

enum impeller::MaliGPU
| strong

Enumerator
kT760 |
kT820 |
kT830 |
kT860 |
kT880 |
kG31 |
kG51 |
kG71 |
kG52 |
kG72 |
kG76 |
kG57 |
kG77 |
kG68 |
kG78 |
kG310 |
kG510 |
kG610 |
kG710 |
kG615 |
kG715 |
kG620 |
kG720 |
kG625 |
kG725 |
kG925 |
kUnknown |

Definition at line 73 of file driver_info_vk.h.

73 {
74 // These might be Vulkan 1.0 Only.
75 kT760,
76 kT820,
77 kT830,
78 kT860,
79 kT880,
80
81 // Bifrost
82 kG31,
83 kG51,
84 kG71,
85 kG52,
86 kG72,
87 kG76,
88
89 // Valhall
90 // Note: there is an Immortalis-G715 a Mali-G715
91 kG57,
92 kG77,
93 kG68,
94 kG78,
95 kG310,
96 kG510,
97 kG610,
98 kG710,
99 kG615,
100 kG715,
101
102 // 5th Gen
103 kG620,
104 kG720,
105 kG625,
106 kG725,
107 kG925,
108 kUnknown,
109 };

## ◆ MinMagFilter

enum impeller::MinMagFilter : uint8_t
| strong

Describes how the texture should be sampled when the texture is being shrunk (minified) or expanded (magnified) to fit to the sample point.

Enumerator
kNearest | Select nearest to the sample point. Most widely supported.
kLinear | Select two points and linearly interpolate between them. Some formats may not support this.

Definition at line 415 of file formats.h.

415 : uint8_t {
416 /// Select nearest to the sample point. Most widely supported.
417 kNearest,
418
419 /// Select two points and linearly interpolate between them. Some formats
420 /// may not support this.
421 kLinear,
422 };

## ◆ MipFilter

enum impeller::MipFilter : uint8_t
| strong

Options for selecting and filtering between mipmap levels.

Enumerator
kBase | The texture is sampled as if it only had a single mipmap level.
            All samples are read from level 0.
kNearest | The nearst mipmap level is selected.
kLinear | Sample from the two nearest mip levels and linearly interpolate.
            If the filter falls between levels, both levels are sampled, and
            their results linearly interpolated between levels.

Definition at line 425 of file formats.h.

425 : uint8_t {
426 /// @brief The texture is sampled as if it only had a single mipmap level.
427 ///
428 /// All samples are read from level 0.
429 kBase,
430
431 /// @brief The nearst mipmap level is selected.
432 kNearest,
433
434 /// @brief Sample from the two nearest mip levels and linearly interpolate.
435 ///
436 /// If the filter falls between levels, both levels are sampled, and
437 /// their results linearly interpolated between levels.
438 kLinear,
439 };

## ◆ MyMaskBits

enum impeller::MyMaskBits : uint32_t
| strong

Enumerator
kFoo |
kBar |
kBaz |
kBang |

Definition at line 13 of file base_unittests.cc.

13 : uint32_t {
14 kFoo = 0,
15 kBar = 1 << 0,
16 kBaz = 1 << 1,
17 kBang = 1 << 2,
18 };

## ◆ OptionalDeviceExtensionVK

enum impeller::OptionalDeviceExtensionVK : uint32_t
| strong

A device extension enabled if available. Subsystems cannot assume availability and must check if these extensions are available.

See also
  `CapabilitiesVK::HasExtension`.

Enumerator
kEXTPipelineCreationFeedback | To instrument and profile PSO creation. https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_pipeline_creation_feedback.html
kVKKHRPortabilitySubset | To enable context creation on MoltenVK. A non-conformant Vulkan implementation. https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_portability_subset.html
kEXTImageCompressionControl | For fixed-rate compression of images. https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_image_compression_control.html
kLast |

Definition at line 121 of file capabilities_vk.h.

121 : uint32_t {
122 //----------------------------------------------------------------------------
123 /// To instrument and profile PSO creation.
124 ///
125 /// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_pipeline_creation_feedback.html
126 ///
127 kEXTPipelineCreationFeedback,
128
129 //----------------------------------------------------------------------------
130 /// To enable context creation on MoltenVK. A non-conformant Vulkan
131 /// implementation.
132 ///
133 /// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_portability_subset.html
134 ///
135 kVKKHRPortabilitySubset,
136
137 //----------------------------------------------------------------------------
138 /// For fixed-rate compression of images.
139 ///
140 /// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_image_compression_control.html
141 ///
142 kEXTImageCompressionControl,
143
144 kLast,
145 };

## ◆ PixelFormat

enum impeller::PixelFormat : uint8_t
| strong

The Pixel formats supported by Impeller. The naming convention denotes the usage of the component, the bit width of that component, and then one or more qualifiers to its interpretation.

For instance, `kR8G8B8A8UNormIntSRGB` is a 32 bits-per-pixel format ordered in RGBA with 8 bits per component with each component expressed as an unsigned normalized integer and a conversion from sRGB to linear color space.

Key: R -> Red Component G -> Green Component B -> Blue Component D -> Depth Component S -> Stencil Component U -> Unsigned (Lack of this denotes a signed component) Norm -> Normalized SRGB -> sRGB to linear interpretation

While the effective bit width of the pixel can be determined by adding up the widths of each component, only the non-esoteric formats are tightly packed. Do not assume tight packing for the esoteric formats and use blit passes to convert to a non-esoteric pass.

Enumerator
kUnknown |
kA8UNormInt |
kR8UNormInt |
kR8G8UNormInt |
kR8G8B8A8UNormInt |
kR8G8B8A8UNormIntSRGB |
kB8G8R8A8UNormInt |
kB8G8R8A8UNormIntSRGB |
kR32G32B32A32Float |
kR16G16B16A16Float |
kB10G10R10XR |
kB10G10R10XRSRGB |
kB10G10R10A10XR |
kS8UInt |
kD24UnormS8Uint |
kD32FloatS8UInt |

Definition at line 99 of file formats.h.

99 : uint8_t {
100 kUnknown,
101 kA8UNormInt,
102 kR8UNormInt,
103 kR8G8UNormInt,
104 kR8G8B8A8UNormInt,
105 kR8G8B8A8UNormIntSRGB,
106 kB8G8R8A8UNormInt,
107 kB8G8R8A8UNormIntSRGB,
108 kR32G32B32A32Float,
109 kR16G16B16A16Float,
110 kB10G10R10XR,
111 kB10G10R10XRSRGB,
112 kB10G10R10A10XR,
113 // Depth and stencil formats.
114 kS8UInt,
115 kD24UnormS8Uint,
116 kD32FloatS8UInt,
117 };

## ◆ PlaygroundBackend

enum impeller::PlaygroundBackend
| strong

Enumerator
kMetal |
kOpenGLES |
kVulkan |

Definition at line 27 of file playground.h.

27 {
28 kMetal,
29 kOpenGLES,
30 kVulkan,
31 };

## ◆ PointStyle

enum impeller::PointStyle
| strong

Enumerator
kRound | Points are drawn as squares.
kSquare | Points are drawn as circles.

Definition at line 60 of file canvas.h.

60 {
61 /// @brief Points are drawn as squares.
62 kRound,
63
64 /// @brief Points are drawn as circles.
65 kSquare,
66 };

## ◆ PolygonMode

enum impeller::PolygonMode
| strong

Enumerator
kFill |
kLine |

Definition at line 389 of file formats.h.

389 {
390 kFill,
391 kLine,
392 };

## ◆ PrimitiveType

enum impeller::PrimitiveType : uint8_t
| strong

Decides how backend draws pixels based on input vertices.

Enumerator
kTriangle | Draws a triangle for each separate set of three vertices. Vertices [A, B, C, D, E, F] will produce triages [ABC, DEF].
kTriangleStrip | Draws a triangle for every adjacent three vertices. Vertices [A, B, C, D, E, F] will produce triages [ABC, BCD, CDE, DEF].
kLine | Draws a line for each separate set of two vertices. Vertices [A, B, C] will produce discontinued line [AB, BC].
kLineStrip | Draws a continuous line that connect every input vertices Vertices [A, B, C] will produce one continuous line [ABC].
kPoint | Draws a point at each input vertex.
kTriangleFan | Draws a triangle for every two vertices, after the first. The first vertex acts as the hub, all following vertices connect with this hub to "fan" out from the first vertex. Triangle fans are not supported in Metal and need a capability check.

Definition at line 352 of file formats.h.

352 : uint8_t {
353 /// Draws a triangle for each separate set of three vertices.
354 ///
355 /// Vertices [A, B, C, D, E, F] will produce triages
356 /// [ABC, DEF].
357 kTriangle,
358
359 /// Draws a triangle for every adjacent three vertices.
360 ///
361 /// Vertices [A, B, C, D, E, F] will produce triages
362 /// [ABC, BCD, CDE, DEF].
363 kTriangleStrip,
364
365 /// Draws a line for each separate set of two vertices.
366 ///
367 /// Vertices [A, B, C] will produce discontinued line
368 /// [AB, BC].
369 kLine,
370
371 /// Draws a continuous line that connect every input vertices
372 ///
373 /// Vertices [A, B, C] will produce one continuous line
374 /// [ABC].
375 kLineStrip,
376
377 /// Draws a point at each input vertex.
378 kPoint,
379
380 /// Draws a triangle for every two vertices, after the first.
381 ///
382 /// The first vertex acts as the hub, all following vertices connect with
383 /// this hub to "fan" out from the first vertex.
384 ///
385 /// Triangle fans are not supported in Metal and need a capability check.
386 kTriangleFan,
387 };

## ◆ RequiredAndroidDeviceExtensionVK

enum impeller::RequiredAndroidDeviceExtensionVK : uint32_t
| strong

A device extension available on all Android platforms. Without the presence of these extensions on Android, context creation will fail.

Platform agnostic code can still check if these Android extensions are present.

Enumerator
kANDROIDExternalMemoryAndroidHardwareBuffer | For importing hardware buffers used in external texture composition. https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_ANDROID_external_memory_android_hardware_buffer.html
kKHRSamplerYcbcrConversion | Dependency of kANDROIDExternalMemoryAndroidHardwareBuffer. https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_sampler_ycbcr_conversion.html
kKHRExternalMemory | Dependency of kANDROIDExternalMemoryAndroidHardwareBuffer. https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_memory.html
kEXTQueueFamilyForeign | Dependency of kANDROIDExternalMemoryAndroidHardwareBuffer. https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_queue_family_foreign.html
kKHRDedicatedAllocation | Dependency of kANDROIDExternalMemoryAndroidHardwareBuffer. https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_dedicated_allocation.html
kKHRExternalFenceFd | For exporting file descriptors from fences to interact with platform APIs. https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_fence_fd.html
kKHRExternalFence | Dependency of kKHRExternalFenceFd. https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_fence.html
kKHRExternalSemaphoreFd | For importing sync file descriptors as semaphores so the GPU can wait for semaphore to be signaled. https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_semaphore_fd.html
kKHRExternalSemaphore | Dependency of kKHRExternalSemaphoreFd https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_semaphore.html
kLast |

Definition at line 48 of file capabilities_vk.h.

48 : uint32_t {
49 //----------------------------------------------------------------------------
50 /// For importing hardware buffers used in external texture composition.
51 ///
52 /// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_ANDROID_external_memory_android_hardware_buffer.html
53 ///
54 kANDROIDExternalMemoryAndroidHardwareBuffer,
55
56 //----------------------------------------------------------------------------
57 /// Dependency of kANDROIDExternalMemoryAndroidHardwareBuffer.
58 ///
59 /// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_sampler_ycbcr_conversion.html
60 ///
61 kKHRSamplerYcbcrConversion,
62
63 //----------------------------------------------------------------------------
64 /// Dependency of kANDROIDExternalMemoryAndroidHardwareBuffer.
65 ///
66 /// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_memory.html
67 ///
68 kKHRExternalMemory,
69
70 //----------------------------------------------------------------------------
71 /// Dependency of kANDROIDExternalMemoryAndroidHardwareBuffer.
72 ///
73 /// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_queue_family_foreign.html
74 ///
75 kEXTQueueFamilyForeign,
76
77 //----------------------------------------------------------------------------
78 /// Dependency of kANDROIDExternalMemoryAndroidHardwareBuffer.
79 ///
80 /// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_dedicated_allocation.html
81 ///
82 kKHRDedicatedAllocation,
83
84 //----------------------------------------------------------------------------
85 /// For exporting file descriptors from fences to interact with platform APIs.
86 ///
87 /// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_fence_fd.html
88 ///
89 kKHRExternalFenceFd,
90
91 //----------------------------------------------------------------------------
92 /// Dependency of kKHRExternalFenceFd.
93 ///
94 /// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_fence.html
95 ///
96 kKHRExternalFence,
97
98 //----------------------------------------------------------------------------
99 /// For importing sync file descriptors as semaphores so the GPU can wait for
100 /// semaphore to be signaled.
101 ///
102 /// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_semaphore_fd.html
103 kKHRExternalSemaphoreFd,
104
105 //----------------------------------------------------------------------------
106 /// Dependency of kKHRExternalSemaphoreFd
107 ///
108 /// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_semaphore.html
109 kKHRExternalSemaphore,
110
111 kLast,
112 };

## ◆ RequiredCommonDeviceExtensionVK

enum impeller::RequiredCommonDeviceExtensionVK : uint32_t
| strong

A device extension available on all platforms. Without the presence of these extensions, context creation will fail.

Enumerator
kKHRSwapchain | For displaying content in the window system. https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_swapchain.html
kLast |

Definition at line 29 of file capabilities_vk.h.

29 : uint32_t {
30 //----------------------------------------------------------------------------
31 /// For displaying content in the window system.
32 ///
33 /// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_swapchain.html
34 ///
35 kKHRSwapchain,
36
37 kLast,
38 };

## ◆ RuntimeShaderStage

enum impeller::RuntimeShaderStage
| strong

Enumerator
kVertex |
kFragment |
kCompute |

Definition at line 30 of file runtime_types.h.

30 {
31 kVertex,
32 kFragment,
33 kCompute,
34 };

## ◆ RuntimeStageBackend

enum impeller::RuntimeStageBackend
| strong

Enumerator
kSkSL |
kMetal |
kOpenGLES |
kOpenGLES3 |
kVulkan |

Definition at line 16 of file runtime_types.h.

16 {
17 kSkSL,
18 kMetal,
19 kOpenGLES,
20 kOpenGLES3,
21 kVulkan,
22 };

## ◆ RuntimeUniformType

enum impeller::RuntimeUniformType

Enumerator
kFloat |
kSampledImage |
kStruct |

Definition at line 24 of file runtime_types.h.

24 {
25 kFloat,
26 kSampledImage,
27 kStruct,
28 };

## ◆ SampleCount

enum impeller::SampleCount : uint8_t
| strong

Enumerator
kCount1 |
kCount4 |

Definition at line 295 of file formats.h.

295 : uint8_t {
296 kCount1 = 1,
297 kCount4 = 4,
298 };

## ◆ SamplerAddressMode

enum impeller::SamplerAddressMode : uint8_t
| strong

Enumerator
kClampToEdge |
kRepeat |
kMirror |
kDecal | decal sampling mode is only supported on devices that pass the `Capabilities.SupportsDecalSamplerAddressMode` check.

Definition at line 441 of file formats.h.

441 : uint8_t {
442 kClampToEdge,
443 kRepeat,
444 kMirror,
445 // More modes are almost always supported but they are usually behind
446 // extensions checks. The ones current in these structs are safe (always
447 // supported) defaults.
448
449 /// @brief decal sampling mode is only supported on devices that pass
450 /// the `Capabilities.SupportsDecalSamplerAddressMode` check.
451 kDecal,
452 };

## ◆ ShaderStage

enum impeller::ShaderStage
| strong

Enumerator
kUnknown |
kVertex |
kFragment |
kCompute |

Definition at line 22 of file shader_types.h.

22 {
23 kUnknown,
24 kVertex,
25 kFragment,
26 kCompute,
27 };

## ◆ ShaderType

enum impeller::ShaderType
| strong

Enumerator
kUnknown |
kVoid |
kBoolean |
kSignedByte |
kUnsignedByte |
kSignedShort |
kUnsignedShort |
kSignedInt |
kUnsignedInt |
kSignedInt64 |
kUnsignedInt64 |
kAtomicCounter |
kHalfFloat |
kFloat |
kDouble |
kStruct |
kImage |
kSampledImage |
kSampler |

Definition at line 41 of file shader_types.h.

41 {
42 kUnknown,
43 kVoid,
44 kBoolean,
45 kSignedByte,
46 kUnsignedByte,
47 kSignedShort,
48 kUnsignedShort,
49 kSignedInt,
50 kUnsignedInt,
51 kSignedInt64,
52 kUnsignedInt64,
53 kAtomicCounter,
54 kHalfFloat,
55 kFloat,
56 kDouble,
57 kStruct,
58 kImage,
59 kSampledImage,
60 kSampler,
61 };

## ◆ SourceRectConstraint

enum impeller::SourceRectConstraint
| strong

Controls the behavior of the source rectangle given to DrawImageRect.

Enumerator
kFast | Faster, but may sample outside the bounds of the source rectangle.
kStrict | Sample only within the source rectangle. May be slower.

Definition at line 69 of file canvas.h.

69 {
70 /// @brief Faster, but may sample outside the bounds of the source rectangle.
71 kFast,
72
73 /// @brief Sample only within the source rectangle. May be slower.
74 kStrict,
75 };

## ◆ StencilOperation

enum impeller::StencilOperation : uint8_t
| strong

Enumerator
kKeep | Don't modify the current stencil value.
kZero | Reset the stencil value to zero.
kSetToReferenceValue | Reset the stencil value to the reference value.
kIncrementClamp | Increment the current stencil value by 1. Clamp it to the maximum.
kDecrementClamp | Decrement the current stencil value by 1. Clamp it to zero.
kInvert | Perform a logical bitwise invert on the current stencil value.
kIncrementWrap | Increment the current stencil value by 1. If at maximum, set to zero.
kDecrementWrap | Decrement the current stencil value by 1. If at zero, set to maximum.

Definition at line 571 of file formats.h.

571 : uint8_t {
572 /// Don't modify the current stencil value.
573 kKeep,
574 /// Reset the stencil value to zero.
575 kZero,
576 /// Reset the stencil value to the reference value.
577 kSetToReferenceValue,
578 /// Increment the current stencil value by 1. Clamp it to the maximum.
579 kIncrementClamp,
580 /// Decrement the current stencil value by 1. Clamp it to zero.
581 kDecrementClamp,
582 /// Perform a logical bitwise invert on the current stencil value.
583 kInvert,
584 /// Increment the current stencil value by 1. If at maximum, set to zero.
585 kIncrementWrap,
586 /// Decrement the current stencil value by 1. If at zero, set to maximum.
587 kDecrementWrap,
588 };

## ◆ StorageMode

enum impeller::StorageMode
| strong

Specified where the allocation resides and how it is used.

Enumerator
kHostVisible | Allocations can be mapped onto the hosts address space and also be used by the device.
kDevicePrivate | Allocations can only be used by the device. This location is optimal for use by the device. If the host needs to access these allocations, the transfer queue must be used to transfer this allocation onto the a host visible buffer.
kDeviceTransient | Used by the device for temporary render targets. These allocations cannot be transferred from and to other allocations using the transfer queue. Render pass cannot initialize the contents of these buffers using load and store actions. These allocations reside in tile memory which has higher bandwidth, lower latency and lower power consumption. The total device memory usage is also lower as a separate allocation does not need to be created in device memory. Prefer using these allocations for intermediates like depth and stencil buffers.

Definition at line 32 of file formats.h.

32 {
33 //----------------------------------------------------------------------------
34 /// Allocations can be mapped onto the hosts address space and also be used by
35 /// the device.
36 ///
37 kHostVisible,
38 //----------------------------------------------------------------------------
39 /// Allocations can only be used by the device. This location is optimal for
40 /// use by the device. If the host needs to access these allocations, the
41 /// transfer queue must be used to transfer this allocation onto the a host
42 /// visible buffer.
43 ///
44 kDevicePrivate,
45 //----------------------------------------------------------------------------
46 /// Used by the device for temporary render targets. These allocations cannot
47 /// be transferred from and to other allocations using the transfer queue.
48 /// Render pass cannot initialize the contents of these buffers using load and
49 /// store actions.
50 ///
51 /// These allocations reside in tile memory which has higher bandwidth, lower
52 /// latency and lower power consumption. The total device memory usage is
53 /// also lower as a separate allocation does not need to be created in
54 /// device memory. Prefer using these allocations for intermediates like depth
55 /// and stencil buffers.
56 ///
57 kDeviceTransient,
58 };

## ◆ StoreAction

enum impeller::StoreAction
| strong

Enumerator
kDontCare |
kStore |
kMultisampleResolve |
kStoreAndMultisampleResolve |

Definition at line 208 of file formats.h.

208 {
209 kDontCare,
210 kStore,
211 kMultisampleResolve,
212 kStoreAndMultisampleResolve,
213 };

## ◆ TextureCoordinateSystem

enum impeller::TextureCoordinateSystem
| strong

Enumerator
kUploadFromHost |
kRenderToTexture |

Definition at line 327 of file formats.h.

327 {
328 // Alternative coordinate system used when uploading texture data from the
329 // host.
330 // (0, 0) is the bottom-left of the image with +Y going up.
331 kUploadFromHost,
332 // Default coordinate system.
333 // (0, 0) is the top-left of the image with +Y going down.
334 kRenderToTexture,
335 };

## ◆ TextureType

enum impeller::TextureType
| strong

Enumerator
kTexture2D |
kTexture2DMultisample |
kTextureCube |
kTextureExternalOES |

Definition at line 262 of file formats.h.

262 {
263 kTexture2D,
264 kTexture2DMultisample,
265 kTextureCube,
266 kTextureExternalOES,
267 };

## ◆ TextureUsage

enum impeller::TextureUsage
| strong

Enumerator
kUnknown |
kShaderRead |
kShaderWrite |
kRenderTarget |

Definition at line 300 of file formats.h.

300 {
301 kUnknown = 0,
302 kShaderRead = 1 << 0,
303 kShaderWrite = 1 << 1,
304 kRenderTarget = 1 << 2,
305 };

## ◆ VendorVK

enum impeller::VendorVK
| strong

Enumerator
kUnknown |
kGoogle | Includes the SwiftShader CPU implementation.
kQualcomm |
kARM |
kImgTec |
kPowerVR |
kAMD |
kNvidia |
kIntel |
kHuawei |
kSamsung |
kMesa | Includes the LLVM Pipe CPU implementation.
kApple | Includes Vulkan on Metal via MoltenVK.

Definition at line 111 of file driver_info_vk.h.

111 {
112 kUnknown,
113 //----------------------------------------------------------------------------
114 /// Includes the SwiftShader CPU implementation.
115 ///
116 kGoogle,
117 kQualcomm,
118 kARM,
119 kImgTec,
120 kPowerVR = kImgTec,
121 kAMD,
122 kNvidia,
123 kIntel,
124 kHuawei,
125 kSamsung,
126 //----------------------------------------------------------------------------
127 /// Includes the LLVM Pipe CPU implementation.
128 ///
129 kMesa,
130 //----------------------------------------------------------------------------
131 /// Includes Vulkan on Metal via MoltenVK.
132 ///
133 kApple,
134 };

## ◆ WindingOrder

enum impeller::WindingOrder
| strong

Enumerator
kClockwise |
kCounterClockwise |

Definition at line 22 of file formats.h.

22 {
23 kClockwise,
24 kCounterClockwise,
25 };

## ◆ YUVColorSpace

enum impeller::YUVColorSpace
| strong

Enumerator
kBT601LimitedRange |
kBT601FullRange |

Definition at line 54 of file color.h.

54 { kBT601LimitedRange, kBT601FullRange };

## Function Documentation

## ◆ Absolute()

template<class T , class = std::enable_if_t<std::is_arithmetic_v<T>>>

constexpr T impeller::Absolute | ( | const T & | val | ) |
| constexpr

Definition at line 21 of file scalar.h.

21 {
22 return val >= T{} ? val : -val;
23 }

Referenced by ScalarNearlyZero().

## ◆ Absolute< Scalar >()

template<>

constexpr Scalar impeller::Absolute< Scalar > | ( | const float & | val | ) |
| constexpr

Definition at line 26 of file scalar.h.

26 {
27 return fabsf(val);
28 }

## ◆ AddMipmapGeneration()

fml::Status impeller::AddMipmapGeneration | ( | const std::shared_ptr< CommandBuffer > & | command_buffer,
|  | const std::shared_ptr< Context > & | context,
|  | const std::shared_ptr< Texture > & | texture
| ) |  |

Adds a blit command to the render pass.

Definition at line 11 of file texture_mipmap.cc.

14 {
15 std::shared_ptr<BlitPass> blit_pass = command_buffer->CreateBlitPass();
16 bool success = blit_pass->GenerateMipmap(texture);
17 if (!success) {
18 return fml::Status(fml::StatusCode::kUnknown, "");
19 }
20 success = blit_pass->EncodeCommands();
21 if (!success) {
22 return fml::Status(fml::StatusCode::kUnknown, "");
23 }
24 return fml::Status();
25 }

Referenced by impeller::InlinePassContext::EndPass(), and impeller::ContentContext::MakeSubpass().

## ◆ AdjustScale()

static void impeller::AdjustScale | ( | Scalar & | radius1,
|  | Scalar & | radius2,
|  | Scalar | dimension,
|  | Scalar & | scale
| ) |  |
| inline static

Definition at line 15 of file rounding_radii.cc.

18 {
19 FML_DCHECK(radius1 >= 0.0f && radius2 >= 0.0f);
20 FML_DCHECK(dimension > 0.0f);
21 if (radius1 + radius2 > dimension) {
22 scale = std::min(scale, dimension / (radius1 + radius2));
23 }
24 }

References scale.

Referenced by impeller::RoundingRadii::Scaled().

## ◆ AdvancedBlend()

template<typename TPipeline >

static std::optional<Entity> impeller::AdvancedBlend | ( | const FilterInput::Vector & | inputs,
|  | const ContentContext & | renderer,
|  | const Entity & | entity,
|  | const Rect & | coverage,
|  | BlendMode | blend_mode,
|  | std::optional< Color > | foreground_color,
|  | ColorFilterContents::AbsorbOpacity | absorb_opacity,
|  | PipelineProc | pipeline_proc,
|  | std::optional< Scalar > | alpha
| ) |  |
| static

Handle inputs.

Render to texture.

Definition at line 96 of file blend_filter_contents.cc.

105 {
106 using VS = typename TPipeline::VertexShader;
107 using FS = typename TPipeline::FragmentShader;
108
109 //----------------------------------------------------------------------------
110 /// Handle inputs.
111 ///
112
113 const size_t total_inputs =
114 inputs.size() + (foreground_color.has_value() ? 1 : 0);
115 if (total_inputs < 2) {
116 return std::nullopt;
117 }
118
119 auto dst_snapshot =
120 inputs[0]->GetSnapshot("AdvancedBlend(Dst)", renderer, entity);
121 if (!dst_snapshot.has_value()) {
122 return std::nullopt;
123 }
124 auto maybe_dst_uvs = dst_snapshot->GetCoverageUVs(coverage);
125 if (!maybe_dst_uvs.has_value()) {
126 return std::nullopt;
127 }
128 auto dst_uvs = maybe_dst_uvs.value();
129
130 std::optional<Snapshot> src_snapshot;
131 std::array<Point, 4> src_uvs;
132 if (!foreground_color.has_value()) {
133 src_snapshot =
134 inputs[1]->GetSnapshot("AdvancedBlend(Src)", renderer, entity);
135 if (!src_snapshot.has_value()) {
136 if (!dst_snapshot.has_value()) {
137 return std::nullopt;
138 }
139 return Entity::FromSnapshot(dst_snapshot.value(), entity.GetBlendMode());
140 }
141 auto maybe_src_uvs = src_snapshot->GetCoverageUVs(coverage);
142 if (!maybe_src_uvs.has_value()) {
143 if (!dst_snapshot.has_value()) {
144 return std::nullopt;
145 }
146 return Entity::FromSnapshot(dst_snapshot.value(), entity.GetBlendMode());
147 }
148 src_uvs = maybe_src_uvs.value();
149 }
150
151 Rect subpass_coverage = coverage;
152 if (entity.GetContents()) {
153 auto coverage_hint = entity.GetContents()->GetCoverageHint();
154
155 if (coverage_hint.has_value()) {
156 auto maybe_subpass_coverage =
157 subpass_coverage.Intersection(*coverage_hint);
158 if (!maybe_subpass_coverage.has_value()) {
159 return std::nullopt; // Nothing to render.
160 }
161
162 subpass_coverage = *maybe_subpass_coverage;
163 }
164 }
165
166 //----------------------------------------------------------------------------
167 /// Render to texture.
168 ///
169
170 ContentContext::SubpassCallback callback = [&](const ContentContext& renderer,
171 RenderPass& pass) {
172 auto& host_buffer = renderer.GetTransientsBuffer();
173
174 auto size = pass.GetRenderTargetSize();
175
176 std::array<typename VS::PerVertexData, 4> vertices = {
177 typename VS::PerVertexData{Point(0, 0), dst_uvs[0], src_uvs[0]},
178 typename VS::PerVertexData{Point(size.width, 0), dst_uvs[1],
179 src_uvs[1]},
180 typename VS::PerVertexData{Point(0, size.height), dst_uvs[2],
181 src_uvs[2]},
182 typename VS::PerVertexData{Point(size.width, size.height), dst_uvs[3],
183 src_uvs[3]},
184 };
185 auto vtx_buffer =
186 CreateVertexBuffer(vertices, renderer.GetTransientsBuffer());
187
188 auto options = OptionsFromPass(pass);
189 options.primitive_type = PrimitiveType::kTriangleStrip;
190 options.blend_mode = BlendMode::kSource;
191 PipelineRef pipeline = std::invoke(pipeline_proc, renderer, options);
192
193 #ifdef IMPELLER_DEBUG
194 pass.SetCommandLabel(BlendModeToFilterString(blend_mode));
195 #endif // IMPELLER_DEBUG
196 pass.SetVertexBuffer(std::move(vtx_buffer));
197 pass.SetPipeline(pipeline);
198
199 typename FS::BlendInfo blend_info;
200 typename VS::FrameInfo frame_info;
201
202 auto dst_sampler_descriptor = dst_snapshot->sampler_descriptor;
203 if (renderer.GetDeviceCapabilities().SupportsDecalSamplerAddressMode()) {
204 dst_sampler_descriptor.width_address_mode = SamplerAddressMode::kDecal;
205 dst_sampler_descriptor.height_address_mode = SamplerAddressMode::kDecal;
206 }
207 raw_ptr<const Sampler> dst_sampler =
208 renderer.GetContext()->GetSamplerLibrary()->GetSampler(
209 dst_sampler_descriptor);
210 FS::BindTextureSamplerDst(pass, dst_snapshot->texture, dst_sampler);
211 frame_info.dst_y_coord_scale = dst_snapshot->texture->GetYCoordScale();
212 blend_info.dst_input_alpha =
213 absorb_opacity == ColorFilterContents::AbsorbOpacity::kYes
214 ? dst_snapshot->opacity
215 : 1.0;
216
217 if (foreground_color.has_value()) {
218 blend_info.color_factor = 1;
219 blend_info.color = foreground_color.value();
220 // This texture will not be sampled from due to the color factor. But
221 // this is present so that validation doesn't trip on a missing
222 // binding.
223 FS::BindTextureSamplerSrc(pass, dst_snapshot->texture, dst_sampler);
224 } else {
225 auto src_sampler_descriptor = src_snapshot->sampler_descriptor;
226 if (renderer.GetDeviceCapabilities().SupportsDecalSamplerAddressMode()) {
227 src_sampler_descriptor.width_address_mode = SamplerAddressMode::kDecal;
228 src_sampler_descriptor.height_address_mode = SamplerAddressMode::kDecal;
229 }
230 raw_ptr<const Sampler> src_sampler =
231 renderer.GetContext()->GetSamplerLibrary()->GetSampler(
232 src_sampler_descriptor);
233 blend_info.color_factor = 0;
234 blend_info.src_input_alpha = src_snapshot->opacity;
235 FS::BindTextureSamplerSrc(pass, src_snapshot->texture, src_sampler);
236 frame_info.src_y_coord_scale = src_snapshot->texture->GetYCoordScale();
237 }
238 auto blend_uniform = host_buffer.EmplaceUniform(blend_info);
239 FS::BindBlendInfo(pass, blend_uniform);
240
241 frame_info.mvp = pass.GetOrthographicTransform() *
242 Matrix::MakeTranslation(coverage.GetOrigin() -
243 subpass_coverage.GetOrigin());
244
245 auto uniform_view = host_buffer.EmplaceUniform(frame_info);
246 VS::BindFrameInfo(pass, uniform_view);
247
248 return pass.Draw().ok();
249 };
250
251 std::shared_ptr<CommandBuffer> command_buffer =
252 renderer.GetContext()->CreateCommandBuffer();
253 if (!command_buffer) {
254 return std::nullopt;
255 }
256 fml::StatusOr<RenderTarget> render_target = renderer.MakeSubpass(
257 "Advanced Blend Filter", ISize(subpass_coverage.GetSize()),
258 command_buffer, callback);
259 if (!render_target.ok()) {
260 return std::nullopt;
261 }
262 if (!renderer.GetContext()->EnqueueCommandBuffer(std::move(command_buffer))) {
263 return std::nullopt;
264 }
265
266 return Entity::FromSnapshot(
267 Snapshot{
268 .texture = render_target.value().GetRenderTargetTexture(),
269 .transform = Matrix::MakeTranslation(subpass_coverage.GetOrigin()),
270 // Since we absorbed the transform of the inputs and used the
271 // respective snapshot sampling modes when blending, pass on
272 // the default NN clamp sampler.
273 .sampler_descriptor = {},
274 .opacity = (absorb_opacity == ColorFilterContents::AbsorbOpacity::kYes
275 ? 1.0f
276 : dst_snapshot->opacity) *
277 alpha.value_or(1.0)},
278 entity.GetBlendMode());
279 }

References CreateVertexBuffer(), impeller::Entity::FromSnapshot(), impeller::Entity::GetBlendMode(), impeller::Entity::GetContents(), impeller::ContentContext::GetContext(), impeller::ContentContext::GetDeviceCapabilities(), impeller::TRect< T >::GetOrigin(), impeller::TRect< T >::GetSize(), impeller::ContentContext::GetTransientsBuffer(), impeller::TRect< T >::Intersection(), kDecal, kSource, kTriangleStrip, impeller::ColorFilterContents::kYes, impeller::ContentContext::MakeSubpass(), impeller::Matrix::MakeTranslation(), OptionsFromPass(), impeller::Capabilities::SupportsDecalSamplerAddressMode(), impeller::Snapshot::texture, and transform.

## ◆ API_AVAILABLE()

impeller::API_AVAILABLE | ( | ios(14.0) | ,
|  | macos(11.0) |
| ) |  |

Definition at line 17 of file command_buffer_mtl.mm.

19 {
20 switch (state) {
21 case MTLCommandEncoderErrorStateUnknown:
22 return @"unknown";
23 case MTLCommandEncoderErrorStateCompleted:
24 return @"completed";
25 case MTLCommandEncoderErrorStateAffected:
26 return @"affected";
27 case MTLCommandEncoderErrorStatePending:
28 return @"pending";
29 case MTLCommandEncoderErrorStateFaulted:
30 return @"faulted";
31 }
32 return @"unknown";
33 }

## ◆ AppendColor()

static void impeller::AppendColor | ( | const Color & | color,
|  | GradientData * | data
| ) |  |
| static

Definition at line 12 of file gradient.cc.

12 {
13 auto converted = color.ToR8G8B8A8();
14 data->color_bytes.push_back(converted[0]);
15 data->color_bytes.push_back(converted[1]);
16 data->color_bytes.push_back(converted[2]);
17 data->color_bytes.push_back(converted[3]);
18 }

References data, and impeller::Color::ToR8G8B8A8().

Referenced by CreateGradientBuffer().

## ◆ AppendToExistingAtlas()

static size_t impeller::AppendToExistingAtlas | ( | const std::shared_ptr< GlyphAtlas > & | atlas,
|  | const std::vector< FontGlyphPair > & | extra_pairs,
|  | std::vector< Rect > & | glyph_positions,
|  | const std::vector< Rect > & | glyph_sizes,
|  | ISize | atlas_size,
|  | int64_t | height_adjustment,
|  | const std::shared_ptr< RectanglePacker > & | rect_packer
| ) |  |
| static

Append as many glyphs to the texture as will fit, and return the first index of [extra_pairs] that did not fit.

Definition at line 103 of file typographer_context_skia.cc.

110 {
111 TRACE_EVENT0("impeller", __FUNCTION__);
112 if (!rect_packer || atlas_size.IsEmpty()) {
113 return 0;
114 }
115
116 for (size_t i = 0; i < extra_pairs.size(); i++) {
117 ISize glyph_size = ISize::Ceil(glyph_sizes[i].GetSize());
118 IPoint16 location_in_atlas;
119 if (!rect_packer->AddRect(glyph_size.width + kPadding, //
120 glyph_size.height + kPadding, //
121 &location_in_atlas //
122 )) {
123 return i;
124 }
125 // Position the glyph in the center of the 1px padding.
126 glyph_positions.push_back(Rect::MakeXYWH(
127 location_in_atlas.x() + 1, //
128 location_in_atlas.y() + height_adjustment + 1, //
129 glyph_size.width, //
130 glyph_size.height //
131 ));
132 }
133
134 return extra_pairs.size();
135 }

References impeller::TSize< T >::Ceil(), impeller::TSize< T >::height, impeller::TSize< T >::IsEmpty(), kPadding, impeller::TRect< Scalar >::MakeXYWH(), impeller::TSize< T >::width, impeller::IPoint16::x(), and impeller::IPoint16::y().

Referenced by impeller::TypographerContextSkia::CreateGlyphAtlas().

## ◆ ApplyBlendedColor()

static constexpr Color impeller::ApplyBlendedColor | ( | Color | dst,
|  | Color | src,
|  | Vector3 | blend_result
| ) |  |
| inline static constexpr

Composite a blended color onto the destination. All three parameters are unpremultiplied. Returns a premultiplied result.

This routine is the same as `IPApplyBlendedColor` in the Impeller shader library.

Definition at line 124 of file color.cc.

126 {
127 dst = dst.Premultiply();
128 src =
129 // Use the blended color for areas where the source and destination
130 // colors overlap.
131 FromRGB(blend_result, src.alpha * dst.alpha).Premultiply() +
132 // Use the original source color for any remaining non-overlapping areas.
133 src.Premultiply() * (1.0f - dst.alpha);
134
135 // Source-over composite the blended source color atop the destination.
136 return src + dst * (1.0f - src.alpha);
137 }

References impeller::Color::alpha, FromRGB(), and impeller::Color::Premultiply().

Referenced by DoColorBlend(), and DoColorBlendComponents().

## ◆ AttachmentToString()

std::string impeller::AttachmentToString | ( | const Attachment & | attachment | ) |

Definition at line 104 of file formats.cc.

104 {
105 std::stringstream stream;
106 if (attachment.texture) {
107 stream << "Texture=("
108 << TextureDescriptorToString(
109 attachment.texture->GetTextureDescriptor())
110 << "),";
111 }
112 if (attachment.resolve_texture) {
113 stream << "ResolveTexture=("
114 << TextureDescriptorToString(
115 attachment.resolve_texture->GetTextureDescriptor())
116 << "),";
117 }
118 stream << "LoadAction=" << LoadActionToString(attachment.load_action) << ",";
119 stream << "StoreAction=" << StoreActionToString(attachment.store_action);
120 return stream.str();
121 }

References impeller::Attachment::load_action, LoadActionToString(), impeller::Attachment::resolve_texture, impeller::Attachment::store_action, StoreActionToString(), impeller::Attachment::texture, and TextureDescriptorToString().

Referenced by ColorAttachmentToString(), DepthAttachmentToString(), and StencilAttachmentToString().

## ◆ AttachmentTypeString()

static const char* impeller::AttachmentTypeString | ( | GLint | type | ) |
| static

Definition at line 233 of file proc_table_gles.cc.

233 {
234 switch (type) {
235 case GL_RENDERBUFFER:
236 return "GL_RENDERBUFFER";
237 case GL_TEXTURE:
238 return "GL_TEXTURE";
239 case GL_NONE:
240 return "GL_NONE";
241 }
242
243 return "Unknown Type";
244 }

References type.

Referenced by DescribeFramebufferAttachment().

## ◆ BENCHMARK_CAPTURE() [1/5]

impeller::BENCHMARK_CAPTURE | ( | BM_Convex | ,
|  | rrect_convex | ,
|  | CreateRRect() | ,
|  | true |
| ) |  |

## ◆ BENCHMARK_CAPTURE() [2/5]

impeller::BENCHMARK_CAPTURE | ( | BM_Polyline | ,
|  | cubic_polyline | ,
|  | CreateCubic(true) |
| ) |  |

## ◆ BENCHMARK_CAPTURE() [3/5]

impeller::BENCHMARK_CAPTURE | ( | BM_Polyline | ,
|  | quad_polyline | ,
|  | CreateQuadratic(true) |
| ) |  |

## ◆ BENCHMARK_CAPTURE() [4/5]

impeller::BENCHMARK_CAPTURE | ( | BM_Polyline | ,
|  | unclosed_cubic_polyline | ,
|  | CreateCubic(false) |
| ) |  |

## ◆ BENCHMARK_CAPTURE() [5/5]

impeller::BENCHMARK_CAPTURE | ( | BM_Polyline | ,
|  | unclosed_quad_polyline | ,
|  | CreateQuadratic(false) |
| ) |  |

## ◆ Bind() [1/2]

static bool impeller::Bind | ( | PassBindingsCacheMTL & | pass,
|  | ShaderStage | stage,
|  | size_t | bind_index,
|  | const BufferView & | view
| ) |  |
| static

Definition at line 188 of file render_pass_mtl.mm.

191 {
192 if (!view.GetBuffer()) {
193 return false;
194 }
195
196 const DeviceBuffer* device_buffer = view.GetBuffer();
197 if (!device_buffer) {
198 return false;
199 }
200
201 auto buffer = DeviceBufferMTL::Cast(*device_buffer).GetMTLBuffer();
202 // The Metal call is a void return and we don't want to make it on nil.
203 if (!buffer) {
204 return false;
205 }
206
207 return pass.SetBuffer(stage, bind_index, view.GetRange().offset, buffer);
208 }

References impeller::BufferView::GetBuffer(), impeller::BufferView::GetRange(), impeller::Range::offset, and impeller::PassBindingsCacheMTL::SetBuffer().

## ◆ Bind() [2/2]

static bool impeller::Bind | ( | PassBindingsCacheMTL & | pass,
|  | ShaderStage | stage,
|  | size_t | bind_index,
|  | raw_ptr< const Sampler > | sampler,
|  | const Texture & | texture
| ) |  |
| static

Definition at line 210 of file render_pass_mtl.mm.

214 {
215 if (!sampler || !texture.IsValid()) {
216 return false;
217 }
218
219 if (texture.NeedsMipmapGeneration()) {
220 // TODO(127697): generate mips when the GPU is available on iOS.
221 #if !FML_OS_IOS
222 VALIDATION_LOG
223 << "Texture at binding index " << bind_index
224 << " has a mip count > 1, but the mipmap has not been generated.";
225 return false;
226 #endif // !FML_OS_IOS
227 }
228
229 return pass.SetTexture(stage, bind_index,
230 TextureMTL::Cast(texture).GetMTLTexture()) &&
231 pass.SetSampler(stage, bind_index,
232 SamplerMTL::Cast(*sampler).GetMTLSamplerState());
233 }

References impeller::Texture::IsValid(), impeller::Texture::NeedsMipmapGeneration(), impeller::PassBindingsCacheMTL::SetSampler(), impeller::PassBindingsCacheMTL::SetTexture(), and VALIDATION_LOG.

## ◆ BindVertexBuffer()

static bool impeller::BindVertexBuffer | ( | const ProcTableGLES & | gl,
|  | BufferBindingsGLES * | vertex_desc_gles,
|  | const BufferView & | vertex_buffer_view,
|  | size_t | buffer_index
| ) |  |
| static

Bind the vertex attributes associated with vertex buffer.

Definition at line 147 of file render_pass_gles.cc.

150 {
151 if (!vertex_buffer_view) {
152 return false;
153 }
154
155 const DeviceBuffer* vertex_buffer = vertex_buffer_view.GetBuffer();
156
157 if (!vertex_buffer) {
158 return false;
159 }
160
161 const auto& vertex_buffer_gles = DeviceBufferGLES::Cast(*vertex_buffer);
162 if (!vertex_buffer_gles.BindAndUploadDataIfNecessary(
163 DeviceBufferGLES::BindingType::kArrayBuffer)) {
164 return false;
165 }
166
167 //--------------------------------------------------------------------------
168 /// Bind the vertex attributes associated with vertex buffer.
169 ///
170 if (!vertex_desc_gles->BindVertexAttributes(
171 gl, buffer_index, vertex_buffer_view.GetRange().offset)) {
172 return false;
173 }
174
175 return true;
176 }

References impeller::BufferBindingsGLES::BindVertexAttributes(), impeller::BackendCast< DeviceBufferGLES, DeviceBuffer >::Cast(), impeller::BufferView::GetBuffer(), impeller::BufferView::GetRange(), impeller::DeviceBufferGLES::kArrayBuffer, and impeller::Range::offset.

Referenced by EncodeCommandsInReactor().

## ◆ BlendModeToString()

const char * impeller::BlendModeToString | ( | BlendMode | blend_mode | ) |

Definition at line 47 of file color.cc.

47 {
48 return kBlendModeNames[static_cast<std::underlying_type_t<BlendMode>>(
49 blend_mode)];
50 }

References kBlendModeNames.

Referenced by impeller::ContentContext::GetPorterDuffPipeline(), impeller::VerticesSimpleBlendContents::Render(), and impeller::testing::TEST().

## ◆ BM_Convex()

template<class... Args>

static void impeller::BM_Convex | ( | benchmark::State & | state,
|  | Args &&... | args
| ) |  |
| static

Definition at line 97 of file geometry_benchmarks.cc.

97 {
98 auto args_tuple = std::make_tuple(std::move(args)...);
99 auto path = std::get<Path>(args_tuple);
100
101 size_t point_count = 0u;
102 size_t single_point_count = 0u;
103 auto points = std::make_unique<std::vector<Point>>();
104 auto indices = std::make_unique<std::vector<uint16_t>>();
105 points->reserve(2048);
106 while (state.KeepRunning()) {
107 points->clear();
108 indices->clear();
109 Tessellator::TessellateConvexInternal(path, *points, *indices, 1.0f);
110 single_point_count = indices->size();
111 point_count += indices->size();
112 }
113 state.counters["SinglePointCount"] = single_point_count;
114 state.counters["TotalPointCount"] = point_count;
115 }

References impeller::Tessellator::TessellateConvexInternal().

## ◆ BM_Polyline()

template<class... Args>

static void impeller::BM_Polyline | ( | benchmark::State & | state,
|  | Args &&... | args
| ) |  |
| static

Definition at line 41 of file geometry_benchmarks.cc.

41 {
42 auto args_tuple = std::make_tuple(std::move(args)...);
43 auto path = std::get<Path>(args_tuple);
44
45 size_t point_count = 0u;
46 size_t single_point_count = 0u;
47 auto points = std::make_unique<std::vector<Point>>();
48 points->reserve(2048);
49 while (state.KeepRunning()) {
50 auto polyline = path.CreatePolyline(
51 // Clang-tidy doesn't know that the points get moved back before
52 // getting moved again in this loop.
53 // NOLINTNEXTLINE(clang-analyzer-cplusplus.Move)
54 1.0f, std::move(points),
55 [&points](Path::Polyline::PointBufferPtr reclaimed) {
56 points = std::move(reclaimed);
57 });
58 single_point_count = polyline.points->size();
59 point_count += single_point_count;
60 }
61 state.counters["SinglePointCount"] = single_point_count;
62 state.counters["TotalPointCount"] = point_count;
63 }

References impeller::Path::Polyline::points, and polyline.

## ◆ BM_StrokePolyline()

template<class... Args>

static void impeller::BM_StrokePolyline | ( | benchmark::State & | state,
|  | Args &&... | args
| ) |  |
| static

Definition at line 66 of file geometry_benchmarks.cc.

66 {
67 auto args_tuple = std::make_tuple(std::move(args)...);
68 auto path = std::get<Path>(args_tuple);
69 auto cap = std::get<Cap>(args_tuple);
70 auto join = std::get<Join>(args_tuple);
71
72 const Scalar stroke_width = 5.0f;
73 const Scalar miter_limit = 10.0f;
74 const Scalar scale = 1.0f;
75
76 auto points = std::make_unique<std::vector<Point>>();
77 points->reserve(2048);
78 auto polyline =
79 path.CreatePolyline(1.0f, std::move(points),
80 [&points](Path::Polyline::PointBufferPtr reclaimed) {
81 points = std::move(reclaimed);
82 });
83
84 size_t point_count = 0u;
85 size_t single_point_count = 0u;
86 while (state.KeepRunning()) {
87 auto vertices = ImpellerBenchmarkAccessor::GenerateSolidStrokeVertices(
88 polyline, stroke_width, miter_limit, join, cap, scale);
89 single_point_count = vertices.size();
90 point_count += single_point_count;
91 }
92 state.counters["SinglePointCount"] = single_point_count;
93 state.counters["TotalPointCount"] = point_count;
94 }

References impeller::ImpellerBenchmarkAccessor::GenerateSolidStrokeVertices(), polyline, scale, and stroke_width.

## ◆ BuildGLArguments()

template<class... Type>

std::string impeller::BuildGLArguments | ( | Type... | args | ) |

Definition at line 65 of file proc_table_gles.h.

65 {
66 std::stringstream stream;
67 stream << "(";
68 BuildGLArgumentsStream(stream, args...);
69 stream << ")";
70 return stream.str();
71 }

References BuildGLArgumentsStream().

Referenced by impeller::GLProc< T >::operator()().

## ◆ BuildGLArgumentsStream() [1/3]

constexpr void impeller::BuildGLArgumentsStream | ( | std::stringstream & | stream | ) |
| constexpr

Definition at line 53 of file proc_table_gles.h.

53 {}

## ◆ BuildGLArgumentsStream() [2/3]

template<class Type >

void impeller::BuildGLArgumentsStream | ( | std::stringstream & | stream,
|  | Type | arg
| ) |  |

Definition at line 49 of file proc_table_gles.h.

49 {
50 stream << arg;
51 }

Referenced by BuildGLArguments(), and BuildGLArgumentsStream().

## ◆ BuildGLArgumentsStream() [3/3]

template<class Type , class... Rest>

void impeller::BuildGLArgumentsStream | ( | std::stringstream & | stream,
|  | Type | arg,
|  | Rest... | other_args
| ) |  |

Definition at line 56 of file proc_table_gles.h.

58 {
59 BuildGLArgumentsStream(stream, arg);
60 stream << ", ";
61 BuildGLArgumentsStream(stream, other_args...);
62 }

References BuildGLArgumentsStream().

## ◆ BulkUpdateAtlasBitmap()

static bool impeller::BulkUpdateAtlasBitmap | ( | const GlyphAtlas & | atlas,
|  | std::shared_ptr< BlitPass > & | blit_pass,
|  | HostBuffer & | host_buffer,
|  | const std::shared_ptr< Texture > & | texture,
|  | const std::vector< FontGlyphPair > & | new_pairs,
|  | size_t | start_index,
|  | size_t | end_index
| ) |  |
| static

Batch render to a single surface.

This is only safe for use when updating a fresh texture.

Definition at line 255 of file typographer_context_skia.cc.

261 {
262 TRACE_EVENT0("impeller", __FUNCTION__);
263
264 bool has_color = atlas.GetType() == GlyphAtlas::Type::kColorBitmap;
265
266 SkBitmap bitmap;
267 bitmap.setInfo(GetImageInfo(atlas, Size(texture->GetSize())));
268 if (!bitmap.tryAllocPixels()) {
269 return false;
270 }
271
272 auto surface = SkSurfaces::WrapPixels(bitmap.pixmap());
273 if (!surface) {
274 return false;
275 }
276 auto canvas = surface->getCanvas();
277 if (!canvas) {
278 return false;
279 }
280
281 for (size_t i = start_index; i < end_index; i++) {
282 const FontGlyphPair& pair = new_pairs[i];
283 auto data = atlas.FindFontGlyphBounds(pair);
284 if (!data.has_value()) {
285 continue;
286 }
287 auto [pos, bounds, placeholder] = data.value();
288 FML_DCHECK(!placeholder);
289 Size size = pos.GetSize();
290 if (size.IsEmpty()) {
291 continue;
292 }
293
294 DrawGlyph(canvas, SkPoint::Make(pos.GetLeft(), pos.GetTop()),
295 pair.scaled_font, pair.glyph, bounds, pair.glyph.properties,
296 has_color);
297 }
298
299 // Writing to a malloc'd buffer and then copying to the staging buffers
300 // benchmarks as substantially faster on a number of Android devices.
301 BufferView buffer_view = host_buffer.Emplace(
302 bitmap.getAddr(0, 0),
303 texture->GetSize().Area() *
304 BytesPerPixelForPixelFormat(
305 atlas.GetTexture()->GetTextureDescriptor().format),
306 DefaultUniformAlignment());
307
308 return blit_pass->AddCopy(std::move(buffer_view), //
309 texture, //
310 IRect::MakeXYWH(0, 0, texture->GetSize().width,
311 texture->GetSize().height));
312 }

References buffer_view, BytesPerPixelForPixelFormat(), data, DefaultUniformAlignment(), DrawGlyph(), impeller::HostBuffer::Emplace(), impeller::GlyphAtlas::FindFontGlyphBounds(), GetImageInfo(), impeller::GlyphAtlas::GetTexture(), impeller::GlyphAtlas::GetType(), impeller::FontGlyphPair::glyph, impeller::TSize< T >::IsEmpty(), impeller::GlyphAtlas::kColorBitmap, impeller::TRect< T >::MakeXYWH(), impeller::SubpixelGlyph::properties, and impeller::FontGlyphPair::scaled_font.

Referenced by impeller::TypographerContextSkia::CreateGlyphAtlas().

## ◆ BytesPerPixelForPixelFormat()

constexpr size_t impeller::BytesPerPixelForPixelFormat | ( | PixelFormat | format | ) |
| constexpr

Definition at line 466 of file formats.h.

466 {
467 switch (format) {
468 case PixelFormat::kUnknown:
469 return 0u;
470 case PixelFormat::kA8UNormInt:
471 case PixelFormat::kR8UNormInt:
472 case PixelFormat::kS8UInt:
473 return 1u;
474 case PixelFormat::kR8G8UNormInt:
475 return 2u;
476 case PixelFormat::kR8G8B8A8UNormInt:
477 case PixelFormat::kR8G8B8A8UNormIntSRGB:
478 case PixelFormat::kB8G8R8A8UNormInt:
479 case PixelFormat::kB8G8R8A8UNormIntSRGB:
480 case PixelFormat::kB10G10R10XRSRGB:
481 case PixelFormat::kB10G10R10XR:
482 return 4u;
483 case PixelFormat::kD24UnormS8Uint:
484 return 4u;
485 case PixelFormat::kD32FloatS8UInt:
486 return 5u;
487 case PixelFormat::kR16G16B16A16Float:
488 case PixelFormat::kB10G10R10A10XR:
489 return 8u;
490 case PixelFormat::kR32G32B32A32Float:
491 return 16u;
492 }
493 return 0u;
494 }

References kA8UNormInt, kB10G10R10A10XR, kB10G10R10XR, kB10G10R10XRSRGB, kB8G8R8A8UNormInt, kB8G8R8A8UNormIntSRGB, kD24UnormS8Uint, kD32FloatS8UInt, kR16G16B16A16Float, kR32G32B32A32Float, kR8G8B8A8UNormInt, kR8G8B8A8UNormIntSRGB, kR8G8UNormInt, kR8UNormInt, kS8UInt, and kUnknown.

Referenced by impeller::BlitPass::AddCopy(), BulkUpdateAtlasBitmap(), impeller::BlitCopyBufferToTextureCommandGLES::Encode(), impeller::TextureDescriptor::GetByteSizeOfAllMipLevels(), impeller::TextureDescriptor::GetByteSizeOfBaseMipLevel(), impeller::TextureDescriptor::GetBytesPerRow(), impeller::Allocator::MinimumBytesPerRow(), and UpdateAtlasBitmap().

## ◆ CanClearAttachment()

constexpr bool impeller::CanClearAttachment | ( | LoadAction | action | ) |
| constexpr

Definition at line 239 of file formats.h.

239 {
240 switch (action) {
241 case LoadAction::kLoad:
242 return false;
243 case LoadAction::kDontCare:
244 case LoadAction::kClear:
245 return true;
246 }
247 FML_UNREACHABLE();
248 }

References kClear, kDontCare, and kLoad.

## ◆ CanDiscardAttachmentWhenDone()

constexpr bool impeller::CanDiscardAttachmentWhenDone | ( | StoreAction | action | ) |
| constexpr

Definition at line 250 of file formats.h.

250 {
251 switch (action) {
252 case StoreAction::kStore:
253 case StoreAction::kStoreAndMultisampleResolve:
254 return false;
255 case StoreAction::kDontCare:
256 case StoreAction::kMultisampleResolve:
257 return true;
258 }
259 FML_UNREACHABLE();
260 }

References kDontCare, kMultisampleResolve, kStore, and kStoreAndMultisampleResolve.

## ◆ ChooseAlphaCompositionMode()

static std::optional<vk::CompositeAlphaFlagBitsKHR> impeller::ChooseAlphaCompositionMode | ( | vk::CompositeAlphaFlagsKHR | flags | ) |
| static

Definition at line 97 of file khr_swapchain_impl_vk.cc.

98 {
99 if (flags & vk::CompositeAlphaFlagBitsKHR::eInherit) {
100 return vk::CompositeAlphaFlagBitsKHR::eInherit;
101 }
102 if (flags & vk::CompositeAlphaFlagBitsKHR::ePreMultiplied) {
103 return vk::CompositeAlphaFlagBitsKHR::ePreMultiplied;
104 }
105 if (flags & vk::CompositeAlphaFlagBitsKHR::ePostMultiplied) {
106 return vk::CompositeAlphaFlagBitsKHR::ePostMultiplied;
107 }
108 if (flags & vk::CompositeAlphaFlagBitsKHR::eOpaque) {
109 return vk::CompositeAlphaFlagBitsKHR::eOpaque;
110 }
111
112 return std::nullopt;
113 }

## ◆ ChooseSurfaceFormat()

static std::optional<vk::SurfaceFormatKHR> impeller::ChooseSurfaceFormat | ( | const std::vector< vk::SurfaceFormatKHR > & | formats,
|  | PixelFormat | preference
| ) |  |
| static

Definition at line 75 of file khr_swapchain_impl_vk.cc.

77 {
78 const auto colorspace = vk::ColorSpaceKHR::eSrgbNonlinear;
79 const auto vk_preference =
80 vk::SurfaceFormatKHR{ToVKImageFormat(preference), colorspace};
81 if (ContainsFormat(formats, vk_preference)) {
82 return vk_preference;
83 }
84
85 std::vector<vk::SurfaceFormatKHR> options = {
86 {vk::Format::eB8G8R8A8Unorm, colorspace},
87 {vk::Format::eR8G8B8A8Unorm, colorspace}};
88 for (const auto& format : options) {
89 if (ContainsFormat(formats, format)) {
90 return format;
91 }
92 }
93
94 return std::nullopt;
95 }

References ContainsFormat(), and ToVKImageFormat().

## ◆ ClipColor()

static constexpr Vector3 impeller::ClipColor | ( | Vector3 | color | ) |
| inline static constexpr

Definition at line 67 of file color.cc.

67 {
68 Scalar lum = Luminosity(color);
69 Scalar mn = std::min(std::min(color.x, color.y), color.z);
70 Scalar mx = std::max(std::max(color.x, color.y), color.z);
71 // `lum - mn` and `mx - lum` will always be >= 0 in the following conditions,
72 // so adding a tiny value is enough to make these divisions safe.
73 if (mn < 0.0f) {
74 color = lum + (((color - lum) * lum) / (lum - mn + kEhCloseEnough));
75 }
76 if (mx > 1.0) {
77 color =
78 lum + (((color - lum) * (1.0f - lum)) / (mx - lum + kEhCloseEnough));
79 }
80 return color;
81 }

References kEhCloseEnough, Luminosity(), impeller::Vector3::x, impeller::Vector3::y, and impeller::Vector3::z.

Referenced by SetLuminosity().

## ◆ Close()

IMPELLER_API void impeller::Close | ( | PathBuilder * | builder | ) |

Definition at line 38 of file tessellator.cc.

38 {
39 builder->Close();
40 }

References impeller::PathBuilder::Close().

Referenced by impeller::testing::TEST(), and impeller::testing::TEST_P().

## ◆ ColorAttachmentToString()

std::string impeller::ColorAttachmentToString | ( | const ColorAttachment & | color | ) |

Definition at line 123 of file formats.cc.

123 {
124 std::stringstream stream;
125 stream << AttachmentToString(color) << ",";
126 stream << "ClearColor=(" << ColorToString(color.clear_color) << ")";
127 return stream.str();
128 }

References AttachmentToString(), impeller::ColorAttachment::clear_color, and ColorToString().

Referenced by impeller::RenderTarget::ToString().

## ◆ ColorToString()

std::string impeller::ColorToString | ( | const Color & | color | ) |

Definition at line 333 of file color.cc.

333 {
334 return SPrintF("R=%.1f,G=%.1f,B=%.1f,A=%.1f", //
335 color.red, //
336 color.green, //
337 color.blue, //
338 color.alpha //
339 );
340 }

References impeller::Color::alpha, impeller::Color::blue, impeller::Color::green, impeller::Color::red, and SPrintF().

Referenced by ColorAttachmentToString().

## ◆ ComponentChoose()

static constexpr Vector3 impeller::ComponentChoose | ( | Vector3 | a,
|  | Vector3 | b,
|  | Vector3 | value,
|  | Scalar | cutoff
| ) |  |
| inline static constexpr

Definition at line 101 of file color.cc.

104 {
105 return Vector3(value.x > cutoff ? b.x : a.x, //
106 value.y > cutoff ? b.y : a.y, //
107 value.z > cutoff ? b.z : a.z //
108 );
109 }

References impeller::saturated::b, value, impeller::Vector3::x, impeller::Vector3::y, and impeller::Vector3::z.

Referenced by impeller::Color::Blend().

## ◆ CompressionTypeToString()

constexpr const char* impeller::CompressionTypeToString | ( | CompressionType | type | ) |
| constexpr

Definition at line 24 of file texture_descriptor.h.

24 {
25 switch (type) {
26 case CompressionType::kLossless:
27 return "Lossless";
28 case CompressionType::kLossy:
29 return "Lossy";
30 }
31 FML_UNREACHABLE();
32 }

References kLossless, kLossy, and type.

Referenced by TextureDescriptorToString().

## ◆ ComputeCubicSubdivisions() [1/2]

Scalar impeller::ComputeCubicSubdivisions | ( | float | scale_factor,
|  | const CubicPathComponent & | cub
| ) |  |

Returns the minimum number of evenly spaced (in the parametric sense) line segments that the cubic must be chopped into in order to guarantee all lines stay within a distance of "1/intolerance" pixels from the true curve.

The scale_factor should be the max basis XY of the current transform.

Definition at line 47 of file wangs_formula.cc.

48 {
49 return ComputeCubicSubdivisions(scale_factor, cub.p1, cub.cp1, cub.cp2,
50 cub.p2);
51 }

References ComputeCubicSubdivisions(), impeller::CubicPathComponent::cp1, impeller::CubicPathComponent::cp2, impeller::CubicPathComponent::p1, and impeller::CubicPathComponent::p2.

## ◆ ComputeCubicSubdivisions() [2/2]

Scalar impeller::ComputeCubicSubdivisions | ( | Scalar | scale_factor,
|  | Point | p0,
|  | Point | p1,
|  | Point | p2,
|  | Point | p3
| ) |  |

Returns the minimum number of evenly spaced (in the parametric sense) line segments that the cubic must be chopped into in order to guarantee all lines stay within a distance of "1/intolerance" pixels from the true curve.

The scale_factor should be the max basis XY of the current transform.

Definition at line 23 of file wangs_formula.cc.

27 {
28 Scalar k = scale_factor * .75f * kPrecision;
29 Point a = (p0 - p1 * 2 + p2).Abs();
30 Point b = (p1 - p2 * 2 + p3).Abs();
31 return std::sqrt(k * length(a.Max(b)));
32 }

References impeller::saturated::b, and impeller::TPoint< T >::Max().

Referenced by ComputeCubicSubdivisions(), impeller::CubicPathComponent::CountLinearPathComponents(), and impeller::CubicPathComponent::ToLinearPathComponents().

## ◆ computeErf7()

static Scalar impeller::computeErf7 | ( | Scalar | x | ) |
| static

Definition at line 60 of file solid_rrect_blur_contents.cc.

60 {
61 x *= kTwoOverSqrtPi;
62 float xx = x * x;
63 x = x + (0.24295 + (0.03395 + 0.0104 * xx) * xx) * (x * xx);
64 return x / sqrt(1.0 + x * x);
65 }

References kTwoOverSqrtPi, and x.

Referenced by SetupFragInfo().

## ◆ ComputeFractionalPosition()

static constexpr Scalar impeller::ComputeFractionalPosition | ( | Scalar | value | ) |
| static constexpr

Definition at line 63 of file text_frame.cc.

63 {
64 value += 0.125;
65 value = (value - floorf(value));
66 if (value < 0.25) {
67 return 0;
68 }
69 if (value < 0.5) {
70 return 0.25;
71 }
72 if (value < 0.75) {
73 return 0.5;
74 }
75 return 0.75;
76 }

References value.

Referenced by impeller::TextFrame::ComputeSubpixelPosition().

## ◆ ComputeGlyphSize()

static Rect impeller::ComputeGlyphSize | ( | const SkFont & | font,
|  | const SubpixelGlyph & | glyph,
|  | Scalar | scale
| ) |  |
| static

Definition at line 387 of file typographer_context_skia.cc.

389 {
390 SkRect scaled_bounds;
391 SkPaint glyph_paint;
392 if (glyph.properties.has_value() && glyph.properties->stroke) {
393 glyph_paint.setStroke(true);
394 glyph_paint.setStrokeWidth(glyph.properties->stroke_width * scale);
395 glyph_paint.setStrokeCap(ToSkiaCap(glyph.properties->stroke_cap));
396 glyph_paint.setStrokeJoin(ToSkiaJoin(glyph.properties->stroke_join));
397 glyph_paint.setStrokeMiter(glyph.properties->stroke_miter);
398 }
399 font.getBounds(&glyph.glyph.index, 1, &scaled_bounds, &glyph_paint);
400
401 // Expand the bounds of glyphs at subpixel offsets by 2 in the x direction.
402 Scalar adjustment = 0.0;
403 if (glyph.subpixel_offset != Point(0, 0)) {
404 adjustment = 1.0;
405 }
406 return Rect::MakeLTRB(scaled_bounds.fLeft - adjustment, scaled_bounds.fTop,
407 scaled_bounds.fRight + adjustment,
408 scaled_bounds.fBottom);
409 };

References impeller::SubpixelGlyph::glyph, impeller::Glyph::index, impeller::TRect< Scalar >::MakeLTRB(), impeller::SubpixelGlyph::properties, scale, and impeller::SubpixelGlyph::subpixel_offset.

## ◆ ComputeNextAtlasSize()

static ISize impeller::ComputeNextAtlasSize | ( | const std::shared_ptr< GlyphAtlasContext > & | atlas_context,
|  | const std::vector< FontGlyphPair > & | extra_pairs,
|  | std::vector< Rect > & | glyph_positions,
|  | const std::vector< Rect > & | glyph_sizes,
|  | size_t | glyph_index_start,
|  | int64_t | max_texture_height
| ) |  |
| static

Definition at line 167 of file typographer_context_skia.cc.

173 {
174 // Because we can't grow the skyline packer horizontally, pick a reasonable
175 // large width for all atlases.
176 static constexpr int64_t kAtlasWidth = 4096;
177 static constexpr int64_t kMinAtlasHeight = 1024;
178
179 ISize current_size = ISize(kAtlasWidth, kMinAtlasHeight);
180 if (atlas_context->GetAtlasSize().height > current_size.height) {
181 current_size.height = atlas_context->GetAtlasSize().height * 2;
182 }
183
184 auto height_adjustment = atlas_context->GetAtlasSize().height;
185 while (current_size.height <= max_texture_height) {
186 std::shared_ptr<RectanglePacker> rect_packer;
187 if (atlas_context->GetRectPacker() || glyph_index_start) {
188 rect_packer = RectanglePacker::Factory(
189 kAtlasWidth,
190 current_size.height - atlas_context->GetAtlasSize().height);
191 } else {
192 rect_packer = RectanglePacker::Factory(kAtlasWidth, current_size.height);
193 }
194 glyph_positions.erase(glyph_positions.begin() + glyph_index_start,
195 glyph_positions.end());
196 atlas_context->UpdateRectPacker(rect_packer);
197 auto next_index = PairsFitInAtlasOfSize(
198 extra_pairs, current_size, glyph_positions, glyph_sizes,
199 height_adjustment, rect_packer, glyph_index_start);
200 if (next_index == extra_pairs.size()) {
201 return current_size;
202 }
203 current_size = ISize(current_size.width, current_size.height * 2);
204 }
205 return {};
206 }

References impeller::RectanglePacker::Factory(), impeller::TSize< T >::height, PairsFitInAtlasOfSize(), and impeller::TSize< T >::width.

Referenced by impeller::TypographerContextSkia::CreateGlyphAtlas().

## ◆ ComputeQuadradicSubdivisions() [1/2]

Scalar impeller::ComputeQuadradicSubdivisions | ( | Scalar | scale_factor,
|  | const QuadraticPathComponent & | quad
| ) |  |

Returns the minimum number of evenly spaced (in the parametric sense) line segments that the quadratic must be chopped into in order to guarantee all lines stay within a distance of "1/intolerance" pixels from the true curve.

The scale_factor should be the max basis XY of the current transform.

Definition at line 42 of file wangs_formula.cc.

43 {
44 return ComputeQuadradicSubdivisions(scale_factor, quad.p1, quad.cp, quad.p2);
45 }

References ComputeQuadradicSubdivisions(), impeller::QuadraticPathComponent::cp, impeller::QuadraticPathComponent::p1, and impeller::QuadraticPathComponent::p2.

## ◆ ComputeQuadradicSubdivisions() [2/2]

Scalar impeller::ComputeQuadradicSubdivisions | ( | Scalar | scale_factor,
|  | Point | p0,
|  | Point | p1,
|  | Point | p2
| ) |  |

Returns the minimum number of evenly spaced (in the parametric sense) line segments that the quadratic must be chopped into in order to guarantee all lines stay within a distance of "1/intolerance" pixels from the true curve.

The scale_factor should be the max basis XY of the current transform.

Definition at line 34 of file wangs_formula.cc.

37 {
38 Scalar k = scale_factor * .25f * kPrecision;
39 return std::sqrt(k * length(p0 - p1 * 2 + p2));
40 }

Referenced by ComputeQuadradicSubdivisions(), impeller::QuadraticPathComponent::CountLinearPathComponents(), and impeller::QuadraticPathComponent::ToLinearPathComponents().

## ◆ ComputeQuadrantDivisions()

static size_t impeller::ComputeQuadrantDivisions | ( | Scalar | pixel_radius | ) |
| static

Definition at line 246 of file tessellator.cc.

246 {
247 if (pixel_radius <= 0.0) {
248 return 1;
249 }
250 int radius_index = ceil(pixel_radius);
251 if (radius_index < kPrecomputedDivisionCount) {
252 return kPrecomputedDivisions[radius_index];
253 }
254
255 // For a circle with N divisions per quadrant, the maximum deviation of
256 // the polgyon approximation from the true circle will be at the center
257 // of the base of each triangular pie slice. We can compute that distance
258 // by finding the midpoint of the line of the first slice and compare
259 // its distance from the center of the circle to the radius. We will aim
260 // to have the length of that bisector to be within |kCircleTolerance|
261 // from the radius in pixels.
262 //
263 // Each vertex will appear at an angle of:
264 // theta(i) = (kPi / 2) * (i / N) // for i in [0..N]
265 // with each point falling at:
266 // point(i) = r * (cos(theta), sin(theta))
267 // If we consider the unit circle to simplify the calculations below then
268 // we need to scale the tolerance from its absolute quantity into a unit
269 // circle fraction:
270 // k = tolerance / radius
271 // Using this scaled tolerance below to avoid multiplying by the radius
272 // throughout all of the math, we have:
273 // first point = (1, 0) // theta(0) == 0
274 // theta = kPi / 2 / N // theta(1)
275 // second point = (cos(theta), sin(theta)) = (c, s)
276 // midpoint = (first + second) * 0.5 = ((1 + c)/2, s/2)
277 // |midpoint| = sqrt((1 + c)*(1 + c)/4 + s*s/4)
278 // = sqrt((1 + c + c + c*c + s*s) / 4)
279 // = sqrt((1 + 2c + 1) / 4)
280 // = sqrt((2 + 2c) / 4)
281 // = sqrt((1 + c) / 2)
282 // = cos(theta / 2) // using half-angle cosine formula
283 // error = 1 - |midpoint| = 1 - cos(theta / 2)
284 // cos(theta/2) = 1 - error
285 // theta/2 = acos(1 - error)
286 // kPi / 2 / N / 2 = acos(1 - error)
287 // kPi / 4 / acos(1 - error) = N
288 // Since we need error <= k, we want divisions >= N, so we use:
289 // N = ceil(kPi / 4 / acos(1 - k))
290 //
291 // Math is confirmed in https://math.stackexchange.com/a/4132095
292 // (keeping in mind that we are computing quarter circle divisions here)
293 // which also points out a performance optimization that is accurate
294 // to within an over-estimation of 1 division would be:
295 // N = ceil(kPi / 4 / sqrt(2 * k))
296 // Since we have precomputed the divisions for radii up to 1024, we can
297 // afford to be more accurate using the acos formula here for larger radii.
298 double k = Tessellator::kCircleTolerance / pixel_radius;
299 return ceil(kPiOver4 / std::acos(1 - k));
300 }

References impeller::Tessellator::kCircleTolerance, kPiOver4, kPrecomputedDivisionCount, and kPrecomputedDivisions.

Referenced by impeller::Tessellator::FilledCircle(), impeller::Tessellator::FilledEllipse(), impeller::Tessellator::FilledRoundRect(), impeller::Tessellator::RoundCapLine(), and impeller::Tessellator::StrokedCircle().

## ◆ ComputeSaveLayerCoverage()

std::optional< Rect > impeller::ComputeSaveLayerCoverage | ( | const Rect & | content_coverage,
|  | const Matrix & | effect_transform,
|  | const Rect & | coverage_limit,
|  | const std::shared_ptr< FilterContents > & | image_filter,
|  | bool | flood_output_coverage = `false`,
|  | bool | flood_input_coverage = `false`
| ) |  |

Compute the coverage of a subpass in the global coordinate space.

Parameters

  content_coverage | the computed coverage of the contents of the save layer. This value may be empty if the save layer has no contents, or Rect::Maximum if the contents are unbounded (like a destructive blend).
  effect_transform | The CTM of the subpass.
  coverage_limit | The current clip coverage. This is used to bound the subpass size.
  image_filter | A subpass image filter, or nullptr.
  flood_output_coverage | Whether the coverage should be flooded to clip coverage regardless of input coverage. This should be set to true when the restore Paint has a destructive blend mode.
  flood_input_coverage | Whther the content coverage should be flooded. This should be set to true if the paint has a backdrop filter or if there is a transparent black effecting color filter.

The coverage computation expects `content_coverage` to be in the child coordinate space. `effect_transform` is used to transform this back into the global coordinate space. A return value of std::nullopt indicates that the coverage is empty or otherwise does not intersect with the parent coverage limit and should be discarded.

Definition at line 19 of file save_layer_utils.cc.

25 {
26 Rect coverage = content_coverage;
27 // There are three conditions that should cause input coverage to flood, the
28 // first is the presence of a backdrop filter on the saveLayer. The second is
29 // the presence of a color filter that effects transparent black on the
30 // saveLayer. The last is the presence of unbounded content within the
31 // saveLayer (such as a drawPaint, bdf, et cetera). Note that unbounded
32 // coverage is handled in the display list dispatcher.
33 //
34 // Backdrop filters apply before the saveLayer is restored. The presence of
35 // a backdrop filter causes the content coverage of the saveLayer to be
36 // unbounded.
37 //
38 // If there is a color filter that needs to flood its output. The color filter
39 // is applied before any image filters, so this floods input coverage and not
40 // the output coverage. Technically, we only need to flood the output of the
41 // color filter and could allocate a render target sized just to the content,
42 // but we don't currenty have the means to do so. Flooding the coverage is a
43 // non-optimal but technically correct way to render this.
44 //
45 // If the saveLayer contains unbounded content, then at this point the
46 // dl_dispatcher will have set content coverage to Rect::MakeMaximum().
47 if (flood_input_coverage) {
48 coverage = Rect::MakeMaximum();
49 }
50
51 // The content coverage must be scaled by any image filters present on the
52 // saveLayer paint. For example, if a saveLayer has a coverage limit of
53 // 100x100, but it has a Matrix image filter that scales by one half, the
54 // actual coverage limit is 200x200.
55 if (image_filter) {
56 // Transform the input coverage into the global coordinate space before
57 // computing the bounds limit intersection. This is the "worst case"
58 // coverage value before we intersect with the content coverage below.
59 std::optional<Rect> source_coverage_limit =
60 image_filter->GetSourceCoverage(effect_transform, coverage_limit);
61 if (!source_coverage_limit.has_value()) {
62 // No intersection with parent coverage limit.
63 return std::nullopt;
64 }
65 // The image filter may change the coverage limit required to flood
66 // the parent layer. Returning the source coverage limit so that we
67 // can guarantee the render target is larger enough.
68 //
69 // See note below on flood_output_coverage.
70 if (flood_output_coverage || coverage.IsMaximum()) {
71 return source_coverage_limit;
72 }
73
74 // Trimming the content coverage by the coverage limit can reduce memory
75 // bandwith. But in cases where there are animated matrix filters, such as
76 // in the framework's zoom transition, the changing scale values continually
77 // change the source_coverage_limit. Intersecting the source_coverage_limit
78 // with the coverage may result in slightly different texture sizes each
79 // frame of the animation. This leads to non-optimal allocation patterns as
80 // differently sized textures cannot be reused. Hence the following
81 // herustic: If the coverage is within a semi-arbitrary percentage of the
82 // intersected coverage, then just use the transformed coverage. In other
83 // cases, use the intersection.
84 auto transformed_coverage = coverage.TransformBounds(effect_transform);
85 auto intersected_coverage =
86 transformed_coverage.Intersection(source_coverage_limit.value());
87 if (intersected_coverage.has_value() &&
88 SizeDifferenceUnderThreshold(transformed_coverage.GetSize(),
89 intersected_coverage->GetSize(),
90 kDefaultSizeThreshold)) {
91 // Returning the transformed coverage is always correct, it just may
92 // be larger than the clip area or onscreen texture.
93 return transformed_coverage;
94 }
95 return intersected_coverage;
96 }
97
98 // If the input coverage is maximum, just return the coverage limit that
99 // is already in the global coordinate space.
100 //
101 // If flood_output_coverage is true, then the restore is applied with a
102 // destructive blend mode that requires flooding to the coverage limit.
103 // Technically we could only allocated a render target as big as the input
104 // coverage and then use a decal sampling mode to perform the flood. Returning
105 // the coverage limit is a correct but non optimal means of ensuring correct
106 // rendering.
107 if (flood_output_coverage || coverage.IsMaximum()) {
108 return coverage_limit;
109 }
110
111 // Transform the input coverage into the global coordinate space before
112 // computing the bounds limit intersection.
113 Rect transformed_coverage = coverage.TransformBounds(effect_transform);
114 std::optional<Rect> intersection =
115 transformed_coverage.Intersection(coverage_limit);
116 if (!intersection.has_value()) {
117 return std::nullopt;
118 }
119 // The the resulting coverage rect is nearly the same as the coverage_limit,
120 // round up to the coverage_limit.
121 Rect intersect_rect = intersection.value();
122 if (SizeDifferenceUnderThreshold(intersect_rect.GetSize(),
123 coverage_limit.GetSize(),
124 kDefaultSizeThreshold)) {
125 return coverage_limit;
126 }
127
128 return intersect_rect;
129 }

References impeller::TRect< T >::GetSize(), impeller::TRect< T >::Intersection(), impeller::TRect< T >::IsMaximum(), impeller::TRect< Scalar >::MakeMaximum(), and impeller::TRect< T >::TransformBounds().

Referenced by impeller::Canvas::SaveLayer(), and impeller::testing::TEST().

## ◆ ConfigureAttachment()

static bool impeller::ConfigureAttachment | ( | const Attachment & | desc,
|  | MTLRenderPassAttachmentDescriptor * | attachment
| ) |  |
| static

Definition at line 56 of file render_pass_mtl.mm.

57 {
58 if (!desc.texture) {
59 return false;
60 }
61
62 attachment.texture = TextureMTL::Cast(*desc.texture).GetMTLTexture();
63 attachment.loadAction = ToMTLLoadAction(desc.load_action);
64 attachment.storeAction = ToMTLStoreAction(desc.store_action);
65
66 if (!ConfigureResolveTextureAttachment(desc, attachment)) {
67 return false;
68 }
69
70 return true;
71 }

References impeller::BackendCast< TextureMTL, Texture >::Cast(), ConfigureResolveTextureAttachment(), impeller::TextureMTL::GetMTLTexture(), impeller::Attachment::load_action, impeller::Attachment::store_action, impeller::Attachment::texture, ToMTLLoadAction(), and ToMTLStoreAction().

Referenced by ConfigureColorAttachment(), ConfigureDepthAttachment(), and ConfigureStencilAttachment().

## ◆ ConfigureBlending()

void impeller::ConfigureBlending | ( | const ProcTableGLES & | gl,
|  | const ColorAttachmentDescriptor * | color
| ) |  |

Definition at line 46 of file render_pass_gles.cc.

47 {
48 if (color->blending_enabled) {
49 gl.Enable(GL_BLEND);
50 gl.BlendFuncSeparate(
51 ToBlendFactor(color->src_color_blend_factor), // src color
52 ToBlendFactor(color->dst_color_blend_factor), // dst color
53 ToBlendFactor(color->src_alpha_blend_factor), // src alpha
54 ToBlendFactor(color->dst_alpha_blend_factor) // dst alpha
55 );
56 gl.BlendEquationSeparate(
57 ToBlendOperation(color->color_blend_op), // mode color
58 ToBlendOperation(color->alpha_blend_op) // mode alpha
59 );
60 } else {
61 gl.Disable(GL_BLEND);
62 }
63
64 {
65 const auto is_set = [](ColorWriteMask mask,
66 ColorWriteMask check) -> GLboolean {
67 return (mask & check) ? GL_TRUE : GL_FALSE;
68 };
69
70 gl.ColorMask(
71 is_set(color->write_mask, ColorWriteMaskBits::kRed), // red
72 is_set(color->write_mask, ColorWriteMaskBits::kGreen), // green
73 is_set(color->write_mask, ColorWriteMaskBits::kBlue), // blue
74 is_set(color->write_mask, ColorWriteMaskBits::kAlpha) // alpha
75 );
76 }
77 }

References impeller::ColorAttachmentDescriptor::alpha_blend_op, impeller::ColorAttachmentDescriptor::blending_enabled, impeller::ColorAttachmentDescriptor::color_blend_op, impeller::ColorAttachmentDescriptor::dst_alpha_blend_factor, impeller::ColorAttachmentDescriptor::dst_color_blend_factor, kAlpha, kBlue, kGreen, kRed, impeller::ColorAttachmentDescriptor::src_alpha_blend_factor, impeller::ColorAttachmentDescriptor::src_color_blend_factor, ToBlendFactor(), ToBlendOperation(), and impeller::ColorAttachmentDescriptor::write_mask.

Referenced by EncodeCommandsInReactor().

## ◆ ConfigureColorAttachment()

static bool impeller::ConfigureColorAttachment | ( | const ColorAttachment & | desc,
|  | MTLRenderPassColorAttachmentDescriptor * | attachment
| ) |  |
| static

Definition at line 73 of file render_pass_mtl.mm.

75 {
76 if (!ConfigureAttachment(desc, attachment)) {
77 return false;
78 }
79 attachment.clearColor = ToMTLClearColor(desc.clear_color);
80 return true;
81 }

References impeller::ColorAttachment::clear_color, ConfigureAttachment(), and ToMTLClearColor().

Referenced by ToMTLRenderPassDescriptor().

## ◆ ConfigureDepthAttachment()

static bool impeller::ConfigureDepthAttachment | ( | const DepthAttachment & | desc,
|  | MTLRenderPassDepthAttachmentDescriptor * | attachment
| ) |  |
| static

Definition at line 83 of file render_pass_mtl.mm.

85 {
86 if (!ConfigureAttachment(desc, attachment)) {
87 return false;
88 }
89 attachment.clearDepth = desc.clear_depth;
90 return true;
91 }

References impeller::DepthAttachment::clear_depth, and ConfigureAttachment().

Referenced by ToMTLRenderPassDescriptor().

## ◆ ConfigureFBO()

static std::optional<GLuint> impeller::ConfigureFBO | ( | const ProcTableGLES & | gl,
|  | const std::shared_ptr< Texture > & | texture,
|  | GLenum | fbo_type
| ) |  |
| static

Definition at line 50 of file blit_command_gles.cc.

53 {
54 auto handle = TextureGLES::Cast(texture.get())->GetGLHandle();
55 if (!handle.has_value()) {
56 return std::nullopt;
57 }
58
59 if (TextureGLES::Cast(*texture).IsWrapped()) {
60 // The texture is attached to the default FBO, so there's no need to
61 // create/configure one.
62 gl.BindFramebuffer(fbo_type, 0);
63 return 0;
64 }
65
66 GLuint fbo;
67 gl.GenFramebuffers(1u, &fbo);
68 gl.BindFramebuffer(fbo_type, fbo);
69
70 if (!TextureGLES::Cast(*texture).SetAsFramebufferAttachment(
71 fbo_type, TextureGLES::AttachmentType::kColor0)) {
72 VALIDATION_LOG << "Could not attach texture to framebuffer.";
73 DeleteFBO(gl, fbo, fbo_type);
74 return std::nullopt;
75 }
76
77 if (gl.CheckFramebufferStatus(fbo_type) != GL_FRAMEBUFFER_COMPLETE) {
78 VALIDATION_LOG << "Could not create a complete framebuffer.";
79 DeleteFBO(gl, fbo, fbo_type);
80 return std::nullopt;
81 }
82
83 return fbo;
84 };

References impeller::BackendCast< TextureGLES, Texture >::Cast(), DeleteFBO(), impeller::TextureGLES::GetGLHandle(), impeller::TextureGLES::IsWrapped(), impeller::TextureGLES::kColor0, impeller::TextureGLES::SetAsFramebufferAttachment(), and VALIDATION_LOG.

Referenced by impeller::BlitCopyTextureToTextureCommandGLES::Encode(), impeller::BlitCopyTextureToBufferCommandGLES::Encode(), and impeller::BlitResizeTextureCommandGLES::Encode().

## ◆ ConfigureResolveTextureAttachment()

static bool impeller::ConfigureResolveTextureAttachment | ( | const Attachment & | desc,
|  | MTLRenderPassAttachmentDescriptor * | attachment
| ) |  |
| static

Definition at line 27 of file render_pass_mtl.mm.

29 {
30 bool needs_resolve =
31 desc.store_action == StoreAction::kMultisampleResolve ||
32 desc.store_action == StoreAction::kStoreAndMultisampleResolve;
33
34 if (needs_resolve && !desc.resolve_texture) {
35 VALIDATION_LOG << "Resolve store action specified on attachment but no "
36 "resolve texture was specified.";
37 return false;
38 }
39
40 if (desc.resolve_texture && !needs_resolve) {
41 VALIDATION_LOG << "A resolve texture was specified even though the store "
42 "action doesn't require it.";
43 return false;
44 }
45
46 if (!desc.resolve_texture) {
47 return true;
48 }
49
50 attachment.resolveTexture =
51 TextureMTL::Cast(*desc.resolve_texture).GetMTLTexture();
52
53 return true;
54 }

References impeller::BackendCast< TextureMTL, Texture >::Cast(), impeller::TextureMTL::GetMTLTexture(), kMultisampleResolve, kStoreAndMultisampleResolve, impeller::Attachment::resolve_texture, impeller::Attachment::store_action, and VALIDATION_LOG.

Referenced by ConfigureAttachment().

## ◆ ConfigureStencil() [1/2]

void impeller::ConfigureStencil | ( | const ProcTableGLES & | gl,
|  | const PipelineDescriptor & | pipeline,
|  | uint32_t | stencil_reference
| ) |  |

Definition at line 97 of file render_pass_gles.cc.

99 {
100 if (!pipeline.HasStencilAttachmentDescriptors()) {
101 gl.Disable(GL_STENCIL_TEST);
102 return;
103 }
104
105 gl.Enable(GL_STENCIL_TEST);
106 const auto& front = pipeline.GetFrontStencilAttachmentDescriptor();
107 const auto& back = pipeline.GetBackStencilAttachmentDescriptor();
108
109 if (front.has_value() && back.has_value() && front == back) {
110 ConfigureStencil(GL_FRONT_AND_BACK, gl, *front, stencil_reference);
111 return;
112 }
113 if (front.has_value()) {
114 ConfigureStencil(GL_FRONT, gl, *front, stencil_reference);
115 }
116 if (back.has_value()) {
117 ConfigureStencil(GL_BACK, gl, *back, stencil_reference);
118 }
119 }

References ConfigureStencil(), impeller::PipelineDescriptor::GetBackStencilAttachmentDescriptor(), impeller::PipelineDescriptor::GetFrontStencilAttachmentDescriptor(), and impeller::PipelineDescriptor::HasStencilAttachmentDescriptors().

## ◆ ConfigureStencil() [2/2]

void impeller::ConfigureStencil | ( | GLenum | face,
|  | const ProcTableGLES & | gl,
|  | const StencilAttachmentDescriptor & | stencil,
|  | uint32_t | stencil_reference
| ) |  |

Definition at line 79 of file render_pass_gles.cc.

82 {
83 gl.StencilOpSeparate(
84 face, // face
85 ToStencilOp(stencil.stencil_failure), // stencil fail
86 ToStencilOp(stencil.depth_failure), // depth fail
87 ToStencilOp(stencil.depth_stencil_pass) // depth stencil pass
88 );
89 gl.StencilFuncSeparate(face, // face
90 ToCompareFunction(stencil.stencil_compare), // func
91 stencil_reference, // ref
92 stencil.read_mask // mask
93 );
94 gl.StencilMaskSeparate(face, stencil.write_mask);
95 }

References impeller::StencilAttachmentDescriptor::depth_failure, impeller::StencilAttachmentDescriptor::depth_stencil_pass, impeller::StencilAttachmentDescriptor::read_mask, impeller::StencilAttachmentDescriptor::stencil_compare, impeller::StencilAttachmentDescriptor::stencil_failure, ToCompareFunction(), ToStencilOp(), and impeller::StencilAttachmentDescriptor::write_mask.

Referenced by ConfigureStencil(), and EncodeCommandsInReactor().

## ◆ ConfigureStencilAttachment()

static bool impeller::ConfigureStencilAttachment | ( | const StencilAttachment & | desc,
|  | MTLRenderPassStencilAttachmentDescriptor * | attachment
| ) |  |
| static

Definition at line 93 of file render_pass_mtl.mm.

95 {
96 if (!ConfigureAttachment(desc, attachment)) {
97 return false;
98 }
99 attachment.clearStencil = desc.clear_stencil;
100 return true;
101 }

References impeller::StencilAttachment::clear_stencil, and ConfigureAttachment().

Referenced by ToMTLRenderPassDescriptor().

## ◆ ContainsFormat()

static bool impeller::ContainsFormat | ( | const std::vector< vk::SurfaceFormatKHR > & | formats,
|  | vk::SurfaceFormatKHR | format
| ) |  |
| static

Definition at line 70 of file khr_swapchain_impl_vk.cc.

71 {
72 return std::find(formats.begin(), formats.end(), format) != formats.end();
73 }

Referenced by ChooseSurfaceFormat().

## ◆ CornerContains()

static bool impeller::CornerContains | ( | const Point & | p,
|  | const Point & | corner,
|  | const Point & | direction,
|  | const Size & | radii
| ) |  |
| static

Definition at line 30 of file round_rect.cc.

33 {
34 FML_DCHECK(radii.width >= 0.0f && radii.height >= 0.0f);
35 if (radii.IsEmpty()) {
36 // This corner is not curved, therefore the containment is the same as
37 // the previously checked bounds containment.
38 return true;
39 }
40
41 // The positive X,Y distance between the corner and the point.
42 Point corner_relative = (corner - p) * direction;
43
44 // The distance from the "center" of the corner's elliptical curve.
45 // If both numbers are positive then we need to do an elliptical distance
46 // check to determine if it is inside the curve.
47 // If either number is negative, then the point is outside this quadrant
48 // and is governed by inclusion in the bounds and inclusion within other
49 // corners of this round rect. In that case, we return true here to allow
50 // further evaluation within other quadrants.
51 Point quadrant_relative = radii - corner_relative;
52 if (quadrant_relative.x <= 0.0f || quadrant_relative.y <= 0.0f) {
53 // Not within the curved quadrant of this corner, therefore "inside"
54 // relative to this one corner.
55 return true;
56 }
57
58 // Dividing the quadrant_relative point by the radii gives a corresponding
59 // location within a unit circle which can be more easily tested for
60 // containment. We can use x^2 + y^2 and compare it against the radius
61 // squared (1.0) to avoid the sqrt.
62 Point quadrant_unit_circle_point = quadrant_relative / radii;
63 return quadrant_unit_circle_point.GetLengthSquared() <= 1.0;
64 }

References impeller::TPoint< T >::GetLengthSquared(), impeller::TSize< T >::height, impeller::TSize< T >::IsEmpty(), impeller::TSize< T >::width, impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

Referenced by impeller::RoundRect::Contains().

## ◆ CreateBufferPool()

static PoolVMA impeller::CreateBufferPool | ( | VmaAllocator | allocator | ) |
| static

Definition at line 57 of file allocator_vk.cc.

57 {
58 vk::BufferCreateInfo buffer_info;
59 buffer_info.usage = vk::BufferUsageFlagBits::eVertexBuffer |
60 vk::BufferUsageFlagBits::eIndexBuffer |
61 vk::BufferUsageFlagBits::eUniformBuffer |
62 vk::BufferUsageFlagBits::eStorageBuffer |
63 vk::BufferUsageFlagBits::eTransferSrc |
64 vk::BufferUsageFlagBits::eTransferDst;
65 buffer_info.size = 1u; // doesn't matter
66 buffer_info.sharingMode = vk::SharingMode::eExclusive;
67 auto buffer_info_native =
68 static_cast<vk::BufferCreateInfo::NativeType>(buffer_info);
69
70 VmaAllocationCreateInfo allocation_info = {};
71 allocation_info.usage = VMA_MEMORY_USAGE_AUTO;
72 allocation_info.preferredFlags = static_cast<VkMemoryPropertyFlags>(
73 ToVKBufferMemoryPropertyFlags(StorageMode::kHostVisible));
74 allocation_info.flags = ToVmaAllocationBufferCreateFlags(
75 StorageMode::kHostVisible, /*readback=*/false);
76
77 uint32_t memTypeIndex;
78 auto result = vk::Result{vmaFindMemoryTypeIndexForBufferInfo(
79 allocator, &buffer_info_native, &allocation_info, &memTypeIndex)};
80 if (result != vk::Result::eSuccess) {
81 return {};
82 }
83
84 VmaPoolCreateInfo pool_create_info = {};
85 pool_create_info.memoryTypeIndex = memTypeIndex;
86 pool_create_info.flags = VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT;
87 pool_create_info.minBlockCount = 1;
88
89 VmaPool pool = {};
90 result = vk::Result{::vmaCreatePool(allocator, &pool_create_info, &pool)};
91 if (result != vk::Result::eSuccess) {
92 return {};
93 }
94 return {allocator, pool};
95 }

References kHostVisible, ToVKBufferMemoryPropertyFlags(), and ToVmaAllocationBufferCreateFlags().

## ◆ CreateCommandBuffer()

static id<MTLCommandBuffer> impeller::CreateCommandBuffer | ( | id< MTLCommandQueue > | queue | ) |
| static

Definition at line 117 of file command_buffer_mtl.mm.

117 {
118 #ifndef FLUTTER_RELEASE
119 if (@available(iOS 14.0, macOS 11.0, *)) {
120 auto desc = [[MTLCommandBufferDescriptor alloc] init];
121 // Degrades CPU performance slightly but is well worth the cost for typical
122 // Impeller workloads.
123 desc.errorOptions = MTLCommandBufferErrorOptionEncoderExecutionStatus;
124 return [queue commandBufferWithDescriptor:desc];
125 }
126 #endif // FLUTTER_RELEASE
127 return [queue commandBuffer];
128 }

## ◆ CreateCompatRenderPassForPipeline()

static vk::UniqueRenderPass impeller::CreateCompatRenderPassForPipeline | ( | const vk::Device & | device,
|  | const PipelineDescriptor & | desc
| ) |  |
| static

Render Pass We are NOT going to use the same render pass with the framebuffer (later) and the graphics pipeline (here). Instead, we are going to ensure that the sub-passes are compatible. To see the compatibility rules, see the Vulkan spec: https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/chap8.html#renderpass-compatibility

Definition at line 127 of file pipeline_vk.cc.

129 {
130 RenderPassBuilderVK builder;
131
132 for (const auto& [bind_point, color] : desc.GetColorAttachmentDescriptors()) {
133 builder.SetColorAttachment(bind_point, //
134 color.format, //
135 desc.GetSampleCount(), //
136 LoadAction::kDontCare, //
137 StoreAction::kDontCare //
138 );
139 }
140
141 if (auto depth = desc.GetDepthStencilAttachmentDescriptor();
142 depth.has_value()) {
143 builder.SetDepthStencilAttachment(desc.GetDepthPixelFormat(), //
144 desc.GetSampleCount(), //
145 LoadAction::kDontCare, //
146 StoreAction::kDontCare //
147 );
148 } else if (desc.HasStencilAttachmentDescriptors()) {
149 builder.SetStencilAttachment(desc.GetStencilPixelFormat(), //
150 desc.GetSampleCount(), //
151 LoadAction::kDontCare, //
152 StoreAction::kDontCare //
153 );
154 }
155
156 auto pass = builder.Build(device);
157 if (!pass) {
158 VALIDATION_LOG << "Failed to create render pass for pipeline: "
159 << desc.GetLabel();
160 return {};
161 }
162
163 #ifdef IMPELLER_DEBUG
164 ContextVK::SetDebugName(
165 device, pass.get(),
166 SPrintF("Compat Render Pass: %s", desc.GetLabel().data()));
167 #endif // IMPELLER_DEBUG
168
169 return pass;
170 }

References impeller::RenderPassBuilderVK::Build(), impeller::PipelineDescriptor::GetColorAttachmentDescriptors(), impeller::PipelineDescriptor::GetDepthPixelFormat(), impeller::PipelineDescriptor::GetDepthStencilAttachmentDescriptor(), impeller::PipelineDescriptor::GetLabel(), impeller::PipelineDescriptor::GetSampleCount(), impeller::PipelineDescriptor::GetStencilPixelFormat(), impeller::PipelineDescriptor::HasStencilAttachmentDescriptors(), kDontCare, impeller::RenderPassBuilderVK::SetColorAttachment(), impeller::ContextVK::SetDebugName(), impeller::RenderPassBuilderVK::SetDepthStencilAttachment(), impeller::RenderPassBuilderVK::SetStencilAttachment(), SPrintF(), and VALIDATION_LOG.

Referenced by impeller::PipelineVK::Create().

## ◆ CreateDefaultPipeline()

template<typename PipelineT >

static std::unique_ptr<PipelineT> impeller::CreateDefaultPipeline | ( | const Context & | context | ) |
| static

Definition at line 246 of file content_context.cc.

247 {
248 auto desc = PipelineT::Builder::MakeDefaultPipelineDescriptor(context);
249 if (!desc.has_value()) {
250 return nullptr;
251 }
252 // Apply default ContentContextOptions to the descriptor.
253 const auto default_color_format =
254 context.GetCapabilities()->GetDefaultColorFormat();
255 ContentContextOptions{.sample_count = SampleCount::kCount4,
256 .primitive_type = PrimitiveType::kTriangleStrip,
257 .color_attachment_pixel_format = default_color_format}
258 .ApplyToPipelineDescriptor(*desc);
259 return std::make_unique<PipelineT>(context, desc);
260 }

References impeller::Context::GetCapabilities(), kCount4, kTriangleStrip, and impeller::ContentContextOptions::sample_count.

## ◆ CreateDepthStencilDescriptor()

static id<MTLDepthStencilState> impeller::CreateDepthStencilDescriptor | ( | const PipelineDescriptor & | desc,
|  | id< MTLDevice > | device
| ) |  |
| static

Definition at line 97 of file pipeline_library_mtl.mm.

99 {
100 auto descriptor = ToMTLDepthStencilDescriptor(
101 desc.GetDepthStencilAttachmentDescriptor(), //
102 desc.GetFrontStencilAttachmentDescriptor(), //
103 desc.GetBackStencilAttachmentDescriptor() //
104 );
105 return [device newDepthStencilStateWithDescriptor:descriptor];
106 }

References impeller::PipelineDescriptor::GetBackStencilAttachmentDescriptor(), impeller::PipelineDescriptor::GetDepthStencilAttachmentDescriptor(), impeller::PipelineDescriptor::GetFrontStencilAttachmentDescriptor(), and ToMTLDepthStencilDescriptor().

## ◆ CreateGradientBuffer()

GradientData impeller::CreateGradientBuffer | ( | const std::vector< Color > & | colors,
|  | const std::vector< Scalar > & | stops
| ) |  |

Populate a vector with the interpolated color bytes for the linear gradient described by colors and stops.

Parameters

  colors |
  stops |

Returns
  GradientData

Definition at line 20 of file gradient.cc.

21 {
22 FML_DCHECK(stops.size() == colors.size());
23
24 uint32_t texture_size;
25 if (stops.size() == 2) {
26 texture_size = colors.size();
27 } else {
28 auto minimum_delta = 1.0;
29 for (size_t i = 1; i < stops.size(); i++) {
30 auto value = stops[i] - stops[i - 1];
31 // Smaller than kEhCloseEnough
32 if (value < 0.0001) {
33 continue;
34 }
35 if (value < minimum_delta) {
36 minimum_delta = value;
37 }
38 }
39 // Avoid creating textures that are absurdly large due to stops that are
40 // very close together.
41 // TODO(jonahwilliams): this should use a platform specific max texture
42 // size.
43 texture_size = std::min(
44 static_cast<uint32_t>(std::round(1.0 / minimum_delta)) + 1, 1024u);
45 }
46 GradientData data = {
47 .color_bytes = {},
48 .texture_size = texture_size,
49 };
50 data.color_bytes.reserve(texture_size * 4);
51
52 if (texture_size == colors.size() && colors.size() <= 1024) {
53 for (auto i = 0u; i < colors.size(); i++) {
54 AppendColor(colors[i], &data);
55 }
56 } else {
57 Color previous_color = colors[0];
58 auto previous_stop = 0.0;
59 auto previous_color_index = 0;
60
61 // The first index is always equal to the first color, exactly.
62 AppendColor(previous_color, &data);
63
64 for (auto i = 1u; i < texture_size - 1; i++) {
65 auto scaled_i = i / (texture_size - 1.0);
66 Color next_color = colors[previous_color_index + 1];
67 auto next_stop = stops[previous_color_index + 1];
68 // We're almost exactly equal to the next stop.
69 if (ScalarNearlyEqual(scaled_i, next_stop)) {
70 AppendColor(next_color, &data);
71
72 previous_color = next_color;
73 previous_stop = next_stop;
74 previous_color_index += 1;
75 } else if (scaled_i < next_stop) {
76 // We're still between the current stop and the next stop.
77 auto t = (scaled_i - previous_stop) / (next_stop - previous_stop);
78 auto mixed_color = Color::Lerp(previous_color, next_color, t);
79
80 AppendColor(mixed_color, &data);
81 } else {
82 // We've slightly overshot the previous stop.
83 previous_color = next_color;
84 previous_stop = next_stop;
85 previous_color_index += 1;
86 next_color = colors[previous_color_index + 1];
87 auto next_stop = stops[previous_color_index + 1];
88
89 auto t = (scaled_i - previous_stop) / (next_stop - previous_stop);
90 auto mixed_color = Color::Lerp(previous_color, next_color, t);
91
92 AppendColor(mixed_color, &data);
93 }
94 }
95 // The last index is always equal to the last color, exactly.
96 AppendColor(colors.back(), &data);
97 }
98 return data;
99 }

References AppendColor(), data, impeller::Color::Lerp(), ScalarNearlyEqual(), and value.

Referenced by impeller::testing::TEST().

## ◆ CreateGradientColors()

std::vector< StopData > impeller::CreateGradientColors | ( | const std::vector< Color > & | colors,
|  | const std::vector< Scalar > & | stops
| ) |  |

Populate a vector with the color and stop data for a gradient.

Parameters

  colors |
  stops |

Returns
  StopData

Definition at line 53 of file gradient_generator.cc.

54 {
55 FML_DCHECK(stops.size() == colors.size());
56
57 std::vector<StopData> result;
58 result.reserve(stops.size());
59 Scalar last_stop = 0;
60 for (auto i = 0u; i < stops.size(); i++) {
61 Scalar delta = stops[i] - last_stop;
62 Scalar inverse_delta = delta == 0.0f ? 0.0 : 1.0 / delta;
63 result.emplace_back(StopData{
64 .color = colors[i], .stop = stops[i], .inverse_delta = inverse_delta});
65 last_stop = stops[i];
66 }
67 return result;
68 }

References impeller::StopData::color.

## ◆ CreateGradientTexture()

std::shared_ptr< Texture > impeller::CreateGradientTexture | ( | const GradientData & | gradient_data,
|  | const std::shared_ptr< impeller::Context > & | context
| ) |  |

Create a host visible texture that contains the gradient defined by the provided gradient data.

Definition at line 16 of file gradient_generator.cc.

18 {
19 if (gradient_data.texture_size == 0) {
20 FML_DLOG(ERROR) << "Invalid gradient data.";
21 return nullptr;
22 }
23
24 impeller::TextureDescriptor texture_descriptor;
25 texture_descriptor.storage_mode = impeller::StorageMode::kHostVisible;
26 texture_descriptor.format = PixelFormat::kR8G8B8A8UNormInt;
27 texture_descriptor.size = {gradient_data.texture_size, 1};
28 auto texture =
29 context->GetResourceAllocator()->CreateTexture(texture_descriptor);
30 if (!texture) {
31 FML_DLOG(ERROR) << "Could not create Impeller texture.";
32 return nullptr;
33 }
34
35 auto data_mapping =
36 std::make_shared<fml::DataMapping>(gradient_data.color_bytes);
37 auto buffer =
38 context->GetResourceAllocator()->CreateBufferWithCopy(*data_mapping);
39
40 auto cmd_buffer = context->CreateCommandBuffer();
41 auto blit_pass = cmd_buffer->CreateBlitPass();
42 blit_pass->AddCopy(DeviceBuffer::AsBufferView(std::move(buffer)), texture);
43
44 if (!blit_pass->EncodeCommands() ||
45 !context->GetCommandQueue()->Submit({std::move(cmd_buffer)}).ok()) {
46 return nullptr;
47 }
48
49 texture->SetLabel(impeller::SPrintF("Gradient(%p)", texture.get()).c_str());
50 return texture;
51 }

References impeller::DeviceBuffer::AsBufferView(), impeller::GradientData::color_bytes, impeller::TextureDescriptor::format, kHostVisible, kR8G8B8A8UNormInt, impeller::TextureDescriptor::size, SPrintF(), impeller::TextureDescriptor::storage_mode, and impeller::GradientData::texture_size.

## ◆ CreateMappingFromAllocation()

std::shared_ptr< fml::Mapping > impeller::CreateMappingFromAllocation | ( | const std::shared_ptr< Allocation > & | allocation | ) |

Creates a mapping from allocation.

            No data copy occurs. Only a reference to the underlying
            allocation is bumped up.

            Changes to the underlying allocation will not be reflected in
            the mapping and must not change.

Parameters

  [in] | allocation | The allocation.

Returns
  A new mapping or nullptr if the argument allocation was invalid.

Definition at line 99 of file allocation.cc.

100 {
101 if (!allocation) {
102 return nullptr;
103 }
104 return std::make_shared<fml::NonOwnedMapping>(
105 reinterpret_cast<const uint8_t*>(allocation->GetBuffer()), //
106 allocation->GetLength().GetByteSize(), //
107 [allocation](auto, auto) {} //
108 );
109 }

Referenced by CreateMappingWithCopy(), PipelineCacheDataPersist(), and impeller::testing::TEST_P().

## ◆ CreateMappingWithCopy()

std::shared_ptr< fml::Mapping > impeller::CreateMappingWithCopy | ( | const uint8_t * | contents,
|  | Bytes | length
| ) |  |

Creates a mapping with copy of the bytes.

Parameters

  [in] | contents | The contents
  [in] | length | The length

Returns
  The new mapping or nullptr if the copy could not be performed.

Definition at line 83 of file allocation.cc.

84 {
85 if (contents == nullptr) {
86 return nullptr;
87 }
88
89 auto allocation = std::make_shared<Allocation>();
90 if (!allocation->Truncate(length)) {
91 return nullptr;
92 }
93
94 std::memmove(allocation->GetBuffer(), contents, length.GetByteSize());
95
96 return CreateMappingFromAllocation(allocation);
97 }

References CreateMappingFromAllocation(), and impeller::AllocationSize< Period >::GetByteSize().

## ◆ CreateMappingWithString() [1/2]

std::shared_ptr<fml::Mapping> impeller::CreateMappingWithString | ( | std::shared_ptr< const std::string > | string | ) |

Creates a mapping with string data.

            Only a reference to the underlying string is bumped up and the
            string is not copied.

Parameters

  [in] | string | The string

Returns
  A new mapping or nullptr in case of allocation failures.

## ◆ CreateMappingWithString() [2/2]

std::shared_ptr< fml::Mapping > impeller::CreateMappingWithString | ( | std::string | string | ) |

Creates a mapping with string data.

            The string is copied.

Parameters

  [in] | string | The string

Returns
  A new mapping or nullptr in case of allocation failures.

Definition at line 111 of file allocation.cc.

111 {
112 auto buffer = std::make_shared<std::string>(std::move(string));
113 return std::make_unique<fml::NonOwnedMapping>(
114 reinterpret_cast<const uint8_t*>(buffer->c_str()), buffer->length(),
115 [buffer](auto, auto) {});
116 }

Referenced by impeller::compiler::Compiler::Compiler().

## ◆ CreateMetalCommandQueue()

static id<MTLCommandQueue> impeller::CreateMetalCommandQueue | ( | id< MTLDevice > | device | ) |
| static

Definition at line 216 of file context_mtl.mm.

216 {
217 auto command_queue = device.newCommandQueue;
218 if (!command_queue) {
219 VALIDATION_LOG << "Could not set up the command queue.";
220 return nullptr;
221 }
222 command_queue.label = @"Impeller Command Queue";
223 return command_queue;
224 }

References VALIDATION_LOG.

Referenced by impeller::ContextMTL::Create().

## ◆ CreateMetalDevice()

static id<MTLDevice> impeller::CreateMetalDevice | ( |  | ) |
| static

Definition at line 212 of file context_mtl.mm.

212 {
213 return ::MTLCreateSystemDefaultDevice();
214 }

Referenced by impeller::ContextMTL::Create().

## ◆ CreatePathBuilder()

IMPELLER_API PathBuilder * impeller::CreatePathBuilder | ( |  | ) |

Definition at line 12 of file tessellator.cc.

12 {
13 return new PathBuilder();
14 }

## ◆ CreatePipelineFuture() [1/2]

PipelineFuture< ComputePipelineDescriptor > impeller::CreatePipelineFuture | ( | const Context & | context,
|  | std::optional< ComputePipelineDescriptor > | desc
| ) |  |

Definition at line 35 of file pipeline.cc.

37 {
38 if (!context.IsValid()) {
39 return {
40 desc,
41 RealizedFuture<std::shared_ptr<Pipeline<ComputePipelineDescriptor>>>(
42 nullptr)};
43 }
44
45 return context.GetPipelineLibrary()->GetPipeline(std::move(desc));
46 }

References impeller::Context::GetPipelineLibrary(), and impeller::Context::IsValid().

## ◆ CreatePipelineFuture() [2/2]

PipelineFuture< PipelineDescriptor > impeller::CreatePipelineFuture | ( | const Context & | context,
|  | std::optional< PipelineDescriptor > | desc
| ) |  |

Definition at line 24 of file pipeline.cc.

26 {
27 if (!context.IsValid()) {
28 return {desc, RealizedFuture<std::shared_ptr<Pipeline<PipelineDescriptor>>>(
29 nullptr)};
30 }
31
32 return context.GetPipelineLibrary()->GetPipeline(std::move(desc));
33 }

References impeller::Context::GetPipelineLibrary(), and impeller::Context::IsValid().

## ◆ CreateSampler()

static vk::UniqueSampler impeller::CreateSampler | ( | const vk::Device & | device,
|  | const SamplerDescriptor & | desc,
|  | const std::shared_ptr< YUVConversionVK > & | yuv_conversion
| ) |  |
| static

Definition at line 14 of file sampler_vk.cc.

17 {
18 const auto min_filter = ToVKSamplerMinMagFilter(desc.min_filter);
19 const auto mag_filter = ToVKSamplerMinMagFilter(desc.mag_filter);
20
21 const auto address_mode_u = ToVKSamplerAddressMode(desc.width_address_mode);
22 const auto address_mode_v = ToVKSamplerAddressMode(desc.height_address_mode);
23 const auto address_mode_w = ToVKSamplerAddressMode(desc.depth_address_mode);
24
25 vk::StructureChain<vk::SamplerCreateInfo,
26 // For VK_KHR_sampler_ycbcr_conversion
27 vk::SamplerYcbcrConversionInfo>
28 sampler_chain;
29
30 auto& sampler_info = sampler_chain.get();
31
32 sampler_info.magFilter = mag_filter;
33 sampler_info.minFilter = min_filter;
34 sampler_info.addressModeU = address_mode_u;
35 sampler_info.addressModeV = address_mode_v;
36 sampler_info.addressModeW = address_mode_w;
37 sampler_info.borderColor = vk::BorderColor::eFloatTransparentBlack;
38 sampler_info.maxLod = VK_LOD_CLAMP_NONE;
39
40 // https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkSamplerCreateInfo.html#_description
41 switch (desc.mip_filter) {
42 case MipFilter::kBase:
43 sampler_info.mipmapMode = vk::SamplerMipmapMode::eNearest;
44 sampler_info.minLod = sampler_info.maxLod = 0.0f;
45 break;
46 case MipFilter::kNearest:
47 sampler_info.mipmapMode = vk::SamplerMipmapMode::eNearest;
48 break;
49 case MipFilter::kLinear:
50 sampler_info.mipmapMode = vk::SamplerMipmapMode::eLinear;
51 break;
52 }
53
54 if (yuv_conversion && yuv_conversion->IsValid()) {
55 sampler_chain.get<vk::SamplerYcbcrConversionInfo>().conversion =
56 yuv_conversion->GetConversion();
57
58 // Spec: If sampler Y'CBCR conversion is enabled and the potential format
59 // features of the sampler Y'CBCR conversion do not support or enable
60 // separate reconstruction filters, minFilter and magFilter must be equal to
61 // the sampler Y'CBCR conversion's chromaFilter.
62 //
63 // We don't enable separate reconstruction filters. So, just do what the
64 // spec. says and use the conversions chromaFilter.
65 //
66 // See the validation VUID-VkSamplerCreateInfo-minFilter-01645 for more.
67 //
68 sampler_info.minFilter = sampler_info.magFilter =
69 yuv_conversion->GetDescriptor().get().chromaFilter;
70
71 // Spec: If sampler Y′CBCR conversion is enabled, addressModeU,
72 // addressModeV, and addressModeW must be
73 // VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, anisotropyEnable must be VK_FALSE,
74 // and unnormalizedCoordinates must be VK_FALSE.
75 //
76 // See the validation VUID-VkSamplerCreateInfo-addressModeU-01646 for more.
77 //
78 sampler_info.addressModeU = vk::SamplerAddressMode::eClampToEdge;
79 sampler_info.addressModeV = vk::SamplerAddressMode::eClampToEdge;
80 sampler_info.addressModeW = vk::SamplerAddressMode::eClampToEdge;
81 sampler_info.anisotropyEnable = false;
82 sampler_info.unnormalizedCoordinates = false;
83 } else {
84 sampler_chain.unlink<vk::SamplerYcbcrConversionInfo>();
85 }
86
87 auto sampler = device.createSamplerUnique(sampler_chain.get());
88 if (sampler.result != vk::Result::eSuccess) {
89 VALIDATION_LOG << "Could not create sampler: "
90 << vk::to_string(sampler.result);
91 return {};
92 }
93
94 if (!desc.label.empty()) {
95 ContextVK::SetDebugName(device, sampler.value.get(), desc.label.data());
96 }
97
98 return std::move(sampler.value);
99 }

References impeller::SamplerDescriptor::depth_address_mode, impeller::SamplerDescriptor::height_address_mode, kBase, kLinear, kNearest, impeller::SamplerDescriptor::label, impeller::SamplerDescriptor::mag_filter, impeller::SamplerDescriptor::min_filter, impeller::SamplerDescriptor::mip_filter, impeller::ContextVK::SetDebugName(), ToVKSamplerAddressMode(), ToVKSamplerMinMagFilter(), VALIDATION_LOG, and impeller::SamplerDescriptor::width_address_mode.

## ◆ CreateTextureForDecompressedImage()

static std::shared_ptr<Texture> impeller::CreateTextureForDecompressedImage | ( | const std::shared_ptr< Context > & | context,
|  | DecompressedImage & | decompressed_image,
|  | bool | enable_mipmapping
| ) |  |
| static

Definition at line 390 of file playground.cc.

393 {
394 TextureDescriptor texture_descriptor;
395 texture_descriptor.storage_mode = StorageMode::kDevicePrivate;
396 texture_descriptor.format = PixelFormat::kR8G8B8A8UNormInt;
397 texture_descriptor.size = decompressed_image.GetSize();
398 texture_descriptor.mip_count =
399 enable_mipmapping ? decompressed_image.GetSize().MipCount() : 1u;
400
401 auto texture =
402 context->GetResourceAllocator()->CreateTexture(texture_descriptor);
403 if (!texture) {
404 VALIDATION_LOG << "Could not allocate texture for fixture.";
405 return nullptr;
406 }
407
408 auto command_buffer = context->CreateCommandBuffer();
409 if (!command_buffer) {
410 FML_DLOG(ERROR) << "Could not create command buffer for mipmap generation.";
411 return nullptr;
412 }
413 command_buffer->SetLabel("Mipmap Command Buffer");
414
415 auto blit_pass = command_buffer->CreateBlitPass();
416 auto buffer_view = DeviceBuffer::AsBufferView(
417 context->GetResourceAllocator()->CreateBufferWithCopy(
418 *decompressed_image.GetAllocation()));
419 blit_pass->AddCopy(buffer_view, texture);
420 if (enable_mipmapping) {
421 blit_pass->SetLabel("Mipmap Blit Pass");
422 blit_pass->GenerateMipmap(texture);
423 }
424 blit_pass->EncodeCommands();
425 if (!context->GetCommandQueue()->Submit({command_buffer}).ok()) {
426 FML_DLOG(ERROR) << "Failed to submit blit pass command buffer.";
427 return nullptr;
428 }
429 return texture;
430 }

References impeller::DeviceBuffer::AsBufferView(), buffer_view, impeller::TextureDescriptor::format, impeller::DecompressedImage::GetAllocation(), impeller::DecompressedImage::GetSize(), kDevicePrivate, kR8G8B8A8UNormInt, impeller::TextureDescriptor::mip_count, impeller::TSize< T >::MipCount(), impeller::TextureDescriptor::size, impeller::TextureDescriptor::storage_mode, and VALIDATION_LOG.

Referenced by impeller::Playground::CreateTextureForMapping().

## ◆ CreateTextureFromDrawableFuture()

std::shared_ptr< TextureMTL > impeller::CreateTextureFromDrawableFuture | ( | TextureDescriptor | desc,
|  | const std::shared_future< id< CAMetalDrawable >> & | drawble_future
| ) |  |

Create a TextureMTL from a deferred drawable.

       This function is safe to call multiple times and will only call
       nextDrawable once.

Definition at line 41 of file lazy_drawable_holder.mm.

43 {
44 return std::make_shared<TextureMTL>(
45 desc, [drawble_future]() { return drawble_future.get().texture; },
46 /*wrapped=*/false, /*drawable=*/true);
47 }

Referenced by impeller::testing::TEST().

## ◆ CreateUniformMemberKey() [1/2]

static std::string impeller::CreateUniformMemberKey | ( | const std::string & | non_struct_member | ) |
| static

Definition at line 96 of file buffer_bindings_gles.cc.

97 {
98 return NormalizeUniformKey(non_struct_member);
99 }

References NormalizeUniformKey().

## ◆ CreateUniformMemberKey() [2/2]

static std::string impeller::CreateUniformMemberKey | ( | const std::string & | struct_name,
|  | const std::string & | member,
|  | bool | is_array
| ) |  |
| static

Definition at line 80 of file buffer_bindings_gles.cc.

82 {
83 std::string result;
84 result.reserve(struct_name.length() + member.length() + (is_array ? 4 : 1));
85 result += struct_name;
86 if (!member.empty()) {
87 result += '.';
88 result += member;
89 }
90 if (is_array) {
91 result += "[0]";
92 }
93 return NormalizeUniformKey(result);
94 }

References NormalizeUniformKey().

## ◆ CreateVertexBuffer()

template<class VertexType , size_t size>

VertexBuffer impeller::CreateVertexBuffer | ( | std::array< VertexType, size > | input,
|  | HostBuffer & | host_buffer
| ) |  |

Create an index-less vertex buffer from a fixed size array.

Definition at line 24 of file vertex_buffer_builder.h.

25 {
26 return VertexBuffer{
27 .vertex_buffer = host_buffer.Emplace(
28 input.data(), sizeof(VertexType) * size, alignof(VertexType)), //
29 .vertex_count = size, //
30 .index_type = IndexType::kNone, //
31 };
32 }

References impeller::HostBuffer::Emplace(), kNone, and impeller::VertexBuffer::vertex_buffer.

Referenced by AdvancedBlend(), PipelineBlend(), impeller::SolidRRectBlurContents::Render(), impeller::ClipContents::Render(), impeller::TextureContents::Render(), and RenderClipRestore().

## ◆ CreateVKImageView()

static vk::UniqueImageView impeller::CreateVKImageView | ( | const vk::Device & | device,
|  | const vk::Image & | image,
|  | const vk::SamplerYcbcrConversion & | yuv_conversion,
|  | const AHBProperties & | ahb_props,
|  | const AHardwareBuffer_Desc & | ahb_desc
| ) |  |
| static

Definition at line 179 of file ahb_texture_source_vk.cc.

184 {
185 const auto& ahb_format =
186 ahb_props.get<vk::AndroidHardwareBufferFormatPropertiesANDROID>();
187
188 vk::StructureChain<vk::ImageViewCreateInfo,
189 // Core in 1.1
190 vk::SamplerYcbcrConversionInfo>
191 view_chain;
192
193 auto& view_info = view_chain.get();
194
195 view_info.image = image;
196 view_info.viewType = vk::ImageViewType::e2D;
197 view_info.format = ahb_format.format;
198 view_info.subresourceRange.aspectMask = vk::ImageAspectFlagBits::eColor;
199 view_info.subresourceRange.baseMipLevel = 0u;
200 view_info.subresourceRange.baseArrayLayer = 0u;
201 view_info.subresourceRange.levelCount =
202 (ahb_desc.usage & AHARDWAREBUFFER_USAGE_GPU_MIPMAP_COMPLETE)
203 ? ISize{ahb_desc.width, ahb_desc.height}.MipCount()
204 : 1u;
205 view_info.subresourceRange.layerCount = ahb_desc.layers;
206
207 // We need a custom YUV conversion only if we don't recognize the format.
208 if (view_info.format == vk::Format::eUndefined) {
209 view_chain.get<vk::SamplerYcbcrConversionInfo>().conversion =
210 yuv_conversion;
211 } else {
212 view_chain.unlink<vk::SamplerYcbcrConversionInfo>();
213 }
214
215 auto image_view = device.createImageViewUnique(view_info);
216 if (image_view.result != vk::Result::eSuccess) {
217 VALIDATION_LOG << "Could not create external image view: "
218 << vk::to_string(image_view.result);
219 return {};
220 }
221
222 return std::move(image_view.value);
223 }

References VALIDATION_LOG, and impeller::TSize< T >::width.

Referenced by impeller::AHBTextureSourceVK::AHBTextureSourceVK().

## ◆ CreateVKImageWrapperForAndroidHarwareBuffer()

static vk::UniqueImage impeller::CreateVKImageWrapperForAndroidHarwareBuffer | ( | const vk::Device & | device,
|  | const AHBProperties & | ahb_props,
|  | const AHardwareBuffer_Desc & | ahb_desc
| ) |  |
| static

Definition at line 20 of file ahb_texture_source_vk.cc.

23 {
24 const auto& ahb_format =
25 ahb_props.get<vk::AndroidHardwareBufferFormatPropertiesANDROID>();
26
27 vk::StructureChain<vk::ImageCreateInfo,
28 // For VK_KHR_external_memory
29 vk::ExternalMemoryImageCreateInfo,
30 // For VK_ANDROID_external_memory_android_hardware_buffer
31 vk::ExternalFormatANDROID>
32 image_chain;
33
34 auto& image_info = image_chain.get<vk::ImageCreateInfo>();
35
36 vk::ImageUsageFlags image_usage_flags;
37 if (ahb_desc.usage & AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE) {
38 image_usage_flags |= vk::ImageUsageFlagBits::eSampled;
39 }
40 if (ahb_desc.usage & AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER) {
41 image_usage_flags |= vk::ImageUsageFlagBits::eColorAttachment;
42 }
43 if (ahb_desc.usage & AHARDWAREBUFFER_USAGE_COMPOSER_OVERLAY) {
44 image_usage_flags |= vk::ImageUsageFlagBits::eColorAttachment;
45 image_usage_flags |= vk::ImageUsageFlagBits::eInputAttachment;
46 image_usage_flags |= vk::ImageUsageFlagBits::eTransferDst;
47 }
48
49 vk::ImageCreateFlags image_create_flags;
50 if (ahb_desc.usage & AHARDWAREBUFFER_USAGE_PROTECTED_CONTENT) {
51 image_create_flags |= vk::ImageCreateFlagBits::eProtected;
52 }
53 if (ahb_desc.usage & AHARDWAREBUFFER_USAGE_GPU_CUBE_MAP) {
54 image_create_flags |= vk::ImageCreateFlagBits::eCubeCompatible;
55 }
56
57 image_info.imageType = vk::ImageType::e2D;
58 image_info.format = ahb_format.format;
59 image_info.extent.width = ahb_desc.width;
60 image_info.extent.height = ahb_desc.height;
61 image_info.extent.depth = 1;
62 image_info.mipLevels =
63 (ahb_desc.usage & AHARDWAREBUFFER_USAGE_GPU_MIPMAP_COMPLETE)
64 ? ISize{ahb_desc.width, ahb_desc.height}.MipCount()
65 : 1u;
66 image_info.arrayLayers = ahb_desc.layers;
67 image_info.samples = vk::SampleCountFlagBits::e1;
68 image_info.tiling = vk::ImageTiling::eOptimal;
69 image_info.usage = image_usage_flags;
70 image_info.flags = image_create_flags;
71 image_info.sharingMode = vk::SharingMode::eExclusive;
72 image_info.initialLayout = vk::ImageLayout::eUndefined;
73
74 image_chain.get<vk::ExternalMemoryImageCreateInfo>().handleTypes =
75 vk::ExternalMemoryHandleTypeFlagBits::eAndroidHardwareBufferANDROID;
76
77 // If the format isn't natively supported by Vulkan (i.e, be a part of the
78 // base vkFormat enum), an untyped "external format" must be specified when
79 // creating the image and the image views. Usually includes YUV formats.
80 if (ahb_format.format == vk::Format::eUndefined) {
81 image_chain.get<vk::ExternalFormatANDROID>().externalFormat =
82 ahb_format.externalFormat;
83 } else {
84 image_chain.unlink<vk::ExternalFormatANDROID>();
85 }
86
87 auto image = device.createImageUnique(image_chain.get());
88 if (image.result != vk::Result::eSuccess) {
89 VALIDATION_LOG << "Could not create image for external buffer: "
90 << vk::to_string(image.result);
91 return {};
92 }
93
94 return std::move(image.value);
95 }

References VALIDATION_LOG, and impeller::TSize< T >::width.

Referenced by impeller::AHBTextureSourceVK::AHBTextureSourceVK().

## ◆ CreateYUVConversion()

static std::shared_ptr<YUVConversionVK> impeller::CreateYUVConversion | ( | const ContextVK & | context,
|  | const AHBProperties & | ahb_props
| ) |  |
| static

Definition at line 141 of file ahb_texture_source_vk.cc.

143 {
144 YUVConversionDescriptorVK conversion_chain;
145
146 const auto& ahb_format =
147 ahb_props.get<vk::AndroidHardwareBufferFormatPropertiesANDROID>();
148
149 // See https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/5806
150 // Both features are required.
151 const bool supports_linear_filtering =
152 !!(ahb_format.formatFeatures &
153 vk::FormatFeatureFlagBits::eSampledImageYcbcrConversionLinearFilter) &&
154 !!(ahb_format.formatFeatures &
155 vk::FormatFeatureFlagBits::eSampledImageFilterLinear);
156 auto& conversion_info = conversion_chain.get();
157
158 conversion_info.format = ahb_format.format;
159 conversion_info.ycbcrModel = ahb_format.suggestedYcbcrModel;
160 conversion_info.ycbcrRange = ahb_format.suggestedYcbcrRange;
161 conversion_info.components = ahb_format.samplerYcbcrConversionComponents;
162 conversion_info.xChromaOffset = ahb_format.suggestedXChromaOffset;
163 conversion_info.yChromaOffset = ahb_format.suggestedYChromaOffset;
164 conversion_info.chromaFilter =
165 supports_linear_filtering ? vk::Filter::eLinear : vk::Filter::eNearest;
166
167 conversion_info.forceExplicitReconstruction = false;
168
169 if (conversion_info.format == vk::Format::eUndefined) {
170 auto& external_format = conversion_chain.get<vk::ExternalFormatANDROID>();
171 external_format.externalFormat = ahb_format.externalFormat;
172 } else {
173 conversion_chain.unlink<vk::ExternalFormatANDROID>();
174 }
175
176 return context.GetYUVConversionLibrary()->GetConversion(conversion_chain);
177 }

References external_format, and impeller::ContextVK::GetYUVConversionLibrary().

Referenced by impeller::AHBTextureSourceVK::AHBTextureSourceVK().

## ◆ CubicPathBoundingPopulateValues()

static void impeller::CubicPathBoundingPopulateValues | ( | std::vector< Scalar > & | values,
|  | Scalar | p1,
|  | Scalar | p2,
|  | Scalar | p3,
|  | Scalar | p4
| ) |  |
| static

Definition at line 378 of file path_component.cc.

382 {
383 const Scalar a = 3.0 * (-p1 + 3.0 * p2 - 3.0 * p3 + p4);
384 const Scalar b = 6.0 * (p1 - 2.0 * p2 + p3);
385 const Scalar c = 3.0 * (p2 - p1);
386
387 /*
388 * Boundary conditions.
389 */
390 if (NearZero(a)) {
391 if (NearZero(b)) {
392 return;
393 }
394
395 Scalar t = -c / b;
396 if (t >= 0.0 && t <= 1.0) {
397 values.emplace_back(t);
398 }
399 return;
400 }
401
402 Scalar b2Minus4AC = (b * b) - (4.0 * a * c);
403
404 if (b2Minus4AC < 0.0) {
405 return;
406 }
407
408 Scalar rootB2Minus4AC = ::sqrt(b2Minus4AC);
409
410 /* From Numerical Recipes in C.
411 *
412 * q = -1/2 (b + sign(b) sqrt[b^2 - 4ac])
413 * x1 = q / a
414 * x2 = c / q
415 */
416 Scalar q = (b < 0) ? -(b - rootB2Minus4AC) / 2 : -(b + rootB2Minus4AC) / 2;
417
418 {
419 Scalar t = q / a;
420 if (t >= 0.0 && t <= 1.0) {
421 values.emplace_back(t);
422 }
423 }
424
425 {
426 Scalar t = c / q;
427 if (t >= 0.0 && t <= 1.0) {
428 values.emplace_back(t);
429 }
430 }
431 }

References impeller::saturated::b, and NearZero().

Referenced by impeller::CubicPathComponent::Extrema().

## ◆ CubicSolve()

static Scalar impeller::CubicSolve | ( | Scalar | t,
|  | Scalar | p0,
|  | Scalar | p1,
|  | Scalar | p2,
|  | Scalar | p3
| ) |  |
| inline static

Definition at line 186 of file path_component.cc.

190 {
191 return (1 - t) * (1 - t) * (1 - t) * p0 + //
192 3 * (1 - t) * (1 - t) * t * p1 + //
193 3 * (1 - t) * t * t * p2 + //
194 t * t * t * p3;
195 }

Referenced by impeller::CubicPathComponent::Solve().

## ◆ CubicSolveDerivative()

static Scalar impeller::CubicSolveDerivative | ( | Scalar | t,
|  | Scalar | p0,
|  | Scalar | p1,
|  | Scalar | p2,
|  | Scalar | p3
| ) |  |
| inline static

Definition at line 197 of file path_component.cc.

201 {
202 return -3 * p0 * (1 - t) * (1 - t) + //
203 p1 * (3 * (1 - t) * (1 - t) - 6 * (1 - t) * t) +
204 p2 * (6 * (1 - t) * t - 3 * t * t) + //
205 3 * p3 * t * t;
206 }

Referenced by impeller::CubicPathComponent::SolveDerivative().

## ◆ CubicTo()

IMPELLER_API void impeller::CubicTo | ( | PathBuilder * | builder,
|  | Scalar | x1,
|  | Scalar | y1,
|  | Scalar | x2,
|  | Scalar | y2,
|  | Scalar | x3,
|  | Scalar | y3
| ) |  |

Definition at line 28 of file tessellator.cc.

34 {
35 builder->CubicCurveTo(Point(x1, y1), Point(x2, y2), Point(x3, y3));
36 }

References impeller::PathBuilder::CubicCurveTo().

## ◆ DebugToFramebufferError()

std::string impeller::DebugToFramebufferError | ( | int | status | ) |

Definition at line 9 of file formats_gles.cc.

9 {
10 switch (status) {
11 case GL_FRAMEBUFFER_UNDEFINED:
12 return "GL_FRAMEBUFFER_UNDEFINED";
13 case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
14 return "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT";
15 case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
16 return "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";
17 case GL_FRAMEBUFFER_UNSUPPORTED:
18 return "GL_FRAMEBUFFER_UNSUPPORTED";
19 case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
20 return "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE";
21 default:
22 return "Unknown error code: " + std::to_string(status);
23 }
24 }

Referenced by EncodeCommandsInReactor().

## ◆ DeepCompareMap()

template<class Key , class ComparableType , class = std::enable_if_t<std::is_base_of_v<ComparableBase, ComparableType>>>

bool impeller::DeepCompareMap | ( | const std::map< Key, std::shared_ptr< ComparableType >> & | lhs,
|  | const std::map< Key, std::shared_ptr< ComparableType >> & | rhs
| ) |  |

Definition at line 74 of file comparable.h.

75 {
76 if (lhs.size() != rhs.size()) {
77 return false;
78 }
79
80 for (auto i = lhs.begin(), j = rhs.begin(); i != lhs.end(); i++, j++) {
81 if (i->first != j->first) {
82 return false;
83 }
84
85 if (!DeepComparePointer(i->second, j->second)) {
86 return false;
87 }
88 }
89
90 return true;
91 }

References DeepComparePointer().

Referenced by impeller::PipelineDescriptor::IsEqual().

## ◆ DeepComparePointer()

template<class ComparableType , class = std::enable_if_t<std::is_base_of_v<ComparableBase, ComparableType>>>

bool impeller::DeepComparePointer | ( | const std::shared_ptr< ComparableType > & | lhs,
|  | const std::shared_ptr< ComparableType > & | rhs
| ) |  |

Definition at line 57 of file comparable.h.

58 {
59 if (lhs == rhs) {
60 return true;
61 }
62
63 if (lhs && rhs) {
64 return lhs->IsEqual(*rhs);
65 }
66
67 return false;
68 }

Referenced by DeepCompareMap(), impeller::ComputePipelineDescriptor::IsEqual(), impeller::Font::IsEqual(), impeller::PipelineDescriptor::IsEqual(), and impeller::PipelineLibraryGLES::ProgramKey::Equal::operator()().

## ◆ DefaultUniformAlignment()

constexpr size_t impeller::DefaultUniformAlignment | ( |  | ) |
| constexpr

Definition at line 14 of file platform.h.

14 {
15 #if FML_OS_IOS && !TARGET_OS_SIMULATOR
16 return 16u;
17 #else
18 return 256u;
19 #endif
20 }

Referenced by BulkUpdateAtlasBitmap(), impeller::HostBuffer::EmplaceStorageBuffer(), impeller::HostBuffer::EmplaceUniform(), impeller::RuntimeEffectContents::EmplaceVulkanUniform(), impeller::RuntimeEffectContents::Render(), and UpdateAtlasBitmap().

## ◆ DeleteFBO()

static void impeller::DeleteFBO | ( | const ProcTableGLES & | gl,
|  | GLuint | fbo,
|  | GLenum | type
| ) |  |
| static

Definition at line 43 of file blit_command_gles.cc.

43 {
44 if (fbo != GL_NONE) {
45 gl.BindFramebuffer(type, GL_NONE);
46 gl.DeleteFramebuffers(1u, &fbo);
47 }
48 };

References type.

Referenced by ConfigureFBO(), impeller::BlitCopyTextureToTextureCommandGLES::Encode(), impeller::BlitCopyTextureToBufferCommandGLES::Encode(), and impeller::BlitResizeTextureCommandGLES::Encode().

## ◆ DepthAttachmentToString()

std::string impeller::DepthAttachmentToString | ( | const DepthAttachment & | depth | ) |

Definition at line 130 of file formats.cc.

130 {
131 std::stringstream stream;
132 stream << AttachmentToString(depth) << ",";
133 stream << "ClearDepth=" << SPrintF("%.2f", depth.clear_depth);
134 return stream.str();
135 }

References AttachmentToString(), impeller::DepthAttachment::clear_depth, and SPrintF().

Referenced by impeller::RenderTarget::ToString().

## ◆ DescribeFramebufferAttachment()

static std::string impeller::DescribeFramebufferAttachment | ( | const ProcTableGLES & | gl,
|  | GLenum | attachment
| ) |  |
| static

Definition at line 246 of file proc_table_gles.cc.

247 {
248 GLint type = GL_NONE;
249 gl.GetFramebufferAttachmentParameteriv(
250 GL_FRAMEBUFFER, // target
251 attachment, // attachment
252 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, // parameter name
253 &type // parameter
254 );
255
256 if (type != GL_NONE) {
257 GLint object = GL_NONE;
258 gl.GetFramebufferAttachmentParameteriv(
259 GL_FRAMEBUFFER, // target
260 attachment, // attachment
261 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, // parameter name
262 &object // parameter
263 );
264 std::stringstream stream;
265 stream << AttachmentTypeString(type) << "(" << object << ")";
266 return stream.str();
267 }
268
269 return "No Attachment";
270 }

References AttachmentTypeString(), and type.

Referenced by impeller::ProcTableGLES::DescribeCurrentFramebuffer().

## ◆ DestroyPathBuilder()

IMPELLER_API void impeller::DestroyPathBuilder | ( | PathBuilder * | builder | ) |

Definition at line 16 of file tessellator.cc.

16 {
17 delete builder;
18 }

## ◆ DestroyTessellator()

void impeller::DestroyTessellator | ( | TESStesselator * | tessellator | ) |

Definition at line 163 of file tessellator_libtess.cc.

163 {
164 if (tessellator != nullptr) {
165 ::tessDeleteTess(tessellator);
166 }
167 }

Referenced by impeller::TessellatorLibtess::TessellatorLibtess().

## ◆ DestroyVertices()

IMPELLER_API void impeller::DestroyVertices | ( | Vertices * | vertices | ) |

Definition at line 76 of file tessellator.cc.

76 {
77 delete vertices->points;
78 delete vertices;
79 }

References impeller::Vertices::points.

## ◆ DetermineIfANGLE()

static bool impeller::DetermineIfANGLE | ( | const std::string & | version | ) |
| static

Definition at line 43 of file description_gles.cc.

43 {
44 return version.find("ANGLE") != std::string::npos;
45 }

Referenced by impeller::DescriptionGLES::DescriptionGLES().

## ◆ DetermineIfES()

static bool impeller::DetermineIfES | ( | const std::string & | version | ) |
| static

Definition at line 39 of file description_gles.cc.

39 {
40 return HasPrefix(version, "OpenGL ES");
41 }

References HasPrefix().

Referenced by impeller::DescriptionGLES::DescriptionGLES().

## ◆ DetermineVersion()

static std::optional<Version> impeller::DetermineVersion | ( | std::string | version | ) |
| static

Definition at line 47 of file description_gles.cc.

47 {
48 // Format for OpenGL "OpenGL<space>ES<space><version
49 // number><space><vendor-specific information>".
50 //
51 // Format for OpenGL SL "OpenGL<space>ES<space>GLSL<space>ES<space><version
52 // number><space><vendor-specific information>"
53 //
54 // The prefixes appear to be absent on Desktop GL.
55
56 version = StripPrefix(version, "OpenGL ES ");
57 version = StripPrefix(version, "GLSL ES ");
58
59 if (version.empty()) {
60 return std::nullopt;
61 }
62
63 std::stringstream stream;
64 for (size_t i = 0; i < version.size(); i++) {
65 const auto character = version[i];
66 if (std::isdigit(character) || character == '.') {
67 stream << character;
68 } else {
69 break;
70 }
71 }
72 std::istringstream istream;
73 istream.str(stream.str());
74 std::vector<size_t> version_components;
75 for (std::string version_component;
76 std::getline(istream, version_component, '.');) {
77 version_components.push_back(std::stoul(version_component));
78 }
79 return Version::FromVector(version_components);
80 }

References impeller::Version::FromVector(), and StripPrefix().

Referenced by impeller::DescriptionGLES::DescriptionGLES().

## ◆ DeviceHasUnifiedMemoryArchitecture()

static bool impeller::DeviceHasUnifiedMemoryArchitecture | ( | id< MTLDevice > | device | ) |
| static

Definition at line 40 of file allocator_mtl.mm.

40 {
41 if (@available(ios 13.0, tvos 13.0, macOS 10.15, *)) {
42 return [device hasUnifiedMemory];
43 } else {
44 #if FML_OS_IOS
45 // iOS devices where the availability check can fail always have had UMA.
46 return true;
47 #else
48 // Mac devices where the availability check can fail have never had UMA.
49 return false;
50 #endif
51 }
52 FML_UNREACHABLE();
53 }

## ◆ DeviceMaxTextureSizeSupported()

ISize impeller::DeviceMaxTextureSizeSupported | ( | id< MTLDevice > | device | ) |

Definition at line 55 of file allocator_mtl.mm.

55 {
56 // Since Apple didn't expose API for us to get the max texture size, we have
57 // to use hardcoded data from
58 // https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
59 // According to the feature set table, there are two supported max sizes :
60 // 16384 and 8192 for devices flutter support. The former is used on macs and
61 // latest ios devices. The latter is used on old ios devices.
62 if (@available(macOS 10.15, iOS 13, tvOS 13, *)) {
63 if ([device supportsFamily:MTLGPUFamilyApple3] ||
64 [device supportsFamily:MTLGPUFamilyMacCatalyst1] ||
65 [device supportsFamily:MTLGPUFamilyMac1]) {
66 return {16384, 16384};
67 }
68 return {8192, 8192};
69 } else {
70 #if FML_OS_IOS
71 if ([device supportsFeatureSet:MTLFeatureSet_iOS_GPUFamily4_v1] ||
72 [device supportsFeatureSet:MTLFeatureSet_iOS_GPUFamily3_v1]) {
73 return {16384, 16384};
74 }
75 #endif
76 #if FML_OS_MACOSX
77 return {16384, 16384};
78 #endif
79 return {8192, 8192};
80 }
81 }

Referenced by InferMetalCapabilities().

## ◆ DeviceSupportsComputeSubgroups()

static bool impeller::DeviceSupportsComputeSubgroups | ( | id< MTLDevice > | device | ) |
| static

Definition at line 44 of file context_mtl.mm.

44 {
45 bool supports_subgroups = false;
46 // Refer to the "SIMD-scoped reduction operations" feature in the table
47 // below: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
48 if (@available(ios 13.0, tvos 13.0, macos 10.15, *)) {
49 supports_subgroups = [device supportsFamily:MTLGPUFamilyApple7] ||
50 [device supportsFamily:MTLGPUFamilyMac2];
51 }
52 return supports_subgroups;
53 }

Referenced by InferMetalCapabilities().

## ◆ DeviceSupportsDeviceTransientTargets()

static bool impeller::DeviceSupportsDeviceTransientTargets | ( | id< MTLDevice > | device | ) |
| static

Definition at line 19 of file allocator_mtl.mm.

19 {
20 // Refer to the "Memoryless render targets" feature in the table below:
21 // https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
22 if (@available(ios 13.0, tvos 13.0, macos 10.15, *)) {
23 return [device supportsFamily:MTLGPUFamilyApple2];
24 } else {
25 #if FML_OS_IOS
26 // This is perhaps redundant. But, just in case we somehow get into a case
27 // where Impeller runs on iOS versions less than 8.0 and/or without A8
28 // GPUs, we explicitly check feature set support.
29 return [device supportsFeatureSet:MTLFeatureSet_iOS_GPUFamily2_v1];
30 #else
31 // MacOS devices with Apple GPUs are only available with macos 10.15 and
32 // above. So, if we are here, it is safe to assume that memory-less targets
33 // are not supported.
34 return false;
35 #endif
36 }
37 FML_UNREACHABLE();
38 }

## ◆ DeviceSupportsFramebufferFetch()

static bool impeller::DeviceSupportsFramebufferFetch | ( | id< MTLDevice > | device | ) |
| static

Definition at line 24 of file context_mtl.mm.

24 {
25 // The iOS simulator lies about supporting framebuffer fetch.
26 #if FML_OS_IOS_SIMULATOR
27 return false;
28 #else // FML_OS_IOS_SIMULATOR
29
30 if (@available(macOS 10.15, iOS 13, tvOS 13, *)) {
31 return [device supportsFamily:MTLGPUFamilyApple2];
32 }
33 // According to
34 // https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf , Apple2
35 // corresponds to iOS GPU family 2, which supports A8 devices.
36 #if FML_OS_IOS
37 return [device supportsFeatureSet:MTLFeatureSet_iOS_GPUFamily2_v1];
38 #else
39 return false;
40 #endif // FML_OS_IOS
41 #endif // FML_OS_IOS_SIMULATOR
42 }

Referenced by InferMetalCapabilities().

## ◆ DeviceTypeToString()

constexpr const char* impeller::DeviceTypeToString | ( | DeviceTypeVK | type | ) |
| constexpr

Definition at line 212 of file driver_info_vk.cc.

212 {
213 switch (type) {
214 case DeviceTypeVK::kUnknown:
215 return "Unknown";
216 case DeviceTypeVK::kIntegratedGPU:
217 return "Integrated GPU";
218 case DeviceTypeVK::kDiscreteGPU:
219 return "Discrete GPU";
220 case DeviceTypeVK::kVirtualGPU:
221 return "Virtual GPU";
222 case DeviceTypeVK::kCPU:
223 return "CPU";
224 }
225 FML_UNREACHABLE();
226 }

References kCPU, kDiscreteGPU, kIntegratedGPU, kUnknown, kVirtualGPU, and type.

Referenced by impeller::DriverInfoVK::DumpToLog().

## ◆ DisplayListToTexture()

std::shared_ptr< Texture > impeller::DisplayListToTexture | ( | const sk_sp< flutter::DisplayList > & | display_list,
|  | ISize | size,
|  | AiksContext & | context,
|  | bool | reset_host_buffer,
|  | bool | generate_mips
| ) |  |

Render the provided display list to a texture with the given size.

Definition at line 1249 of file dl_dispatcher.cc.

1254 {
1255 int mip_count = 1;
1256 if (generate_mips) {
1257 mip_count = size.MipCount();
1258 }
1259 // Do not use the render target cache as the lifecycle of this texture
1260 // will outlive a particular frame.
1261 impeller::RenderTargetAllocator render_target_allocator =
1262 impeller::RenderTargetAllocator(
1263 context.GetContext()->GetResourceAllocator());
1264 impeller::RenderTarget target;
1265 if (context.GetContext()->GetCapabilities()->SupportsOffscreenMSAA()) {
1266 target = render_target_allocator.CreateOffscreenMSAA(
1267 *context.GetContext(), // context
1268 size, // size
1269 /*mip_count=*/mip_count,
1270 "Picture Snapshot MSAA", // label
1271 impeller::RenderTarget::
1272 kDefaultColorAttachmentConfigMSAA // color_attachment_config
1273 );
1274 } else {
1275 target = render_target_allocator.CreateOffscreen(
1276 *context.GetContext(), // context
1277 size, // size
1278 /*mip_count=*/mip_count,
1279 "Picture Snapshot", // label
1280 impeller::RenderTarget::
1281 kDefaultColorAttachmentConfig // color_attachment_config
1282 );
1283 }
1284
1285 SkIRect sk_cull_rect = SkIRect::MakeWH(size.width, size.height);
1286 impeller::FirstPassDispatcher collector(
1287 context.GetContentContext(), impeller::Matrix(), Rect::MakeSize(size));
1288 display_list->Dispatch(collector, sk_cull_rect);
1289 impeller::CanvasDlDispatcher impeller_dispatcher(
1290 context.GetContentContext(), //
1291 target, //
1292 /*is_onscreen=*/false, //
1293 display_list->root_has_backdrop_filter(), //
1294 display_list->max_root_blend_mode(), //
1295 impeller::IRect::MakeSize(size) //
1296 );
1297 const auto& [data, count] = collector.TakeBackdropData();
1298 impeller_dispatcher.SetBackdropData(data, count);
1299 display_list->Dispatch(impeller_dispatcher, sk_cull_rect);
1300 impeller_dispatcher.FinishRecording();
1301
1302 if (reset_host_buffer) {
1303 context.GetContentContext().GetTransientsBuffer().Reset();
1304 }
1305 context.GetContentContext().GetLazyGlyphAtlas()->ResetTextFrames();
1306 context.GetContext()->DisposeThreadLocalCachedResources();
1307
1308 return target.GetRenderTargetTexture();
1309 }

References impeller::RenderTargetAllocator::CreateOffscreen(), impeller::RenderTargetAllocator::CreateOffscreenMSAA(), data, impeller::CanvasDlDispatcher::FinishRecording(), impeller::AiksContext::GetContentContext(), impeller::AiksContext::GetContext(), impeller::ContentContext::GetLazyGlyphAtlas(), impeller::RenderTarget::GetRenderTargetTexture(), impeller::ContentContext::GetTransientsBuffer(), impeller::TSize< T >::height, impeller::TRect< T >::MakeSize(), impeller::TRect< Scalar >::MakeSize(), impeller::TSize< T >::MipCount(), impeller::HostBuffer::Reset(), impeller::CanvasDlDispatcher::SetBackdropData(), impeller::FirstPassDispatcher::TakeBackdropData(), and impeller::TSize< T >::width.

Referenced by impeller::GoldenPlaygroundTest::MakeScreenshot(), impeller::GoldenPlaygroundTest::OpenPlaygroundHere(), impeller::testing::TEST_F(), and impeller::testing::TEST_P().

## ◆ DoColorBlend()

static constexpr Color impeller::DoColorBlend | ( | Color | dst,
|  | Color | src,
|  | const std::function< Vector3(Vector3, Vector3)> & | blend_rgb_func
| ) |  |
| inline static constexpr

Definition at line 139 of file color.cc.

142 {
143 const Vector3 blend_result = blend_rgb_func(ToRGB(dst), ToRGB(src));
144 return ApplyBlendedColor(dst, src, blend_result).Unpremultiply();
145 }

References ApplyBlendedColor(), ToRGB(), and impeller::Color::Unpremultiply().

Referenced by impeller::Color::Blend().

## ◆ DoColorBlendComponents()

static constexpr Color impeller::DoColorBlendComponents | ( | Color | dst,
|  | Color | src,
|  | const std::function< Scalar(Scalar, Scalar)> & | blend_func
| ) |  |
| inline static constexpr

Definition at line 147 of file color.cc.

150 {
151 Vector3 blend_result = Vector3(blend_func(dst.red, src.red), //
152 blend_func(dst.green, src.green), //
153 blend_func(dst.blue, src.blue)); //
154 return ApplyBlendedColor(dst, src, blend_result).Unpremultiply();
155 }

References ApplyBlendedColor(), impeller::Color::blue, impeller::Color::green, impeller::Color::red, and impeller::Color::Unpremultiply().

Referenced by impeller::Color::Blend().

## ◆ DrawGlyph()

static void impeller::DrawGlyph | ( | SkCanvas * | canvas,
|  | const SkPoint | position,
|  | const ScaledFont & | scaled_font,
|  | const SubpixelGlyph & | glyph,
|  | const Rect & | scaled_bounds,
|  | const std::optional< GlyphProperties > & | prop,
|  | bool | has_color
| ) |  |
| static

Definition at line 208 of file typographer_context_skia.cc.

214 {
215 const auto& metrics = scaled_font.font.GetMetrics();
216 SkGlyphID glyph_id = glyph.glyph.index;
217
218 SkFont sk_font(
219 TypefaceSkia::Cast(*scaled_font.font.GetTypeface()).GetSkiaTypeface(),
220 metrics.point_size, metrics.scaleX, metrics.skewX);
221 sk_font.setEdging(SkFont::Edging::kAntiAlias);
222 sk_font.setHinting(SkFontHinting::kSlight);
223 sk_font.setEmbolden(metrics.embolden);
224 sk_font.setSubpixel(true);
225 sk_font.setSize(sk_font.getSize() * scaled_font.scale);
226
227 auto glyph_color = prop.has_value() ? prop->color.ToARGB() : SK_ColorBLACK;
228
229 SkPaint glyph_paint;
230 glyph_paint.setColor(glyph_color);
231 glyph_paint.setBlendMode(SkBlendMode::kSrc);
232 if (prop.has_value() && prop->stroke) {
233 glyph_paint.setStroke(true);
234 glyph_paint.setStrokeWidth(prop->stroke_width * scaled_font.scale);
235 glyph_paint.setStrokeCap(ToSkiaCap(prop->stroke_cap));
236 glyph_paint.setStrokeJoin(ToSkiaJoin(prop->stroke_join));
237 glyph_paint.setStrokeMiter(prop->stroke_miter);
238 }
239 canvas->save();
240 canvas->translate(glyph.subpixel_offset.x, glyph.subpixel_offset.y);
241 canvas->drawGlyphs(1u, // count
242 &glyph_id, // glyphs
243 &position, // positions
244 SkPoint::Make(-scaled_bounds.GetLeft(),
245 -scaled_bounds.GetTop()), // origin
246 sk_font, // font
247 glyph_paint // paint
248 );
249 canvas->restore();
250 }

References impeller::BackendCast< TypefaceSkia, Typeface >::Cast(), impeller::ScaledFont::font, impeller::TRect< T >::GetLeft(), impeller::Font::GetMetrics(), impeller::TypefaceSkia::GetSkiaTypeface(), impeller::TRect< T >::GetTop(), impeller::Font::GetTypeface(), impeller::SubpixelGlyph::glyph, impeller::Glyph::index, impeller::ScaledFont::scale, impeller::SubpixelGlyph::subpixel_offset, impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

Referenced by BulkUpdateAtlasBitmap(), and UpdateAtlasBitmap().

## ◆ DrawPlaygroundLine()

std::tuple< Point, Point > impeller::DrawPlaygroundLine | ( | PlaygroundPoint & | point_a,
|  | PlaygroundPoint & | point_b
| ) |  |

Definition at line 50 of file widgets.cc.

51 {
52 Point position_a = DrawPlaygroundPoint(point_a);
53 Point position_b = DrawPlaygroundPoint(point_b);
54
55 if (ImGui::GetCurrentContext()) {
56 auto dir = (position_b - position_a).Normalize() * point_a.radius;
57 auto line_a = position_a + dir;
58 auto line_b = position_b - dir;
59 ImGui::GetBackgroundDrawList()->AddLine(
60 {line_a.x, line_a.y}, {line_b.x, line_b.y},
61 ImColor(point_b.color.red, point_b.color.green, point_b.color.blue,
62 0.3f));
63 }
64 return std::make_tuple(position_a, position_b);
65 }

References impeller::Color::blue, impeller::PlaygroundPoint::color, DrawPlaygroundPoint(), impeller::Color::green, impeller::PlaygroundPoint::radius, and impeller::Color::red.

Referenced by impeller::testing::TEST_P().

## ◆ DrawPlaygroundPoint()

Point impeller::DrawPlaygroundPoint | ( | PlaygroundPoint & | point | ) |

Definition at line 9 of file widgets.cc.

9 {
10 if (ImGui::GetCurrentContext()) {
11 impeller::Point mouse_pos(ImGui::GetMousePos().x, ImGui::GetMousePos().y);
12 if (!point.prev_mouse_pos.has_value()) {
13 point.prev_mouse_pos = mouse_pos;
14 }
15
16 if (ImGui::IsKeyPressed(ImGuiKey_R)) {
17 point.position = point.reset_position;
18 point.dragging = false;
19 }
20
21 bool hovering =
22 point.position.GetDistance(mouse_pos) < point.radius &&
23 point.position.GetDistance(point.prev_mouse_pos.value()) < point.radius;
24 if (!ImGui::IsMouseDown(0)) {
25 point.dragging = false;
26 } else if (hovering && ImGui::IsMouseClicked(0)) {
27 point.dragging = true;
28 }
29 if (point.dragging) {
30 point.position += mouse_pos - point.prev_mouse_pos.value();
31 }
32 ImGui::GetBackgroundDrawList()->AddCircleFilled(
33 {point.position.x, point.position.y}, point.radius,
34 ImColor(point.color.red, point.color.green, point.color.blue,
35 (hovering || point.dragging) ? 0.6f : 0.3f));
36 if (hovering || point.dragging) {
37 ImGui::GetBackgroundDrawList()->AddText(
38 {point.position.x - point.radius,
39 point.position.y + point.radius + 10},
40 ImColor(point.color.red, point.color.green, point.color.blue, 1.0f),
41 impeller::SPrintF("x:%0.3f y:%0.3f", point.position.x,
42 point.position.y)
43 .c_str());
44 }
45 point.prev_mouse_pos = mouse_pos;
46 }
47 return point.position;
48 }

References impeller::Color::blue, impeller::PlaygroundPoint::color, impeller::PlaygroundPoint::dragging, impeller::TPoint< T >::GetDistance(), impeller::Color::green, impeller::PlaygroundPoint::position, impeller::PlaygroundPoint::prev_mouse_pos, impeller::PlaygroundPoint::radius, impeller::Color::red, impeller::PlaygroundPoint::reset_position, SPrintF(), impeller::TPoint< T >::x, x, and impeller::TPoint< T >::y.

Referenced by DrawPlaygroundLine(), and impeller::testing::TEST_P().

## ◆ eccentricity()

static Point impeller::eccentricity | ( | Point | v,
|  | double | sInverse
| ) |  |
| static

Definition at line 51 of file solid_rrect_blur_contents.cc.

51 {
52 Point vOverS = v * sInverse * 0.5;
53 Point vOverS_squared = -(vOverS * vOverS);
54 return {std::exp(vOverS_squared.x), std::exp(vOverS_squared.y)};
55 }

References impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

Referenced by SetupFragInfo().

## ◆ EmptyFeedback()

static vk::PipelineCreationFeedbackEXT impeller::EmptyFeedback | ( |  | ) |
| static

Definition at line 22 of file pipeline_vk.cc.

22 {
23 vk::PipelineCreationFeedbackEXT feedback;
24 // If the VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT is not set in flags, an
25 // implementation must not set any other bits in flags, and the values of all
26 // other VkPipelineCreationFeedback data members are undefined.
27 feedback.flags = vk::PipelineCreationFeedbackFlagBits::eValid;
28 return feedback;
29 }

## ◆ EncodeCommandsInReactor() [1/2]

bool impeller::EncodeCommandsInReactor | ( | const ReactorGLES & | reactor,
|  | const std::vector< std::unique_ptr< BlitEncodeGLES >> & | commands,
|  | const std::string & | label
| ) |  |

Definition at line 34 of file blit_pass_gles.cc.

37 {
38 TRACE_EVENT0("impeller", "BlitPassGLES::EncodeCommandsInReactor");
39
40 if (commands.empty()) {
41 return true;
42 }
43
44 #ifdef IMPELLER_DEBUG
45 const auto& gl = reactor.GetProcTable();
46 fml::ScopedCleanupClosure pop_pass_debug_marker(
47 [&gl]() { gl.PopDebugGroup(); });
48 if (!label.empty()) {
49 gl.PushDebugGroup(label);
50 } else {
51 pop_pass_debug_marker.Release();
52 }
53 #endif // IMPELLER_DEBUG
54
55 for (const auto& command : commands) {
56 #ifdef IMPELLER_DEBUG
57 fml::ScopedCleanupClosure pop_cmd_debug_marker(
58 [&gl]() { gl.PopDebugGroup(); });
59 auto label = command->GetLabel();
60 if (!label.empty()) {
61 gl.PushDebugGroup(label);
62 } else {
63 pop_cmd_debug_marker.Release();
64 }
65 #endif // IMPELLER_DEBUG
66
67 if (!command->Encode(reactor)) {
68 return false;
69 }
70 }
71
72 return true;
73 }

References impeller::ReactorGLES::GetProcTable(), and impeller::ProcTableGLES::PushDebugGroup().

## ◆ EncodeCommandsInReactor() [2/2]

bool impeller::EncodeCommandsInReactor | ( | const RenderPassData & | pass_data,
|  | const ReactorGLES & | reactor,
|  | const std::vector< Command > & | commands,
|  | const std::vector< BufferView > & | vertex_buffers,
|  | const std::vector< TextureAndSampler > & | bound_textures,
|  | const std::vector< BufferResource > & | bound_buffers,
|  | const std::shared_ptr< GPUTracerGLES > & | tracer
| ) |  |

Setup the viewport.

Configure blending.

Setup stencil.

Configure depth.

Setup the viewport.

Setup the scissor rect.

Setup culling.

Setup winding order.

Bind vertex buffers.

Note: There is no need to run `RenderPass::ValidateVertexBuffers` or `RenderPass::ValidateIndexBuffer` here, as validation already runs when the vertex/index buffers are set on the command.

Bind the pipeline program.

Bind uniform data.

Determine the primitive type.

Finally! Invoke the draw call.

Unbind vertex attribs.

Definition at line 191 of file render_pass_gles.cc.

198 {
199 TRACE_EVENT0("impeller", "RenderPassGLES::EncodeCommandsInReactor");
200
201 const auto& gl = reactor.GetProcTable();
202 #ifdef IMPELLER_DEBUG
203 tracer->MarkFrameStart(gl);
204
205 fml::ScopedCleanupClosure pop_pass_debug_marker(
206 [&gl]() { gl.PopDebugGroup(); });
207 if (!pass_data.label.empty()) {
208 gl.PushDebugGroup(pass_data.label);
209 } else {
210 pop_pass_debug_marker.Release();
211 }
212 #endif // IMPELLER_DEBUG
213
214 GLuint fbo = GL_NONE;
215 TextureGLES& color_gles = TextureGLES::Cast(*pass_data.color_attachment);
216 const bool is_default_fbo = color_gles.IsWrapped();
217
218 if (is_default_fbo) {
219 if (color_gles.GetFBO().has_value()) {
220 // NOLINTNEXTLINE(bugprone-unchecked-optional-access)
221 gl.BindFramebuffer(GL_FRAMEBUFFER, *color_gles.GetFBO());
222 }
223 } else {
224 // Create and bind an offscreen FBO.
225 GLuint cached_fbo = color_gles.GetCachedFBO();
226 if (cached_fbo != GL_NONE) {
227 fbo = cached_fbo;
228 gl.BindFramebuffer(GL_FRAMEBUFFER, fbo);
229 } else {
230 gl.GenFramebuffers(1u, &fbo);
231 color_gles.SetCachedFBO(fbo);
232 gl.BindFramebuffer(GL_FRAMEBUFFER, fbo);
233
234 if (!color_gles.SetAsFramebufferAttachment(
235 GL_FRAMEBUFFER, TextureGLES::AttachmentType::kColor0)) {
236 return false;
237 }
238
239 if (auto depth = TextureGLES::Cast(pass_data.depth_attachment.get())) {
240 if (!depth->SetAsFramebufferAttachment(
241 GL_FRAMEBUFFER, TextureGLES::AttachmentType::kDepth)) {
242 return false;
243 }
244 }
245 if (auto stencil =
246 TextureGLES::Cast(pass_data.stencil_attachment.get())) {
247 if (!stencil->SetAsFramebufferAttachment(
248 GL_FRAMEBUFFER, TextureGLES::AttachmentType::kStencil)) {
249 return false;
250 }
251 }
252
253 auto status = gl.CheckFramebufferStatus(GL_FRAMEBUFFER);
254 if (status != GL_FRAMEBUFFER_COMPLETE) {
255 VALIDATION_LOG << "Could not create a complete frambuffer: "
256 << DebugToFramebufferError(status);
257 return false;
258 }
259 }
260 }
261
262 gl.ClearColor(pass_data.clear_color.red, // red
263 pass_data.clear_color.green, // green
264 pass_data.clear_color.blue, // blue
265 pass_data.clear_color.alpha // alpha
266 );
267 if (pass_data.depth_attachment) {
268 if (gl.DepthRangef.IsAvailable()) {
269 gl.ClearDepthf(pass_data.clear_depth);
270 } else {
271 gl.ClearDepth(pass_data.clear_depth);
272 }
273 }
274 if (pass_data.stencil_attachment) {
275 gl.ClearStencil(pass_data.clear_stencil);
276 }
277
278 GLenum clear_bits = 0u;
279 if (pass_data.clear_color_attachment) {
280 clear_bits |= GL_COLOR_BUFFER_BIT;
281 }
282 if (pass_data.clear_depth_attachment) {
283 clear_bits |= GL_DEPTH_BUFFER_BIT;
284 }
285 if (pass_data.clear_stencil_attachment) {
286 clear_bits |= GL_STENCIL_BUFFER_BIT;
287 }
288
289 RenderPassGLES::ResetGLState(gl);
290
291 gl.Clear(clear_bits);
292
293 // Both the viewport and scissor are specified in framebuffer coordinates.
294 // Impeller's framebuffer coordinate system is top left origin, but OpenGL's
295 // is bottom left origin, so we convert the coordinates here.
296 ISize target_size = pass_data.color_attachment->GetSize();
297
298 //--------------------------------------------------------------------------
299 /// Setup the viewport.
300 ///
301 const auto& viewport = pass_data.viewport;
302 gl.Viewport(viewport.rect.GetX(), // x
303 target_size.height - viewport.rect.GetY() -
304 viewport.rect.GetHeight(), // y
305 viewport.rect.GetWidth(), // width
306 viewport.rect.GetHeight() // height
307 );
308 if (pass_data.depth_attachment) {
309 if (gl.DepthRangef.IsAvailable()) {
310 gl.DepthRangef(viewport.depth_range.z_near, viewport.depth_range.z_far);
311 } else {
312 gl.DepthRange(viewport.depth_range.z_near, viewport.depth_range.z_far);
313 }
314 }
315
316 CullMode current_cull_mode = CullMode::kNone;
317 WindingOrder current_winding_order = WindingOrder::kClockwise;
318 gl.FrontFace(GL_CW);
319
320 for (const auto& command : commands) {
321 #ifdef IMPELLER_DEBUG
322 fml::ScopedCleanupClosure pop_cmd_debug_marker(
323 [&gl]() { gl.PopDebugGroup(); });
324 if (!command.label.empty()) {
325 gl.PushDebugGroup(command.label);
326 } else {
327 pop_cmd_debug_marker.Release();
328 }
329 #endif // IMPELLER_DEBUG
330
331 const auto& pipeline = PipelineGLES::Cast(*command.pipeline);
332
333 const auto* color_attachment =
334 pipeline.GetDescriptor().GetLegacyCompatibleColorAttachment();
335 if (!color_attachment) {
336 VALIDATION_LOG
337 << "Color attachment is too complicated for a legacy renderer.";
338 return false;
339 }
340
341 //--------------------------------------------------------------------------
342 /// Configure blending.
343 ///
344 ConfigureBlending(gl, color_attachment);
345
346 //--------------------------------------------------------------------------
347 /// Setup stencil.
348 ///
349 ConfigureStencil(gl, pipeline.GetDescriptor(), command.stencil_reference);
350
351 //--------------------------------------------------------------------------
352 /// Configure depth.
353 ///
354 if (auto depth =
355 pipeline.GetDescriptor().GetDepthStencilAttachmentDescriptor();
356 depth.has_value()) {
357 gl.Enable(GL_DEPTH_TEST);
358 gl.DepthFunc(ToCompareFunction(depth->depth_compare));
359 gl.DepthMask(depth->depth_write_enabled ? GL_TRUE : GL_FALSE);
360 } else {
361 gl.Disable(GL_DEPTH_TEST);
362 }
363
364 //--------------------------------------------------------------------------
365 /// Setup the viewport.
366 ///
367 if (command.viewport.has_value()) {
368 gl.Viewport(viewport.rect.GetX(), // x
369 target_size.height - viewport.rect.GetY() -
370 viewport.rect.GetHeight(), // y
371 viewport.rect.GetWidth(), // width
372 viewport.rect.GetHeight() // height
373 );
374 if (pass_data.depth_attachment) {
375 if (gl.DepthRangef.IsAvailable()) {
376 gl.DepthRangef(viewport.depth_range.z_near,
377 viewport.depth_range.z_far);
378 } else {
379 gl.DepthRange(viewport.depth_range.z_near,
380 viewport.depth_range.z_far);
381 }
382 }
383 }
384
385 //--------------------------------------------------------------------------
386 /// Setup the scissor rect.
387 ///
388 if (command.scissor.has_value()) {
389 const auto& scissor = command.scissor.value();
390 gl.Enable(GL_SCISSOR_TEST);
391 gl.Scissor(
392 scissor.GetX(), // x
393 target_size.height - scissor.GetY() - scissor.GetHeight(), // y
394 scissor.GetWidth(), // width
395 scissor.GetHeight() // height
396 );
397 }
398
399 //--------------------------------------------------------------------------
400 /// Setup culling.
401 ///
402 CullMode pipeline_cull_mode = pipeline.GetDescriptor().GetCullMode();
403 if (current_cull_mode != pipeline_cull_mode) {
404 switch (pipeline_cull_mode) {
405 case CullMode::kNone:
406 gl.Disable(GL_CULL_FACE);
407 break;
408 case CullMode::kFrontFace:
409 gl.Enable(GL_CULL_FACE);
410 gl.CullFace(GL_FRONT);
411 break;
412 case CullMode::kBackFace:
413 gl.Enable(GL_CULL_FACE);
414 gl.CullFace(GL_BACK);
415 break;
416 }
417 current_cull_mode = pipeline_cull_mode;
418 }
419
420 //--------------------------------------------------------------------------
421 /// Setup winding order.
422 ///
423 WindingOrder pipeline_winding_order =
424 pipeline.GetDescriptor().GetWindingOrder();
425 if (current_winding_order != pipeline_winding_order) {
426 switch (pipeline.GetDescriptor().GetWindingOrder()) {
427 case WindingOrder::kClockwise:
428 gl.FrontFace(GL_CW);
429 break;
430 case WindingOrder::kCounterClockwise:
431 gl.FrontFace(GL_CCW);
432 break;
433 }
434 current_winding_order = pipeline_winding_order;
435 }
436
437 BufferBindingsGLES* vertex_desc_gles = pipeline.GetBufferBindings();
438
439 //--------------------------------------------------------------------------
440 /// Bind vertex buffers.
441 ///
442 /// Note: There is no need to run `RenderPass::ValidateVertexBuffers` or
443 /// `RenderPass::ValidateIndexBuffer` here, as validation already runs
444 /// when the vertex/index buffers are set on the command.
445 ///
446 for (size_t i = 0; i < command.vertex_buffers.length; i++) {
447 if (!BindVertexBuffer(gl, vertex_desc_gles,
448 vertex_buffers[i + command.vertex_buffers.offset],
449 i)) {
450 return false;
451 }
452 }
453
454 //--------------------------------------------------------------------------
455 /// Bind the pipeline program.
456 ///
457 if (!pipeline.BindProgram()) {
458 return false;
459 }
460
461 //--------------------------------------------------------------------------
462 /// Bind uniform data.
463 ///
464 if (!vertex_desc_gles->BindUniformData(
465 gl, //
466 bound_textures, //
467 bound_buffers, //
468 /*texture_range=*/command.bound_textures, //
469 /*buffer_range=*/command.bound_buffers //
470 )) {
471 return false;
472 }
473
474 //--------------------------------------------------------------------------
475 /// Determine the primitive type.
476 ///
477 // GLES doesn't support setting the fill mode, so override the primitive
478 // with GL_LINE_STRIP to somewhat emulate PolygonMode::kLine. This isn't
479 // correct; full triangle outlines won't be drawn and disconnected
480 // geometry may appear connected. However this can still be useful for
481 // wireframe debug views.
482 GLenum mode =
483 pipeline.GetDescriptor().GetPolygonMode() == PolygonMode::kLine
484 ? GL_LINE_STRIP
485 : ToMode(pipeline.GetDescriptor().GetPrimitiveType());
486
487 //--------------------------------------------------------------------------
488 /// Finally! Invoke the draw call.
489 ///
490 if (command.index_type == IndexType::kNone) {
491 gl.DrawArrays(mode, command.base_vertex, command.element_count);
492 } else {
493 // Bind the index buffer if necessary.
494 auto index_buffer_view = command.index_buffer;
495 const DeviceBuffer* index_buffer = index_buffer_view.GetBuffer();
496 const auto& index_buffer_gles = DeviceBufferGLES::Cast(*index_buffer);
497 if (!index_buffer_gles.BindAndUploadDataIfNecessary(
498 DeviceBufferGLES::BindingType::kElementArrayBuffer)) {
499 return false;
500 }
501 gl.DrawElements(mode, // mode
502 command.element_count, // count
503 ToIndexType(command.index_type), // type
504 reinterpret_cast<const GLvoid*>(static_cast<GLsizei>(
505 index_buffer_view.GetRange().offset)) // indices
506 );
507 }
508
509 //--------------------------------------------------------------------------
510 /// Unbind vertex attribs.
511 ///
512 if (!vertex_desc_gles->UnbindVertexAttributes(gl)) {
513 return false;
514 }
515 }
516
517 if (gl.DiscardFramebufferEXT.IsAvailable()) {
518 std::array<GLenum, 3> attachments;
519 size_t attachment_count = 0;
520
521 // TODO(130048): discarding stencil or depth on the default fbo causes Angle
522 // to discard the entire render target. Until we know the reason, default to
523 // storing.
524 bool angle_safe = gl.GetCapabilities()->IsANGLE() ? !is_default_fbo : true;
525
526 if (pass_data.discard_color_attachment) {
527 attachments[attachment_count++] =
528 (is_default_fbo ? GL_COLOR_EXT : GL_COLOR_ATTACHMENT0);
529 }
530 if (pass_data.discard_depth_attachment && angle_safe) {
531 attachments[attachment_count++] =
532 (is_default_fbo ? GL_DEPTH_EXT : GL_DEPTH_ATTACHMENT);
533 }
534
535 if (pass_data.discard_stencil_attachment && angle_safe) {
536 attachments[attachment_count++] =
537 (is_default_fbo ? GL_STENCIL_EXT : GL_STENCIL_ATTACHMENT);
538 }
539 gl.DiscardFramebufferEXT(GL_FRAMEBUFFER, // target
540 attachment_count, // attachments to discard
541 attachments.data() // size
542 );
543 }
544
545 #ifdef IMPELLER_DEBUG
546 if (is_default_fbo) {
547 tracer->MarkFrameEnd(gl);
548 }
549 #endif // IMPELLER_DEBUG
550
551 return true;
552 }

References impeller::Color::alpha, impeller::BufferBindingsGLES::BindUniformData(), BindVertexBuffer(), impeller::Color::blue, impeller::BackendCast< PipelineGLES, Pipeline< PipelineDescriptor > >::Cast(), impeller::BackendCast< TextureGLES, Texture >::Cast(), impeller::BackendCast< DeviceBufferGLES, DeviceBuffer >::Cast(), impeller::RenderPassData::clear_color, impeller::RenderPassData::clear_color_attachment, impeller::RenderPassData::clear_depth, impeller::RenderPassData::clear_depth_attachment, impeller::RenderPassData::clear_stencil, impeller::RenderPassData::clear_stencil_attachment, impeller::RenderPassData::color_attachment, ConfigureBlending(), ConfigureStencil(), DebugToFramebufferError(), impeller::RenderPassData::depth_attachment, impeller::RenderPassData::discard_color_attachment, impeller::RenderPassData::discard_depth_attachment, impeller::RenderPassData::discard_stencil_attachment, impeller::TextureGLES::GetCachedFBO(), impeller::TextureGLES::GetFBO(), impeller::ReactorGLES::GetProcTable(), impeller::Color::green, impeller::TSize< T >::height, impeller::TextureGLES::IsWrapped(), kBackFace, kClockwise, impeller::TextureGLES::kColor0, kCounterClockwise, impeller::TextureGLES::kDepth, impeller::DeviceBufferGLES::kElementArrayBuffer, kFrontFace, kLine, kNone, impeller::TextureGLES::kStencil, impeller::RenderPassData::label, impeller::ProcTableGLES::PushDebugGroup(), impeller::Color::red, impeller::RenderPassGLES::ResetGLState(), impeller::TextureGLES::SetAsFramebufferAttachment(), impeller::TextureGLES::SetCachedFBO(), impeller::RenderPassData::stencil_attachment, ToCompareFunction(), ToIndexType(), ToMode(), impeller::BufferBindingsGLES::UnbindVertexAttributes(), VALIDATION_LOG, and impeller::RenderPassData::viewport.

## ◆ FindSwiftShaderICDAtKnownPaths()

static void impeller::FindSwiftShaderICDAtKnownPaths | ( |  | ) |
| static

Definition at line 20 of file swiftshader_utilities.cc.

20 {
21 static constexpr const char* kSwiftShaderICDJSON = "vk_swiftshader_icd.json";
22 static constexpr const char* kVulkanICDFileNamesEnvVariableKey =
23 "VK_ICD_FILENAMES";
24 const auto executable_directory_path =
25 fml::paths::GetExecutableDirectoryPath();
26 FML_CHECK(executable_directory_path.first);
27 const auto executable_directory =
28 fml::OpenDirectory(executable_directory_path.second.c_str(), false,
29 fml::FilePermission::kRead);
30 FML_CHECK(executable_directory.is_valid());
31 if (fml::FileExists(executable_directory, kSwiftShaderICDJSON)) {
32 const auto icd_path = fml::paths::JoinPaths(
33 {executable_directory_path.second, kSwiftShaderICDJSON});
34 #if FML_OS_WIN
35 const auto success =
36 ::SetEnvironmentVariableA(kVulkanICDFileNamesEnvVariableKey, //
37 icd_path.c_str() //
38 ) != 0;
39 #else // FML_OS_WIN
40 const auto success = ::setenv(kVulkanICDFileNamesEnvVariableKey, //
41 icd_path.c_str(), //
42 1 // overwrite
43 ) == 0;
44 #endif // FML_OS_WIN
45 FML_CHECK(success)
46 << "Could not set the environment variable to use SwiftShader.";
47 } else {
48 FML_CHECK(false)
49 << "Was asked to use SwiftShader but could not find the installable "
50 "client driver (ICD) for the locally built SwiftShader.";
51 }
52 }

Referenced by SetupSwiftshaderOnce().

## ◆ FormatWindowTitle()

static std::string impeller::FormatWindowTitle | ( | const std::string & | test_name | ) |
| static

Definition at line 44 of file compute_playground_test.cc.

44 {
45 std::stringstream stream;
46 stream << "Impeller Playground for '" << test_name << "' (Press ESC to quit)";
47 return stream.str();
48 }

Referenced by impeller::ComputePlaygroundTest::GetWindowTitle().

## ◆ FramebufferStatusToString()

static const char* impeller::FramebufferStatusToString | ( | GLenum | status | ) |
| static

Definition at line 212 of file proc_table_gles.cc.

212 {
213 switch (status) {
214 case GL_FRAMEBUFFER_COMPLETE:
215 return "GL_FRAMEBUFFER_COMPLETE";
216 case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
217 return "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT";
218 #if GL_ES_VERSION_2_0
219 case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
220 return "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS";
221 #endif
222 case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
223 return "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";
224 case GL_FRAMEBUFFER_UNSUPPORTED:
225 return "GL_FRAMEBUFFER_UNSUPPORTED";
226 case GL_INVALID_ENUM:
227 return "GL_INVALID_ENUM";
228 }
229
230 return "Unknown FBO Error Status";
231 }

Referenced by impeller::ProcTableGLES::DescribeCurrentFramebuffer().

## ◆ FromMTLLoadAction()

constexpr LoadAction impeller::FromMTLLoadAction | ( | MTLLoadAction | action | ) |
| constexpr

Definition at line 292 of file formats_mtl.h.

292 {
293 switch (action) {
294 case MTLLoadActionDontCare:
295 return LoadAction::kDontCare;
296 case MTLLoadActionLoad:
297 return LoadAction::kLoad;
298 case MTLLoadActionClear:
299 return LoadAction::kClear;
300 default:
301 break;
302 }
303
304 return LoadAction::kDontCare;
305 }

References kClear, kDontCare, and kLoad.

## ◆ FromMTLPixelFormat()

constexpr PixelFormat impeller::FromMTLPixelFormat | ( | MTLPixelFormat | format | ) |
| constexpr

Definition at line 22 of file formats_mtl.h.

22 {
23 switch (format) {
24 case MTLPixelFormatInvalid:
25 return PixelFormat::kUnknown;
26 case MTLPixelFormatBGRA8Unorm:
27 return PixelFormat::kB8G8R8A8UNormInt;
28 case MTLPixelFormatBGRA8Unorm_sRGB:
29 return PixelFormat::kB8G8R8A8UNormIntSRGB;
30 case MTLPixelFormatRGBA8Unorm:
31 return PixelFormat::kR8G8B8A8UNormInt;
32 case MTLPixelFormatRGBA8Unorm_sRGB:
33 return PixelFormat::kR8G8B8A8UNormIntSRGB;
34 case MTLPixelFormatRGBA32Float:
35 return PixelFormat::kR32G32B32A32Float;
36 case MTLPixelFormatRGBA16Float:
37 return PixelFormat::kR16G16B16A16Float;
38 case MTLPixelFormatStencil8:
39 return PixelFormat::kS8UInt;
40 #if !FML_OS_IOS
41 case MTLPixelFormatDepth24Unorm_Stencil8:
42 return PixelFormat::kD24UnormS8Uint;
43 #endif // FML_OS_IOS
44 case MTLPixelFormatDepth32Float_Stencil8:
45 return PixelFormat::kD32FloatS8UInt;
46 case MTLPixelFormatBGR10_XR_sRGB:
47 return PixelFormat::kB10G10R10XRSRGB;
48 case MTLPixelFormatBGR10_XR:
49 return PixelFormat::kB10G10R10XR;
50 case MTLPixelFormatBGRA10_XR:
51 return PixelFormat::kB10G10R10A10XR;
52 default:
53 return PixelFormat::kUnknown;
54 }
55 return PixelFormat::kUnknown;
56 }

References kB10G10R10A10XR, kB10G10R10XR, kB10G10R10XRSRGB, kB8G8R8A8UNormInt, kB8G8R8A8UNormIntSRGB, kD24UnormS8Uint, kD32FloatS8UInt, kR16G16B16A16Float, kR32G32B32A32Float, kR8G8B8A8UNormInt, kR8G8B8A8UNormIntSRGB, kS8UInt, and kUnknown.

Referenced by WrapTextureMTL(), and WrapTextureWithRenderTarget().

## ◆ FromMTLStoreAction()

constexpr StoreAction impeller::FromMTLStoreAction | ( | MTLStoreAction | action | ) |
| constexpr

Definition at line 321 of file formats_mtl.h.

321 {
322 switch (action) {
323 case MTLStoreActionDontCare:
324 return StoreAction::kDontCare;
325 case MTLStoreActionStore:
326 return StoreAction::kStore;
327 case MTLStoreActionMultisampleResolve:
328 return StoreAction::kMultisampleResolve;
329 case MTLStoreActionStoreAndMultisampleResolve:
330 return StoreAction::kStoreAndMultisampleResolve;
331 default:
332 break;
333 }
334 return StoreAction::kDontCare;
335 }

References kDontCare, kMultisampleResolve, kStore, and kStoreAndMultisampleResolve.

## ◆ FromRGB()

static constexpr Color impeller::FromRGB | ( | Vector3 | color,
|  | Scalar | alpha
| ) |  |
| inline static constexpr

Definition at line 115 of file color.cc.

115 {
116 return {color.x, color.y, color.z, alpha};
117 }

References impeller::Vector3::x, impeller::Vector3::y, and impeller::Vector3::z.

Referenced by ApplyBlendedColor().

## ◆ GenerateBlurInfo()

KernelSamples impeller::GenerateBlurInfo | ( | BlurParameters | parameters | ) |

Definition at line 907 of file gaussian_blur_filter_contents.cc.

907 {
908 KernelSamples result;
909 result.sample_count =
910 ((2 * parameters.blur_radius) / parameters.step_size) + 1;
911
912 // Chop off the last samples if the radius >= 3 where they account for < 1.56%
913 // of the result.
914 int x_offset = 0;
915 if (parameters.blur_radius >= 3) {
916 result.sample_count -= 2;
917 x_offset = 1;
918 }
919
920 // This is a safe-guard to make sure we don't overflow the fragment shader.
921 // The kernel size is multiplied by 2 since we'll use the lerp hack on the
922 // result. In practice this isn't throwing away much data since the blur radii
923 // are around 53 before the down-sampling and max sigma of 500 kick in.
924 //
925 // TODO(https://github.com/flutter/flutter/issues/150462): Come up with a more
926 // wholistic remedy for this. A proper downsample size should not make this
927 // required. Or we can increase the kernel size.
928 if (result.sample_count > KernelSamples::kMaxKernelSize) {
929 result.sample_count = KernelSamples::kMaxKernelSize;
930 }
931
932 Scalar tally = 0.0f;
933 for (int i = 0; i < result.sample_count; ++i) {
934 int x = x_offset + (i * parameters.step_size) - parameters.blur_radius;
935 result.samples[i] = KernelSample{
936 .uv_offset = parameters.blur_uv_offset * x,
937 .coefficient = expf(-0.5f * (x * x) /
938 (parameters.blur_sigma * parameters.blur_sigma)) /
939 (sqrtf(2.0f * M_PI) * parameters.blur_sigma),
940 };
941 tally += result.samples[i].coefficient;
942 }
943
944 // Make sure everything adds up to 1.
945 for (auto& sample : result.samples) {
946 sample.coefficient /= tally;
947 }
948
949 return result;
950 }

References impeller::BlurParameters::blur_radius, impeller::BlurParameters::blur_sigma, impeller::BlurParameters::blur_uv_offset, impeller::KernelSample::coefficient, impeller::KernelSamples::kMaxKernelSize, impeller::KernelSamples::sample_count, impeller::KernelSamples::samples, impeller::BlurParameters::step_size, impeller::KernelSample::uv_offset, and x.

Referenced by impeller::testing::TEST().

## ◆ GetAdrenoVersion()

AdrenoGPU impeller::GetAdrenoVersion | ( | std::string_view | version | ) |

The format that Adreno names follow is "Adreno (TM) VERSION".

Definition at line 108 of file driver_info_vk.cc.

108 {
109 /// The format that Adreno names follow is "Adreno (TM) VERSION".
110 auto paren_pos = version.find("Adreno (TM) ");
111 if (paren_pos == std::string::npos) {
112 return AdrenoGPU::kUnknown;
113 }
114 auto version_string = version.substr(paren_pos + 12);
115 const auto& result = kAdrenoVersions.find(version_string);
116 if (result == kAdrenoVersions.end()) {
117 return AdrenoGPU::kUnknown;
118 }
119 return result->second;
120 }

References kAdrenoVersions, and kUnknown.

Referenced by impeller::DriverInfoVK::DriverInfoVK(), and impeller::testing::TEST().

## ◆ GetBytesPerPixel()

static size_t impeller::GetBytesPerPixel | ( | DecompressedImage::Format | format | ) |
| static

Definition at line 46 of file decompressed_image.cc.

46 {
47 switch (format) {
48 case DecompressedImage::Format::kInvalid:
49 return 0u;
50 case DecompressedImage::Format::kGrey:
51 return 1u;
52 case DecompressedImage::Format::kGreyAlpha:
53 return 1u;
54 case DecompressedImage::Format::kRGB:
55 return 3u;
56 case DecompressedImage::Format::kRGBA:
57 return 4;
58 }
59 return 0u;
60 }

References impeller::DecompressedImage::kGrey, impeller::DecompressedImage::kGreyAlpha, impeller::DecompressedImage::kInvalid, impeller::DecompressedImage::kRGB, and impeller::DecompressedImage::kRGBA.

Referenced by impeller::DecompressedImage::ConvertToRGBA().

## ◆ GetCPUColorFilterProc()

ColorFilterProc impeller::GetCPUColorFilterProc | ( | const flutter::DlColorFilter * | filter | ) |

Definition at line 66 of file color_filter.cc.

66 {
67 FML_DCHECK(filter);
68
69 switch (filter->type()) {
70 case flutter::DlColorFilterType::kBlend: {
71 const flutter::DlBlendColorFilter* blend_filter = filter->asBlend();
72 FML_DCHECK(blend_filter);
73
74 return [filter_blend_mode = static_cast<BlendMode>(blend_filter->mode()),
75 filter_color = skia_conversions::ToColor(blend_filter->color())](
76 Color color) {
77 return color.Blend(filter_color, filter_blend_mode);
78 };
79 }
80 case flutter::DlColorFilterType::kMatrix: {
81 const flutter::DlMatrixColorFilter* matrix_filter = filter->asMatrix();
82 FML_DCHECK(matrix_filter);
83
84 impeller::ColorMatrix color_matrix;
85 matrix_filter->get_matrix(color_matrix.array);
86 return [color_matrix = color_matrix](Color color) {
87 return color.ApplyColorMatrix(color_matrix);
88 };
89 }
90 case flutter::DlColorFilterType::kSrgbToLinearGamma: {
91 return [](Color color) { return color.SRGBToLinear(); };
92 }
93
94 case flutter::DlColorFilterType::kLinearToSrgbGamma: {
95 return [](Color color) { return color.LinearToSRGB(); };
96 }
97 }
98
99 FML_UNREACHABLE();
100 }

References impeller::ColorMatrix::array, impeller::Color::Blend(), and impeller::skia_conversions::ToColor().

## ◆ GetDrawableDeferred()

std::shared_future< id< CAMetalDrawable > > impeller::GetDrawableDeferred | ( | CAMetalLayer * | layer | ) |

Create a deferred drawable from a CAMetalLayer.

Definition at line 23 of file lazy_drawable_holder.mm.

24 {
25 auto future =
26 std::async(std::launch::deferred, [layer]() -> id<CAMetalDrawable> {
27 id<CAMetalDrawable> current_drawable = nil;
28 {
29 TRACE_EVENT0("impeller", "WaitForNextDrawable");
30 current_drawable = [layer nextDrawable];
31 }
32 if (!current_drawable) {
33 VALIDATION_LOG << "Could not acquire current drawable.";
34 return nullptr;
35 }
36 return current_drawable;
37 });
38 return std::shared_future<id<CAMetalDrawable>>(std::move(future));
39 }

References VALIDATION_LOG.

Referenced by impeller::testing::TEST().

## ◆ GetExtensionName() [1/3]

static const char* impeller::GetExtensionName | ( | OptionalDeviceExtensionVK | ext | ) |
| static

Definition at line 210 of file capabilities_vk.cc.

210 {
211 switch (ext) {
212 case OptionalDeviceExtensionVK::kEXTPipelineCreationFeedback:
213 return VK_EXT_PIPELINE_CREATION_FEEDBACK_EXTENSION_NAME;
214 case OptionalDeviceExtensionVK::kVKKHRPortabilitySubset:
215 return "VK_KHR_portability_subset";
216 case OptionalDeviceExtensionVK::kEXTImageCompressionControl:
217 return VK_EXT_IMAGE_COMPRESSION_CONTROL_EXTENSION_NAME;
218 case OptionalDeviceExtensionVK::kLast:
219 return "Unknown";
220 }
221 FML_UNREACHABLE();
222 }

References kEXTImageCompressionControl, kEXTPipelineCreationFeedback, kLast, and kVKKHRPortabilitySubset.

## ◆ GetExtensionName() [2/3]

static const char* impeller::GetExtensionName | ( | RequiredAndroidDeviceExtensionVK | ext | ) |
| static

Definition at line 183 of file capabilities_vk.cc.

183 {
184 switch (ext) {
185 case RequiredAndroidDeviceExtensionVK::
186 kANDROIDExternalMemoryAndroidHardwareBuffer:
187 return "VK_ANDROID_external_memory_android_hardware_buffer";
188 case RequiredAndroidDeviceExtensionVK::kKHRSamplerYcbcrConversion:
189 return VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME;
190 case RequiredAndroidDeviceExtensionVK::kKHRExternalMemory:
191 return VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME;
192 case RequiredAndroidDeviceExtensionVK::kEXTQueueFamilyForeign:
193 return VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME;
194 case RequiredAndroidDeviceExtensionVK::kKHRDedicatedAllocation:
195 return VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME;
196 case RequiredAndroidDeviceExtensionVK::kKHRExternalFenceFd:
197 return VK_KHR_EXTERNAL_FENCE_FD_EXTENSION_NAME;
198 case RequiredAndroidDeviceExtensionVK::kKHRExternalFence:
199 return VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME;
200 case RequiredAndroidDeviceExtensionVK::kKHRExternalSemaphoreFd:
201 return VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME;
202 case RequiredAndroidDeviceExtensionVK::kKHRExternalSemaphore:
203 return VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME;
204 case RequiredAndroidDeviceExtensionVK::kLast:
205 return "Unknown";
206 }
207 FML_UNREACHABLE();
208 }

References kANDROIDExternalMemoryAndroidHardwareBuffer, kEXTQueueFamilyForeign, kKHRDedicatedAllocation, kKHRExternalFence, kKHRExternalFenceFd, kKHRExternalMemory, kKHRExternalSemaphore, kKHRExternalSemaphoreFd, kKHRSamplerYcbcrConversion, and kLast.

## ◆ GetExtensionName() [3/3]

static const char* impeller::GetExtensionName | ( | RequiredCommonDeviceExtensionVK | ext | ) |
| static

Definition at line 173 of file capabilities_vk.cc.

173 {
174 switch (ext) {
175 case RequiredCommonDeviceExtensionVK::kKHRSwapchain:
176 return VK_KHR_SWAPCHAIN_EXTENSION_NAME;
177 case RequiredCommonDeviceExtensionVK::kLast:
178 return "Unknown";
179 }
180 FML_UNREACHABLE();
181 }

References kKHRSwapchain, and kLast.

Referenced by impeller::CapabilitiesVK::GetEnabledDeviceExtensions(), IsExtensionInList(), and impeller::CapabilitiesVK::SetPhysicalDevice().

## ◆ GetFencesForWaitSet()

static std::vector<vk::Fence> impeller::GetFencesForWaitSet | ( | const WaitSet & | set | ) |
| static

Definition at line 82 of file fence_waiter_vk.cc.

82 {
83 std::vector<vk::Fence> fences;
84 for (const auto& entry : set) {
85 if (!entry->IsSignalled()) {
86 fences.emplace_back(entry->GetFence());
87 }
88 }
89 return fences;
90 }

## ◆ GetGLString()

static std::string impeller::GetGLString | ( | const ProcTableGLES & | gl,
|  | GLenum | name
| ) |  |
| static

Definition at line 21 of file description_gles.cc.

21 {
22 auto str = gl.GetString(name);
23 if (str == nullptr) {
24 return "";
25 }
26 return reinterpret_cast<const char*>(str);
27 }

Referenced by impeller::DescriptionGLES::DescriptionGLES().

## ◆ GetGLStringi()

static std::string impeller::GetGLStringi | ( | const ProcTableGLES & | gl,
|  | GLenum | name,
|  | int | index
| ) |  |
| static

Definition at line 29 of file description_gles.cc.

31 {
32 auto str = gl.GetStringi(name, index);
33 if (str == nullptr) {
34 return "";
35 }
36 return reinterpret_cast<const char*>(str);
37 }

Referenced by impeller::DescriptionGLES::DescriptionGLES().

## ◆ GetImageInfo()

static SkImageInfo impeller::GetImageInfo | ( | const GlyphAtlas & | atlas,
|  | Size | size
| ) |  |
| static

Definition at line 90 of file typographer_context_skia.cc.

90 {
91 switch (atlas.GetType()) {
92 case GlyphAtlas::Type::kAlphaBitmap:
93 return SkImageInfo::MakeA8(SkISize{static_cast<int32_t>(size.width),
94 static_cast<int32_t>(size.height)});
95 case GlyphAtlas::Type::kColorBitmap:
96 return SkImageInfo::MakeN32Premul(size.width, size.height);
97 }
98 FML_UNREACHABLE();
99 }

References impeller::GlyphAtlas::GetType(), impeller::TSize< T >::height, impeller::GlyphAtlas::kAlphaBitmap, impeller::GlyphAtlas::kColorBitmap, and impeller::TSize< T >::width.

Referenced by BulkUpdateAtlasBitmap(), and UpdateAtlasBitmap().

## ◆ GetMaliVersion()

MaliGPU impeller::GetMaliVersion | ( | std::string_view | version | ) |

Definition at line 122 of file driver_info_vk.cc.

122 {
123 // These names are usually Mali-VERSION or Mali-Version-EXTRA_CRAP.
124 auto dash_pos = version.find("Mali-");
125 if (dash_pos == std::string::npos) {
126 return MaliGPU::kUnknown;
127 }
128 auto version_string_with_trailing = version.substr(dash_pos + 5);
129 // Remove any trailing crap if present.
130 auto more_dash_pos = version_string_with_trailing.find("-");
131 if (more_dash_pos != std::string::npos) {
132 version_string_with_trailing =
133 version_string_with_trailing.substr(0, more_dash_pos);
134 }
135
136 const auto& result = kMaliVersions.find(version_string_with_trailing);
137 if (result == kMaliVersions.end()) {
138 return MaliGPU::kUnknown;
139 }
140 return result->second;
141 }

References kMaliVersions, and kUnknown.

Referenced by impeller::DriverInfoVK::DriverInfoVK(), and impeller::testing::TEST().

## ◆ GetMTLComputePipelineDescriptor()

static MTLComputePipelineDescriptor* impeller::GetMTLComputePipelineDescriptor | ( | const ComputePipelineDescriptor & | desc | ) |
| static

Definition at line 88 of file pipeline_library_mtl.mm.

89 {
90 auto descriptor = [[MTLComputePipelineDescriptor alloc] init];
91 descriptor.label = @(desc.GetLabel().c_str());
92 descriptor.computeFunction =
93 ShaderFunctionMTL::Cast(*desc.GetStageEntrypoint()).GetMTLFunction();
94 return descriptor;
95 }

References impeller::BackendCast< ShaderFunctionMTL, ShaderFunction >::Cast(), impeller::ComputePipelineDescriptor::GetLabel(), impeller::ShaderFunctionMTL::GetMTLFunction(), and impeller::ComputePipelineDescriptor::GetStageEntrypoint().

## ◆ GetMTLRenderPipelineDescriptor()

static void impeller::GetMTLRenderPipelineDescriptor | ( | const PipelineDescriptor & | desc,
|  | const Callback & | callback
| ) |  |
| static

Definition at line 32 of file pipeline_library_mtl.mm.

33 {
34 auto descriptor = [[MTLRenderPipelineDescriptor alloc] init];
35 descriptor.label = @(desc.GetLabel().data());
36 descriptor.rasterSampleCount = static_cast<NSUInteger>(desc.GetSampleCount());
37 bool created_specialized_function = false;
38
39 if (const auto& vertex_descriptor = desc.GetVertexDescriptor()) {
40 VertexDescriptorMTL vertex_descriptor_mtl;
41 if (vertex_descriptor_mtl.SetStageInputsAndLayout(
42 vertex_descriptor->GetStageInputs(),
43 vertex_descriptor->GetStageLayouts())) {
44 descriptor.vertexDescriptor =
45 vertex_descriptor_mtl.GetMTLVertexDescriptor();
46 }
47 }
48
49 for (const auto& item : desc.GetColorAttachmentDescriptors()) {
50 descriptor.colorAttachments[item.first] =
51 ToMTLRenderPipelineColorAttachmentDescriptor(item.second);
52 }
53
54 descriptor.depthAttachmentPixelFormat =
55 ToMTLPixelFormat(desc.GetDepthPixelFormat());
56 descriptor.stencilAttachmentPixelFormat =
57 ToMTLPixelFormat(desc.GetStencilPixelFormat());
58
59 const auto& constants = desc.GetSpecializationConstants();
60 for (const auto& entry : desc.GetStageEntrypoints()) {
61 if (entry.first == ShaderStage::kVertex) {
62 descriptor.vertexFunction =
63 ShaderFunctionMTL::Cast(*entry.second).GetMTLFunction();
64 }
65 if (entry.first == ShaderStage::kFragment) {
66 if (constants.empty()) {
67 descriptor.fragmentFunction =
68 ShaderFunctionMTL::Cast(*entry.second).GetMTLFunction();
69 } else {
70 // This code only expects a single specialized function per pipeline.
71 FML_CHECK(!created_specialized_function);
72 created_specialized_function = true;
73 ShaderFunctionMTL::Cast(*entry.second)
74 .GetMTLFunctionSpecialized(
75 constants, [callback, descriptor](id<MTLFunction> function) {
76 descriptor.fragmentFunction = function;
77 callback(descriptor);
78 });
79 }
80 }
81 }
82
83 if (!created_specialized_function) {
84 callback(descriptor);
85 }
86 }

References impeller::BackendCast< ShaderFunctionMTL, ShaderFunction >::Cast(), impeller::PipelineDescriptor::GetColorAttachmentDescriptors(), impeller::PipelineDescriptor::GetDepthPixelFormat(), impeller::PipelineDescriptor::GetLabel(), impeller::ShaderFunctionMTL::GetMTLFunction(), impeller::ShaderFunctionMTL::GetMTLFunctionSpecialized(), impeller::VertexDescriptorMTL::GetMTLVertexDescriptor(), impeller::PipelineDescriptor::GetSampleCount(), impeller::PipelineDescriptor::GetSpecializationConstants(), impeller::PipelineDescriptor::GetStageEntrypoints(), impeller::PipelineDescriptor::GetStencilPixelFormat(), impeller::PipelineDescriptor::GetVertexDescriptor(), kFragment, kVertex, impeller::VertexDescriptorMTL::SetStageInputsAndLayout(), ToMTLPixelFormat(), and ToMTLRenderPipelineColorAttachmentDescriptor().

## ◆ GetPorterDuffSpecConstants()

std::array<std::vector<Scalar>, 15> impeller::GetPorterDuffSpecConstants | ( | bool | supports_decal | ) |

Definition at line 223 of file content_context.cc.

224 {
225 Scalar x = supports_decal ? 1 : 0;
226 return {{
227 {x, 0, 0, 0, 0, 0}, // Clear
228 {x, 1, 0, 0, 0, 0}, // Source
229 {x, 0, 0, 1, 0, 0}, // Destination
230 {x, 1, 0, 1, -1, 0}, // SourceOver
231 {x, 1, -1, 1, 0, 0}, // DestinationOver
232 {x, 0, 1, 0, 0, 0}, // SourceIn
233 {x, 0, 0, 0, 1, 0}, // DestinationIn
234 {x, 1, -1, 0, 0, 0}, // SourceOut
235 {x, 0, 0, 1, -1, 0}, // DestinationOut
236 {x, 0, 1, 1, -1, 0}, // SourceATop
237 {x, 1, -1, 0, 1, 0}, // DestinationATop
238 {x, 1, -1, 1, -1, 0}, // Xor
239 {x, 1, 0, 1, 0, 0}, // Plus
240 {x, 0, 0, 0, 0, 1}, // Modulate
241 {x, 0, 0, 1, 0, -1}, // Screen
242 }};
243 }

References x.

Referenced by impeller::ContentContext::ContentContext().

## ◆ GetQueueCreateInfos()

static std::vector<vk::DeviceQueueCreateInfo> impeller::GetQueueCreateInfos | ( | std::initializer_list< QueueIndexVK > | queues | ) |
| static

Definition at line 68 of file context_vk.cc.

69 {
70 std::map<size_t /* family */, size_t /* index */> family_index_map;
71 for (const auto& queue : queues) {
72 family_index_map[queue.family] = 0;
73 }
74 for (const auto& queue : queues) {
75 auto value = family_index_map[queue.family];
76 family_index_map[queue.family] = std::max(value, queue.index);
77 }
78
79 static float kQueuePriority = 1.0f;
80 std::vector<vk::DeviceQueueCreateInfo> infos;
81 for (const auto& item : family_index_map) {
82 vk::DeviceQueueCreateInfo info;
83 info.setQueueFamilyIndex(item.first);
84 info.setQueueCount(item.second + 1);
85 info.setQueuePriorities(kQueuePriority);
86 infos.push_back(info);
87 }
88 return infos;
89 }

References value.

## ◆ GetShaderClipDepth()

static Scalar impeller::GetShaderClipDepth | ( | uint32_t | clip_depth | ) |
| static

Definition at line 19 of file clip_contents.cc.

19 {
20 // Draw the clip at the max of the clip entity's depth slice, so that other
21 // draw calls with this same depth value will be culled even if they have a
22 // perspective transform.
23 return std::nextafterf(Entity::GetShaderClipDepth(clip_depth + 1), 0.0f);
24 }

References impeller::Entity::GetShaderClipDepth().

Referenced by impeller::ClipContents::Render(), and RenderClipRestore().

## ◆ GetShaderInfoLog()

static std::string impeller::GetShaderInfoLog | ( | const ProcTableGLES & | gl,
|  | GLuint | shader
| ) |  |
| static

Definition at line 22 of file pipeline_library_gles.cc.

22 {
23 GLint log_length = 0;
24 gl.GetShaderiv(shader, GL_INFO_LOG_LENGTH, &log_length);
25 if (log_length == 0) {
26 return "";
27 }
28 auto log_buffer =
29 reinterpret_cast<char*>(std::calloc(log_length, sizeof(char)));
30 gl.GetShaderInfoLog(shader, log_length, &log_length, log_buffer);
31 auto log_string = std::string(log_buffer, log_length);
32 std::free(log_buffer);
33 return log_string;
34 }

Referenced by LogShaderCompilationFailure().

## ◆ GetShaderSource()

static std::string impeller::GetShaderSource | ( | const ProcTableGLES & | gl,
|  | GLuint | shader
| ) |  |
| static

Definition at line 36 of file pipeline_library_gles.cc.

36 {
37 // Arbitrarily chosen size that should be larger than most shaders.
38 // Since this only fires on compilation errors the performance shouldn't
39 // matter.
40 auto data = static_cast<char*>(malloc(10240));
41 GLsizei length;
42 gl.GetShaderSource(shader, 10240, &length, data);
43
44 auto result = std::string{data, static_cast<size_t>(length)};
45 free(data);
46 return result;
47 }

References data.

Referenced by LogShaderCompilationFailure().

## ◆ GetShaderType()

static ShaderType impeller::GetShaderType | ( | RuntimeUniformType | type | ) |
| static

Definition at line 74 of file runtime_effect_contents.cc.

74 {
75 switch (type) {
76 case kSampledImage:
77 return ShaderType::kSampledImage;
78 case kFloat:
79 return ShaderType::kFloat;
80 case kStruct:
81 return ShaderType::kStruct;
82 }
83 }

References kFloat, kSampledImage, kStruct, and type.

Referenced by MakeShaderMetadata().

## ◆ GetSupportedDeviceExtensions()

static std::optional<std::set<std::string> > impeller::GetSupportedDeviceExtensions | ( | const vk::PhysicalDevice & | physical_device | ) |
| static

Definition at line 237 of file capabilities_vk.cc.

238 {
239 auto device_extensions = physical_device.enumerateDeviceExtensionProperties();
240 if (device_extensions.result != vk::Result::eSuccess) {
241 return std::nullopt;
242 }
243
244 std::set<std::string> exts;
245 for (const auto& device_extension : device_extensions.value) {
246 exts.insert(device_extension.extensionName);
247 };
248
249 return exts;
250 }

Referenced by impeller::CapabilitiesVK::GetEnabledDeviceExtensions(), and impeller::CapabilitiesVK::SetPhysicalDevice().

## ◆ GetVKClearValues()

static size_t impeller::GetVKClearValues | ( | const RenderTarget & | target,
|  | std::array< vk::ClearValue, kMaxAttachments > & | values
| ) |  |
| static

Definition at line 51 of file render_pass_vk.cc.

53 {
54 size_t offset = 0u;
55 target.IterateAllColorAttachments(
56 [&values, &offset](size_t index,
57 const ColorAttachment& attachment) -> bool {
58 values.at(offset++) = VKClearValueFromColor(attachment.clear_color);
59 if (attachment.resolve_texture) {
60 values.at(offset++) = VKClearValueFromColor(attachment.clear_color);
61 }
62 return true;
63 });
64
65 const auto& depth = target.GetDepthAttachment();
66 const auto& stencil = target.GetStencilAttachment();
67
68 if (depth.has_value()) {
69 values.at(offset++) = VKClearValueFromDepthStencil(
70 stencil ? stencil->clear_stencil : 0u, depth->clear_depth);
71 } else if (stencil.has_value()) {
72 values.at(offset++) = VKClearValueFromDepthStencil(
73 stencil->clear_stencil, depth ? depth->clear_depth : 0.0f);
74 }
75 return offset;
76 }

References impeller::ColorAttachment::clear_color, impeller::RenderTarget::GetDepthAttachment(), impeller::RenderTarget::GetStencilAttachment(), impeller::RenderTarget::IterateAllColorAttachments(), offset, impeller::Attachment::resolve_texture, VKClearValueFromColor(), and VKClearValueFromDepthStencil().

## ◆ GetWorkaroundsFromDriverInfo()

WorkaroundsVK impeller::GetWorkaroundsFromDriverInfo | ( | DriverInfoVK & | driver_info | ) |

Definition at line 10 of file workarounds_vk.cc.

10 {
11 WorkaroundsVK workarounds;
12
13 const auto& adreno_gpu = driver_info.GetAdrenoGPUInfo();
14 const auto& mali_gpu = driver_info.GetMaliGPUInfo();
15
16 workarounds.batch_submit_command_buffer_timeout = true;
17 if (adreno_gpu.has_value()) {
18 workarounds.slow_primitive_restart_performance = true;
19 workarounds.broken_mipmap_generation = true;
20
21 if (adreno_gpu.value() <= AdrenoGPU::kAdreno630) {
22 workarounds.input_attachment_self_dependency_broken = true;
23 }
24
25 if (adreno_gpu.value() >= AdrenoGPU::kAdreno702) {
26 workarounds.batch_submit_command_buffer_timeout = false;
27 }
28 } else if (mali_gpu.has_value()) {
29 workarounds.batch_submit_command_buffer_timeout = false;
30 }
31 return workarounds;
32 }

References impeller::WorkaroundsVK::batch_submit_command_buffer_timeout, impeller::WorkaroundsVK::broken_mipmap_generation, impeller::DriverInfoVK::GetAdrenoGPUInfo(), impeller::DriverInfoVK::GetMaliGPUInfo(), impeller::WorkaroundsVK::input_attachment_self_dependency_broken, kAdreno630, kAdreno702, and impeller::WorkaroundsVK::slow_primitive_restart_performance.

Referenced by impeller::testing::CanBatchSubmitTest(), impeller::testing::CanUseFramebufferFetch(), impeller::testing::CanUseMipgeneration(), and impeller::testing::CanUsePrimitiveRestartSubmitTest().

## ◆ glClearDepth()

void() impeller::glClearDepth | ( | GLdouble | depth | ) |

## ◆ glClearDepthf()

void() impeller::glClearDepthf | ( | GLfloat | depth | ) |

## ◆ glDepthRange()

void() impeller::glDepthRange | ( | GLdouble | n,
|  | GLdouble | f
| ) |  |

## ◆ glDepthRangef()

void() impeller::glDepthRangef | ( | GLfloat | n,
|  | GLfloat | f
| ) |  |

## ◆ GLErrorIsFatal()

bool impeller::GLErrorIsFatal | ( | GLenum | value | ) |

Definition at line 38 of file proc_table_gles.cc.

38 {
39 switch (value) {
40 case GL_NO_ERROR:
41 return false;
42 case GL_INVALID_ENUM:
43 case GL_INVALID_VALUE:
44 case GL_INVALID_OPERATION:
45 case GL_INVALID_FRAMEBUFFER_OPERATION:
46 case GL_OUT_OF_MEMORY:
47 return true;
48 }
49 return false;
50 }

References value.

Referenced by impeller::AutoErrorCheck::~AutoErrorCheck().

## ◆ GLErrorToString()

const char * impeller::GLErrorToString | ( | GLenum | value | ) |

Definition at line 18 of file proc_table_gles.cc.

18 {
19 switch (value) {
20 case GL_NO_ERROR:
21 return "GL_NO_ERROR";
22 case GL_INVALID_ENUM:
23 return "GL_INVALID_ENUM";
24 case GL_INVALID_VALUE:
25 return "GL_INVALID_VALUE";
26 case GL_INVALID_OPERATION:
27 return "GL_INVALID_OPERATION";
28 case GL_INVALID_FRAMEBUFFER_OPERATION:
29 return "GL_INVALID_FRAMEBUFFER_OPERATION";
30 case GL_FRAMEBUFFER_COMPLETE:
31 return "GL_FRAMEBUFFER_COMPLETE";
32 case GL_OUT_OF_MEMORY:
33 return "GL_OUT_OF_MEMORY";
34 }
35 return "Unknown.";
36 }

References value.

Referenced by impeller::AutoErrorCheck::~AutoErrorCheck().

## ◆ GLESShaderNameToShaderKeyName()

static std::string impeller::GLESShaderNameToShaderKeyName | ( | const std::string & | name,
|  | ShaderStage | stage
| ) |  |
| static

Definition at line 29 of file shader_library_gles.cc.

30 {
31 std::stringstream stream;
32 stream << name;
33 switch (stage) {
34 case ShaderStage::kUnknown:
35 stream << "_unknown_";
36 break;
37 case ShaderStage::kVertex:
38 stream << "_vertex_";
39 break;
40 case ShaderStage::kFragment:
41 stream << "_fragment_";
42 break;
43 case ShaderStage::kCompute:
44 stream << "_compute_";
45 break;
46 }
47 stream << "main";
48 return stream.str();
49 }

References kCompute, kFragment, kUnknown, and kVertex.

## ◆ HandleTypeToString()

std::string impeller::HandleTypeToString | ( | HandleType | type | ) |

Definition at line 11 of file handle_gles.cc.

11 {
12 switch (type) {
13 case HandleType::kUnknown:
14 return "Unknown";
15 case HandleType::kTexture:
16 return "Texture";
17 case HandleType::kBuffer:
18 return "Buffer";
19 case HandleType::kProgram:
20 return "Program";
21 case HandleType::kRenderBuffer:
22 return "RenderBuffer";
23 case HandleType::kFrameBuffer:
24 return "Framebuffer";
25 case HandleType::kFence:
26 return "Fence";
27 }
28 FML_UNREACHABLE();
29 }

References kBuffer, kFence, kFrameBuffer, kProgram, kRenderBuffer, kTexture, kUnknown, and type.

Referenced by std::operator<<().

## ◆ HasPrefix()

bool impeller::HasPrefix | ( | const std::string & | string,
|  | const std::string & | prefix
| ) |  |

Definition at line 30 of file strings.cc.

30 {
31 return string.find(prefix) == 0u;
32 }

Referenced by DetermineIfES(), and StripPrefix().

## ◆ HasRequiredProperties()

static bool impeller::HasRequiredProperties | ( | const vk::PhysicalDevice & | physical_device | ) |
| static

Definition at line 343 of file capabilities_vk.cc.

343 {
344 auto properties = physical_device.getProperties();
345 if (!(properties.limits.framebufferColorSampleCounts &
346 (vk::SampleCountFlagBits::e1 | vk::SampleCountFlagBits::e4))) {
347 return false;
348 }
349 return true;
350 }

Referenced by impeller::CapabilitiesVK::GetEnabledDeviceFeatures().

## ◆ HasRequiredQueues()

static bool impeller::HasRequiredQueues | ( | const vk::PhysicalDevice & | physical_device | ) |
| static

Definition at line 352 of file capabilities_vk.cc.

352 {
353 auto queue_flags = vk::QueueFlags{};
354 for (const auto& queue : physical_device.getQueueFamilyProperties()) {
355 if (queue.queueCount == 0) {
356 continue;
357 }
358 queue_flags |= queue.queueFlags;
359 }
360 return static_cast<VkQueueFlags>(queue_flags &
361 (vk::QueueFlagBits::eGraphics |
362 vk::QueueFlagBits::eCompute |
363 vk::QueueFlagBits::eTransfer));
364 }

Referenced by impeller::CapabilitiesVK::GetEnabledDeviceFeatures().

## ◆ HasSuffix()

bool impeller::HasSuffix | ( | const std::string & | string,
|  | const std::string & | suffix
| ) |  |

Definition at line 34 of file strings.cc.

34 {
35 auto position = string.rfind(suffix);
36 if (position == std::string::npos) {
37 return false;
38 }
39 return position == string.size() - suffix.size();
40 }

## ◆ HasSuitableColorFormat()

static bool impeller::HasSuitableColorFormat | ( | const vk::PhysicalDevice & | device,
|  | vk::Format | format
| ) |  |
| static

Definition at line 318 of file capabilities_vk.cc.

319 {
320 const auto props = device.getFormatProperties(format);
321 // This needs to be more comprehensive.
322 return !!(props.optimalTilingFeatures &
323 vk::FormatFeatureFlagBits::eColorAttachment);
324 }

Referenced by PhysicalDeviceSupportsRequiredFormats(), and impeller::CapabilitiesVK::SetPhysicalDevice().

## ◆ HasSuitableDepthStencilFormat()

static bool impeller::HasSuitableDepthStencilFormat | ( | const vk::PhysicalDevice & | device,
|  | vk::Format | format
| ) |  |
| static

Definition at line 326 of file capabilities_vk.cc.

327 {
328 const auto props = device.getFormatProperties(format);
329 return !!(props.optimalTilingFeatures &
330 vk::FormatFeatureFlagBits::eDepthStencilAttachment);
331 }

Referenced by PhysicalDeviceSupportsRequiredFormats(), and impeller::CapabilitiesVK::SetPhysicalDevice().

## ◆ HasValidationLayers()

bool impeller::HasValidationLayers | ( |  | ) |

Definition at line 53 of file context_vk.cc.

53 {
54 return gHasValidationLayers;
55 }

References gHasValidationLayers.

Referenced by impeller::QueueVK::InsertDebugMarker(), impeller::CommandBufferVK::InsertDebugMarker(), impeller::CommandBufferVK::PopDebugGroup(), impeller::CommandBufferVK::PushDebugGroup(), impeller::ContextVK::SetDebugName(), and impeller::TextureVK::TextureVK().

## ◆ HeapAlloc()

static void* impeller::HeapAlloc | ( | void * | userData,
|  | unsigned int | size
| ) |  |
| static

Definition at line 11 of file tessellator_libtess.cc.

11 {
12 return malloc(size);
13 }

## ◆ HeapFree()

static void impeller::HeapFree | ( | void * | userData,
|  | void * | ptr
| ) |  |
| static

Definition at line 19 of file tessellator_libtess.cc.

19 {
20 free(ptr);
21 }

## ◆ HeapRealloc()

static void* impeller::HeapRealloc | ( | void * | userData,
|  | void * | ptr,
|  | unsigned int | size
| ) |  |
| static

Definition at line 15 of file tessellator_libtess.cc.

15 {
16 return realloc(ptr, size);
17 }

## ◆ IdentifyVendor()

constexpr VendorVK impeller::IdentifyVendor | ( | uint32_t | vendor | ) |
| constexpr

Definition at line 143 of file driver_info_vk.cc.

143 {
144 // Check if the vendor has a PCI ID:
145 // https://pcisig.com/membership/member-companies
146 switch (vendor) {
147 case 0x1AE0:
148 return VendorVK::kGoogle;
149 case 0x168C:
150 case 0x17CB:
151 case 0x1969:
152 case 0x5143:
153 return VendorVK::kQualcomm;
154 case 0x13B5:
155 return VendorVK::kARM;
156 case 0x1010:
157 return VendorVK::kImgTec;
158 case 0x1002:
159 case 0x1022:
160 return VendorVK::kAMD;
161 case 0x10DE:
162 return VendorVK::kNvidia;
163 case 0x8086: // :)
164 return VendorVK::kIntel;
165 case 0x106B:
166 return VendorVK::kApple;
167 case 0x19E5:
168 return VendorVK::kHuawei;
169 case 0x144D:
170 return VendorVK::kSamsung;
171 }
172 // Check if the ID is a known Khronos vendor.
173 switch (vendor) {
174 case VK_VENDOR_ID_MESA:
175 return VendorVK::kMesa;
176 // There are others but have never been observed. These can be added as
177 // needed.
178 }
179 return VendorVK::kUnknown;
180 }

References kAMD, kApple, kARM, kGoogle, kHuawei, kImgTec, kIntel, kMesa, kNvidia, kQualcomm, kSamsung, and kUnknown.

Referenced by impeller::DriverInfoVK::DriverInfoVK().

## ◆ IMPELLER_ENUM_IS_MASK() [1/4]

impeller::IMPELLER_ENUM_IS_MASK | ( | android::HardwareBufferUsageFlags |  | ) |

## ◆ IMPELLER_ENUM_IS_MASK() [2/4]

impeller::IMPELLER_ENUM_IS_MASK | ( | ColorWriteMaskBits |  | ) |

## ◆ IMPELLER_ENUM_IS_MASK() [3/4]

impeller::IMPELLER_ENUM_IS_MASK | ( | MyMaskBits |  | ) |

## ◆ IMPELLER_ENUM_IS_MASK() [4/4]

impeller::IMPELLER_ENUM_IS_MASK | ( | TextureUsage |  | ) |

## ◆ ImpellerUnimplemented()

void impeller::ImpellerUnimplemented | ( | const char * | method,
|  | const char * | file,
|  | int | line
| ) |  |
| inline

Definition at line 30 of file config.h.

32 {
33 FML_CHECK(false) << "Unimplemented: " << method << " in " << file << ":"
34 << line;
35 std::abort();
36 }

## ◆ ImpellerValidationBreak()

void impeller::ImpellerValidationBreak | ( | const char * | message,
|  | const char * | file,
|  | int | line
| ) |  |

Definition at line 54 of file validation.cc.

54 {
55 if (sValidationFailureCallback &&
56 sValidationFailureCallback(message, file, line)) {
57 return;
58 }
59 const auto severity =
60 ImpellerValidationErrorsAreFatal() ? fml::LOG_FATAL : fml::LOG_ERROR;
61 auto fml_log = fml::LogMessage{severity, file, line, nullptr};
62 fml_log.stream() <<
63 #if FLUTTER_RELEASE
64 "Impeller validation: " << message;
65 #else // FLUTTER_RELEASE
66 "Break on '" << __FUNCTION__
67 << "' to inspect point of failure: " << message;
68 #endif // FLUTTER_RELEASE
69 }

References ImpellerValidationErrorsAreFatal(), and sValidationFailureCallback.

Referenced by impeller::ValidationLog::~ValidationLog().

## ◆ ImpellerValidationErrorsAreFatal()

bool impeller::ImpellerValidationErrorsAreFatal | ( |  | ) |

Definition at line 71 of file validation.cc.

71 {
72 return sValidationLogsAreFatal;
73 }

References sValidationLogsAreFatal.

Referenced by ImpellerValidationBreak(), and TEST().

## ◆ ImpellerValidationErrorsSetCallback()

void impeller::ImpellerValidationErrorsSetCallback | ( | ValidationFailureCallback | callback | ) |

Sets a callback that callers (usually tests) can set to intercept validation failures.

Returning true from the callback indicates that Impeller can continue and avoid any default behavior on tripping validation (which could include process termination).

Parameters

  [in] | callback | The callback

Definition at line 21 of file validation.cc.

21 {
22 sValidationFailureCallback = std::move(callback);
23 }

References sValidationFailureCallback.

Referenced by impeller::PlaygroundTest::~PlaygroundTest().

## ◆ ImpellerValidationErrorsSetFatal()

void impeller::ImpellerValidationErrorsSetFatal | ( | bool | fatal | ) |

Definition at line 17 of file validation.cc.

17 {
18 sValidationLogsAreFatal = fatal;
19 }

References sValidationLogsAreFatal.

Referenced by main().

## ◆ ImportVKDeviceMemoryFromAndroidHarwareBuffer()

static vk::UniqueDeviceMemory impeller::ImportVKDeviceMemoryFromAndroidHarwareBuffer | ( | const vk::Device & | device,
|  | const vk::PhysicalDevice & | physical_device,
|  | const vk::Image & | image,
|  | struct AHardwareBuffer * | hardware_buffer,
|  | const AHBProperties & | ahb_props
| ) |  |
| static

Definition at line 97 of file ahb_texture_source_vk.cc.

102 {
103 vk::PhysicalDeviceMemoryProperties memory_properties;
104 physical_device.getMemoryProperties(&memory_properties);
105 int memory_type_index = AllocatorVK::FindMemoryTypeIndex(
106 ahb_props.get().memoryTypeBits, memory_properties);
107 if (memory_type_index < 0) {
108 VALIDATION_LOG << "Could not find memory type of external image.";
109 return {};
110 }
111
112 vk::StructureChain<vk::MemoryAllocateInfo,
113 // Core in 1.1
114 vk::MemoryDedicatedAllocateInfo,
115 // For VK_ANDROID_external_memory_android_hardware_buffer
116 vk::ImportAndroidHardwareBufferInfoANDROID>
117 memory_chain;
118
119 auto& mem_alloc_info = memory_chain.get<vk::MemoryAllocateInfo>();
120 mem_alloc_info.allocationSize = ahb_props.get().allocationSize;
121 mem_alloc_info.memoryTypeIndex = memory_type_index;
122
123 auto& dedicated_alloc_info =
124 memory_chain.get<vk::MemoryDedicatedAllocateInfo>();
125 dedicated_alloc_info.image = image;
126
127 auto& ahb_import_info =
128 memory_chain.get<vk::ImportAndroidHardwareBufferInfoANDROID>();
129 ahb_import_info.buffer = hardware_buffer;
130
131 auto device_memory = device.allocateMemoryUnique(memory_chain.get());
132 if (device_memory.result != vk::Result::eSuccess) {
133 VALIDATION_LOG << "Could not allocate device memory for external image : "
134 << vk::to_string(device_memory.result);
135 return {};
136 }
137
138 return std::move(device_memory.value);
139 }

References impeller::AllocatorVK::FindMemoryTypeIndex(), and VALIDATION_LOG.

Referenced by impeller::AHBTextureSourceVK::AHBTextureSourceVK().

## ◆ InferMetalCapabilities()

static std::unique_ptr<Capabilities> impeller::InferMetalCapabilities | ( | id< MTLDevice > | device,
|  | PixelFormat | color_format
| ) |  |
| static

Definition at line 55 of file context_mtl.mm.

57 {
58 return CapabilitiesBuilder()
59 .SetSupportsOffscreenMSAA(true)
60 .SetSupportsSSBO(true)
61 .SetSupportsTextureToTextureBlits(true)
62 .SetSupportsDecalSamplerAddressMode(true)
63 .SetSupportsFramebufferFetch(DeviceSupportsFramebufferFetch(device))
64 .SetDefaultColorFormat(color_format)
65 .SetDefaultStencilFormat(PixelFormat::kS8UInt)
66 .SetDefaultDepthStencilFormat(PixelFormat::kD32FloatS8UInt)
67 .SetSupportsCompute(true)
68 .SetSupportsComputeSubgroups(DeviceSupportsComputeSubgroups(device))
69 .SetSupportsReadFromResolve(true)
70 .SetSupportsDeviceTransientTextures(true)
71 .SetDefaultGlyphAtlasFormat(PixelFormat::kA8UNormInt)
72 .SetSupportsTriangleFan(false)
73 .SetMaximumRenderPassAttachmentSize(DeviceMaxTextureSizeSupported(device))
74 .Build();
75 }

References impeller::CapabilitiesBuilder::Build(), DeviceMaxTextureSizeSupported(), DeviceSupportsComputeSubgroups(), DeviceSupportsFramebufferFetch(), kA8UNormInt, kD32FloatS8UInt, kS8UInt, impeller::CapabilitiesBuilder::SetDefaultColorFormat(), impeller::CapabilitiesBuilder::SetDefaultDepthStencilFormat(), impeller::CapabilitiesBuilder::SetDefaultGlyphAtlasFormat(), impeller::CapabilitiesBuilder::SetDefaultStencilFormat(), impeller::CapabilitiesBuilder::SetMaximumRenderPassAttachmentSize(), impeller::CapabilitiesBuilder::SetSupportsCompute(), impeller::CapabilitiesBuilder::SetSupportsComputeSubgroups(), impeller::CapabilitiesBuilder::SetSupportsDecalSamplerAddressMode(), impeller::CapabilitiesBuilder::SetSupportsDeviceTransientTextures(), impeller::CapabilitiesBuilder::SetSupportsFramebufferFetch(), impeller::CapabilitiesBuilder::SetSupportsOffscreenMSAA(), impeller::CapabilitiesBuilder::SetSupportsReadFromResolve(), impeller::CapabilitiesBuilder::SetSupportsSSBO(), impeller::CapabilitiesBuilder::SetSupportsTextureToTextureBlits(), and impeller::CapabilitiesBuilder::SetSupportsTriangleFan().

Referenced by impeller::ContextMTL::UpdateOffscreenLayerPixelFormat().

## ◆ InferShaderTypefromFileExtension()

std::optional<ArchiveShaderType> impeller::InferShaderTypefromFileExtension | ( | const std::filesystem::path & | path | ) |

Definition at line 19 of file shader_archive_writer.cc.

20 {
21 if (path == ".vert") {
22 return ArchiveShaderType::kVertex;
23 } else if (path == ".frag") {
24 return ArchiveShaderType::kFragment;
25 } else if (path == ".comp") {
26 return ArchiveShaderType::kCompute;
27 }
28 return std::nullopt;
29 }

References kCompute, kFragment, and kVertex.

Referenced by impeller::ShaderArchiveWriter::AddShaderAtPath().

## ◆ InitializeGLFWOnce()

static void impeller::InitializeGLFWOnce | ( |  | ) |
| static

Definition at line 58 of file playground.cc.

58 {
59 // This guard is a hack to work around a problem where glfwCreateWindow
60 // hangs when opening a second window after GLFW has been reinitialized (for
61 // example, when flipping through multiple playground tests).
62 //
63 // Explanation:
64 // * glfwCreateWindow calls [NSApp run], which begins running the event
65 // loop on the current thread.
66 // * GLFW then immediately stops the loop when
67 // applicationDidFinishLaunching is fired.
68 // * applicationDidFinishLaunching is only ever fired once during the
69 // application's lifetime, so subsequent calls to [NSApp run] will always
70 // hang with this setup.
71 // * glfwInit resets the flag that guards against [NSApp run] being
72 // called a second time, which causes the subsequent `glfwCreateWindow`
73 // to hang indefinitely in the event loop, because
74 // applicationDidFinishLaunching is never fired.
75 static std::once_flag sOnceInitializer;
76 std::call_once(sOnceInitializer, []() {
77 ::glfwSetErrorCallback([](int code, const char* description) {
78 FML_LOG(ERROR) << "GLFW Error '" << description << "' (" << code << ").";
79 });
80 FML_CHECK(::glfwInit() == GLFW_TRUE);
81 });
82 }

Referenced by impeller::Playground::Playground().

## ◆ InsertBarrierForInputAttachmentRead()

void impeller::InsertBarrierForInputAttachmentRead | ( | const vk::CommandBuffer & | buffer,
|  | const vk::Image & | image
| ) |  |

Inserts the appropriate barriers to ensure that subsequent commands can read from the specified image (itself a framebuffer attachment) as an input attachment.

Unlike most barriers, this barrier may only be inserted within a Vulkan render-pass.

The type of barrier inserted depends on the subpass setup and self-dependencies. Only use this utility method for inserting barriers in render passes created by `RenderPassBuilderVK`.

Parameters

  [in] | buffer | The buffer
  [in] | image | The image

Definition at line 202 of file render_pass_builder_vk.cc.

203 {
204 // This barrier must be a subset of the masks specified in the subpass
205 // dependency setup.
206 vk::ImageMemoryBarrier barrier;
207 barrier.srcAccessMask = kSelfDependencySrcAccessMask;
208 barrier.dstAccessMask = kSelfDependencyDstAccessMask;
209 barrier.oldLayout = vk::ImageLayout::eGeneral;
210 barrier.newLayout = vk::ImageLayout::eGeneral;
211 barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
212 barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
213 barrier.image = image;
214
215 vk::ImageSubresourceRange image_levels;
216 image_levels.aspectMask = vk::ImageAspectFlagBits::eColor;
217 image_levels.baseArrayLayer = 0u;
218 image_levels.baseMipLevel = 0u;
219 image_levels.layerCount = VK_REMAINING_ARRAY_LAYERS;
220 image_levels.levelCount = VK_REMAINING_MIP_LEVELS;
221 barrier.subresourceRange = image_levels;
222
223 buffer.pipelineBarrier(kSelfDependencySrcStageMask, //
224 kSelfDependencyDstStageMask, //
225 kSelfDependencyFlags, //
226 {}, //
227 {}, //
228 barrier //
229 );
230 }

References kSelfDependencyDstAccessMask, kSelfDependencyDstStageMask, kSelfDependencyFlags, kSelfDependencySrcAccessMask, and kSelfDependencySrcStageMask.

## ◆ InsertImageMemoryBarrier()

static void impeller::InsertImageMemoryBarrier | ( | const vk::CommandBuffer & | cmd,
|  | const vk::Image & | image,
|  | vk::AccessFlags | src_access_mask,
|  | vk::AccessFlags | dst_access_mask,
|  | vk::ImageLayout | old_layout,
|  | vk::ImageLayout | new_layout,
|  | vk::PipelineStageFlags | src_stage,
|  | vk::PipelineStageFlags | dst_stage,
|  | uint32_t | base_mip_level,
|  | uint32_t | mip_level_count = `1u`
| ) |  |
| static

Definition at line 16 of file blit_pass_vk.cc.

25 {
26 if (old_layout == new_layout) {
27 return;
28 }
29
30 vk::ImageMemoryBarrier barrier;
31 barrier.srcAccessMask = src_access_mask;
32 barrier.dstAccessMask = dst_access_mask;
33 barrier.oldLayout = old_layout;
34 barrier.newLayout = new_layout;
35 barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
36 barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
37 barrier.image = image;
38 barrier.subresourceRange.aspectMask = vk::ImageAspectFlagBits::eColor;
39 barrier.subresourceRange.baseMipLevel = base_mip_level;
40 barrier.subresourceRange.levelCount = mip_level_count;
41 barrier.subresourceRange.baseArrayLayer = 0u;
42 barrier.subresourceRange.layerCount = 1u;
43
44 cmd.pipelineBarrier(src_stage, dst_stage, {}, nullptr, nullptr, barrier);
45 }

## ◆ InvertPorterDuffBlend()

std::optional< BlendMode > impeller::InvertPorterDuffBlend | ( | BlendMode | blend_mode | ) |

Definition at line 51 of file blend_filter_contents.cc.

51 {
52 switch (blend_mode) {
53 case BlendMode::kClear:
54 return BlendMode::kClear;
55 case BlendMode::kSource:
56 return BlendMode::kDestination;
57 case BlendMode::kDestination:
58 return BlendMode::kSource;
59 case BlendMode::kSourceOver:
60 return BlendMode::kDestinationOver;
61 case BlendMode::kDestinationOver:
62 return BlendMode::kSourceOver;
63 case BlendMode::kSourceIn:
64 return BlendMode::kDestinationIn;
65 case BlendMode::kDestinationIn:
66 return BlendMode::kSourceIn;
67 case BlendMode::kSourceOut:
68 return BlendMode::kDestinationOut;
69 case BlendMode::kDestinationOut:
70 return BlendMode::kSourceOut;
71 case BlendMode::kSourceATop:
72 return BlendMode::kDestinationATop;
73 case BlendMode::kDestinationATop:
74 return BlendMode::kSourceATop;
75 case BlendMode::kXor:
76 return BlendMode::kXor;
77 case BlendMode::kPlus:
78 return BlendMode::kPlus;
79 case BlendMode::kModulate:
80 return BlendMode::kModulate;
81 default:
82 return std::nullopt;
83 }
84 }

References kClear, kDestination, kDestinationATop, kDestinationIn, kDestinationOut, kDestinationOver, kModulate, kPlus, kSource, kSourceATop, kSourceIn, kSourceOut, kSourceOver, and kXor.

Referenced by impeller::VerticesSimpleBlendContents::Render(), and impeller::AtlasContents::Render().

## ◆ IPLR_CAPABILITY()

class impeller::IPLR_CAPABILITY | ( | "mutex" |  | ) |

Definition at line 22 of file thread.h.

22 {
23 public:
24 Mutex() = default;
25
26 ~Mutex() = default;
27
28 void Lock() IPLR_ACQUIRE() { mutex_.lock(); }
29
30 void Unlock() IPLR_RELEASE() { mutex_.unlock(); }
31
32 private:
33 friend class ConditionVariable;
34
35 std::mutex mutex_;
36
37 Mutex(const Mutex&) = delete;
38
39 Mutex(Mutex&&) = delete;
40
41 Mutex& operator=(const Mutex&) = delete;
42
43 Mutex& operator=(Mutex&&) = delete;
44 };

References IPLR_ACQUIRE, and IPLR_RELEASE.

## ◆ IPLR_GUARDED_BY()

static std::unordered_map< const ContextVK*, std::vector<std::weak_ptr<CommandPoolVK> > > g_all_pools_map impeller::IPLR_GUARDED_BY | ( | g_all_pools_map_mutex |  | ) |
| static

## ◆ IsDepthWritable()

constexpr bool impeller::IsDepthWritable | ( | PixelFormat | format | ) |
| constexpr

Definition at line 119 of file formats.h.

119 {
120 switch (format) {
121 case PixelFormat::kD24UnormS8Uint:
122 case PixelFormat::kD32FloatS8UInt:
123 return true;
124 default:
125 return false;
126 }
127 }

References kD24UnormS8Uint, and kD32FloatS8UInt.

## ◆ IsExtensionInList()

template<class ExtensionEnum >

static bool impeller::IsExtensionInList | ( | const std::vector< std::string > & | list,
|  | ExtensionEnum | ext
| ) |  |
| static

Definition at line 367 of file capabilities_vk.cc.

368 {
369 const std::string name = GetExtensionName(ext);
370 return std::find(list.begin(), list.end(), name) != list.end();
371 }

References GetExtensionName().

Referenced by impeller::CapabilitiesVK::GetEnabledDeviceFeatures().

## ◆ IsMappingSPIRV()

static bool impeller::IsMappingSPIRV | ( | const fml::Mapping & | mapping | ) |
| static

Definition at line 116 of file shader_library_vk.cc.

116 {
117 // https://registry.khronos.org/SPIR-V/specs/1.0/SPIRV.html#Magic
118 const uint32_t kSPIRVMagic = 0x07230203;
119 if (mapping.GetSize() < sizeof(kSPIRVMagic)) {
120 return false;
121 }
122 uint32_t magic = 0u;
123 ::memcpy(&magic, mapping.GetMapping(), sizeof(magic));
124 return magic == kSPIRVMagic;
125 }

## ◆ IsMultisampleCapable()

constexpr bool impeller::IsMultisampleCapable | ( | TextureType | type | ) |
| constexpr

Definition at line 283 of file formats.h.

283 {
284 switch (type) {
285 case TextureType::kTexture2D:
286 case TextureType::kTextureCube:
287 case TextureType::kTextureExternalOES:
288 return false;
289 case TextureType::kTexture2DMultisample:
290 return true;
291 }
292 return false;
293 }

References kTexture2D, kTexture2DMultisample, kTextureCube, kTextureExternalOES, and type.

Referenced by impeller::TextureDescriptor::SamplingOptionsAreValid().

## ◆ IsStencilWritable()

constexpr bool impeller::IsStencilWritable | ( | PixelFormat | format | ) |
| constexpr

Definition at line 129 of file formats.h.

129 {
130 switch (format) {
131 case PixelFormat::kS8UInt:
132 case PixelFormat::kD24UnormS8Uint:
133 case PixelFormat::kD32FloatS8UInt:
134 return true;
135 default:
136 return false;
137 }
138 }

References kD24UnormS8Uint, kD32FloatS8UInt, and kS8UInt.

## ◆ IterateExtensions()

template<class T >

static bool impeller::IterateExtensions | ( | const std::function< bool(T)> & | it | ) |
| static

Definition at line 225 of file capabilities_vk.cc.

225 {
226 if (!it) {
227 return false;
228 }
229 for (size_t i = 0; i < static_cast<uint32_t>(T::kLast); i++) {
230 if (!it(static_cast<T>(i))) {
231 return false;
232 }
233 }
234 return true;
235 }

## ◆ JoinLabels()

static std::string impeller::JoinLabels | ( | const VkDebugUtilsLabelEXT * | labels,
|  | size_t | count
| ) |  |
| static

Definition at line 48 of file debug_report_vk.cc.

49 {
50 std::stringstream stream;
51 for (size_t i = 0u; i < count; i++) {
52 stream << labels[i].pLabelName;
53 if (i != count - 1u) {
54 stream << ", ";
55 }
56 }
57 return stream.str();
58 }

## ◆ JoinVKDebugUtilsObjectNameInfoEXT()

static std::string impeller::JoinVKDebugUtilsObjectNameInfoEXT | ( | const VkDebugUtilsObjectNameInfoEXT * | names,
|  | size_t | count
| ) |  |
| static

Definition at line 60 of file debug_report_vk.cc.

62 {
63 std::stringstream stream;
64 for (size_t i = 0u; i < count; i++) {
65 stream << vk::to_string(static_cast<vk::ObjectType>(names[i].objectType))
66 << " [" << names[i].objectHandle << "] [";
67 if (names[i].pObjectName != nullptr) {
68 stream << names[i].pObjectName;
69 } else {
70 stream << "UNNAMED";
71 }
72 stream << "]";
73 if (i != count - 1u) {
74 stream << ", ";
75 }
76 }
77 return stream.str();
78 }

## ◆ kLowerLeftDirection()

static constexpr Point impeller::kLowerLeftDirection | ( | -1. | 0f,
|  | 1. | 0f
| ) |  |
| static constexpr

Referenced by impeller::RoundRect::Contains().

## ◆ kLowerRightDirection()

static constexpr Point impeller::kLowerRightDirection | ( | 1. | 0f,
|  | 1. | 0f
| ) |  |
| static constexpr

Referenced by impeller::RoundRect::Contains().

## ◆ kUpperLeftDirection()

static constexpr Point impeller::kUpperLeftDirection | ( | -1. | 0f,
|  | -1. | 0f
| ) |  |
| static constexpr

Referenced by impeller::RoundRect::Contains().

## ◆ kUpperRightDirection()

static constexpr Point impeller::kUpperRightDirection | ( | 1. | 0f,
|  | -1. | 0f
| ) |  |
| static constexpr

Referenced by impeller::RoundRect::Contains().

## ◆ LerpHackKernelSamples()

GaussianBlurPipeline::FragmentShader::KernelSamples impeller::LerpHackKernelSamples | ( | KernelSamples | samples | ) |

This will shrink the size of a kernel by roughly half by sampling between samples and relying on linear interpolation between the samples.

Definition at line 954 of file gaussian_blur_filter_contents.cc.

955 {
956 GaussianBlurPipeline::FragmentShader::KernelSamples result = {};
957 result.sample_count = ((parameters.sample_count - 1) / 2) + 1;
958 int32_t middle = result.sample_count / 2;
959 int32_t j = 0;
960 FML_DCHECK(result.sample_count <= kGaussianBlurMaxKernelSize);
961 static_assert(sizeof(result.sample_data) ==
962 sizeof(std::array<Vector4, kGaussianBlurMaxKernelSize>));
963
964 for (int i = 0; i < result.sample_count; i++) {
965 if (i == middle) {
966 result.sample_data[i].x = parameters.samples[j].uv_offset.x;
967 result.sample_data[i].y = parameters.samples[j].uv_offset.y;
968 result.sample_data[i].z = parameters.samples[j].coefficient;
969 j++;
970 } else {
971 KernelSample left = parameters.samples[j];
972 KernelSample right = parameters.samples[j + 1];
973
974 result.sample_data[i].z = left.coefficient + right.coefficient;
975
976 Point uv = (left.uv_offset * left.coefficient +
977 right.uv_offset * right.coefficient) /
978 (left.coefficient + right.coefficient);
979 result.sample_data[i].x = uv.x;
980 result.sample_data[i].y = uv.y;
981 j += 2;
982 }
983 }
984
985 return result;
986 }

References impeller::KernelSample::coefficient, kGaussianBlurMaxKernelSize, impeller::KernelSamples::sample_count, impeller::KernelSamples::samples, impeller::KernelSample::uv_offset, impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

Referenced by impeller::testing::TEST().

## ◆ LinearSolve()

static Scalar impeller::LinearSolve | ( | Scalar | t,
|  | Scalar | p0,
|  | Scalar | p1
| ) |  |
| inline static

Definition at line 168 of file path_component.cc.

168 {
169 return p0 + t * (p1 - p0);
170 }

Referenced by impeller::LinearPathComponent::Solve().

## ◆ LineTo()

IMPELLER_API void impeller::LineTo | ( | PathBuilder * | builder,
|  | Scalar | x,
|  | Scalar | y
| ) |  |

Definition at line 24 of file tessellator.cc.

24 {
25 builder->LineTo(Point(x, y));
26 }

References impeller::PathBuilder::LineTo(), and x.

Referenced by impeller::testing::TEST(), and impeller::testing::TEST_P().

## ◆ LinkProgram()

static bool impeller::LinkProgram | ( | const ReactorGLES & | reactor,
|  | const std::shared_ptr< PipelineGLES > & | pipeline,
|  | const std::shared_ptr< const ShaderFunction > & | vert_function,
|  | const std::shared_ptr< const ShaderFunction > & | frag_function
| ) |  |
| static

Definition at line 77 of file pipeline_library_gles.cc.

81 {
82 TRACE_EVENT0("impeller", __FUNCTION__);
83
84 const auto& descriptor = pipeline->GetDescriptor();
85
86 auto vert_mapping =
87 ShaderFunctionGLES::Cast(*vert_function).GetSourceMapping();
88 auto frag_mapping =
89 ShaderFunctionGLES::Cast(*frag_function).GetSourceMapping();
90
91 const auto& gl = reactor.GetProcTable();
92
93 auto vert_shader = gl.CreateShader(GL_VERTEX_SHADER);
94 auto frag_shader = gl.CreateShader(GL_FRAGMENT_SHADER);
95
96 if (vert_shader == 0 || frag_shader == 0) {
97 VALIDATION_LOG << "Could not create shader handles.";
98 return false;
99 }
100
101 gl.SetDebugLabel(DebugResourceType::kShader, vert_shader,
102 SPrintF("%s Vertex Shader", descriptor.GetLabel().data()));
103 gl.SetDebugLabel(DebugResourceType::kShader, frag_shader,
104 SPrintF("%s Fragment Shader", descriptor.GetLabel().data()));
105
106 fml::ScopedCleanupClosure delete_vert_shader(
107 [&gl, vert_shader]() { gl.DeleteShader(vert_shader); });
108 fml::ScopedCleanupClosure delete_frag_shader(
109 [&gl, frag_shader]() { gl.DeleteShader(frag_shader); });
110
111 gl.ShaderSourceMapping(vert_shader, *vert_mapping,
112 descriptor.GetSpecializationConstants());
113 gl.ShaderSourceMapping(frag_shader, *frag_mapping,
114 descriptor.GetSpecializationConstants());
115
116 gl.CompileShader(vert_shader);
117 gl.CompileShader(frag_shader);
118
119 GLint vert_status = GL_FALSE;
120 GLint frag_status = GL_FALSE;
121
122 gl.GetShaderiv(vert_shader, GL_COMPILE_STATUS, &vert_status);
123 gl.GetShaderiv(frag_shader, GL_COMPILE_STATUS, &frag_status);
124
125 if (vert_status != GL_TRUE) {
126 LogShaderCompilationFailure(gl, vert_shader, descriptor.GetLabel(),
127 *vert_mapping, ShaderStage::kVertex);
128 return false;
129 }
130
131 if (frag_status != GL_TRUE) {
132 LogShaderCompilationFailure(gl, frag_shader, descriptor.GetLabel(),
133 *frag_mapping, ShaderStage::kFragment);
134 return false;
135 }
136
137 auto program = reactor.GetGLHandle(pipeline->GetProgramHandle());
138 if (!program.has_value()) {
139 VALIDATION_LOG << "Could not get program handle from reactor.";
140 return false;
141 }
142
143 gl.AttachShader(*program, vert_shader);
144 gl.AttachShader(*program, frag_shader);
145
146 fml::ScopedCleanupClosure detach_vert_shader(
147 [&gl, program = *program, vert_shader]() {
148 gl.DetachShader(program, vert_shader);
149 });
150 fml::ScopedCleanupClosure detach_frag_shader(
151 [&gl, program = *program, frag_shader]() {
152 gl.DetachShader(program, frag_shader);
153 });
154
155 for (const auto& stage_input :
156 descriptor.GetVertexDescriptor()->GetStageInputs()) {
157 gl.BindAttribLocation(*program, //
158 static_cast<GLuint>(stage_input.location), //
159 stage_input.name //
160 );
161 }
162
163 gl.LinkProgram(*program);
164
165 GLint link_status = GL_FALSE;
166 gl.GetProgramiv(*program, GL_LINK_STATUS, &link_status);
167
168 if (link_status != GL_TRUE) {
169 VALIDATION_LOG << "Could not link shader program: "
170 << gl.GetProgramInfoLogString(*program);
171 return false;
172 }
173 return true;
174 }

References impeller::BackendCast< ShaderFunctionGLES, ShaderFunction >::Cast(), impeller::ReactorGLES::GetGLHandle(), impeller::ReactorGLES::GetProcTable(), impeller::ShaderFunctionGLES::GetSourceMapping(), kFragment, kShader, kVertex, LogShaderCompilationFailure(), SPrintF(), and VALIDATION_LOG.

## ◆ LoadActionToString()

constexpr const char* impeller::LoadActionToString | ( | LoadAction | action | ) |
| constexpr

Definition at line 215 of file formats.h.

215 {
216 switch (action) {
217 case LoadAction::kDontCare:
218 return "DontCare";
219 case LoadAction::kLoad:
220 return "Load";
221 case LoadAction::kClear:
222 return "Clear";
223 }
224 }

References kClear, kDontCare, and kLoad.

Referenced by AttachmentToString().

## ◆ LogMTLCommandBufferErrorIfPresent()

static bool impeller::LogMTLCommandBufferErrorIfPresent | ( | id< MTLCommandBuffer > | buffer | ) |
| static

Definition at line 60 of file command_buffer_mtl.mm.

60 {
61 if (!buffer) {
62 return true;
63 }
64
65 if (buffer.status == MTLCommandBufferStatusCompleted) {
66 return true;
67 }
68
69 std::stringstream stream;
70 stream << ">>>>>>>" << std::endl;
71 stream << "Impeller command buffer could not be committed!" << std::endl;
72
73 if (auto desc = buffer.error.localizedDescription) {
74 stream << desc.UTF8String << std::endl;
75 }
76
77 if (buffer.error) {
78 stream << "Domain: "
79 << (buffer.error.domain.length > 0u ? buffer.error.domain.UTF8String
80 : "<unknown>")
81 << " Code: "
82 << MTLCommandBufferErrorToString(
83 static_cast<MTLCommandBufferError>(buffer.error.code))
84 .UTF8String
85 << std::endl;
86 }
87
88 if (@available(iOS 14.0, macOS 11.0, *)) {
89 NSArray<id<MTLCommandBufferEncoderInfo>>* infos =
90 buffer.error.userInfo[MTLCommandBufferEncoderInfoErrorKey];
91 for (id<MTLCommandBufferEncoderInfo> info in infos) {
92 stream << (info.label.length > 0u ? info.label.UTF8String
93 : "<Unlabelled Render Pass>")
94 << ": "
95 << MTLCommandEncoderErrorStateToString(info.errorState).UTF8String
96 << std::endl;
97
98 auto signposts = [info.debugSignposts componentsJoinedByString:@", "];
99 if (signposts.length > 0u) {
100 stream << signposts.UTF8String << std::endl;
101 }
102 }
103
104 for (id<MTLFunctionLog> log in buffer.logs) {
105 auto desc = log.description;
106 if (desc.length > 0u) {
107 stream << desc.UTF8String << std::endl;
108 }
109 }
110 }
111
112 stream << "<<<<<<<";
113 VALIDATION_LOG << stream.str();
114 return false;
115 }

References MTLCommandBufferErrorToString(), and VALIDATION_LOG.

## ◆ LogShaderCompilationFailure()

static void impeller::LogShaderCompilationFailure | ( | const ProcTableGLES & | gl,
|  | GLuint | shader,
|  | std::string_view | name,
|  | const fml::Mapping & | source_mapping,
|  | ShaderStage | stage
| ) |  |
| static

Definition at line 49 of file pipeline_library_gles.cc.

53 {
54 std::stringstream stream;
55 stream << "Failed to compile ";
56 switch (stage) {
57 case ShaderStage::kUnknown:
58 stream << "unknown";
59 break;
60 case ShaderStage::kVertex:
61 stream << "vertex";
62 break;
63 case ShaderStage::kFragment:
64 stream << "fragment";
65 break;
66 case ShaderStage::kCompute:
67 stream << "compute";
68 break;
69 }
70 stream << " shader for '" << name << "' with error:" << std::endl;
71 stream << GetShaderInfoLog(gl, shader) << std::endl;
72 stream << "Shader source was: " << std::endl;
73 stream << GetShaderSource(gl, shader) << std::endl;
74 VALIDATION_LOG << stream.str();
75 }

References GetShaderInfoLog(), GetShaderSource(), kCompute, kFragment, kUnknown, kVertex, and VALIDATION_LOG.

Referenced by LinkProgram().

## ◆ Luminosity()

static constexpr Scalar impeller::Luminosity | ( | Vector3 | color | ) |
| inline static constexpr

Definition at line 63 of file color.cc.

63 {
64 return color.x * 0.3f + color.y * 0.59f + color.z * 0.11f;
65 }

References impeller::Vector3::x, impeller::Vector3::y, and impeller::Vector3::z.

Referenced by impeller::Color::Blend(), ClipColor(), impeller::BlendFilterContents::SetBlendMode(), and SetLuminosity().

## ◆ Main()

bool impeller::Main | ( | const fml::CommandLine & | command_line | ) |

Definition at line 13 of file shader_archive_main.cc.

13 {
14 ShaderArchiveWriter writer;
15
16 std::string output;
17 if (!command_line.GetOptionValue("output", &output)) {
18 std::cerr << "Output path not specified." << std::endl;
19 return false;
20 }
21
22 for (const auto& input : command_line.GetOptionValues("input")) {
23 if (!writer.AddShaderAtPath(std::string{input})) {
24 std::cerr << "Could not add shader at path: " << input << std::endl;
25 return false;
26 }
27 }
28
29 auto archive = writer.CreateMapping();
30 if (!archive) {
31 std::cerr << "Could not create shader archive." << std::endl;
32 return false;
33 }
34
35 auto current_directory =
36 fml::OpenDirectory(std::filesystem::current_path().string().c_str(),
37 false, fml::FilePermission::kReadWrite);
38 auto output_path =
39 std::filesystem::absolute(std::filesystem::current_path() / output);
40 if (!fml::WriteAtomically(current_directory, output_path.string().c_str(),
41 *archive)) {
42 std::cerr << "Could not write shader archive to path " << output
43 << std::endl;
44 return false;
45 }
46
47 return true;
48 }

References impeller::ShaderArchiveWriter::AddShaderAtPath(), and impeller::ShaderArchiveWriter::CreateMapping().

Referenced by main().

## ◆ MAKE_STROKE_BENCHMARK_CAPTURE() [1/3]

impeller::MAKE_STROKE_BENCHMARK_CAPTURE | ( | RRect | ,
|  | Butt | ,
|  | Bevel |
| ) |  |

## ◆ MAKE_STROKE_BENCHMARK_CAPTURE() [2/3]

impeller::MAKE_STROKE_BENCHMARK_CAPTURE | ( | RRect | ,
|  | Butt | ,
|  | Miter |
| ) |  |

## ◆ MAKE_STROKE_BENCHMARK_CAPTURE() [3/3]

impeller::MAKE_STROKE_BENCHMARK_CAPTURE | ( | RRect | ,
|  | Butt | ,
|  | Round |
| ) |  |

## ◆ MAKE_STROKE_BENCHMARK_CAPTURE_ALL_CAPS_JOINS() [1/2]

impeller::MAKE_STROKE_BENCHMARK_CAPTURE_ALL_CAPS_JOINS | ( | Cubic | ,
|  | false |
| ) |  |

## ◆ MAKE_STROKE_BENCHMARK_CAPTURE_ALL_CAPS_JOINS() [2/2]

impeller::MAKE_STROKE_BENCHMARK_CAPTURE_ALL_CAPS_JOINS | ( | Quadratic | ,
|  | false |
| ) |  |

## ◆ MakeShaderMetadata()

static std::unique_ptr<ShaderMetadata> impeller::MakeShaderMetadata | ( | const RuntimeUniformDescription & | uniform | ) |
| static

Definition at line 85 of file runtime_effect_contents.cc.

86 {
87 std::unique_ptr<ShaderMetadata> metadata = std::make_unique<ShaderMetadata>();
88 metadata->name = uniform.name;
89 metadata->members.emplace_back(ShaderStructMemberMetadata{
90 .type = GetShaderType(uniform.type),
91 .size = uniform.GetSize(),
92 .byte_length = uniform.bit_width / 8,
93 });
94
95 return metadata;
96 }

References impeller::RuntimeUniformDescription::bit_width, GetShaderType(), impeller::RuntimeUniformDescription::GetSize(), impeller::RuntimeUniformDescription::name, impeller::RuntimeUniformDescription::type, and impeller::ShaderStructMemberMetadata::type.

Referenced by impeller::RuntimeEffectContents::Render().

## ◆ MakeSharedVK()

template<class T >

auto impeller::MakeSharedVK | ( | vk::UniqueHandle< T, VULKAN_HPP_DEFAULT_DISPATCHER_TYPE > | handle | ) |

Definition at line 44 of file shared_object_vk.h.

45 {
46 if (!handle) {
47 return std::shared_ptr<SharedObjectVKT<T>>{nullptr};
48 }
49 return std::make_shared<SharedObjectVKT<T>>(std::move(handle));
50 }

Referenced by impeller::ExternalFenceVK::ExternalFenceVK().

## ◆ MakeTextFrameFromTextBlobSkia()

std::shared_ptr< impeller::TextFrame > impeller::MakeTextFrameFromTextBlobSkia | ( | const sk_sp< SkTextBlob > & | blob | ) |

Definition at line 42 of file text_frame_skia.cc.

43 {
44 bool has_color = false;
45 std::vector<TextRun> runs;
46 for (SkTextBlobRunIterator run(blob.get()); !run.done(); run.next()) {
47 SkStrikeSpec strikeSpec = SkStrikeSpec::MakeWithNoDevice(run.font());
48 SkBulkGlyphMetricsAndPaths paths{strikeSpec};
49 SkSpan<const SkGlyph*> glyphs =
50 paths.glyphs(SkSpan(run.glyphs(), run.glyphCount()));
51
52 for (const auto& glyph : glyphs) {
53 has_color |= glyph->isColor();
54 }
55
56 AxisAlignment alignment = AxisAlignment::kNone;
57 if (run.font().isSubpixel() && run.font().isBaselineSnap() && !has_color) {
58 alignment = AxisAlignment::kX;
59 }
60
61 switch (run.positioning()) {
62 case SkTextBlobRunIterator::kFull_Positioning: {
63 std::vector<TextRun::GlyphPosition> positions;
64 positions.reserve(run.glyphCount());
65 for (auto i = 0u; i < run.glyphCount(); i++) {
66 // kFull_Positioning has two scalars per glyph.
67 const SkPoint* glyph_points = run.points();
68 const SkPoint* point = glyph_points + i;
69 Glyph::Type type =
70 glyphs[i]->isColor() ? Glyph::Type::kBitmap : Glyph::Type::kPath;
71 positions.emplace_back(TextRun::GlyphPosition{
72 Glyph{glyphs[i]->getGlyphID(), type}, Point{
73 point->x(),
74 point->y(),
75 }});
76 }
77 TextRun text_run(ToFont(run, alignment), positions);
78 runs.emplace_back(text_run);
79 break;
80 }
81 default:
82 FML_DLOG(ERROR) << "Unimplemented.";
83 continue;
84 }
85 }
86 return std::make_shared<TextFrame>(runs, ToRect(blob->bounds()), has_color);
87 }

References impeller::Glyph::kBitmap, kNone, impeller::Glyph::kPath, kX, ToFont(), ToRect(), type, and impeller::TPoint< T >::x.

Referenced by impeller::testing::TEST_P().

## ◆ Min()

static constexpr Color impeller::Min | ( | Color | c,
|  | float | threshold
| ) |  |
| inline static constexpr

Definition at line 55 of file color.cc.

55 {
56 return Color(std::min(c.red, threshold), std::min(c.green, threshold),
57 std::min(c.blue, threshold), std::min(c.alpha, threshold));
58 }

References impeller::Color::alpha, impeller::Color::blue, impeller::Color::green, and impeller::Color::red.

Referenced by impeller::Color::Blend().

## ◆ MoveTo()

IMPELLER_API void impeller::MoveTo | ( | PathBuilder * | builder,
|  | Scalar | x,
|  | Scalar | y
| ) |  |

Definition at line 20 of file tessellator.cc.

20 {
21 builder->MoveTo(Point(x, y));
22 }

References impeller::PathBuilder::MoveTo(), and x.

Referenced by impeller::testing::TEST(), and impeller::testing::TEST_P().

## ◆ MTLCommandBufferErrorToString()

static NSString* impeller::MTLCommandBufferErrorToString | ( | MTLCommandBufferError | code | ) |
| static

Definition at line 35 of file command_buffer_mtl.mm.

35 {
36 switch (code) {
37 case MTLCommandBufferErrorNone:
38 return @"none";
39 case MTLCommandBufferErrorInternal:
40 return @"internal";
41 case MTLCommandBufferErrorTimeout:
42 return @"timeout";
43 case MTLCommandBufferErrorPageFault:
44 return @"page fault";
45 case MTLCommandBufferErrorNotPermitted:
46 return @"not permitted";
47 case MTLCommandBufferErrorOutOfMemory:
48 return @"out of memory";
49 case MTLCommandBufferErrorInvalidResource:
50 return @"invalid resource";
51 case MTLCommandBufferErrorMemoryless:
52 return @"memory-less";
53 default:
54 break;
55 }
56
57 return [NSString stringWithFormat:@"<unknown> %zu", code];
58 }

Referenced by LogMTLCommandBufferErrorIfPresent().

## ◆ MTLShaderLibraryFromFileData()

static NSArray<id<MTLLibrary> >* impeller::MTLShaderLibraryFromFileData | ( | id< MTLDevice > | device,
|  | const std::vector< std::shared_ptr< fml::Mapping >> & | libraries_data,
|  | const std::string & | label
| ) |  |
| static

Definition at line 169 of file context_mtl.mm.

172 {
173 NSMutableArray<id<MTLLibrary>>* found_libraries = [NSMutableArray array];
174 for (const auto& library_data : libraries_data) {
175 if (library_data == nullptr) {
176 FML_LOG(ERROR) << "Shader library data was null.";
177 return nil;
178 }
179
180 __block auto data = library_data;
181
182 auto dispatch_data =
183 ::dispatch_data_create(library_data->GetMapping(), // buffer
184 library_data->GetSize(), // size
185 dispatch_get_main_queue(), // queue
186 ^() {
187 // We just need a reference.
188 data.reset();
189 } // destructor
190 );
191 if (!dispatch_data) {
192 FML_LOG(ERROR) << "Could not wrap shader data in dispatch data.";
193 return nil;
194 }
195
196 NSError* shader_library_error = nil;
197 auto library = [device newLibraryWithData:dispatch_data
198 error:&shader_library_error];
199 if (!library) {
200 FML_LOG(ERROR) << "Could not create shader library: "
201 << shader_library_error.localizedDescription.UTF8String;
202 return nil;
203 }
204 if (!label.empty()) {
205 library.label = @(label.c_str());
206 }
207 [found_libraries addObject:library];
208 }
209 return found_libraries;
210 }

References data.

Referenced by impeller::ContextMTL::Create().

## ◆ MTLShaderLibraryFromFilePaths()

static NSArray<id<MTLLibrary> >* impeller::MTLShaderLibraryFromFilePaths | ( | id< MTLDevice > | device,
|  | const std::vector< std::string > & | libraries_paths
| ) |  |
| static

Definition at line 146 of file context_mtl.mm.

148 {
149 NSMutableArray<id<MTLLibrary>>* found_libraries = [NSMutableArray array];
150 for (const auto& library_path : libraries_paths) {
151 if (!fml::IsFile(library_path)) {
152 VALIDATION_LOG << "Shader library does not exist at path '"
153 << library_path << "'";
154 return nil;
155 }
156 NSError* shader_library_error = nil;
157 auto library = [device newLibraryWithFile:@(library_path.c_str())
158 error:&shader_library_error];
159 if (!library) {
160 FML_LOG(ERROR) << "Could not create shader library: "
161 << shader_library_error.localizedDescription.UTF8String;
162 return nil;
163 }
164 [found_libraries addObject:library];
165 }
166 return found_libraries;
167 }

References VALIDATION_LOG.

Referenced by impeller::ContextMTL::Create().

## ◆ NearEqual()

static bool impeller::NearEqual | ( | Scalar | a,
|  | Scalar | b,
|  | Scalar | epsilon
| ) |  |
| inline static

Definition at line 370 of file path_component.cc.

370 {
371 return (a > (b - epsilon)) && (a < (b + epsilon));
372 }

References impeller::saturated::b.

Referenced by NearZero().

## ◆ NearZero()

static bool impeller::NearZero | ( | Scalar | a | ) |
| inline static

Definition at line 374 of file path_component.cc.

374 {
375 return NearEqual(a, 0.0, 1e-12);
376 }

References NearEqual().

Referenced by CubicPathBoundingPopulateValues().

## ◆ NegPos()

static Point impeller::NegPos | ( | Scalar | v | ) |
| static

Definition at line 67 of file solid_rrect_blur_contents.cc.

67 {
68 return {std::min(v, 0.0f), std::max(v, 0.0f)};
69 }

Referenced by SetupFragInfo().

## ◆ NormalizeEmptyToZero()

static void impeller::NormalizeEmptyToZero | ( | Size & | radii | ) |
| inline static

Definition at line 9 of file rounding_radii.cc.

9 {
10 if (radii.IsEmpty()) {
11 radii = Size();
12 }
13 }

References impeller::TSize< T >::IsEmpty().

Referenced by impeller::RoundingRadii::Scaled().

## ◆ NormalizeUniformKey()

static std::string impeller::NormalizeUniformKey | ( | const std::string & | key | ) |
| static

Definition at line 69 of file buffer_bindings_gles.cc.

69 {
70 std::string result;
71 result.reserve(key.length());
72 for (char ch : key) {
73 if (ch != '_') {
74 result.push_back(toupper(ch));
75 }
76 }
77 return result;
78 }

Referenced by CreateUniformMemberKey().

## ◆ operator!=()

template<typename EnumType , typename std::enable_if_t< MaskTraits< EnumType >::kIsMask, bool > = true>

constexpr bool impeller::operator!= | ( | const EnumType & | lhs,
|  | const Mask< EnumType > & | rhs
| ) |  |
| inline constexpr

Definition at line 223 of file mask.h.

224 {
225 return Mask<EnumType>{lhs} != rhs;
226 }

## ◆ operator&() [1/2]

template<typename EnumType , typename std::enable_if< MaskTraits< EnumType >::kIsMask, bool >::type = true>

constexpr Mask<EnumType> impeller::operator& | ( | const EnumType & | lhs,
|  | const EnumType & | rhs
| ) |  |
| inline constexpr

Definition at line 139 of file mask.h.

140 {
141 return Mask<EnumType>{lhs} & rhs;
142 }

## ◆ operator&() [2/2]

template<typename EnumType , typename std::enable_if< MaskTraits< EnumType >::kIsMask, bool >::type = true>

constexpr Mask<EnumType> impeller::operator& | ( | const EnumType & | lhs,
|  | const Mask< EnumType > & | rhs
| ) |  |
| inline constexpr

Definition at line 170 of file mask.h.

171 {
172 return Mask<EnumType>{lhs} & rhs;
173 }

## ◆ operator*() [1/7]

template<class F , class I , class = MixedOp<F, I>>

constexpr TPoint<F> impeller::operator* | ( | const TPoint< F > & | p1,
|  | const TPoint< I > & | p2
| ) |  |
| constexpr

Definition at line 269 of file point.h.

269 {
270 return {p1.x * static_cast<F>(p2.x), p1.y * static_cast<F>(p2.y)};
271 }

References impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

## ◆ operator*() [2/7]

template<class F , class I , class = MixedOp<F, I>>

constexpr TPoint<F> impeller::operator* | ( | const TPoint< I > & | p1,
|  | const TPoint< F > & | p2
| ) |  |
| constexpr

Definition at line 274 of file point.h.

274 {
275 return p2 * p1;
276 }

## ◆ operator*() [3/7]

template<class T , class U >

constexpr TPoint<T> impeller::operator* | ( | const TSize< U > & | s,
|  | const TPoint< T > & | p
| ) |  |
| constexpr

Definition at line 313 of file point.h.

313 {
314 return p * s;
315 }

## ◆ operator*() [4/7]

template<class T , class = std::enable_if_t<std::is_arithmetic_v<T>>>

constexpr Color impeller::operator* | ( | T | value,
|  | const Color & | c
| ) |  |
| inline constexpr

Definition at line 908 of file color.h.

908 {
909 return c * static_cast<Scalar>(value);
910 }

References value.

## ◆ operator*() [5/7]

template<class T , class U , class = std::enable_if_t<std::is_arithmetic_v<U>>>

constexpr TPoint<T> impeller::operator* | ( | U | s,
|  | const TPoint< T > & | p
| ) |  |
| constexpr

Definition at line 291 of file point.h.

291 {
292 return p * s;
293 }

## ◆ operator*() [6/7]

template<class T , class U , class = std::enable_if_t<std::is_arithmetic_v<U>>>

constexpr TSize<T> impeller::operator* | ( | U | s,
|  | const TSize< T > & | p
| ) |  |
| constexpr

Definition at line 162 of file size.h.

162 {
163 return p * s;
164 }

## ◆ operator*() [7/7]

template<class U , class = std::enable_if_t<std::is_arithmetic_v<U>>>

constexpr Vector3 impeller::operator* | ( | U | s,
|  | const Vector3 & | p
| ) |  |
| constexpr

Definition at line 209 of file vector.h.

209 {
210 return p * s;
211 }

## ◆ operator+() [1/5]

template<class F , class I , class = MixedOp<F, I>>

constexpr TPoint<F> impeller::operator+ | ( | const TPoint< F > & | p1,
|  | const TPoint< I > & | p2
| ) |  |
| constexpr

Definition at line 249 of file point.h.

249 {
250 return {p1.x + static_cast<F>(p2.x), p1.y + static_cast<F>(p2.y)};
251 }

References impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

## ◆ operator+() [2/5]

template<class F , class I , class = MixedOp<F, I>>

constexpr TPoint<F> impeller::operator+ | ( | const TPoint< I > & | p1,
|  | const TPoint< F > & | p2
| ) |  |
| constexpr

Definition at line 254 of file point.h.

254 {
255 return p2 + p1;
256 }

## ◆ operator+() [3/5]

template<class T , class U >

constexpr TPoint<T> impeller::operator+ | ( | const TSize< U > & | s,
|  | const TPoint< T > & | p
| ) |  |
| constexpr

Definition at line 303 of file point.h.

303 {
304 return p + s;
305 }

## ◆ operator+() [4/5]

template<class T , class = std::enable_if_t<std::is_arithmetic_v<T>>>

constexpr Color impeller::operator+ | ( | T | value,
|  | const Color & | c
| ) |  |
| inline constexpr

Definition at line 897 of file color.h.

897 {
898 return c + static_cast<Scalar>(value);
899 }

References value.

## ◆ operator+() [5/5]

template<class U , class = std::enable_if_t<std::is_arithmetic_v<U>>>

constexpr Vector3 impeller::operator+ | ( | U | s,
|  | const Vector3 & | p
| ) |  |
| constexpr

Definition at line 214 of file vector.h.

214 {
215 return p + s;
216 }

## ◆ operator-() [1/6]

template<class F , class I , class = MixedOp<F, I>>

constexpr TPoint<F> impeller::operator- | ( | const TPoint< F > & | p1,
|  | const TPoint< I > & | p2
| ) |  |
| constexpr

Definition at line 259 of file point.h.

259 {
260 return {p1.x - static_cast<F>(p2.x), p1.y - static_cast<F>(p2.y)};
261 }

References impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

## ◆ operator-() [2/6]

template<class F , class I , class = MixedOp<F, I>>

constexpr TPoint<F> impeller::operator- | ( | const TPoint< I > & | p1,
|  | const TPoint< F > & | p2
| ) |  |
| constexpr

Definition at line 264 of file point.h.

264 {
265 return {static_cast<F>(p1.x) - p2.x, static_cast<F>(p1.y) - p2.y};
266 }

References impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

## ◆ operator-() [3/6]

template<class T >

constexpr TPoint<T> impeller::operator- | ( | const TPoint< T > & | p,
|  | T | v
| ) |  |
| constexpr

Definition at line 323 of file point.h.

323 {
324 return {p.x - v, p.y - v};
325 }

References impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

## ◆ operator-() [4/6]

template<class T , class U >

constexpr TPoint<T> impeller::operator- | ( | const TSize< U > & | s,
|  | const TPoint< T > & | p
| ) |  |
| constexpr

Definition at line 308 of file point.h.

308 {
309 return {static_cast<T>(s.width) - p.x, static_cast<T>(s.height) - p.y};
310 }

References impeller::TSize< T >::height, impeller::TSize< T >::width, impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

## ◆ operator-() [5/6]

template<class T , class = std::enable_if_t<std::is_arithmetic_v<T>>>

constexpr Color impeller::operator- | ( | T | value,
|  | const Color & | c
| ) |  |
| inline constexpr

Definition at line 902 of file color.h.

902 {
903 auto v = static_cast<Scalar>(value);
904 return {v - c.red, v - c.green, v - c.blue, v - c.alpha};
905 }

References impeller::Color::alpha, impeller::Color::blue, impeller::Color::green, impeller::Color::red, and value.

## ◆ operator-() [6/6]

template<class U , class = std::enable_if_t<std::is_arithmetic_v<U>>>

constexpr Vector3 impeller::operator- | ( | U | s,
|  | const Vector3 & | p
| ) |  |
| constexpr

Definition at line 219 of file vector.h.

219 {
220 return -p + s;
221 }

## ◆ operator/() [1/7]

template<class F , class I , class = MixedOp<F, I>>

constexpr TPoint<F> impeller::operator/ | ( | const TPoint< F > & | p1,
|  | const TPoint< I > & | p2
| ) |  |
| constexpr

Definition at line 279 of file point.h.

279 {
280 return {p1.x / static_cast<F>(p2.x), p1.y / static_cast<F>(p2.y)};
281 }

References impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

## ◆ operator/() [2/7]

template<class F , class I , class = MixedOp<F, I>>

constexpr TPoint<F> impeller::operator/ | ( | const TPoint< I > & | p1,
|  | const TPoint< F > & | p2
| ) |  |
| constexpr

Definition at line 284 of file point.h.

284 {
285 return {static_cast<F>(p1.x) / p2.x, static_cast<F>(p1.y) / p2.y};
286 }

References impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

## ◆ operator/() [3/7]

template<class T , class U >

constexpr TPoint<T> impeller::operator/ | ( | const TSize< U > & | s,
|  | const TPoint< T > & | p
| ) |  |
| constexpr

Definition at line 318 of file point.h.

318 {
319 return {static_cast<T>(s.width) / p.x, static_cast<T>(s.height) / p.y};
320 }

References impeller::TSize< T >::height, impeller::TSize< T >::width, impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

## ◆ operator/() [4/7]

template<class T , class = std::enable_if_t<std::is_arithmetic_v<T>>>

constexpr Color impeller::operator/ | ( | T | value,
|  | const Color & | c
| ) |  |
| inline constexpr

Definition at line 913 of file color.h.

913 {
914 auto v = static_cast<Scalar>(value);
915 return {v / c.red, v / c.green, v / c.blue, v / c.alpha};
916 }

References impeller::Color::alpha, impeller::Color::blue, impeller::Color::green, impeller::Color::red, and value.

## ◆ operator/() [5/7]

template<class T , class U , class = std::enable_if_t<std::is_arithmetic_v<U>>>

constexpr TPoint<T> impeller::operator/ | ( | U | s,
|  | const TPoint< T > & | p
| ) |  |
| constexpr

Definition at line 296 of file point.h.

296 {
297 return {static_cast<T>(s) / p.x, static_cast<T>(s) / p.y};
298 }

References impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

## ◆ operator/() [6/7]

template<class T , class U , class = std::enable_if_t<std::is_arithmetic_v<U>>>

constexpr TSize<T> impeller::operator/ | ( | U | s,
|  | const TSize< T > & | p
| ) |  |
| constexpr

Definition at line 167 of file size.h.

167 {
168 return {static_cast<T>(s) / p.width, static_cast<T>(s) / p.height};
169 }

References impeller::TSize< T >::height, and impeller::TSize< T >::width.

## ◆ operator/() [7/7]

template<class U , class = std::enable_if_t<std::is_arithmetic_v<U>>>

constexpr Vector3 impeller::operator/ | ( | U | s,
|  | const Vector3 & | p
| ) |  |
| constexpr

Definition at line 224 of file vector.h.

224 {
225 return {
226 static_cast<Scalar>(s) / p.x,
227 static_cast<Scalar>(s) / p.y,
228 static_cast<Scalar>(s) / p.z,
229 };
230 }

References impeller::Vector3::x, impeller::Vector3::y, and impeller::Vector3::z.

## ◆ operator<()

template<typename EnumType , typename std::enable_if_t< MaskTraits< EnumType >::kIsMask, bool > = true>

constexpr bool impeller::operator< | ( | const EnumType & | lhs,
|  | const Mask< EnumType > & | rhs
| ) |  |
| inline constexpr

Definition at line 188 of file mask.h.

189 {
190 return Mask<EnumType>{lhs} < rhs;
191 }

## ◆ operator<=()

template<typename EnumType , typename std::enable_if_t< MaskTraits< EnumType >::kIsMask, bool > = true>

constexpr bool impeller::operator<= | ( | const EnumType & | lhs,
|  | const Mask< EnumType > & | rhs
| ) |  |
| inline constexpr

Definition at line 202 of file mask.h.

203 {
204 return Mask<EnumType>{lhs} <= rhs;
205 }

## ◆ operator==()

template<typename EnumType , typename std::enable_if_t< MaskTraits< EnumType >::kIsMask, bool > = true>

constexpr bool impeller::operator== | ( | const EnumType & | lhs,
|  | const Mask< EnumType > & | rhs
| ) |  |
| inline constexpr

Definition at line 216 of file mask.h.

217 {
218 return Mask<EnumType>{lhs} == rhs;
219 }

## ◆ operator>()

template<typename EnumType , typename std::enable_if_t< MaskTraits< EnumType >::kIsMask, bool > = true>

constexpr bool impeller::operator> | ( | const EnumType & | lhs,
|  | const Mask< EnumType > & | rhs
| ) |  |
| inline constexpr

Definition at line 195 of file mask.h.

196 {
197 return Mask<EnumType>{lhs} > rhs;
198 }

## ◆ operator>=()

template<typename EnumType , typename std::enable_if_t< MaskTraits< EnumType >::kIsMask, bool > = true>

constexpr bool impeller::operator>= | ( | const EnumType & | lhs,
|  | const Mask< EnumType > & | rhs
| ) |  |
| inline constexpr

Definition at line 209 of file mask.h.

210 {
211 return Mask<EnumType>{lhs} >= rhs;
212 }

## ◆ operator^() [1/2]

template<typename EnumType , typename std::enable_if< MaskTraits< EnumType >::kIsMask, bool >::type = true>

constexpr Mask<EnumType> impeller::operator^ | ( | const EnumType & | lhs,
|  | const EnumType & | rhs
| ) |  |
| inline constexpr

Definition at line 147 of file mask.h.

148 {
149 return Mask<EnumType>{lhs} ^ rhs;
150 }

## ◆ operator^() [2/2]

template<typename EnumType , typename std::enable_if< MaskTraits< EnumType >::kIsMask, bool >::type = true>

constexpr Mask<EnumType> impeller::operator^ | ( | const EnumType & | lhs,
|  | const Mask< EnumType > & | rhs
| ) |  |
| inline constexpr

Definition at line 178 of file mask.h.

179 {
180 return Mask<EnumType>{lhs} ^ rhs;
181 }

## ◆ operator|() [1/2]

template<typename EnumType , typename std::enable_if< MaskTraits< EnumType >::kIsMask, bool >::type = true>

constexpr Mask<EnumType> impeller::operator| | ( | const EnumType & | lhs,
|  | const EnumType & | rhs
| ) |  |
| inline constexpr

Definition at line 131 of file mask.h.

132 {
133 return Mask<EnumType>{lhs} | rhs;
134 }

## ◆ operator|() [2/2]

template<typename EnumType , typename std::enable_if< MaskTraits< EnumType >::kIsMask, bool >::type = true>

constexpr Mask<EnumType> impeller::operator| | ( | const EnumType & | lhs,
|  | const Mask< EnumType > & | rhs
| ) |  |
| inline constexpr

Definition at line 162 of file mask.h.

163 {
164 return Mask<EnumType>{lhs} | rhs;
165 }

## ◆ operator~()

template<typename EnumType , typename std::enable_if< MaskTraits< EnumType >::kIsMask, bool >::type = true>

constexpr Mask<EnumType> impeller::operator~ | ( | const EnumType & | other | ) |
| inline constexpr

Definition at line 155 of file mask.h.

155 {
156 return ~Mask<EnumType>{other};
157 }

## ◆ OptionsFromPass()

ContentContextOptions impeller::OptionsFromPass | ( | const RenderPass & | pass | ) |

Definition at line 19 of file contents.cc.

19 {
20 ContentContextOptions opts;
21 opts.sample_count = pass.GetSampleCount();
22 opts.color_attachment_pixel_format = pass.GetRenderTargetPixelFormat();
23
24 bool has_depth_stencil_attachments =
25 pass.HasDepthAttachment() && pass.HasStencilAttachment();
26 FML_DCHECK(pass.HasDepthAttachment() == pass.HasStencilAttachment());
27
28 opts.has_depth_stencil_attachments = has_depth_stencil_attachments;
29 opts.depth_compare = CompareFunction::kGreaterEqual;
30 opts.stencil_mode = ContentContextOptions::StencilMode::kIgnore;
31 return opts;
32 }

References impeller::ContentContextOptions::color_attachment_pixel_format, impeller::ContentContextOptions::depth_compare, impeller::RenderPass::GetRenderTargetPixelFormat(), impeller::RenderPass::GetSampleCount(), impeller::ContentContextOptions::has_depth_stencil_attachments, impeller::RenderPass::HasDepthAttachment(), impeller::RenderPass::HasStencilAttachment(), kGreaterEqual, impeller::ContentContextOptions::kIgnore, impeller::ContentContextOptions::sample_count, and impeller::ContentContextOptions::stencil_mode.

Referenced by AdvancedBlend(), OptionsFromPassAndEntity(), PipelineBlend(), impeller::ClipContents::Render(), impeller::AtlasContents::Render(), RenderClipRestore(), and impeller::testing::TEST_P().

## ◆ OptionsFromPassAndEntity()

ContentContextOptions impeller::OptionsFromPassAndEntity | ( | const RenderPass & | pass,
|  | const Entity & | entity
| ) |  |

Definition at line 34 of file contents.cc.

35 {
36 ContentContextOptions opts = OptionsFromPass(pass);
37 opts.blend_mode = entity.GetBlendMode();
38 return opts;
39 }

References impeller::ContentContextOptions::blend_mode, impeller::Entity::GetBlendMode(), and OptionsFromPass().

Referenced by impeller::ColorSourceContents::DrawGeometry(), impeller::SolidRRectBlurContents::Render(), impeller::VerticesSimpleBlendContents::Render(), impeller::AtlasContents::Render(), impeller::TextContents::Render(), impeller::TextureContents::Render(), and impeller::testing::TEST_P().

## ◆ PairsFitInAtlasOfSize()

static size_t impeller::PairsFitInAtlasOfSize | ( | const std::vector< FontGlyphPair > & | pairs,
|  | const ISize & | atlas_size,
|  | std::vector< Rect > & | glyph_positions,
|  | const std::vector< Rect > & | glyph_sizes,
|  | int64_t | height_adjustment,
|  | const std::shared_ptr< RectanglePacker > & | rect_packer,
|  | size_t | start_index
| ) |  |
| static

Definition at line 137 of file typographer_context_skia.cc.

144 {
145 FML_DCHECK(!atlas_size.IsEmpty());
146
147 for (size_t i = start_index; i < pairs.size(); i++) {
148 ISize glyph_size = ISize::Ceil(glyph_sizes[i].GetSize());
149 IPoint16 location_in_atlas;
150 if (!rect_packer->AddRect(glyph_size.width + kPadding, //
151 glyph_size.height + kPadding, //
152 &location_in_atlas //
153 )) {
154 return i;
155 }
156 glyph_positions.push_back(Rect::MakeXYWH(
157 location_in_atlas.x() + 1, //
158 location_in_atlas.y() + height_adjustment + 1, //
159 glyph_size.width, //
160 glyph_size.height //
161 ));
162 }
163
164 return pairs.size();
165 }

References impeller::TSize< T >::Ceil(), impeller::TSize< T >::height, impeller::TSize< T >::IsEmpty(), kPadding, impeller::TRect< Scalar >::MakeXYWH(), impeller::TSize< T >::width, impeller::IPoint16::x(), and impeller::IPoint16::y().

Referenced by ComputeNextAtlasSize().

## ◆ PhysicalDeviceSupportsRequiredFormats()

static bool impeller::PhysicalDeviceSupportsRequiredFormats | ( | const vk::PhysicalDevice & | device | ) |
| static

Definition at line 333 of file capabilities_vk.cc.

334 {
335 const auto has_color_format =
336 HasSuitableColorFormat(device, vk::Format::eR8G8B8A8Unorm);
337 const auto has_stencil_format =
338 HasSuitableDepthStencilFormat(device, vk::Format::eD32SfloatS8Uint) ||
339 HasSuitableDepthStencilFormat(device, vk::Format::eD24UnormS8Uint);
340 return has_color_format && has_stencil_format;
341 }

References HasSuitableColorFormat(), and HasSuitableDepthStencilFormat().

Referenced by impeller::CapabilitiesVK::GetEnabledDeviceFeatures().

## ◆ PickPhysicalDevice()

static std::optional<vk::PhysicalDevice> impeller::PickPhysicalDevice | ( | const CapabilitiesVK & | caps,
|  | const vk::Instance & | instance
| ) |  |
| static

Definition at line 57 of file context_vk.cc.

59 {
60 for (const auto& device : instance.enumeratePhysicalDevices().value) {
61 if (caps.GetEnabledDeviceFeatures(device).has_value()) {
62 return device;
63 }
64 }
65 return std::nullopt;
66 }

References impeller::CapabilitiesVK::GetEnabledDeviceFeatures().

## ◆ PickQueue()

static std::optional<QueueIndexVK> impeller::PickQueue | ( | const vk::PhysicalDevice & | device,
|  | vk::QueueFlagBits | flags
| ) |  |
| static

Definition at line 91 of file context_vk.cc.

92 {
93 // This can be modified to ensure that dedicated queues are returned for each
94 // queue type depending on support.
95 const auto families = device.getQueueFamilyProperties();
96 for (size_t i = 0u; i < families.size(); i++) {
97 if (!(families[i].queueFlags & flags)) {
98 continue;
99 }
100 return QueueIndexVK{.family = i, .index = 0};
101 }
102 return std::nullopt;
103 }

References impeller::QueueIndexVK::family.

## ◆ PipelineBlend()

static std::optional<Entity> impeller::PipelineBlend | ( | const FilterInput::Vector & | inputs,
|  | const ContentContext & | renderer,
|  | const Entity & | entity,
|  | const Rect & | coverage,
|  | BlendMode | blend_mode,
|  | std::optional< Color > | foreground_color,
|  | ColorFilterContents::AbsorbOpacity | absorb_opacity,
|  | std::optional< Scalar > | alpha
| ) |  |
| static

Definition at line 520 of file blend_filter_contents.cc.

528 {
529 using VS = TexturePipeline::VertexShader;
530 using FS = TexturePipeline::FragmentShader;
531
532 auto dst_snapshot =
533 inputs[0]->GetSnapshot("PipelineBlend(Dst)", renderer, entity);
534 if (!dst_snapshot.has_value()) {
535 return std::nullopt; // Nothing to render.
536 }
537
538 Rect subpass_coverage = coverage;
539 if (entity.GetContents()) {
540 auto coverage_hint = entity.GetContents()->GetCoverageHint();
541
542 if (coverage_hint.has_value()) {
543 auto maybe_subpass_coverage =
544 subpass_coverage.Intersection(*coverage_hint);
545 if (!maybe_subpass_coverage.has_value()) {
546 return std::nullopt; // Nothing to render.
547 }
548
549 subpass_coverage = *maybe_subpass_coverage;
550 }
551 }
552
553 ContentContext::SubpassCallback callback = [&](const ContentContext& renderer,
554 RenderPass& pass) {
555 auto& host_buffer = renderer.GetTransientsBuffer();
556
557 #ifdef IMPELLER_DEBUG
558 pass.SetCommandLabel(BlendModeToFilterString(blend_mode));
559 #endif // IMPELLER_DEBUG
560 auto options = OptionsFromPass(pass);
561 options.primitive_type = PrimitiveType::kTriangleStrip;
562
563 auto add_blend_command = [&](std::optional<Snapshot> input) {
564 if (!input.has_value()) {
565 return false;
566 }
567 auto input_coverage = input->GetCoverage();
568 if (!input_coverage.has_value()) {
569 return false;
570 }
571
572 raw_ptr<const Sampler> sampler =
573 renderer.GetContext()->GetSamplerLibrary()->GetSampler(
574 input->sampler_descriptor);
575 FS::BindTextureSampler(pass, input->texture, sampler);
576
577 auto size = input->texture->GetSize();
578 std::array<VS::PerVertexData, 4> vertices = {
579 VS::PerVertexData{Point(0, 0), Point(0, 0)},
580 VS::PerVertexData{Point(size.width, 0), Point(1, 0)},
581 VS::PerVertexData{Point(0, size.height), Point(0, 1)},
582 VS::PerVertexData{Point(size.width, size.height), Point(1, 1)},
583 };
584 pass.SetVertexBuffer(
585 CreateVertexBuffer(vertices, renderer.GetTransientsBuffer()));
586
587 VS::FrameInfo frame_info;
588 frame_info.mvp = pass.GetOrthographicTransform() *
589 Matrix::MakeTranslation(-subpass_coverage.GetOrigin()) *
590 input->transform;
591 frame_info.texture_sampler_y_coord_scale =
592 input->texture->GetYCoordScale();
593
594 FS::FragInfo frag_info;
595 frag_info.alpha =
596 absorb_opacity == ColorFilterContents::AbsorbOpacity::kYes
597 ? input->opacity
598 : 1.0;
599 FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info));
600 VS::BindFrameInfo(pass, host_buffer.EmplaceUniform(frame_info));
601
602 return pass.Draw().ok();
603 };
604
605 // Draw the first texture using kSource.
606 options.blend_mode = BlendMode::kSource;
607 pass.SetPipeline(renderer.GetTexturePipeline(options));
608 if (!add_blend_command(dst_snapshot)) {
609 return true;
610 }
611
612 // Write subsequent textures using the selected blend mode.
613
614 if (inputs.size() >= 2) {
615 options.blend_mode = blend_mode;
616 pass.SetPipeline(renderer.GetTexturePipeline(options));
617
618 for (auto texture_i = inputs.begin() + 1; texture_i < inputs.end();
619 texture_i++) {
620 auto src_input = texture_i->get()->GetSnapshot("PipelineBlend(Src)",
621 renderer, entity);
622 if (!add_blend_command(src_input)) {
623 return true;
624 }
625 }
626 }
627
628 // If a foreground color is set, blend it in.
629
630 if (foreground_color.has_value()) {
631 auto contents = std::make_shared<SolidColorContents>();
632 RectGeometry geom(Rect::MakeSize(pass.GetRenderTargetSize()));
633 contents->SetGeometry(&geom);
634 contents->SetColor(foreground_color.value());
635
636 Entity foreground_entity;
637 foreground_entity.SetBlendMode(blend_mode);
638 foreground_entity.SetContents(contents);
639 if (!foreground_entity.Render(renderer, pass)) {
640 return false;
641 }
642 }
643
644 return true;
645 };
646
647 std::shared_ptr<CommandBuffer> command_buffer =
648 renderer.GetContext()->CreateCommandBuffer();
649 if (!command_buffer) {
650 return std::nullopt;
651 }
652
653 fml::StatusOr<RenderTarget> render_target = renderer.MakeSubpass(
654 "Pipeline Blend Filter", ISize(subpass_coverage.GetSize()),
655 command_buffer, callback);
656
657 if (!render_target.ok()) {
658 return std::nullopt;
659 }
660 if (!renderer.GetContext()->EnqueueCommandBuffer(std::move(command_buffer))) {
661 return std::nullopt;
662 }
663
664 return Entity::FromSnapshot(
665 Snapshot{
666 .texture = render_target.value().GetRenderTargetTexture(),
667 .transform = Matrix::MakeTranslation(subpass_coverage.GetOrigin()),
668 // Since we absorbed the transform of the inputs and used the
669 // respective snapshot sampling modes when blending, pass on
670 // the default NN clamp sampler.
671 .sampler_descriptor = {},
672 .opacity = (absorb_opacity == ColorFilterContents::AbsorbOpacity::kYes
673 ? 1.0f
674 : dst_snapshot->opacity) *
675 alpha.value_or(1.0)},
676 entity.GetBlendMode());
677 }

References CreateVertexBuffer(), impeller::Entity::FromSnapshot(), impeller::Entity::GetBlendMode(), impeller::Entity::GetContents(), impeller::ContentContext::GetContext(), impeller::TRect< T >::GetOrigin(), impeller::TRect< T >::GetSize(), impeller::ContentContext::GetTexturePipeline(), impeller::ContentContext::GetTransientsBuffer(), impeller::TRect< T >::Intersection(), kSource, kTriangleStrip, impeller::ColorFilterContents::kYes, impeller::TRect< Scalar >::MakeSize(), impeller::ContentContext::MakeSubpass(), impeller::Matrix::MakeTranslation(), OptionsFromPass(), impeller::Entity::Render(), impeller::Entity::SetBlendMode(), impeller::Entity::SetContents(), impeller::Snapshot::texture, and transform.

## ◆ PipelineCacheDataPersist()

bool impeller::PipelineCacheDataPersist | ( | const fml::UniqueFD & | cache_directory,
|  | const VkPhysicalDeviceProperties & | props,
|  | const vk::UniquePipelineCache & | cache
| ) |  |

Persist the pipeline cache to a file in the given cache directory. This function performs integrity checks the Vulkan driver may have missed.

Warning
  The pipeline cache must be externally synchronized for most complete results. If additional pipelines are being created while this function is executing, this function may fail to persist data.

Parameters

  [in] | cache_directory | The cache directory
  [in] | props | The physical device properties
  [in] | cache | The cache

Returns
  If the cache data could be persisted to disk.

Definition at line 16 of file pipeline_cache_data_vk.cc.

18 {
19 if (!cache_directory.is_valid()) {
20 return false;
21 }
22 size_t data_size = 0u;
23 if (cache.getOwner().getPipelineCacheData(*cache, &data_size, nullptr) !=
24 vk::Result::eSuccess) {
25 VALIDATION_LOG << "Could not fetch pipeline cache size.";
26 return false;
27 }
28 if (data_size == 0u) {
29 return true;
30 }
31 auto allocation = std::make_shared<Allocation>();
32 if (!allocation->Truncate(Bytes{sizeof(PipelineCacheHeaderVK) + data_size},
33 false)) {
34 VALIDATION_LOG << "Could not allocate pipeline cache data staging buffer.";
35 return false;
36 }
37 const auto header = PipelineCacheHeaderVK{props, data_size};
38 std::memcpy(allocation->GetBuffer(), &header, sizeof(header));
39 if (cache.getOwner().getPipelineCacheData(
40 *cache, &data_size, allocation->GetBuffer() + sizeof(header)) !=
41 vk::Result::eSuccess) {
42 VALIDATION_LOG << "Could not copy pipeline cache data.";
43 return false;
44 }
45
46 auto allocation_mapping = CreateMappingFromAllocation(allocation);
47 if (!allocation_mapping) {
48 return false;
49 }
50 if (!fml::WriteAtomically(cache_directory, kPipelineCacheFileName,
51 *allocation_mapping)) {
52 VALIDATION_LOG << "Could not write cache file to disk.";
53 return false;
54 }
55 return true;
56 }

References CreateMappingFromAllocation(), kPipelineCacheFileName, and VALIDATION_LOG.

Referenced by impeller::PipelineCacheVK::PersistCacheToDisk(), and impeller::testing::TEST_P().

## ◆ PipelineCacheDataRetrieve()

std::unique_ptr< fml::Mapping > impeller::PipelineCacheDataRetrieve | ( | const fml::UniqueFD & | cache_directory,
|  | const VkPhysicalDeviceProperties & | props
| ) |  |

Retrieve the previously persisted pipeline cache data. This function provides integrity checks the Vulkan driver may have missed.

The data is stripped of any additional headers that perform integrity checks. It can be used directly to construct a pre-initialized Vulkan pipeline cache.

Parameters

  [in] | cache_directory | The cache directory
  [in] | props | The properties

Returns
  The cache data if it was found and checked to have passed additional integrity checks.

Definition at line 58 of file pipeline_cache_data_vk.cc.

60 {
61 if (!cache_directory.is_valid()) {
62 return nullptr;
63 }
64 std::shared_ptr<fml::FileMapping> on_disk_data =
65 fml::FileMapping::CreateReadOnly(cache_directory, kPipelineCacheFileName);
66 if (!on_disk_data) {
67 return nullptr;
68 }
69 if (on_disk_data->GetSize() < sizeof(PipelineCacheHeaderVK)) {
70 VALIDATION_LOG << "Pipeline cache data size is too small.";
71 return nullptr;
72 }
73 auto on_disk_header = PipelineCacheHeaderVK{};
74 std::memcpy(&on_disk_header, //
75 on_disk_data->GetMapping(), //
76 sizeof(on_disk_header) //
77 );
78 const auto current_header = PipelineCacheHeaderVK{props, 0u};
79 if (!on_disk_header.IsCompatibleWith(current_header)) {
80 FML_LOG(WARNING)
81 << "Persisted pipeline cache is not compatible with current "
82 "Vulkan context. Ignoring.";
83 return nullptr;
84 }
85 // Zero sized data is known to cause issues.
86 if (on_disk_header.data_size == 0u) {
87 return nullptr;
88 }
89 return std::make_unique<fml::NonOwnedMapping>(
90 on_disk_data->GetMapping() + sizeof(on_disk_header),
91 on_disk_header.data_size, [on_disk_data](auto, auto) {});
92 }

References kPipelineCacheFileName, and VALIDATION_LOG.

Referenced by impeller::PipelineCacheVK::PipelineCacheVK(), and impeller::testing::TEST_P().

## ◆ PixelFormatIsDepthStencil()

constexpr bool impeller::PixelFormatIsDepthStencil | ( | PixelFormat | format | ) |
| constexpr

Definition at line 414 of file formats_vk.h.

414 {
415 switch (format) {
416 case PixelFormat::kUnknown:
417 case PixelFormat::kA8UNormInt:
418 case PixelFormat::kR8UNormInt:
419 case PixelFormat::kR8G8UNormInt:
420 case PixelFormat::kR8G8B8A8UNormInt:
421 case PixelFormat::kR8G8B8A8UNormIntSRGB:
422 case PixelFormat::kB8G8R8A8UNormInt:
423 case PixelFormat::kB8G8R8A8UNormIntSRGB:
424 case PixelFormat::kR32G32B32A32Float:
425 case PixelFormat::kR16G16B16A16Float:
426 case PixelFormat::kB10G10R10XR:
427 case PixelFormat::kB10G10R10XRSRGB:
428 case PixelFormat::kB10G10R10A10XR:
429 return false;
430 case PixelFormat::kS8UInt:
431 case PixelFormat::kD24UnormS8Uint:
432 case PixelFormat::kD32FloatS8UInt:
433 return true;
434 }
435 return false;
436 }

References kA8UNormInt, kB10G10R10A10XR, kB10G10R10XR, kB10G10R10XRSRGB, kB8G8R8A8UNormInt, kB8G8R8A8UNormIntSRGB, kD24UnormS8Uint, kD32FloatS8UInt, kR16G16B16A16Float, kR32G32B32A32Float, kR8G8B8A8UNormInt, kR8G8B8A8UNormIntSRGB, kR8G8UNormInt, kR8UNormInt, kS8UInt, and kUnknown.

Referenced by impeller::AllocatorVK::ToVKImageUsageFlags().

## ◆ PixelFormatToString()

constexpr const char* impeller::PixelFormatToString | ( | PixelFormat | format | ) |
| constexpr

Definition at line 140 of file formats.h.

140 {
141 switch (format) {
142 case PixelFormat::kUnknown:
143 return "Unknown";
144 case PixelFormat::kA8UNormInt:
145 return "A8UNormInt";
146 case PixelFormat::kR8UNormInt:
147 return "R8UNormInt";
148 case PixelFormat::kR8G8UNormInt:
149 return "R8G8UNormInt";
150 case PixelFormat::kR8G8B8A8UNormInt:
151 return "R8G8B8A8UNormInt";
152 case PixelFormat::kR8G8B8A8UNormIntSRGB:
153 return "R8G8B8A8UNormIntSRGB";
154 case PixelFormat::kB8G8R8A8UNormInt:
155 return "B8G8R8A8UNormInt";
156 case PixelFormat::kB8G8R8A8UNormIntSRGB:
157 return "B8G8R8A8UNormIntSRGB";
158 case PixelFormat::kR32G32B32A32Float:
159 return "R32G32B32A32Float";
160 case PixelFormat::kR16G16B16A16Float:
161 return "R16G16B16A16Float";
162 case PixelFormat::kB10G10R10XR:
163 return "B10G10R10XR";
164 case PixelFormat::kB10G10R10XRSRGB:
165 return "B10G10R10XRSRGB";
166 case PixelFormat::kB10G10R10A10XR:
167 return "B10G10R10A10XR";
168 case PixelFormat::kS8UInt:
169 return "S8UInt";
170 case PixelFormat::kD24UnormS8Uint:
171 return "D24UnormS8Uint";
172 case PixelFormat::kD32FloatS8UInt:
173 return "D32FloatS8UInt";
174 }
175 FML_UNREACHABLE();
176 }

References kA8UNormInt, kB10G10R10A10XR, kB10G10R10XR, kB10G10R10XRSRGB, kB8G8R8A8UNormInt, kB8G8R8A8UNormIntSRGB, kD24UnormS8Uint, kD32FloatS8UInt, kR16G16B16A16Float, kR32G32B32A32Float, kR8G8B8A8UNormInt, kR8G8B8A8UNormIntSRGB, kR8G8UNormInt, kR8UNormInt, kS8UInt, and kUnknown.

Referenced by impeller::BlitPass::AddCopy(), impeller::testing::TEST_P(), and TextureDescriptorToString().

## ◆ PlaygroundBackendToRuntimeStageBackend()

constexpr RuntimeStageBackend impeller::PlaygroundBackendToRuntimeStageBackend | ( | PlaygroundBackend | backend | ) |
| inline constexpr

Definition at line 33 of file playground.h.

34 {
35 switch (backend) {
36 case PlaygroundBackend::kMetal:
37 return RuntimeStageBackend::kMetal;
38 case PlaygroundBackend::kOpenGLES:
39 return RuntimeStageBackend::kOpenGLES;
40 case PlaygroundBackend::kVulkan:
41 return RuntimeStageBackend::kVulkan;
42 }
43 FML_UNREACHABLE();
44 }

References kMetal, kOpenGLES, and kVulkan.

Referenced by impeller::testing::TEST_P().

## ◆ PlaygroundBackendToString()

std::string impeller::PlaygroundBackendToString | ( | PlaygroundBackend | backend | ) |

Definition at line 46 of file playground.cc.

46 {
47 switch (backend) {
48 case PlaygroundBackend::kMetal:
49 return "Metal";
50 case PlaygroundBackend::kOpenGLES:
51 return "OpenGLES";
52 case PlaygroundBackend::kVulkan:
53 return "Vulkan";
54 }
55 FML_UNREACHABLE();
56 }

References kMetal, kOpenGLES, and kVulkan.

Referenced by impeller::PlaygroundImpl::Create().

## ◆ PlaygroundKeyCallback()

static void impeller::PlaygroundKeyCallback | ( | GLFWwindow * | window,
|  | int | key,
|  | int | scancode,
|  | int | action,
|  | int | mods
| ) |  |
| static

Definition at line 168 of file playground.cc.

172 {
173 if ((key == GLFW_KEY_ESCAPE) && action == GLFW_RELEASE) {
174 if (mods & (GLFW_MOD_CONTROL | GLFW_MOD_SUPER | GLFW_MOD_SHIFT)) {
175 gShouldOpenNewPlaygrounds = false;
176 }
177 ::glfwSetWindowShouldClose(window, GLFW_TRUE);
178 }
179 }

References gShouldOpenNewPlaygrounds.

Referenced by impeller::Playground::OpenPlaygroundHere().

## ◆ PopulateUniformGradientColors()

int impeller::PopulateUniformGradientColors | ( | const std::vector< Color > & | colors,
|  | const std::vector< Scalar > & | stops,
|  | Vector4 | frag_info_colors[kMaxUniformGradientStops],
|  | Vector4 | frag_info_stop_pairs[kMaxUniformGradientStops/2]
| ) |  |

Populate 2 arrays with the colors and stop data for a gradient.

The color data is simply converted to a vec4 format, but the stop data is both turned into pairs of {t, inverse_delta} information and also stops are themselves paired up into a vec4 format for efficient packing in the uniform data.

Parameters

  colors | colors from gradient
  stops | stops from gradient
  frag_info_colors | colors for fragment shader in vec4 format
  frag_info_stop_pairs | pairs of stop data for shader in vec4 format

Returns
  count of colors stored

Definition at line 70 of file gradient_generator.cc.

74 {
75 FML_DCHECK(stops.size() == colors.size());
76
77 Scalar last_stop = 0;
78 int index = 0;
79 for (auto i = 0u; i < stops.size() && i < kMaxUniformGradientStops; i++) {
80 Scalar cur_stop = stops[i];
81 Scalar delta = cur_stop - last_stop;
82 Scalar inverse_delta = delta == 0.0f ? 0.0 : 1.0 / delta;
83 frag_info_colors[index] = colors[i];
84 if ((i & 1) == 0) {
85 frag_info_stop_pairs[index / 2].x = cur_stop;
86 frag_info_stop_pairs[index / 2].y = inverse_delta;
87 } else {
88 frag_info_stop_pairs[index / 2].z = cur_stop;
89 frag_info_stop_pairs[index / 2].w = inverse_delta;
90 }
91 last_stop = cur_stop;
92 index++;
93 }
94 return index;
95 }

References kMaxUniformGradientStops.

## ◆ PrimitiveTopologySupportsPrimitiveRestart()

constexpr bool impeller::PrimitiveTopologySupportsPrimitiveRestart | ( | PrimitiveType | primitive | ) |
| constexpr

Definition at line 380 of file formats_vk.h.

381 {
382 switch (primitive) {
383 case PrimitiveType::kTriangleStrip:
384 case PrimitiveType::kLine:
385 case PrimitiveType::kPoint:
386 case PrimitiveType::kTriangleFan:
387 return true;
388 case PrimitiveType::kTriangle:
389 case PrimitiveType::kLineStrip:
390 return false;
391 }
392 FML_UNREACHABLE();
393 }

References kLine, kLineStrip, kPoint, kTriangle, kTriangleFan, and kTriangleStrip.

## ◆ QuadraticSolve()

static Scalar impeller::QuadraticSolve | ( | Scalar | t,
|  | Scalar | p0,
|  | Scalar | p1,
|  | Scalar | p2
| ) |  |
| inline static

Definition at line 172 of file path_component.cc.

172 {
173 return (1 - t) * (1 - t) * p0 + //
174 2 * (1 - t) * t * p1 + //
175 t * t * p2;
176 }

Referenced by impeller::QuadraticPathComponent::Solve().

## ◆ QuadraticSolveDerivative()

static Scalar impeller::QuadraticSolveDerivative | ( | Scalar | t,
|  | Scalar | p0,
|  | Scalar | p1,
|  | Scalar | p2
| ) |  |
| inline static

Definition at line 178 of file path_component.cc.

181 {
182 return 2 * (1 - t) * (p1 - p0) + //
183 2 * t * (p2 - p1);
184 }

Referenced by impeller::QuadraticPathComponent::SolveDerivative().

## ◆ ReadStageInputFormat()

static MTLVertexFormat impeller::ReadStageInputFormat | ( | const ShaderStageIOSlot & | input | ) |
| static

Definition at line 16 of file vertex_descriptor_mtl.mm.

16 {
17 if (input.columns != 1) {
18 // All matrix types are unsupported as vertex inputs.
19 return MTLVertexFormatInvalid;
20 }
21
22 switch (input.type) {
23 case ShaderType::kFloat: {
24 if (input.bit_width == 8 * sizeof(float)) {
25 switch (input.vec_size) {
26 case 1:
27 return MTLVertexFormatFloat;
28 case 2:
29 return MTLVertexFormatFloat2;
30 case 3:
31 return MTLVertexFormatFloat3;
32 case 4:
33 return MTLVertexFormatFloat4;
34 }
35 }
36 return MTLVertexFormatInvalid;
37 }
38 case ShaderType::kHalfFloat: {
39 if (input.bit_width == 8 * sizeof(float) / 2) {
40 switch (input.vec_size) {
41 case 1:
42 return MTLVertexFormatHalf;
43 case 2:
44 return MTLVertexFormatHalf2;
45 case 3:
46 return MTLVertexFormatHalf3;
47 case 4:
48 return MTLVertexFormatHalf4;
49 }
50 }
51 return MTLVertexFormatInvalid;
52 }
53 case ShaderType::kDouble: {
54 // Unsupported.
55 return MTLVertexFormatInvalid;
56 }
57 case ShaderType::kBoolean: {
58 if (input.bit_width == 8 * sizeof(bool) && input.vec_size == 1) {
59 return MTLVertexFormatChar;
60 }
61 return MTLVertexFormatInvalid;
62 }
63 case ShaderType::kSignedByte: {
64 if (input.bit_width == 8 * sizeof(char)) {
65 switch (input.vec_size) {
66 case 1:
67 return MTLVertexFormatChar;
68 case 2:
69 return MTLVertexFormatChar2;
70 case 3:
71 return MTLVertexFormatChar3;
72 case 4:
73 return MTLVertexFormatChar4;
74 }
75 }
76 return MTLVertexFormatInvalid;
77 }
78 case ShaderType::kUnsignedByte: {
79 if (input.bit_width == 8 * sizeof(char)) {
80 switch (input.vec_size) {
81 case 1:
82 return MTLVertexFormatUChar;
83 case 2:
84 return MTLVertexFormatUChar2;
85 case 3:
86 return MTLVertexFormatUChar3;
87 case 4:
88 return MTLVertexFormatUChar4;
89 }
90 }
91 return MTLVertexFormatInvalid;
92 }
93 case ShaderType::kSignedShort: {
94 if (input.bit_width == 8 * sizeof(short)) {
95 switch (input.vec_size) {
96 case 1:
97 return MTLVertexFormatShort;
98 case 2:
99 return MTLVertexFormatShort2;
100 case 3:
101 return MTLVertexFormatShort3;
102 case 4:
103 return MTLVertexFormatShort4;
104 }
105 }
106 return MTLVertexFormatInvalid;
107 }
108 case ShaderType::kUnsignedShort: {
109 if (input.bit_width == 8 * sizeof(ushort)) {
110 switch (input.vec_size) {
111 case 1:
112 return MTLVertexFormatUShort;
113 case 2:
114 return MTLVertexFormatUShort2;
115 case 3:
116 return MTLVertexFormatUShort3;
117 case 4:
118 return MTLVertexFormatUShort4;
119 }
120 }
121 return MTLVertexFormatInvalid;
122 }
123 case ShaderType::kSignedInt: {
124 if (input.bit_width == 8 * sizeof(int32_t)) {
125 switch (input.vec_size) {
126 case 1:
127 return MTLVertexFormatInt;
128 case 2:
129 return MTLVertexFormatInt2;
130 case 3:
131 return MTLVertexFormatInt3;
132 case 4:
133 return MTLVertexFormatInt4;
134 }
135 }
136 return MTLVertexFormatInvalid;
137 }
138 case ShaderType::kUnsignedInt: {
139 if (input.bit_width == 8 * sizeof(uint32_t)) {
140 switch (input.vec_size) {
141 case 1:
142 return MTLVertexFormatUInt;
143 case 2:
144 return MTLVertexFormatUInt2;
145 case 3:
146 return MTLVertexFormatUInt3;
147 case 4:
148 return MTLVertexFormatUInt4;
149 }
150 }
151 return MTLVertexFormatInvalid;
152 }
153 case ShaderType::kSignedInt64: {
154 // Unsupported.
155 return MTLVertexFormatInvalid;
156 }
157 case ShaderType::kUnsignedInt64: {
158 // Unsupported.
159 return MTLVertexFormatInvalid;
160 }
161 case ShaderType::kAtomicCounter:
162 case ShaderType::kStruct:
163 case ShaderType::kImage:
164 case ShaderType::kSampledImage:
165 case ShaderType::kUnknown:
166 case ShaderType::kVoid:
167 case ShaderType::kSampler:
168 return MTLVertexFormatInvalid;
169 }
170 }

References impeller::ShaderStageIOSlot::bit_width, impeller::ShaderStageIOSlot::columns, kAtomicCounter, kBoolean, kDouble, kFloat, kHalfFloat, kImage, kSampledImage, kSampler, kSignedByte, kSignedInt, kSignedInt64, kSignedShort, kStruct, kUnknown, kUnsignedByte, kUnsignedInt, kUnsignedInt64, kUnsignedShort, kVoid, impeller::ShaderStageIOSlot::type, and impeller::ShaderStageIOSlot::vec_size.

Referenced by impeller::VertexDescriptorMTL::SetStageInputsAndLayout().

## ◆ RealizedFuture()

template<class T >

std::future<T> impeller::RealizedFuture | ( | T | t | ) |

Definition at line 13 of file promise.h.

13 {
14 std::promise<T> promise;
15 auto future = promise.get_future();
16 promise.set_value(std::move(t));
17 return future;
18 }

## ◆ RenderClipRestore()

bool impeller::RenderClipRestore | ( | const ContentContext & | renderer,
|  | RenderPass & | pass,
|  | uint32_t | clip_depth,
|  | std::optional< Rect > | restore_coverage
| ) |  |

Render a restore clip.

This is is intended to be used for prevent overdraw mechanism. The clip depth should be the depth of the entity that is currently being drawn, and restore_coverage should be its coverage. If restore_coverage is std::nullopt, the render pass coverage is used instead.

Definition at line 152 of file clip_contents.cc.

155 {
156 using VS = ClipPipeline::VertexShader;
157
158 pass.SetCommandLabel("Restore Clip");
159 auto options = OptionsFromPass(pass);
160 options.blend_mode = BlendMode::kDestination;
161 options.stencil_mode =
162 ContentContextOptions::StencilMode::kOverdrawPreventionRestore;
163 options.primitive_type = PrimitiveType::kTriangleStrip;
164 pass.SetPipeline(renderer.GetClipPipeline(options));
165 pass.SetStencilReference(0);
166
167 // Create a rect that covers either the given restore area, or the whole
168 // render target texture.
169 auto ltrb =
170 restore_coverage.value_or(Rect::MakeSize(pass.GetRenderTargetSize()))
171 .GetLTRB();
172
173 std::array<VS::PerVertexData, 4> vertices = {
174 VS::PerVertexData{Point(ltrb[0], ltrb[1])},
175 VS::PerVertexData{Point(ltrb[2], ltrb[1])},
176 VS::PerVertexData{Point(ltrb[0], ltrb[3])},
177 VS::PerVertexData{Point(ltrb[2], ltrb[3])},
178 };
179 pass.SetVertexBuffer(
180 CreateVertexBuffer(vertices, renderer.GetTransientsBuffer()));
181
182 VS::FrameInfo info;
183 info.depth = GetShaderClipDepth(clip_depth);
184 info.mvp = pass.GetOrthographicTransform();
185 VS::BindFrameInfo(pass, renderer.GetTransientsBuffer().EmplaceUniform(info));
186
187 return pass.Draw().ok();
188 }

References CreateVertexBuffer(), impeller::RenderPass::Draw(), impeller::HostBuffer::EmplaceUniform(), impeller::ContentContext::GetClipPipeline(), impeller::RenderPass::GetOrthographicTransform(), impeller::RenderPass::GetRenderTargetSize(), GetShaderClipDepth(), impeller::ContentContext::GetTransientsBuffer(), kDestination, impeller::ContentContextOptions::kOverdrawPreventionRestore, kTriangleStrip, impeller::TRect< Scalar >::MakeSize(), OptionsFromPass(), impeller::RenderPass::SetCommandLabel(), impeller::RenderPass::SetPipeline(), impeller::RenderPass::SetStencilReference(), and impeller::RenderPass::SetVertexBuffer().

Referenced by impeller::ColorSourceContents::DrawGeometry().

## ◆ RenderToTarget()

bool impeller::RenderToTarget | ( | ContentContext & | context,
|  | RenderTarget | render_target,
|  | const sk_sp< flutter::DisplayList > & | display_list,
|  | SkIRect | cull_rect,
|  | bool | reset_host_buffer,
|  | bool | is_onscreen = `true`
| ) |  |

Render the provided display list to the render target.

If [is_onscreen] is true, then the onscreen command buffer will be submitted via Context::SubmitOnscreen.

Definition at line 1311 of file dl_dispatcher.cc.

1316 {
1317 Rect ip_cull_rect = Rect::MakeLTRB(cull_rect.left(), cull_rect.top(),
1318 cull_rect.right(), cull_rect.bottom());
1319 FirstPassDispatcher collector(context, impeller::Matrix(), ip_cull_rect);
1320 display_list->Dispatch(collector, cull_rect);
1321
1322 impeller::CanvasDlDispatcher impeller_dispatcher(
1323 context, //
1324 render_target, //
1325 /*is_onscreen=*/is_onscreen, //
1326 display_list->root_has_backdrop_filter(), //
1327 display_list->max_root_blend_mode(), //
1328 IRect::RoundOut(ip_cull_rect) //
1329 );
1330 const auto& [data, count] = collector.TakeBackdropData();
1331 impeller_dispatcher.SetBackdropData(data, count);
1332 display_list->Dispatch(impeller_dispatcher, cull_rect);
1333 impeller_dispatcher.FinishRecording();
1334 if (reset_host_buffer) {
1335 context.GetTransientsBuffer().Reset();
1336 }
1337 context.GetLazyGlyphAtlas()->ResetTextFrames();
1338
1339 return true;
1340 }

References data, impeller::CanvasDlDispatcher::FinishRecording(), impeller::ContentContext::GetLazyGlyphAtlas(), impeller::ContentContext::GetTransientsBuffer(), impeller::TRect< Scalar >::MakeLTRB(), impeller::HostBuffer::Reset(), impeller::TRect< T >::RoundOut(), impeller::CanvasDlDispatcher::SetBackdropData(), and impeller::FirstPassDispatcher::TakeBackdropData().

Referenced by impeller::interop::Surface::DrawDisplayList(), impeller::AiksPlayground::OpenPlaygroundHere(), and impeller::DlPlayground::OpenPlaygroundHere().

## ◆ ReportPipelineCreationFeedback()

static void impeller::ReportPipelineCreationFeedback | ( | const PipelineDescriptor & | desc,
|  | const vk::PipelineCreationFeedbackCreateInfoEXT & | feedback
| ) |  |
| static

Definition at line 106 of file pipeline_vk.cc.

108 {
109 constexpr bool kReportPipelineCreationFeedbackToLogs = false;
110 constexpr bool kReportPipelineCreationFeedbackToTraces = true;
111 if (kReportPipelineCreationFeedbackToLogs) {
112 ReportPipelineCreationFeedbackToLog(desc, feedback);
113 }
114 if (kReportPipelineCreationFeedbackToTraces) {
115 ReportPipelineCreationFeedbackToTrace(desc, feedback);
116 }
117 }

References ReportPipelineCreationFeedbackToLog(), and ReportPipelineCreationFeedbackToTrace().

## ◆ ReportPipelineCreationFeedbackToLog() [1/2]

static void impeller::ReportPipelineCreationFeedbackToLog | ( | const PipelineDescriptor & | desc,
|  | const vk::PipelineCreationFeedbackCreateInfoEXT & | feedback
| ) |  |
| static

Definition at line 58 of file pipeline_vk.cc.

60 {
61 std::stringstream stream;
62 stream << std::fixed << std::showpoint << std::setprecision(2);
63 stream << std::endl << ">>>>>>" << std::endl;
64 stream << "Pipeline '" << desc.GetLabel() << "' ";
65 ReportPipelineCreationFeedbackToLog(stream,
66 *feedback.pPipelineCreationFeedback);
67 if (feedback.pipelineStageCreationFeedbackCount != 0) {
68 stream << std::endl;
69 }
70 for (size_t i = 0, count = feedback.pipelineStageCreationFeedbackCount;
71 i < count; i++) {
72 stream << "\tStage " << i + 1 << ": ";
73 ReportPipelineCreationFeedbackToLog(
74 stream, feedback.pPipelineStageCreationFeedbacks[i]);
75 if (i != count - 1) {
76 stream << std::endl;
77 }
78 }
79 stream << std::endl << "<<<<<<" << std::endl;
80 FML_LOG(ERROR) << stream.str();
81 }

References impeller::PipelineDescriptor::GetLabel(), and ReportPipelineCreationFeedbackToLog().

## ◆ ReportPipelineCreationFeedbackToLog() [2/2]

static void impeller::ReportPipelineCreationFeedbackToLog | ( | std::stringstream & | stream,
|  | const vk::PipelineCreationFeedbackEXT & | feedback
| ) |  |
| static

Definition at line 41 of file pipeline_vk.cc.

43 {
44 const auto pipeline_cache_hit =
45 feedback.flags &
46 vk::PipelineCreationFeedbackFlagBits::eApplicationPipelineCacheHit;
47 const auto base_pipeline_accl =
48 feedback.flags &
49 vk::PipelineCreationFeedbackFlagBits::eBasePipelineAcceleration;
50 auto duration = std::chrono::duration_cast<MillisecondsF>(
51 std::chrono::nanoseconds{feedback.duration});
52 stream << "Time: " << duration.count() << "ms"
53 << " Cache Hit: " << static_cast<bool>(pipeline_cache_hit)
54 << " Base Accel: " << static_cast<bool>(base_pipeline_accl)
55 << " Thread: " << std::this_thread::get_id();
56 }

Referenced by ReportPipelineCreationFeedback(), and ReportPipelineCreationFeedbackToLog().

## ◆ ReportPipelineCreationFeedbackToTrace()

static void impeller::ReportPipelineCreationFeedbackToTrace | ( | const PipelineDescriptor & | desc,
|  | const vk::PipelineCreationFeedbackCreateInfoEXT & | feedback
| ) |  |
| static

Definition at line 83 of file pipeline_vk.cc.

85 {
86 static int64_t gPipelineCacheHits = 0;
87 static int64_t gPipelineCacheMisses = 0;
88 static int64_t gPipelines = 0;
89 if (feedback.pPipelineCreationFeedback->flags &
90 vk::PipelineCreationFeedbackFlagBits::eApplicationPipelineCacheHit) {
91 gPipelineCacheHits++;
92 } else {
93 gPipelineCacheMisses++;
94 }
95 gPipelines++;
96 static constexpr int64_t kImpellerPipelineTraceID = 1988;
97 FML_TRACE_COUNTER("impeller", //
98 "PipelineCache", // series name
99 kImpellerPipelineTraceID, // series ID
100 "PipelineCacheHits", gPipelineCacheHits, //
101 "PipelineCacheMisses", gPipelineCacheMisses, //
102 "TotalPipelines", gPipelines //
103 );
104 }

Referenced by ReportPipelineCreationFeedback().

## ◆ RequiresReadbackForBlends()

static bool impeller::RequiresReadbackForBlends | ( | const ContentContext & | renderer,
|  | flutter::DlBlendMode | max_root_blend_mode
| ) |  |
| static

Subclasses.

Definition at line 956 of file dl_dispatcher.cc.

958 {
959 return !renderer.GetDeviceCapabilities().SupportsFramebufferFetch() &&
960 skia_conversions::ToBlendMode(max_root_blend_mode) >
961 Entity::kLastPipelineBlendMode;
962 }

References impeller::ContentContext::GetDeviceCapabilities(), impeller::Entity::kLastPipelineBlendMode, impeller::Capabilities::SupportsFramebufferFetch(), and impeller::skia_conversions::ToBlendMode().

## ◆ ResourceIsLive()

static bool impeller::ResourceIsLive | ( | const ProcTableGLES & | gl,
|  | DebugResourceType | type,
|  | GLint | name
| ) |  |
| static

Definition at line 338 of file proc_table_gles.cc.

340 {
341 switch (type) {
342 case DebugResourceType::kTexture:
343 return gl.IsTexture(name);
344 case DebugResourceType::kBuffer:
345 return gl.IsBuffer(name);
346 case DebugResourceType::kProgram:
347 return gl.IsProgram(name);
348 case DebugResourceType::kShader:
349 return gl.IsShader(name);
350 case DebugResourceType::kRenderBuffer:
351 return gl.IsRenderbuffer(name);
352 case DebugResourceType::kFrameBuffer:
353 return gl.IsFramebuffer(name);
354 case DebugResourceType::kFence:
355 return true;
356 }
357 FML_UNREACHABLE();
358 }

References kBuffer, kFence, kFrameBuffer, kProgram, kRenderBuffer, kShader, kTexture, and type.

Referenced by impeller::ProcTableGLES::SetDebugLabel().

## ◆ SafeMTLPixelFormatBGR10_XR()

MTLPixelFormat impeller::SafeMTLPixelFormatBGR10_XR | ( |  | ) |

Safe accessor for MTLPixelFormatBGR10_XR. Returns PixelFormat::kUnknown if MTLPixelFormatBGR10_XR isn't supported.

Definition at line 130 of file formats_mtl.mm.

130 {
131 if (@available(iOS 10, macOS 11.0, *)) {
132 return MTLPixelFormatBGR10_XR;
133 } else {
134 return MTLPixelFormatInvalid;
135 }
136 }

Referenced by ToMTLPixelFormat().

## ◆ SafeMTLPixelFormatBGR10_XR_sRGB()

MTLPixelFormat impeller::SafeMTLPixelFormatBGR10_XR_sRGB | ( |  | ) |

Safe accessor for MTLPixelFormatBGR10_XR_sRGB. Returns PixelFormat::kUnknown if MTLPixelFormatBGR10_XR_sRGB isn't supported.

Definition at line 122 of file formats_mtl.mm.

122 {
123 if (@available(iOS 11, macOS 11.0, *)) {
124 return MTLPixelFormatBGR10_XR_sRGB;
125 } else {
126 return MTLPixelFormatInvalid;
127 }
128 }

Referenced by ToMTLPixelFormat().

## ◆ SafeMTLPixelFormatBGRA10_XR()

MTLPixelFormat impeller::SafeMTLPixelFormatBGRA10_XR | ( |  | ) |

Safe accessor for MTLPixelFormatBGRA10_XR. Returns PixelFormat::kUnknown if MTLPixelFormatBGR10_XR isn't supported.

Definition at line 138 of file formats_mtl.mm.

138 {
139 if (@available(iOS 10, macOS 11.0, *)) {
140 return MTLPixelFormatBGRA10_XR;
141 } else {
142 return MTLPixelFormatInvalid;
143 }
144 }

Referenced by ToMTLPixelFormat().

## ◆ SafeMTLPixelFormatDepth24Unorm_Stencil8()

MTLPixelFormat impeller::SafeMTLPixelFormatDepth24Unorm_Stencil8 | ( |  | ) |

Safe accessor for MTLPixelFormatDepth24Unorm_Stencil8. Returns PixelFormat::kUnknown if MTLPixelFormatDepth24Unorm_Stencil8 isn't supported.

Definition at line 113 of file formats_mtl.mm.

113 {
114 #if !FML_OS_IOS
115 if (@available(macOS 10.11, *)) {
116 return MTLPixelFormatDepth24Unorm_Stencil8;
117 }
118 #endif // FML_OS_IOS
119 return MTLPixelFormatInvalid;
120 }

Referenced by ToMTLPixelFormat().

## ◆ Saturation()

static constexpr Scalar impeller::Saturation | ( | Vector3 | color | ) |
| inline static constexpr

Definition at line 89 of file color.cc.

89 {
90 return std::max(std::max(color.x, color.y), color.z) -
91 std::min(std::min(color.x, color.y), color.z);
92 }

References impeller::Vector3::x, impeller::Vector3::y, and impeller::Vector3::z.

Referenced by impeller::Color::Blend(), and impeller::BlendFilterContents::SetBlendMode().

## ◆ ScalarNearlyEqual()

constexpr bool impeller::ScalarNearlyEqual | ( | Scalar | x,
|  | Scalar | y,
|  | Scalar | tolerance = `kEhCloseEnough`
| ) |  |
| inline constexpr

Definition at line 35 of file scalar.h.

37 {
38 return ScalarNearlyZero(x - y, tolerance);
39 }

References ScalarNearlyZero(), and x.

Referenced by impeller::RoundingRadii::AreAllCornersSame(), CreateGradientBuffer(), impeller::Matrix::Equals(), impeller::RoundRect::IsOval(), impeller::Color::operator==(), impeller::TextFrame::SetPerFrameData(), impeller::testing::TEST(), and impeller::Color::Unpremultiply().

## ◆ ScalarNearlyZero()

constexpr bool impeller::ScalarNearlyZero | ( | Scalar | x,
|  | Scalar | tolerance = `kEhCloseEnough`
| ) |  |
| inline constexpr

Definition at line 30 of file scalar.h.

31 {
32 return Absolute(x) <= tolerance;
33 }

References Absolute(), and x.

Referenced by impeller::Matrix::IsAligned(), impeller::Matrix::IsAligned2D(), and ScalarNearlyEqual().

## ◆ ScalarToHalf()

constexpr InternalHalf impeller::ScalarToHalf | ( | Scalar | f | ) |
| inline constexpr

Convert a scalar to a half precision float.

See also: https://clang.llvm.org/docs/LanguageExtensions.html This is not currently supported on Windows toolchains.

Definition at line 32 of file half.h.

32 {
33 #ifdef FML_OS_WIN
34 return static_cast<InternalHalf>(0);
35 #else
36 return static_cast<InternalHalf>(f);
37 #endif
38 }

Referenced by impeller::testing::TEST().

## ◆ SetLuminosity()

static constexpr Vector3 impeller::SetLuminosity | ( | Vector3 | color,
|  | Scalar | luminosity
| ) |  |
| inline static constexpr

Definition at line 83 of file color.cc.

84 {
85 Scalar relative_lum = luminosity - Luminosity(color);
86 return ClipColor(color + relative_lum);
87 }

References ClipColor(), and Luminosity().

Referenced by impeller::Color::Blend().

## ◆ SetSaturation()

static constexpr Vector3 impeller::SetSaturation | ( | Vector3 | color,
|  | Scalar | saturation
| ) |  |
| inline static constexpr

Definition at line 94 of file color.cc.

95 {
96 Scalar mn = std::min(std::min(color.x, color.y), color.z);
97 Scalar mx = std::max(std::max(color.x, color.y), color.z);
98 return (mn < mx) ? ((color - mn) * saturation) / (mx - mn) : Vector3();
99 }

References impeller::Vector3::x, impeller::Vector3::y, and impeller::Vector3::z.

Referenced by impeller::Color::Blend().

## ◆ SetupFragInfo()

static bool impeller::SetupFragInfo | ( | RRectBlurPipeline::FragmentShader::FragInfo & | frag_info,
|  | Scalar | blurSigma,
|  | Point | center,
|  | Point | rSize,
|  | Scalar | radius
| ) |  |
| static

Definition at line 71 of file solid_rrect_blur_contents.cc.

76 {
77 Scalar sigma = std::max(blurSigma * kSqrt2, 1.f);
78
79 frag_info.center = rSize * 0.5f;
80 frag_info.minEdge = std::min(rSize.x, rSize.y);
81 double rMax = 0.5 * frag_info.minEdge;
82 double r0 = std::min(std::hypot(radius, sigma * 1.15), rMax);
83 frag_info.r1 = std::min(std::hypot(radius, sigma * 2.0), rMax);
84
85 frag_info.exponent = 2.0 * frag_info.r1 / r0;
86
87 frag_info.sInv = 1.0 / sigma;
88
89 // Pull in long end (make less eccentric).
90 Point eccentricV = eccentricity(rSize, frag_info.sInv);
91 double delta = 1.25 * sigma * (eccentricV.x - eccentricV.y);
92 rSize += NegPos(delta);
93
94 frag_info.adjust = rSize * 0.5 - frag_info.r1;
95 frag_info.exponentInv = 1.0 / frag_info.exponent;
96 frag_info.scale =
97 0.5 * computeErf7(frag_info.sInv * 0.5 *
98 (std::max(rSize.x, rSize.y) - 0.5 * radius));
99
100 return frag_info.center.IsFinite() && //
101 frag_info.adjust.IsFinite() && //
102 std::isfinite(frag_info.minEdge) && //
103 std::isfinite(frag_info.r1) && //
104 std::isfinite(frag_info.exponent) && //
105 std::isfinite(frag_info.sInv) && //
106 std::isfinite(frag_info.exponentInv) && //
107 std::isfinite(frag_info.scale);
108 }

References computeErf7(), eccentricity(), kSqrt2, NegPos(), impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

Referenced by impeller::SolidRRectBlurContents::Render().

## ◆ SetupSwiftshaderOnce()

void impeller::SetupSwiftshaderOnce | ( | bool | use_swiftshader | ) |

Find and setup the installable client driver for a locally built SwiftShader at known paths. The option to use SwiftShader can only be used once in the process. While calling this method multiple times is fine, specifying a different use_swiftshader value will trip an assertion.

Warning
  This call must be made before any Vulkan contexts are created in the process.

Parameters

  [in] | use_swiftshader | If SwiftShader should be used.

Definition at line 54 of file swiftshader_utilities.cc.

54 {
55 static bool swiftshader_preference = false;
56 static std::once_flag sOnceInitializer;
57 std::call_once(sOnceInitializer, [use_swiftshader]() {
58 if (use_swiftshader) {
59 FindSwiftShaderICDAtKnownPaths();
60 swiftshader_preference = use_swiftshader;
61 }
62 });
63 FML_CHECK(swiftshader_preference == use_swiftshader)
64 << "The option to use SwiftShader in a process can only be set once and "
65 "may not be changed later.";
66 }

References FindSwiftShaderICDAtKnownPaths().

Referenced by impeller::Playground::Playground().

## ◆ ShaderLibraryMappingsForPlayground() [1/3]

static std::vector<std::shared_ptr<fml::Mapping> > impeller::ShaderLibraryMappingsForPlayground | ( |  | ) |
| static

Definition at line 31 of file playground_impl_vk.cc.

31 {
32 return {
33 std::make_shared<fml::NonOwnedMapping>(impeller_entity_shaders_vk_data,
34 impeller_entity_shaders_vk_length),
35 std::make_shared<fml::NonOwnedMapping>(impeller_modern_shaders_vk_data,
36 impeller_modern_shaders_vk_length),
37 std::make_shared<fml::NonOwnedMapping>(
38 impeller_framebuffer_blend_shaders_vk_data,
39 impeller_framebuffer_blend_shaders_vk_length),
40 std::make_shared<fml::NonOwnedMapping>(
41 impeller_fixtures_shaders_vk_data,
42 impeller_fixtures_shaders_vk_length),
43 std::make_shared<fml::NonOwnedMapping>(
44 impeller_modern_fixtures_shaders_vk_data,
45 impeller_modern_fixtures_shaders_vk_length),
46 std::make_shared<fml::NonOwnedMapping>(impeller_imgui_shaders_vk_data,
47 impeller_imgui_shaders_vk_length),
48 std::make_shared<fml::NonOwnedMapping>(
49 impeller_compute_shaders_vk_data, impeller_compute_shaders_vk_length),
50 };
51 }

## ◆ ShaderLibraryMappingsForPlayground() [2/3]

static std::vector<std::shared_ptr<fml::Mapping> > impeller::ShaderLibraryMappingsForPlayground | ( |  | ) |
| static

Definition at line 37 of file playground_impl_mtl.mm.

37 {
38 return {std::make_shared<fml::NonOwnedMapping>(
39 impeller_entity_shaders_data, impeller_entity_shaders_length),
40 std::make_shared<fml::NonOwnedMapping>(
41 impeller_modern_shaders_data, impeller_modern_shaders_length),
42 std::make_shared<fml::NonOwnedMapping>(
43 impeller_framebuffer_blend_shaders_data,
44 impeller_framebuffer_blend_shaders_length),
45 std::make_shared<fml::NonOwnedMapping>(
46 impeller_fixtures_shaders_data, impeller_fixtures_shaders_length),
47 std::make_shared<fml::NonOwnedMapping>(
48 impeller_modern_fixtures_shaders_data,
49 impeller_modern_fixtures_shaders_length),
50 std::make_shared<fml::NonOwnedMapping>(impeller_imgui_shaders_data,
51 impeller_imgui_shaders_length),
52 std::make_shared<fml::NonOwnedMapping>(
53 impeller_compute_shaders_data, impeller_compute_shaders_length)
54
55 };
56 }

## ◆ ShaderLibraryMappingsForPlayground() [3/3]

static std::vector<std::shared_ptr<fml::Mapping> > impeller::ShaderLibraryMappingsForPlayground | ( |  | ) |
| static

Definition at line 106 of file playground_impl_gles.cc.

106 {
107 return {
108 std::make_shared<fml::NonOwnedMapping>(
109 impeller_entity_shaders_gles_data,
110 impeller_entity_shaders_gles_length),
111 std::make_shared<fml::NonOwnedMapping>(
112 impeller_modern_shaders_gles_data,
113 impeller_modern_shaders_gles_length),
114 std::make_shared<fml::NonOwnedMapping>(
115 impeller_framebuffer_blend_shaders_gles_data,
116 impeller_framebuffer_blend_shaders_gles_length),
117 std::make_shared<fml::NonOwnedMapping>(
118 impeller_fixtures_shaders_gles_data,
119 impeller_fixtures_shaders_gles_length),
120 std::make_shared<fml::NonOwnedMapping>(
121 impeller_modern_fixtures_shaders_gles_data,
122 impeller_modern_fixtures_shaders_gles_length),
123 std::make_shared<fml::NonOwnedMapping>(
124 impeller_imgui_shaders_gles_data, impeller_imgui_shaders_gles_length),
125 };
126 }

Referenced by impeller::PlaygroundImplMTL::PlaygroundImplMTL(), and impeller::PlaygroundImplVK::PlaygroundImplVK().

## ◆ SizeToPoint()

Point impeller::SizeToPoint | ( | Size | size | ) |

Definition at line 21 of file text_contents.cc.

21 {
22 return Point(size.width, size.height);
23 }

References impeller::TSize< T >::height, and impeller::TSize< T >::width.

Referenced by impeller::TextContents::ComputeVertexData().

## ◆ SortUniforms()

std::vector< spirv_cross::ID > impeller::SortUniforms | ( | const spirv_cross::ParsedIR * | ir,
|  | const spirv_cross::Compiler * | compiler,
|  | std::optional< spirv_cross::SPIRType::BaseType > | type_filter = `std::nullopt`,
|  | bool | include = `true`
| ) |  |

Sorts uniform declarations in an IR according to decoration order.

The [type_filter] may be optionally supplied to limit which types are returned The [include] value can be set to false change this filter to exclude instead of include.

Definition at line 11 of file uniform_sorter.cc.

15 {
16 // Sort the IR so that the uniforms are in declaration order.
17 std::vector<spirv_cross::ID> uniforms;
18 ir->for_each_typed_id<spirv_cross::SPIRVariable>(
19 [&](uint32_t, const spirv_cross::SPIRVariable& var) {
20 if (var.storage != spv::StorageClassUniformConstant) {
21 return;
22 }
23 const auto& type = compiler->get_type(var.basetype);
24 if (!type_filter.has_value() ||
25 (include && type_filter.value() == type.basetype) ||
26 (!include && type_filter.value() != type.basetype)) {
27 uniforms.push_back(var.self);
28 }
29 });
30
31 auto compare_locations = [&ir](spirv_cross::ID id1, spirv_cross::ID id2) {
32 auto& flags1 = ir->get_decoration_bitset(id1);
33 auto& flags2 = ir->get_decoration_bitset(id2);
34 // Put the uniforms with no location after the ones that have a location.
35 if (!flags1.get(spv::Decoration::DecorationLocation)) {
36 return false;
37 }
38 if (!flags2.get(spv::Decoration::DecorationLocation)) {
39 return true;
40 }
41 // Sort in increasing order of location.
42 return ir->get_decoration(id1, spv::Decoration::DecorationLocation) <
43 ir->get_decoration(id2, spv::Decoration::DecorationLocation);
44 };
45 std::sort(uniforms.begin(), uniforms.end(), compare_locations);
46
47 return uniforms;
48 }

References type.

## ◆ SPrintF()

std::string impeller::SPrintF | ( | const char * | format,
|  |  | ...
| ) |  |

Definition at line 12 of file strings.cc.

12 {
13 std::string ret_val;
14 va_list list;
15 va_list list2;
16 va_start(list, format);
17 va_copy(list2, list);
18 if (auto string_length = ::vsnprintf(nullptr, 0, format, list);
19 string_length >= 0) {
20 auto buffer = reinterpret_cast<char*>(::malloc(string_length + 1));
21 ::vsnprintf(buffer, string_length + 1, format, list2);
22 ret_val = std::string{buffer, static_cast<size_t>(string_length)};
23 ::free(buffer);
24 }
25 va_end(list2);
26 va_end(list);
27 return ret_val;
28 }

Referenced by impeller::BlitPass::AddCopy(), ColorToString(), CreateCompatRenderPassForPipeline(), CreateGradientTexture(), DepthAttachmentToString(), impeller::ProcTableGLES::DescribeCurrentFramebuffer(), DrawPlaygroundPoint(), ImGui_ImplImpeller_RenderDrawData(), impeller::ComputePipelineBuilder< ComputeShader_ >::InitializePipelineDescriptorDefaults(), impeller::PipelineBuilder< VertexShader_, FragmentShader_ >::InitializePipelineDescriptorDefaults(), LinkProgram(), impeller::VerticesSimpleBlendContents::Render(), impeller::ContextVK::SetDebugName(), impeller::testing::TEST(), and impeller::RenderTarget::ToString().

## ◆ StencilAttachmentToString()

std::string impeller::StencilAttachmentToString | ( | const StencilAttachment & | stencil | ) |

Definition at line 137 of file formats.cc.

137 {
138 std::stringstream stream;
139 stream << AttachmentToString(stencil) << ",";
140 stream << "ClearStencil=" << stencil.clear_stencil;
141 return stream.str();
142 }

References AttachmentToString(), and impeller::StencilAttachment::clear_stencil.

Referenced by impeller::RenderTarget::ToString().

## ◆ StorageModeToString()

constexpr const char* impeller::StorageModeToString | ( | StorageMode | mode | ) |
| constexpr

Definition at line 60 of file formats.h.

60 {
61 switch (mode) {
62 case StorageMode::kHostVisible:
63 return "HostVisible";
64 case StorageMode::kDevicePrivate:
65 return "DevicePrivate";
66 case StorageMode::kDeviceTransient:
67 return "DeviceTransient";
68 }
69 FML_UNREACHABLE();
70 }

References kDevicePrivate, kDeviceTransient, and kHostVisible.

Referenced by impeller::AllocatedTextureSourceVK::AllocatedTextureSourceVK(), and TextureDescriptorToString().

## ◆ StoreActionNeedsResolveTexture()

constexpr bool impeller::StoreActionNeedsResolveTexture | ( | StoreAction | action | ) |
| constexpr

Definition at line 15 of file formats.cc.

15 {
16 switch (action) {
17 case StoreAction::kDontCare:
18 case StoreAction::kStore:
19 return false;
20 case StoreAction::kMultisampleResolve:
21 case StoreAction::kStoreAndMultisampleResolve:
22 return true;
23 }
24 }

References kDontCare, kMultisampleResolve, kStore, and kStoreAndMultisampleResolve.

Referenced by impeller::Attachment::IsValid().

## ◆ StoreActionPerformsResolve()

constexpr bool impeller::StoreActionPerformsResolve | ( | StoreAction | store_action | ) |
| constexpr

Definition at line 343 of file formats_vk.h.

343 {
344 switch (store_action) {
345 case StoreAction::kDontCare:
346 case StoreAction::kStore:
347 return false;
348 case StoreAction::kMultisampleResolve:
349 case StoreAction::kStoreAndMultisampleResolve:
350 return true;
351 }
352 FML_UNREACHABLE();
353 }

References kDontCare, kMultisampleResolve, kStore, and kStoreAndMultisampleResolve.

Referenced by impeller::RenderPassBuilderVK::SetColorAttachment().

## ◆ StoreActionToString()

constexpr const char* impeller::StoreActionToString | ( | StoreAction | action | ) |
| constexpr

Definition at line 226 of file formats.h.

226 {
227 switch (action) {
228 case StoreAction::kDontCare:
229 return "DontCare";
230 case StoreAction::kStore:
231 return "Store";
232 case StoreAction::kMultisampleResolve:
233 return "MultisampleResolve";
234 case StoreAction::kStoreAndMultisampleResolve:
235 return "StoreAndMultisampleResolve";
236 }
237 }

References kDontCare, kMultisampleResolve, kStore, and kStoreAndMultisampleResolve.

Referenced by AttachmentToString().

## ◆ StripPrefix()

std::string impeller::StripPrefix | ( | const std::string & | string,
|  | const std::string & | to_strip
| ) |  |

Definition at line 42 of file strings.cc.

43 {
44 if (!HasPrefix(string, to_strip)) {
45 return string;
46 }
47 return string.substr(to_strip.length());
48 }

References HasPrefix().

Referenced by DetermineVersion().

## ◆ SupportsLossyTextureCompression()

static bool impeller::SupportsLossyTextureCompression | ( | id< MTLDevice > | device | ) |
| static

Definition at line 83 of file allocator_mtl.mm.

83 {
84 #ifdef FML_OS_IOS_SIMULATOR
85 return false;
86 #else
87 if (@available(macOS 10.15, iOS 13, tvOS 13, *)) {
88 return [device supportsFamily:MTLGPUFamilyApple8];
89 }
90 return false;
91 #endif
92 }

## ◆ Tessellate()

IMPELLER_API struct Vertices * impeller::Tessellate | ( | PathBuilder * | builder,
|  | int | fill_type,
|  | Scalar | tolerance
| ) |  |

Definition at line 42 of file tessellator.cc.

44 {
45 auto path = builder->CopyPath(static_cast<FillType>(fill_type));
46 std::vector<float> points;
47 if (TessellatorLibtess{}.Tessellate(
48 path, tolerance,
49 [&points](const float* vertices, size_t vertices_count,
50 const uint16_t* indices, size_t indices_count) {
51 // Results are expected to be re-duplicated.
52 std::vector<Point> raw_points;
53 for (auto i = 0u; i < vertices_count * 2; i += 2) {
54 raw_points.emplace_back(Point{vertices[i], vertices[i + 1]});
55 }
56 for (auto i = 0u; i < indices_count; i++) {
57 auto point = raw_points[indices[i]];
58 points.push_back(point.x);
59 points.push_back(point.y);
60 }
61 return true;
62 }) != TessellatorLibtess::Result::kSuccess) {
63 return nullptr;
64 }
65
66 Vertices* vertices = new Vertices();
67 vertices->points = new float[points.size()];
68 if (!vertices->points) {
69 return nullptr;
70 }
71 vertices->length = points.size();
72 std::copy(points.begin(), points.end(), vertices->points);
73 return vertices;
74 }

References impeller::PathBuilder::CopyPath(), impeller::TessellatorLibtess::kSuccess, impeller::Vertices::length, impeller::Vertices::points, and impeller::TessellatorLibtess::Tessellate().

## ◆ TEST()

impeller::TEST | ( | ValidationTest | ,
|  | IsFatal |
| ) |  |

Definition at line 29 of file main.cc.

29 {
30 EXPECT_TRUE(ImpellerValidationErrorsAreFatal());
31 }

References ImpellerValidationErrorsAreFatal().

## ◆ TextureDescriptorToString()

std::string impeller::TextureDescriptorToString | ( | const TextureDescriptor & | desc | ) |

Definition at line 11 of file texture_descriptor.cc.

11 {
12 std::stringstream stream;
13 stream << "StorageMode=" << StorageModeToString(desc.storage_mode) << ",";
14 stream << "Type=" << TextureTypeToString(desc.type) << ",";
15 stream << "Format=" << PixelFormatToString(desc.format) << ",";
16 stream << "Size=" << desc.size << ",";
17 stream << "MipCount=" << desc.mip_count << ",";
18 stream << "SampleCount=" << static_cast<size_t>(desc.sample_count) << ",";
19 stream << "Compression=" << CompressionTypeToString(desc.compression_type);
20 return stream.str();
21 }

References impeller::TextureDescriptor::compression_type, CompressionTypeToString(), impeller::TextureDescriptor::format, impeller::TextureDescriptor::mip_count, PixelFormatToString(), impeller::TextureDescriptor::sample_count, impeller::TextureDescriptor::size, impeller::TextureDescriptor::storage_mode, StorageModeToString(), TextureTypeToString(), and impeller::TextureDescriptor::type.

Referenced by AttachmentToString().

## ◆ TextureTypeToString()

constexpr const char* impeller::TextureTypeToString | ( | TextureType | type | ) |
| constexpr

Definition at line 269 of file formats.h.

269 {
270 switch (type) {
271 case TextureType::kTexture2D:
272 return "Texture2D";
273 case TextureType::kTexture2DMultisample:
274 return "Texture2DMultisample";
275 case TextureType::kTextureCube:
276 return "TextureCube";
277 case TextureType::kTextureExternalOES:
278 return "TextureExternalOES";
279 }
280 FML_UNREACHABLE();
281 }

References kTexture2D, kTexture2DMultisample, kTextureCube, kTextureExternalOES, and type.

Referenced by impeller::AllocatedTextureSourceVK::AllocatedTextureSourceVK(), impeller::RenderTarget::IsValid(), and TextureDescriptorToString().

## ◆ TextureUsageMaskToString()

std::string impeller::TextureUsageMaskToString | ( | TextureUsageMask | mask | ) |

Definition at line 81 of file formats.cc.

81 {
82 std::vector<TextureUsage> usages;
83 if (mask & TextureUsage::kShaderRead) {
84 usages.push_back(TextureUsage::kShaderRead);
85 }
86 if (mask & TextureUsage::kShaderWrite) {
87 usages.push_back(TextureUsage::kShaderWrite);
88 }
89 if (mask & TextureUsage::kRenderTarget) {
90 usages.push_back(TextureUsage::kRenderTarget);
91 }
92 std::stringstream stream;
93 stream << "{ ";
94 for (size_t i = 0; i < usages.size(); i++) {
95 stream << TextureUsageToString(usages[i]);
96 if (i != usages.size() - 1u) {
97 stream << ", ";
98 }
99 }
100 stream << " }";
101 return stream.str();
102 }

References kRenderTarget, kShaderRead, kShaderWrite, and TextureUsageToString().

Referenced by impeller::AllocatedTextureSourceVK::AllocatedTextureSourceVK().

## ◆ TextureUsageToString()

constexpr const char* impeller::TextureUsageToString | ( | TextureUsage | usage | ) |
| constexpr

Definition at line 310 of file formats.h.

310 {
311 switch (usage) {
312 case TextureUsage::kUnknown:
313 return "Unknown";
314 case TextureUsage::kShaderRead:
315 return "ShaderRead";
316 case TextureUsage::kShaderWrite:
317 return "ShaderWrite";
318 case TextureUsage::kRenderTarget:
319 return "RenderTarget";
320 }
321 FML_UNREACHABLE();
322 }

References kRenderTarget, kShaderRead, kShaderWrite, and kUnknown.

Referenced by TextureUsageMaskToString().

## ◆ TileModeToAddressMode()

static std::optional<SamplerAddressMode> impeller::TileModeToAddressMode | ( | Entity::TileMode | tile_mode,
|  | const Capabilities & | capabilities
| ) |  |
| static

Definition at line 15 of file tiled_texture_contents.cc.

17 {
18 switch (tile_mode) {
19 case Entity::TileMode::kClamp:
20 return SamplerAddressMode::kClampToEdge;
21 break;
22 case Entity::TileMode::kMirror:
23 return SamplerAddressMode::kMirror;
24 break;
25 case Entity::TileMode::kRepeat:
26 return SamplerAddressMode::kRepeat;
27 break;
28 case Entity::TileMode::kDecal:
29 if (capabilities.SupportsDecalSamplerAddressMode()) {
30 return SamplerAddressMode::kDecal;
31 }
32 return std::nullopt;
33 }
34 }

References impeller::Entity::kClamp, kClampToEdge, impeller::Entity::kDecal, kDecal, impeller::Entity::kMirror, kMirror, impeller::Entity::kRepeat, kRepeat, and impeller::Capabilities::SupportsDecalSamplerAddressMode().

Referenced by impeller::VerticesSimpleBlendContents::Render().

## ◆ ToAddressMode()

static GLint impeller::ToAddressMode | ( | SamplerAddressMode | mode,
|  | bool | supports_decal_sampler_address_mode
| ) |  |
| static

Definition at line 52 of file sampler_gles.cc.

53 {
54 switch (mode) {
55 case SamplerAddressMode::kClampToEdge:
56 return GL_CLAMP_TO_EDGE;
57 case SamplerAddressMode::kRepeat:
58 return GL_REPEAT;
59 case SamplerAddressMode::kMirror:
60 return GL_MIRRORED_REPEAT;
61 case SamplerAddressMode::kDecal:
62 if (supports_decal_sampler_address_mode) {
63 return IMPELLER_GL_CLAMP_TO_BORDER;
64 } else {
65 return GL_CLAMP_TO_EDGE;
66 }
67 }
68 FML_UNREACHABLE();
69 }

References IMPELLER_GL_CLAMP_TO_BORDER, kClampToEdge, kDecal, kMirror, and kRepeat.

Referenced by impeller::SamplerGLES::ConfigureBoundTexture().

## ◆ ToArrayLayerCount()

constexpr uint32_t impeller::ToArrayLayerCount | ( | TextureType | type | ) |
| constexpr

Definition at line 539 of file formats_vk.h.

539 {
540 switch (type) {
541 case TextureType::kTexture2D:
542 case TextureType::kTexture2DMultisample:
543 return 1u;
544 case TextureType::kTextureCube:
545 return 6u;
546 case TextureType::kTextureExternalOES:
547 VALIDATION_LOG
548 << "kTextureExternalOES can not be used with the Vulkan backend.";
549 }
550 FML_UNREACHABLE();
551 }

References kTexture2D, kTexture2DMultisample, kTextureCube, kTextureExternalOES, type, and VALIDATION_LOG.

Referenced by impeller::AllocatedTextureSourceVK::AllocatedTextureSourceVK(), impeller::KHRSwapchainImageVK::KHRSwapchainImageVK(), and impeller::TextureSourceVK::SetLayout().

## ◆ ToAttachmentType()

static GLenum impeller::ToAttachmentType | ( | TextureGLES::AttachmentType | point | ) |
| static

Definition at line 576 of file texture_gles.cc.

576 {
577 switch (point) {
578 case TextureGLES::AttachmentType::kColor0:
579 return GL_COLOR_ATTACHMENT0;
580 case TextureGLES::AttachmentType::kDepth:
581 return GL_DEPTH_ATTACHMENT;
582 case TextureGLES::AttachmentType::kStencil:
583 return GL_STENCIL_ATTACHMENT;
584 }
585 }

References impeller::TextureGLES::kColor0, impeller::TextureGLES::kDepth, and impeller::TextureGLES::kStencil.

Referenced by impeller::TextureGLES::SetAsFramebufferAttachment().

## ◆ ToBlendFactor()

constexpr GLenum impeller::ToBlendFactor | ( | BlendFactor | factor | ) |
| constexpr

Definition at line 92 of file formats_gles.h.

92 {
93 switch (factor) {
94 case BlendFactor::kZero:
95 return GL_ZERO;
96 case BlendFactor::kOne:
97 return GL_ONE;
98 case BlendFactor::kSourceColor:
99 return GL_SRC_COLOR;
100 case BlendFactor::kOneMinusSourceColor:
101 return GL_ONE_MINUS_SRC_COLOR;
102 case BlendFactor::kSourceAlpha:
103 return GL_SRC_ALPHA;
104 case BlendFactor::kOneMinusSourceAlpha:
105 return GL_ONE_MINUS_SRC_ALPHA;
106 case BlendFactor::kDestinationColor:
107 return GL_DST_COLOR;
108 case BlendFactor::kOneMinusDestinationColor:
109 return GL_ONE_MINUS_DST_COLOR;
110 case BlendFactor::kDestinationAlpha:
111 return GL_DST_ALPHA;
112 case BlendFactor::kOneMinusDestinationAlpha:
113 return GL_ONE_MINUS_DST_ALPHA;
114 case BlendFactor::kSourceAlphaSaturated:
115 return GL_SRC_ALPHA_SATURATE;
116 case BlendFactor::kBlendColor:
117 return GL_CONSTANT_COLOR;
118 case BlendFactor::kOneMinusBlendColor:
119 return GL_ONE_MINUS_CONSTANT_COLOR;
120 case BlendFactor::kBlendAlpha:
121 return GL_CONSTANT_ALPHA;
122 case BlendFactor::kOneMinusBlendAlpha:
123 return GL_ONE_MINUS_CONSTANT_ALPHA;
124 }
125 FML_UNREACHABLE();
126 }

References kBlendAlpha, kBlendColor, kDestinationAlpha, kDestinationColor, kOne, kOneMinusBlendAlpha, kOneMinusBlendColor, kOneMinusDestinationAlpha, kOneMinusDestinationColor, kOneMinusSourceAlpha, kOneMinusSourceColor, kSourceAlpha, kSourceAlphaSaturated, kSourceColor, and kZero.

Referenced by ConfigureBlending().

## ◆ ToBlendOperation()

constexpr GLenum impeller::ToBlendOperation | ( | BlendOperation | op | ) |
| constexpr

Definition at line 128 of file formats_gles.h.

128 {
129 switch (op) {
130 case BlendOperation::kAdd:
131 return GL_FUNC_ADD;
132 case BlendOperation::kSubtract:
133 return GL_FUNC_SUBTRACT;
134 case BlendOperation::kReverseSubtract:
135 return GL_FUNC_REVERSE_SUBTRACT;
136 }
137 FML_UNREACHABLE();
138 }

References kAdd, kReverseSubtract, and kSubtract.

Referenced by ConfigureBlending().

## ◆ ToBlurStyle()

static FilterContents::BlurStyle impeller::ToBlurStyle | ( | flutter::DlBlurStyle | blur_style | ) |
| static

Definition at line 249 of file dl_dispatcher.cc.

249 {
250 switch (blur_style) {
251 case flutter::DlBlurStyle::kNormal:
252 return FilterContents::BlurStyle::kNormal;
253 case flutter::DlBlurStyle::kSolid:
254 return FilterContents::BlurStyle::kSolid;
255 case flutter::DlBlurStyle::kOuter:
256 return FilterContents::BlurStyle::kOuter;
257 case flutter::DlBlurStyle::kInner:
258 return FilterContents::BlurStyle::kInner;
259 }
260 }

References impeller::FilterContents::kInner, impeller::FilterContents::kNormal, impeller::FilterContents::kOuter, and impeller::FilterContents::kSolid.

Referenced by impeller::DlDispatcherBase::setMaskFilter().

## ◆ ToClipOperation()

static Entity::ClipOperation impeller::ToClipOperation | ( | flutter::DlCanvas::ClipOp | clip_op | ) |
| static

Definition at line 420 of file dl_dispatcher.cc.

421 {
422 switch (clip_op) {
423 case flutter::DlCanvas::ClipOp::kDifference:
424 return Entity::ClipOperation::kDifference;
425 case flutter::DlCanvas::ClipOp::kIntersect:
426 return Entity::ClipOperation::kIntersect;
427 }
428 }

References impeller::Entity::kDifference, and impeller::Entity::kIntersect.

Referenced by impeller::DlDispatcherBase::clipOval(), impeller::DlDispatcherBase::clipPath(), impeller::DlDispatcherBase::clipRect(), and impeller::DlDispatcherBase::clipRoundRect().

## ◆ ToCommitResult()

static CommandBuffer::Status impeller::ToCommitResult | ( | MTLCommandBufferStatus | status | ) |
| static

Definition at line 153 of file command_buffer_mtl.mm.

153 {
154 switch (status) {
155 case MTLCommandBufferStatusCompleted:
156 return CommandBufferMTL::Status::kCompleted;
157 case MTLCommandBufferStatusEnqueued:
158 return CommandBufferMTL::Status::kPending;
159 default:
160 break;
161 }
162 return CommandBufferMTL::Status::kError;
163 }

## ◆ ToCompareFunction()

constexpr GLenum impeller::ToCompareFunction | ( | CompareFunction | func | ) |
| constexpr

Definition at line 70 of file formats_gles.h.

70 {
71 switch (func) {
72 case CompareFunction::kNever:
73 return GL_NEVER;
74 case CompareFunction::kAlways:
75 return GL_ALWAYS;
76 case CompareFunction::kLess:
77 return GL_LESS;
78 case CompareFunction::kEqual:
79 return GL_EQUAL;
80 case CompareFunction::kLessEqual:
81 return GL_LEQUAL;
82 case CompareFunction::kGreater:
83 return GL_GREATER;
84 case CompareFunction::kNotEqual:
85 return GL_NOTEQUAL;
86 case CompareFunction::kGreaterEqual:
87 return GL_GEQUAL;
88 }
89 FML_UNREACHABLE();
90 }

References kAlways, kEqual, kGreater, kGreaterEqual, kLess, kLessEqual, kNever, and kNotEqual.

Referenced by ConfigureStencil(), and EncodeCommandsInReactor().

## ◆ ToDebugIdentifier()

static std::optional<GLenum> impeller::ToDebugIdentifier | ( | DebugResourceType | type | ) |
| static

Definition at line 318 of file proc_table_gles.cc.

318 {
319 switch (type) {
320 case DebugResourceType::kTexture:
321 return GL_TEXTURE;
322 case DebugResourceType::kBuffer:
323 return GL_BUFFER_KHR;
324 case DebugResourceType::kProgram:
325 return GL_PROGRAM_KHR;
326 case DebugResourceType::kShader:
327 return GL_SHADER_KHR;
328 case DebugResourceType::kRenderBuffer:
329 return GL_RENDERBUFFER;
330 case DebugResourceType::kFrameBuffer:
331 return GL_FRAMEBUFFER;
332 case DebugResourceType::kFence:
333 return GL_SYNC_FENCE;
334 }
335 FML_UNREACHABLE();
336 }

References kBuffer, kFence, kFrameBuffer, kProgram, kRenderBuffer, kShader, kTexture, and type.

Referenced by impeller::ProcTableGLES::SetDebugLabel().

## ◆ ToDebugResourceType()

static DebugResourceType impeller::ToDebugResourceType | ( | HandleType | type | ) |
| static

Definition at line 265 of file reactor_gles.cc.

265 {
266 switch (type) {
267 case HandleType::kUnknown:
268 FML_UNREACHABLE();
269 case HandleType::kTexture:
270 return DebugResourceType::kTexture;
271 case HandleType::kBuffer:
272 return DebugResourceType::kBuffer;
273 case HandleType::kProgram:
274 return DebugResourceType::kProgram;
275 case HandleType::kRenderBuffer:
276 return DebugResourceType::kRenderBuffer;
277 case HandleType::kFrameBuffer:
278 return DebugResourceType::kFrameBuffer;
279 case HandleType::kFence:
280 return DebugResourceType::kFence;
281 }
282 FML_UNREACHABLE();
283 }

References kBuffer, kFence, kFrameBuffer, kProgram, kRenderBuffer, kTexture, kUnknown, and type.

Referenced by impeller::ReactorGLES::SetDebugLabel().

## ◆ ToDeviceType()

constexpr DeviceTypeVK impeller::ToDeviceType | ( | const vk::PhysicalDeviceType & | type | ) |
| constexpr

Definition at line 228 of file driver_info_vk.cc.

228 {
229 switch (type) {
230 case vk::PhysicalDeviceType::eOther:
231 return DeviceTypeVK::kUnknown;
232 case vk::PhysicalDeviceType::eIntegratedGpu:
233 return DeviceTypeVK::kIntegratedGPU;
234 case vk::PhysicalDeviceType::eDiscreteGpu:
235 return DeviceTypeVK::kDiscreteGPU;
236 case vk::PhysicalDeviceType::eVirtualGpu:
237 return DeviceTypeVK::kVirtualGPU;
238 case vk::PhysicalDeviceType::eCpu:
239 return DeviceTypeVK::kCPU;
240 break;
241 }
242 return DeviceTypeVK::kUnknown;
243 }

References kCPU, kDiscreteGPU, kIntegratedGPU, kUnknown, kVirtualGPU, and type.

Referenced by impeller::DriverInfoVK::DriverInfoVK().

## ◆ ToFont()

static Font impeller::ToFont | ( | const SkTextBlobRunIterator & | run,
|  | AxisAlignment | alignment
| ) |  |
| static

Definition at line 22 of file text_frame_skia.cc.

22 {
23 auto& font = run.font();
24 auto typeface = std::make_shared<TypefaceSkia>(font.refTypeface());
25
26 SkFontMetrics sk_metrics;
27 font.getMetrics(&sk_metrics);
28
29 Font::Metrics metrics;
30 metrics.point_size = font.getSize();
31 metrics.embolden = font.isEmbolden();
32 metrics.skewX = font.getSkewX();
33 metrics.scaleX = font.getScaleX();
34
35 return Font{std::move(typeface), metrics, alignment};
36 }

References impeller::Font::Metrics::embolden, impeller::Font::Metrics::point_size, impeller::Font::Metrics::scaleX, and impeller::Font::Metrics::skewX.

Referenced by MakeTextFrameFromTextBlobSkia().

## ◆ ToHandleType()

HandleType impeller::ToHandleType | ( | TextureGLES::Type | type | ) |

Definition at line 131 of file texture_gles.cc.

131 {
132 switch (type) {
133 case TextureGLES::Type::kTexture:
134 case TextureGLES::Type::kTextureMultisampled:
135 return HandleType::kTexture;
136 case TextureGLES::Type::kRenderBuffer:
137 case TextureGLES::Type::kRenderBufferMultisampled:
138 return HandleType::kRenderBuffer;
139 }
140 FML_UNREACHABLE();
141 }

References kRenderBuffer, impeller::TextureGLES::kRenderBuffer, impeller::TextureGLES::kRenderBufferMultisampled, kTexture, impeller::TextureGLES::kTexture, impeller::TextureGLES::kTextureMultisampled, and type.

## ◆ ToImageAspectFlags()

constexpr vk::ImageAspectFlags impeller::ToImageAspectFlags | ( | PixelFormat | format | ) |
| constexpr

Definition at line 586 of file formats_vk.h.

586 {
587 switch (format) {
588 case PixelFormat::kUnknown:
589 return {};
590 case PixelFormat::kA8UNormInt:
591 case PixelFormat::kR8UNormInt:
592 case PixelFormat::kR8G8UNormInt:
593 case PixelFormat::kR8G8B8A8UNormInt:
594 case PixelFormat::kR8G8B8A8UNormIntSRGB:
595 case PixelFormat::kB8G8R8A8UNormInt:
596 case PixelFormat::kB8G8R8A8UNormIntSRGB:
597 case PixelFormat::kR32G32B32A32Float:
598 case PixelFormat::kR16G16B16A16Float:
599 case PixelFormat::kB10G10R10XR:
600 case PixelFormat::kB10G10R10XRSRGB:
601 case PixelFormat::kB10G10R10A10XR:
602 return vk::ImageAspectFlagBits::eColor;
603 case PixelFormat::kS8UInt:
604 return vk::ImageAspectFlagBits::eStencil;
605 case PixelFormat::kD24UnormS8Uint:
606 case PixelFormat::kD32FloatS8UInt:
607 return vk::ImageAspectFlagBits::eDepth |
608 vk::ImageAspectFlagBits::eStencil;
609 }
610 FML_UNREACHABLE();
611 }

References kA8UNormInt, kB10G10R10A10XR, kB10G10R10XR, kB10G10R10XRSRGB, kB8G8R8A8UNormInt, kB8G8R8A8UNormIntSRGB, kD24UnormS8Uint, kD32FloatS8UInt, kR16G16B16A16Float, kR32G32B32A32Float, kR8G8B8A8UNormInt, kR8G8B8A8UNormIntSRGB, kR8G8UNormInt, kR8UNormInt, kS8UInt, and kUnknown.

Referenced by impeller::TextureSourceVK::SetLayout().

## ◆ ToIndexType()

constexpr GLenum impeller::ToIndexType | ( | IndexType | type | ) |
| constexpr

Definition at line 35 of file formats_gles.h.

35 {
36 switch (type) {
37 case IndexType::kUnknown:
38 case IndexType::kNone:
39 FML_UNREACHABLE();
40 case IndexType::k16bit:
41 return GL_UNSIGNED_SHORT;
42 case IndexType::k32bit:
43 return GL_UNSIGNED_INT;
44 }
45 FML_UNREACHABLE();
46 }

References k16bit, k32bit, kNone, kUnknown, and type.

Referenced by EncodeCommandsInReactor().

## ◆ ToMode()

constexpr GLenum impeller::ToMode | ( | PrimitiveType | primitive_type | ) |
| constexpr

Definition at line 17 of file formats_gles.h.

17 {
18 switch (primitive_type) {
19 case PrimitiveType::kTriangle:
20 return GL_TRIANGLES;
21 case PrimitiveType::kTriangleStrip:
22 return GL_TRIANGLE_STRIP;
23 case PrimitiveType::kLine:
24 return GL_LINES;
25 case PrimitiveType::kLineStrip:
26 return GL_LINE_STRIP;
27 case PrimitiveType::kPoint:
28 return GL_POINTS;
29 case PrimitiveType::kTriangleFan:
30 return GL_TRIANGLE_FAN;
31 }
32 FML_UNREACHABLE();
33 }

References kLine, kLineStrip, kPoint, kTriangle, kTriangleFan, and kTriangleStrip.

Referenced by EncodeCommandsInReactor().

## ◆ ToMTLBlendFactor()

constexpr MTLBlendFactor impeller::ToMTLBlendFactor | ( | BlendFactor | type | ) |
| constexpr

Definition at line 114 of file formats_mtl.h.

114 {
115 switch (type) {
116 case BlendFactor::kZero:
117 return MTLBlendFactorZero;
118 case BlendFactor::kOne:
119 return MTLBlendFactorOne;
120 case BlendFactor::kSourceColor:
121 return MTLBlendFactorSourceColor;
122 case BlendFactor::kOneMinusSourceColor:
123 return MTLBlendFactorOneMinusSourceColor;
124 case BlendFactor::kSourceAlpha:
125 return MTLBlendFactorSourceAlpha;
126 case BlendFactor::kOneMinusSourceAlpha:
127 return MTLBlendFactorOneMinusSourceAlpha;
128 case BlendFactor::kDestinationColor:
129 return MTLBlendFactorDestinationColor;
130 case BlendFactor::kOneMinusDestinationColor:
131 return MTLBlendFactorOneMinusDestinationColor;
132 case BlendFactor::kDestinationAlpha:
133 return MTLBlendFactorDestinationAlpha;
134 case BlendFactor::kOneMinusDestinationAlpha:
135 return MTLBlendFactorOneMinusDestinationAlpha;
136 case BlendFactor::kSourceAlphaSaturated:
137 return MTLBlendFactorSourceAlphaSaturated;
138 case BlendFactor::kBlendColor:
139 return MTLBlendFactorBlendColor;
140 case BlendFactor::kOneMinusBlendColor:
141 return MTLBlendFactorOneMinusBlendColor;
142 case BlendFactor::kBlendAlpha:
143 return MTLBlendFactorBlendAlpha;
144 case BlendFactor::kOneMinusBlendAlpha:
145 return MTLBlendFactorOneMinusBlendAlpha;
146 }
147 return MTLBlendFactorZero;
148 };

References kBlendAlpha, kBlendColor, kDestinationAlpha, kDestinationColor, kOne, kOneMinusBlendAlpha, kOneMinusBlendColor, kOneMinusDestinationAlpha, kOneMinusDestinationColor, kOneMinusSourceAlpha, kOneMinusSourceColor, kSourceAlpha, kSourceAlphaSaturated, kSourceColor, kZero, and type.

Referenced by ToMTLRenderPipelineColorAttachmentDescriptor().

## ◆ ToMTLBlendOperation()

constexpr MTLBlendOperation impeller::ToMTLBlendOperation | ( | BlendOperation | type | ) |
| constexpr

Definition at line 201 of file formats_mtl.h.

201 {
202 switch (type) {
203 case BlendOperation::kAdd:
204 return MTLBlendOperationAdd;
205 case BlendOperation::kSubtract:
206 return MTLBlendOperationSubtract;
207 case BlendOperation::kReverseSubtract:
208 return MTLBlendOperationReverseSubtract;
209 }
210 return MTLBlendOperationAdd;
211 };

References kAdd, kReverseSubtract, kSubtract, and type.

Referenced by ToMTLRenderPipelineColorAttachmentDescriptor().

## ◆ ToMTLClearColor()

MTLClearColor impeller::ToMTLClearColor | ( | const Color & | color | ) |
| inline

Definition at line 374 of file formats_mtl.h.

374 {
375 return MTLClearColorMake(color.red, color.green, color.blue, color.alpha);
376 }

References impeller::Color::alpha, impeller::Color::blue, impeller::Color::green, and impeller::Color::red.

Referenced by ConfigureColorAttachment().

## ◆ ToMTLColorWriteMask()

constexpr MTLColorWriteMask impeller::ToMTLColorWriteMask | ( | ColorWriteMask | type | ) |
| constexpr

Definition at line 213 of file formats_mtl.h.

213 {
214 MTLColorWriteMask mask = MTLColorWriteMaskNone;
215
216 if (type & ColorWriteMaskBits::kRed) {
217 mask |= MTLColorWriteMaskRed;
218 }
219
220 if (type & ColorWriteMaskBits::kGreen) {
221 mask |= MTLColorWriteMaskGreen;
222 }
223
224 if (type & ColorWriteMaskBits::kBlue) {
225 mask |= MTLColorWriteMaskBlue;
226 }
227
228 if (type & ColorWriteMaskBits::kAlpha) {
229 mask |= MTLColorWriteMaskAlpha;
230 }
231
232 return mask;
233 };

References kAlpha, kBlue, kGreen, kRed, and type.

Referenced by ToMTLRenderPipelineColorAttachmentDescriptor().

## ◆ ToMTLCompareFunction()

constexpr MTLCompareFunction impeller::ToMTLCompareFunction | ( | CompareFunction | func | ) |
| constexpr

Definition at line 235 of file formats_mtl.h.

235 {
236 switch (func) {
237 case CompareFunction::kNever:
238 return MTLCompareFunctionNever;
239 case CompareFunction::kLess:
240 return MTLCompareFunctionLess;
241 case CompareFunction::kEqual:
242 return MTLCompareFunctionEqual;
243 case CompareFunction::kLessEqual:
244 return MTLCompareFunctionLessEqual;
245 case CompareFunction::kGreater:
246 return MTLCompareFunctionGreater;
247 case CompareFunction::kNotEqual:
248 return MTLCompareFunctionNotEqual;
249 case CompareFunction::kGreaterEqual:
250 return MTLCompareFunctionGreaterEqual;
251 case CompareFunction::kAlways:
252 return MTLCompareFunctionAlways;
253 }
254 return MTLCompareFunctionAlways;
255 };

References kAlways, kEqual, kGreater, kGreaterEqual, kLess, kLessEqual, kNever, and kNotEqual.

Referenced by ToMTLDepthStencilDescriptor(), and ToMTLStencilDescriptor().

## ◆ ToMTLCullMode()

constexpr MTLCullMode impeller::ToMTLCullMode | ( | CullMode | mode | ) |
| constexpr

Definition at line 189 of file formats_mtl.h.

189 {
190 switch (mode) {
191 case CullMode::kNone:
192 return MTLCullModeNone;
193 case CullMode::kBackFace:
194 return MTLCullModeBack;
195 case CullMode::kFrontFace:
196 return MTLCullModeFront;
197 }
198 return MTLCullModeNone;
199 }

References kBackFace, kFrontFace, and kNone.

## ◆ ToMTLDepthStencilDescriptor()

MTLDepthStencilDescriptor * impeller::ToMTLDepthStencilDescriptor | ( | std::optional< DepthAttachmentDescriptor > | depth,
|  | std::optional< StencilAttachmentDescriptor > | front,
|  | std::optional< StencilAttachmentDescriptor > | back
| ) |  |

Definition at line 54 of file formats_mtl.mm.

57 {
58 if (!depth) {
59 depth = DepthAttachmentDescriptor{
60 // Always pass the depth test.
61 .depth_compare = CompareFunction::kAlways,
62 .depth_write_enabled = false,
63 };
64 }
65
66 auto des = [[MTLDepthStencilDescriptor alloc] init];
67
68 // These temporary variables are necessary for clang-tidy (Fuchsia LLVM
69 // version 17.0.0git) to not crash.
70 auto compare_function = ToMTLCompareFunction(depth->depth_compare);
71 auto depth_write_enabled = depth->depth_write_enabled;
72
73 des.depthCompareFunction = compare_function;
74 des.depthWriteEnabled = depth_write_enabled;
75
76 if (front.has_value()) {
77 des.frontFaceStencil = ToMTLStencilDescriptor(front.value());
78 }
79 if (back.has_value()) {
80 des.backFaceStencil = ToMTLStencilDescriptor(back.value());
81 }
82
83 return des;
84 }

References impeller::DepthAttachmentDescriptor::depth_compare, kAlways, ToMTLCompareFunction(), and ToMTLStencilDescriptor().

Referenced by CreateDepthStencilDescriptor().

## ◆ ToMTLFunctionType()

static MTLFunctionType impeller::ToMTLFunctionType | ( | ShaderStage | stage | ) |
| static

Definition at line 28 of file shader_library_mtl.mm.

28 {
29 switch (stage) {
30 case ShaderStage::kVertex:
31 return MTLFunctionTypeVertex;
32 case ShaderStage::kFragment:
33 return MTLFunctionTypeFragment;
34 case ShaderStage::kUnknown:
35 case ShaderStage::kCompute:
36 return MTLFunctionTypeKernel;
37 }
38 FML_UNREACHABLE();
39 }

References kCompute, kFragment, kUnknown, and kVertex.

## ◆ ToMTLIndexType()

constexpr MTLIndexType impeller::ToMTLIndexType | ( | IndexType | type | ) |
| constexpr

Definition at line 180 of file formats_mtl.h.

180 {
181 switch (type) {
182 case IndexType::k16bit:
183 return MTLIndexTypeUInt16;
184 default:
185 return MTLIndexTypeUInt32;
186 }
187 }

References k16bit, and type.

## ◆ ToMTLLoadAction()

constexpr MTLLoadAction impeller::ToMTLLoadAction | ( | LoadAction | action | ) |
| constexpr

Definition at line 279 of file formats_mtl.h.

279 {
280 switch (action) {
281 case LoadAction::kDontCare:
282 return MTLLoadActionDontCare;
283 case LoadAction::kLoad:
284 return MTLLoadActionLoad;
285 case LoadAction::kClear:
286 return MTLLoadActionClear;
287 }
288
289 return MTLLoadActionDontCare;
290 }

References kClear, kDontCare, and kLoad.

Referenced by ConfigureAttachment().

## ◆ ToMTLPixelFormat()

constexpr MTLPixelFormat impeller::ToMTLPixelFormat | ( | PixelFormat | format | ) |
| constexpr

Definition at line 76 of file formats_mtl.h.

76 {
77 switch (format) {
78 case PixelFormat::kUnknown:
79 return MTLPixelFormatInvalid;
80 case PixelFormat::kA8UNormInt:
81 return MTLPixelFormatA8Unorm;
82 case PixelFormat::kR8UNormInt:
83 return MTLPixelFormatR8Unorm;
84 case PixelFormat::kR8G8UNormInt:
85 return MTLPixelFormatRG8Unorm;
86 case PixelFormat::kB8G8R8A8UNormInt:
87 return MTLPixelFormatBGRA8Unorm;
88 case PixelFormat::kB8G8R8A8UNormIntSRGB:
89 return MTLPixelFormatBGRA8Unorm_sRGB;
90 case PixelFormat::kR8G8B8A8UNormInt:
91 return MTLPixelFormatRGBA8Unorm;
92 case PixelFormat::kR8G8B8A8UNormIntSRGB:
93 return MTLPixelFormatRGBA8Unorm_sRGB;
94 case PixelFormat::kR32G32B32A32Float:
95 return MTLPixelFormatRGBA32Float;
96 case PixelFormat::kR16G16B16A16Float:
97 return MTLPixelFormatRGBA16Float;
98 case PixelFormat::kS8UInt:
99 return MTLPixelFormatStencil8;
100 case PixelFormat::kD24UnormS8Uint:
101 return SafeMTLPixelFormatDepth24Unorm_Stencil8();
102 case PixelFormat::kD32FloatS8UInt:
103 return MTLPixelFormatDepth32Float_Stencil8;
104 case PixelFormat::kB10G10R10XRSRGB:
105 return SafeMTLPixelFormatBGR10_XR_sRGB();
106 case PixelFormat::kB10G10R10XR:
107 return SafeMTLPixelFormatBGR10_XR();
108 case PixelFormat::kB10G10R10A10XR:
109 return SafeMTLPixelFormatBGRA10_XR();
110 }
111 return MTLPixelFormatInvalid;
112 };

References kA8UNormInt, kB10G10R10A10XR, kB10G10R10XR, kB10G10R10XRSRGB, kB8G8R8A8UNormInt, kB8G8R8A8UNormIntSRGB, kD24UnormS8Uint, kD32FloatS8UInt, kR16G16B16A16Float, kR32G32B32A32Float, kR8G8B8A8UNormInt, kR8G8B8A8UNormIntSRGB, kR8G8UNormInt, kR8UNormInt, kS8UInt, kUnknown, SafeMTLPixelFormatBGR10_XR(), SafeMTLPixelFormatBGR10_XR_sRGB(), SafeMTLPixelFormatBGRA10_XR(), and SafeMTLPixelFormatDepth24Unorm_Stencil8().

Referenced by GetMTLRenderPipelineDescriptor(), impeller::PlaygroundImplMTL::PlaygroundImplMTL(), impeller::testing::TEST(), ToMTLRenderPipelineColorAttachmentDescriptor(), and ToMTLTextureDescriptor().

## ◆ ToMTLPrimitiveType()

constexpr MTLPrimitiveType impeller::ToMTLPrimitiveType | ( | PrimitiveType | type | ) |
| constexpr

Definition at line 150 of file formats_mtl.h.

150 {
151 switch (type) {
152 case PrimitiveType::kTriangle:
153 return MTLPrimitiveTypeTriangle;
154 case PrimitiveType::kTriangleStrip:
155 return MTLPrimitiveTypeTriangleStrip;
156 case PrimitiveType::kLine:
157 return MTLPrimitiveTypeLine;
158 case PrimitiveType::kLineStrip:
159 return MTLPrimitiveTypeLineStrip;
160 case PrimitiveType::kPoint:
161 return MTLPrimitiveTypePoint;
162 case PrimitiveType::kTriangleFan:
163 // Callers are expected to perform a capability check for triangle fan
164 // support.
165 return MTLPrimitiveTypePoint;
166 }
167 return MTLPrimitiveTypePoint;
168 }

References kLine, kLineStrip, kPoint, kTriangle, kTriangleFan, kTriangleStrip, and type.

## ◆ ToMTLRenderPassDescriptor()

static MTLRenderPassDescriptor* impeller::ToMTLRenderPassDescriptor | ( | const RenderTarget & | desc | ) |
| static

Definition at line 103 of file render_pass_mtl.mm.

104 {
105 auto result = [MTLRenderPassDescriptor renderPassDescriptor];
106
107 bool configured_attachment = desc.IterateAllColorAttachments(
108 [&result](size_t index, const ColorAttachment& attachment) -> bool {
109 return ConfigureColorAttachment(attachment,
110 result.colorAttachments[index]);
111 });
112
113 if (!configured_attachment) {
114 VALIDATION_LOG << "Could not configure color attachments";
115 return nil;
116 }
117
118 const auto& depth = desc.GetDepthAttachment();
119
120 if (depth.has_value() &&
121 !ConfigureDepthAttachment(depth.value(), result.depthAttachment)) {
122 VALIDATION_LOG << "Could not configure depth attachment.";
123 return nil;
124 }
125
126 const auto& stencil = desc.GetStencilAttachment();
127
128 if (stencil.has_value() &&
129 !ConfigureStencilAttachment(stencil.value(), result.stencilAttachment)) {
130 VALIDATION_LOG << "Could not configure stencil attachment.";
131 return nil;
132 }
133
134 return result;
135 }

References ConfigureColorAttachment(), ConfigureDepthAttachment(), ConfigureStencilAttachment(), impeller::RenderTarget::GetDepthAttachment(), impeller::RenderTarget::GetStencilAttachment(), impeller::RenderTarget::IterateAllColorAttachments(), and VALIDATION_LOG.

## ◆ ToMTLRenderPipelineColorAttachmentDescriptor()

MTLRenderPipelineColorAttachmentDescriptor * impeller::ToMTLRenderPipelineColorAttachmentDescriptor | ( | ColorAttachmentDescriptor | descriptor | ) |

Definition at line 15 of file formats_mtl.mm.

16 {
17 auto des = [[MTLRenderPipelineColorAttachmentDescriptor alloc] init];
18 des.pixelFormat = ToMTLPixelFormat(descriptor.format);
19
20 des.blendingEnabled = descriptor.blending_enabled;
21
22 des.sourceRGBBlendFactor =
23 ToMTLBlendFactor(descriptor.src_color_blend_factor);
24 des.rgbBlendOperation = ToMTLBlendOperation(descriptor.color_blend_op);
25 des.destinationRGBBlendFactor =
26 ToMTLBlendFactor(descriptor.dst_color_blend_factor);
27
28 des.sourceAlphaBlendFactor =
29 ToMTLBlendFactor(descriptor.src_alpha_blend_factor);
30 des.alphaBlendOperation = ToMTLBlendOperation(descriptor.alpha_blend_op);
31 des.destinationAlphaBlendFactor =
32 ToMTLBlendFactor(descriptor.dst_alpha_blend_factor);
33
34 des.writeMask = ToMTLColorWriteMask(descriptor.write_mask);
35 return des;
36 }

References impeller::ColorAttachmentDescriptor::alpha_blend_op, impeller::ColorAttachmentDescriptor::blending_enabled, impeller::ColorAttachmentDescriptor::color_blend_op, impeller::ColorAttachmentDescriptor::dst_alpha_blend_factor, impeller::ColorAttachmentDescriptor::dst_color_blend_factor, impeller::ColorAttachmentDescriptor::format, impeller::ColorAttachmentDescriptor::src_alpha_blend_factor, impeller::ColorAttachmentDescriptor::src_color_blend_factor, ToMTLBlendFactor(), ToMTLBlendOperation(), ToMTLColorWriteMask(), ToMTLPixelFormat(), and impeller::ColorAttachmentDescriptor::write_mask.

Referenced by GetMTLRenderPipelineDescriptor().

## ◆ ToMTLResourceOptions()

static MTLResourceOptions impeller::ToMTLResourceOptions | ( | StorageMode | type,
|  | bool | supports_memoryless_targets,
|  | bool | supports_uma
| ) |  |
| static

Definition at line 125 of file allocator_mtl.mm.

127 {
128 switch (type) {
129 case StorageMode::kHostVisible:
130 #if FML_OS_IOS
131 return MTLResourceStorageModeShared;
132 #else
133 if (supports_uma) {
134 return MTLResourceStorageModeShared;
135 } else {
136 return MTLResourceStorageModeManaged;
137 }
138 #endif
139 case StorageMode::kDevicePrivate:
140 return MTLResourceStorageModePrivate;
141 case StorageMode::kDeviceTransient:
142 if (supports_memoryless_targets) {
143 // Device may support but the OS has not been updated.
144 if (@available(macOS 11.0, *)) {
145 return MTLResourceStorageModeMemoryless;
146 } else {
147 return MTLResourceStorageModePrivate;
148 }
149 } else {
150 return MTLResourceStorageModePrivate;
151 }
152 FML_UNREACHABLE();
153 }
154 FML_UNREACHABLE();
155 }

References kDevicePrivate, kDeviceTransient, kHostVisible, and type.

## ◆ ToMTLSamplerAddressMode()

constexpr MTLSamplerAddressMode impeller::ToMTLSamplerAddressMode | ( | SamplerAddressMode | mode | ) |
| constexpr

Definition at line 359 of file formats_mtl.h.

360 {
361 switch (mode) {
362 case SamplerAddressMode::kClampToEdge:
363 return MTLSamplerAddressModeClampToEdge;
364 case SamplerAddressMode::kRepeat:
365 return MTLSamplerAddressModeRepeat;
366 case SamplerAddressMode::kMirror:
367 return MTLSamplerAddressModeMirrorRepeat;
368 case SamplerAddressMode::kDecal:
369 return MTLSamplerAddressModeClampToZero;
370 }
371 return MTLSamplerAddressModeClampToEdge;
372 }

References kClampToEdge, kDecal, kMirror, and kRepeat.

## ◆ ToMTLSamplerMinMagFilter()

constexpr MTLSamplerMinMagFilter impeller::ToMTLSamplerMinMagFilter | ( | MinMagFilter | filter | ) |
| constexpr

Definition at line 337 of file formats_mtl.h.

337 {
338 switch (filter) {
339 case MinMagFilter::kNearest:
340 return MTLSamplerMinMagFilterNearest;
341 case MinMagFilter::kLinear:
342 return MTLSamplerMinMagFilterLinear;
343 }
344 return MTLSamplerMinMagFilterNearest;
345 }

References kLinear, and kNearest.

## ◆ ToMTLSamplerMipFilter()

constexpr MTLSamplerMipFilter impeller::ToMTLSamplerMipFilter | ( | MipFilter | filter | ) |
| constexpr

Definition at line 347 of file formats_mtl.h.

347 {
348 switch (filter) {
349 case MipFilter::kBase:
350 return MTLSamplerMipFilterNotMipmapped;
351 case MipFilter::kNearest:
352 return MTLSamplerMipFilterNearest;
353 case MipFilter::kLinear:
354 return MTLSamplerMipFilterLinear;
355 }
356 return MTLSamplerMipFilterNotMipmapped;
357 }

References kBase, kLinear, and kNearest.

## ◆ ToMTLStencilDescriptor()

MTLStencilDescriptor* impeller::ToMTLStencilDescriptor | ( | const StencilAttachmentDescriptor & | descriptor | ) |

Definition at line 38 of file formats_mtl.mm.

39 {
40 auto des = [[MTLStencilDescriptor alloc] init];
41 des.stencilCompareFunction = ToMTLCompareFunction(descriptor.stencil_compare);
42 des.stencilFailureOperation =
43 ToMTLStencilOperation(descriptor.stencil_failure);
44 des.depthFailureOperation = ToMTLStencilOperation(descriptor.depth_failure);
45 des.depthStencilPassOperation =
46 ToMTLStencilOperation(descriptor.depth_stencil_pass);
47
48 des.readMask = descriptor.read_mask;
49 des.writeMask = descriptor.write_mask;
50
51 return des;
52 }

References impeller::StencilAttachmentDescriptor::depth_failure, impeller::StencilAttachmentDescriptor::depth_stencil_pass, impeller::StencilAttachmentDescriptor::read_mask, impeller::StencilAttachmentDescriptor::stencil_compare, impeller::StencilAttachmentDescriptor::stencil_failure, ToMTLCompareFunction(), ToMTLStencilOperation(), and impeller::StencilAttachmentDescriptor::write_mask.

Referenced by ToMTLDepthStencilDescriptor().

## ◆ ToMTLStencilOperation()

constexpr MTLStencilOperation impeller::ToMTLStencilOperation | ( | StencilOperation | op | ) |
| constexpr

Definition at line 257 of file formats_mtl.h.

257 {
258 switch (op) {
259 case StencilOperation::kKeep:
260 return MTLStencilOperationKeep;
261 case StencilOperation::kZero:
262 return MTLStencilOperationZero;
263 case StencilOperation::kSetToReferenceValue:
264 return MTLStencilOperationReplace;
265 case StencilOperation::kIncrementClamp:
266 return MTLStencilOperationIncrementClamp;
267 case StencilOperation::kDecrementClamp:
268 return MTLStencilOperationDecrementClamp;
269 case StencilOperation::kInvert:
270 return MTLStencilOperationInvert;
271 case StencilOperation::kIncrementWrap:
272 return MTLStencilOperationIncrementWrap;
273 case StencilOperation::kDecrementWrap:
274 return MTLStencilOperationDecrementWrap;
275 }
276 return MTLStencilOperationKeep;
277 };

References kDecrementClamp, kDecrementWrap, kIncrementClamp, kIncrementWrap, kInvert, kKeep, kSetToReferenceValue, and kZero.

Referenced by ToMTLStencilDescriptor().

## ◆ ToMTLStorageMode()

static MTLStorageMode impeller::ToMTLStorageMode | ( | StorageMode | mode,
|  | bool | supports_memoryless_targets,
|  | bool | supports_uma
| ) |  |
| static

Definition at line 157 of file allocator_mtl.mm.

159 {
160 switch (mode) {
161 case StorageMode::kHostVisible:
162 #if FML_OS_IOS
163 return MTLStorageModeShared;
164 #else
165 if (supports_uma) {
166 return MTLStorageModeShared;
167 } else {
168 return MTLStorageModeManaged;
169 }
170 #endif
171 case StorageMode::kDevicePrivate:
172 return MTLStorageModePrivate;
173 case StorageMode::kDeviceTransient:
174 if (supports_memoryless_targets) {
175 // Device may support but the OS has not been updated.
176 if (@available(macOS 11.0, *)) {
177 return MTLStorageModeMemoryless;
178 } else {
179 return MTLStorageModePrivate;
180 }
181 } else {
182 return MTLStorageModePrivate;
183 }
184 FML_UNREACHABLE();
185 }
186 FML_UNREACHABLE();
187 }

References kDevicePrivate, kDeviceTransient, and kHostVisible.

## ◆ ToMTLStoreAction()

constexpr MTLStoreAction impeller::ToMTLStoreAction | ( | StoreAction | action | ) |
| constexpr

Definition at line 307 of file formats_mtl.h.

307 {
308 switch (action) {
309 case StoreAction::kDontCare:
310 return MTLStoreActionDontCare;
311 case StoreAction::kStore:
312 return MTLStoreActionStore;
313 case StoreAction::kMultisampleResolve:
314 return MTLStoreActionMultisampleResolve;
315 case StoreAction::kStoreAndMultisampleResolve:
316 return MTLStoreActionStoreAndMultisampleResolve;
317 }
318 return MTLStoreActionDontCare;
319 }

References kDontCare, kMultisampleResolve, kStore, and kStoreAndMultisampleResolve.

Referenced by ConfigureAttachment().

## ◆ ToMTLTextureDescriptor()

MTLTextureDescriptor * impeller::ToMTLTextureDescriptor | ( | const TextureDescriptor & | desc | ) |

Definition at line 86 of file formats_mtl.mm.

86 {
87 if (!desc.IsValid()) {
88 return nil;
89 }
90 auto mtl_desc = [[MTLTextureDescriptor alloc] init];
91 mtl_desc.textureType = ToMTLTextureType(desc.type);
92 mtl_desc.pixelFormat = ToMTLPixelFormat(desc.format);
93 mtl_desc.sampleCount = static_cast<NSUInteger>(desc.sample_count);
94 mtl_desc.width = desc.size.width;
95 mtl_desc.height = desc.size.height;
96 mtl_desc.mipmapLevelCount = desc.mip_count;
97 mtl_desc.usage = MTLTextureUsageUnknown;
98 if (desc.usage & TextureUsage::kUnknown) {
99 mtl_desc.usage |= MTLTextureUsageUnknown;
100 }
101 if (desc.usage & TextureUsage::kShaderRead) {
102 mtl_desc.usage |= MTLTextureUsageShaderRead;
103 }
104 if (desc.usage & TextureUsage::kShaderWrite) {
105 mtl_desc.usage |= MTLTextureUsageShaderWrite;
106 }
107 if (desc.usage & TextureUsage::kRenderTarget) {
108 mtl_desc.usage |= MTLTextureUsageRenderTarget;
109 }
110 return mtl_desc;
111 }

References impeller::TextureDescriptor::format, impeller::TSize< T >::height, impeller::TextureDescriptor::IsValid(), kRenderTarget, kShaderRead, kShaderWrite, kUnknown, impeller::TextureDescriptor::mip_count, impeller::TextureDescriptor::sample_count, impeller::TextureDescriptor::size, ToMTLPixelFormat(), ToMTLTextureType(), impeller::TextureDescriptor::type, impeller::TextureDescriptor::usage, and impeller::TSize< T >::width.

## ◆ ToMTLTextureType()

constexpr MTLTextureType impeller::ToMTLTextureType | ( | TextureType | type | ) |
| constexpr

Definition at line 378 of file formats_mtl.h.

378 {
379 switch (type) {
380 case TextureType::kTexture2D:
381 return MTLTextureType2D;
382 case TextureType::kTexture2DMultisample:
383 return MTLTextureType2DMultisample;
384 case TextureType::kTextureCube:
385 return MTLTextureTypeCube;
386 case TextureType::kTextureExternalOES:
387 VALIDATION_LOG
388 << "kTextureExternalOES can not be used with the Metal backend.";
389 }
390 return MTLTextureType2D;
391 }

References kTexture2D, kTexture2DMultisample, kTextureCube, kTextureExternalOES, type, and VALIDATION_LOG.

Referenced by ToMTLTextureDescriptor().

## ◆ ToMTLTriangleFillMode()

constexpr MTLTriangleFillMode impeller::ToMTLTriangleFillMode | ( | PolygonMode | mode | ) |
| constexpr

Definition at line 170 of file formats_mtl.h.

170 {
171 switch (mode) {
172 case PolygonMode::kFill:
173 return MTLTriangleFillModeFill;
174 case PolygonMode::kLine:
175 return MTLTriangleFillModeLines;
176 }
177 return MTLTriangleFillModeFill;
178 }

References kFill, and kLine.

## ◆ ToParam() [1/2]

static GLint impeller::ToParam | ( | MinMagFilter | minmag_filter | ) |
| static

Definition at line 20 of file sampler_gles.cc.

20 {
21 switch (minmag_filter) {
22 case MinMagFilter::kNearest:
23 return GL_NEAREST;
24 case MinMagFilter::kLinear:
25 return GL_LINEAR;
26 }
27 FML_UNREACHABLE();
28 }

References kLinear, and kNearest.

Referenced by impeller::SamplerGLES::ConfigureBoundTexture(), and ToParam().

## ◆ ToParam() [2/2]

static GLint impeller::ToParam | ( | MinMagFilter | minmag_filter,
|  | MipFilter | mip_filter
| ) |  |
| static

Definition at line 30 of file sampler_gles.cc.

30 {
31 switch (mip_filter) {
32 case MipFilter::kBase:
33 return ToParam(minmag_filter);
34 case MipFilter::kNearest:
35 switch (minmag_filter) {
36 case MinMagFilter::kNearest:
37 return GL_NEAREST_MIPMAP_NEAREST;
38 case MinMagFilter::kLinear:
39 return GL_LINEAR_MIPMAP_NEAREST;
40 }
41 case MipFilter::kLinear:
42 switch (minmag_filter) {
43 case MinMagFilter::kNearest:
44 return GL_NEAREST_MIPMAP_LINEAR;
45 case MinMagFilter::kLinear:
46 return GL_LINEAR_MIPMAP_LINEAR;
47 }
48 }
49 FML_UNREACHABLE();
50 }

References kBase, kLinear, kNearest, and ToParam().

## ◆ ToPixelFormat() [1/3]

static PixelFormat impeller::ToPixelFormat | ( | AHardwareBuffer_Format | format | ) |
| static

Definition at line 225 of file ahb_texture_source_vk.cc.

225 {
226 switch (format) {
227 case AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM:
228 return PixelFormat::kR8G8B8A8UNormInt;
229 case AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT:
230 return PixelFormat::kR16G16B16A16Float;
231 case AHARDWAREBUFFER_FORMAT_D24_UNORM_S8_UINT:
232 return PixelFormat::kD24UnormS8Uint;
233 case AHARDWAREBUFFER_FORMAT_D32_FLOAT_S8_UINT:
234 return PixelFormat::kD32FloatS8UInt;
235 case AHARDWAREBUFFER_FORMAT_S8_UINT:
236 return PixelFormat::kS8UInt;
237 case AHARDWAREBUFFER_FORMAT_R8_UNORM:
238 return PixelFormat::kR8UNormInt;
239 case AHARDWAREBUFFER_FORMAT_R10G10B10A10_UNORM:
240 case AHARDWAREBUFFER_FORMAT_R16G16_UINT:
241 case AHARDWAREBUFFER_FORMAT_D32_FLOAT:
242 case AHARDWAREBUFFER_FORMAT_R16_UINT:
243 case AHARDWAREBUFFER_FORMAT_D24_UNORM:
244 case AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420:
245 case AHARDWAREBUFFER_FORMAT_YCbCr_P010:
246 case AHARDWAREBUFFER_FORMAT_BLOB:
247 case AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM:
248 case AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM:
249 case AHARDWAREBUFFER_FORMAT_R8G8B8_UNORM:
250 case AHARDWAREBUFFER_FORMAT_D16_UNORM:
251 case AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM:
252 // Not understood by the rest of Impeller. Use a placeholder but create
253 // the native image and image views using the right external format.
254 break;
255 }
256 return PixelFormat::kR8G8B8A8UNormInt;
257 }

References kD24UnormS8Uint, kD32FloatS8UInt, kR16G16B16A16Float, kR8G8B8A8UNormInt, kR8UNormInt, and kS8UInt.

Referenced by impeller::AHBSwapchainVK::GetSurfaceFormat(), ToSwapchainTextureDescriptor(), and ToTextureDescriptor().

## ◆ ToPixelFormat() [2/3]

constexpr PixelFormat impeller::ToPixelFormat | ( | android::HardwareBufferFormat | format | ) |
| constexpr

Definition at line 13 of file ahb_formats.h.

13 {
14 switch (format) {
15 case android::HardwareBufferFormat::kR8G8B8A8UNormInt:
16 return PixelFormat::kR8G8B8A8UNormInt;
17 }
18 FML_UNREACHABLE();
19 }

References impeller::android::kR8G8B8A8UNormInt, and kR8G8B8A8UNormInt.

## ◆ ToPixelFormat() [3/3]

constexpr PixelFormat impeller::ToPixelFormat | ( | vk::Format | format | ) |
| constexpr

Definition at line 183 of file formats_vk.h.

183 {
184 switch (format) {
185 case vk::Format::eUndefined:
186 return PixelFormat::kUnknown;
187 case vk::Format::eR8G8B8A8Unorm:
188 return PixelFormat::kR8G8B8A8UNormInt;
189 case vk::Format::eR8G8B8A8Srgb:
190 return PixelFormat::kR8G8B8A8UNormIntSRGB;
191 case vk::Format::eB8G8R8A8Unorm:
192 return PixelFormat::kB8G8R8A8UNormInt;
193 case vk::Format::eB8G8R8A8Srgb:
194 return PixelFormat::kB8G8R8A8UNormIntSRGB;
195 case vk::Format::eR32G32B32A32Sfloat:
196 return PixelFormat::kR32G32B32A32Float;
197 case vk::Format::eR16G16B16A16Sfloat:
198 return PixelFormat::kR16G16B16A16Float;
199 case vk::Format::eS8Uint:
200 return PixelFormat::kS8UInt;
201 case vk::Format::eD24UnormS8Uint:
202 return PixelFormat::kD24UnormS8Uint;
203 case vk::Format::eD32SfloatS8Uint:
204 return PixelFormat::kD32FloatS8UInt;
205 case vk::Format::eR8Unorm:
206 return PixelFormat::kR8UNormInt;
207 case vk::Format::eR8G8Unorm:
208 return PixelFormat::kR8G8UNormInt;
209 default:
210 return PixelFormat::kUnknown;
211 }
212 }

References kB8G8R8A8UNormInt, kB8G8R8A8UNormIntSRGB, kD24UnormS8Uint, kD32FloatS8UInt, kR16G16B16A16Float, kR32G32B32A32Float, kR8G8B8A8UNormInt, kR8G8B8A8UNormIntSRGB, kR8G8UNormInt, kR8UNormInt, kS8UInt, and kUnknown.

## ◆ ToRect()

static Rect impeller::ToRect | ( | const SkRect & | rect | ) |
| static

Definition at line 38 of file text_frame_skia.cc.

38 {
39 return Rect::MakeLTRB(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
40 }

References impeller::TRect< Scalar >::MakeLTRB().

Referenced by MakeTextFrameFromTextBlobSkia().

## ◆ ToRenderBufferFormat()

static std::optional<GLenum> impeller::ToRenderBufferFormat | ( | PixelFormat | format | ) |
| static

Definition at line 366 of file texture_gles.cc.

366 {
367 switch (format) {
368 case PixelFormat::kB8G8R8A8UNormInt:
369 case PixelFormat::kR8G8B8A8UNormInt:
370 return GL_RGBA4;
371 case PixelFormat::kR32G32B32A32Float:
372 return GL_RGBA32F;
373 case PixelFormat::kR16G16B16A16Float:
374 return GL_RGBA16F;
375 case PixelFormat::kS8UInt:
376 return GL_STENCIL_INDEX8;
377 case PixelFormat::kD24UnormS8Uint:
378 return GL_DEPTH24_STENCIL8;
379 case PixelFormat::kD32FloatS8UInt:
380 return GL_DEPTH32F_STENCIL8;
381 case PixelFormat::kUnknown:
382 case PixelFormat::kA8UNormInt:
383 case PixelFormat::kR8UNormInt:
384 case PixelFormat::kR8G8UNormInt:
385 case PixelFormat::kR8G8B8A8UNormIntSRGB:
386 case PixelFormat::kB8G8R8A8UNormIntSRGB:
387 case PixelFormat::kB10G10R10XRSRGB:
388 case PixelFormat::kB10G10R10XR:
389 case PixelFormat::kB10G10R10A10XR:
390 return std::nullopt;
391 }
392 FML_UNREACHABLE();
393 }

References kA8UNormInt, kB10G10R10A10XR, kB10G10R10XR, kB10G10R10XRSRGB, kB8G8R8A8UNormInt, kB8G8R8A8UNormIntSRGB, kD24UnormS8Uint, kD32FloatS8UInt, kR16G16B16A16Float, kR32G32B32A32Float, kR8G8B8A8UNormInt, kR8G8B8A8UNormIntSRGB, kR8G8UNormInt, kR8UNormInt, kS8UInt, and kUnknown.

## ◆ ToRGB()

static constexpr Vector3 impeller::ToRGB | ( | Color | color | ) |
| inline static constexpr

Definition at line 111 of file color.cc.

111 {
112 return {color.red, color.green, color.blue};
113 }

References impeller::Color::blue, impeller::Color::green, and impeller::Color::red.

Referenced by DoColorBlend().

## ◆ ToSamplerDescriptor()

static impeller::SamplerDescriptor impeller::ToSamplerDescriptor | ( | const flutter::DlFilterMode | options | ) |
| static

Definition at line 121 of file dl_dispatcher.cc.

122 {
123 impeller::SamplerDescriptor desc;
124 switch (options) {
125 case flutter::DlFilterMode::kNearest:
126 desc.min_filter = desc.mag_filter = impeller::MinMagFilter::kNearest;
127 desc.label = "Nearest Sampler";
128 break;
129 case flutter::DlFilterMode::kLinear:
130 desc.min_filter = desc.mag_filter = impeller::MinMagFilter::kLinear;
131 desc.label = "Linear Sampler";
132 break;
133 default:
134 break;
135 }
136 return desc;
137 }

References kLinear, kNearest, impeller::SamplerDescriptor::label, impeller::SamplerDescriptor::mag_filter, and impeller::SamplerDescriptor::min_filter.

Referenced by impeller::DlDispatcherBase::drawImageNine().

## ◆ ToShaderStage() [1/4]

static ShaderStage impeller::ToShaderStage | ( | ArchiveShaderType | type | ) |
| static

Definition at line 17 of file shader_library_gles.cc.

17 {
18 switch (type) {
19 case ArchiveShaderType::kVertex:
20 return ShaderStage::kVertex;
21 case ArchiveShaderType::kFragment:
22 return ShaderStage::kFragment;
23 case ArchiveShaderType::kCompute:
24 return ShaderStage::kCompute;
25 }
26 FML_UNREACHABLE();
27 }

References kCompute, kFragment, kVertex, and type.

## ◆ ToShaderStage() [2/4]

static ShaderStage impeller::ToShaderStage | ( | ArchiveShaderType | type | ) |
| static

Definition at line 17 of file shader_library_vk.cc.

17 {
18 switch (type) {
19 case ArchiveShaderType::kVertex:
20 return ShaderStage::kVertex;
21 case ArchiveShaderType::kFragment:
22 return ShaderStage::kFragment;
23 case ArchiveShaderType::kCompute:
24 return ShaderStage::kCompute;
25 }
26 FML_UNREACHABLE();
27 }

References kCompute, kFragment, kVertex, and type.

## ◆ ToShaderStage() [3/4]

static RuntimeShaderStage impeller::ToShaderStage | ( | fb::Stage | stage | ) |
| static

Definition at line 31 of file runtime_stage.cc.

31 {
32 switch (stage) {
33 case fb::Stage::kVertex:
34 return RuntimeShaderStage::kVertex;
35 case fb::Stage::kFragment:
36 return RuntimeShaderStage::kFragment;
37 case fb::Stage::kCompute:
38 return RuntimeShaderStage::kCompute;
39 }
40 FML_UNREACHABLE();
41 }

References kCompute, kFragment, and kVertex.

## ◆ ToShaderStage() [4/4]

constexpr ShaderStage impeller::ToShaderStage | ( | RuntimeShaderStage | stage | ) |
| constexpr

Definition at line 29 of file shader_types.h.

29 {
30 switch (stage) {
31 case RuntimeShaderStage::kVertex:
32 return ShaderStage::kVertex;
33 case RuntimeShaderStage::kFragment:
34 return ShaderStage::kFragment;
35 case RuntimeShaderStage::kCompute:
36 return ShaderStage::kCompute;
37 }
38 FML_UNREACHABLE();
39 }

References kCompute, kFragment, and kVertex.

Referenced by impeller::RuntimeStagePlayground::RegisterStage(), impeller::RuntimeStage::RuntimeStage(), and impeller::testing::TEST_P().

## ◆ ToShaderType()

constexpr ArchiveShaderType impeller::ToShaderType | ( | fb::Stage | stage | ) |
| constexpr

Definition at line 16 of file shader_archive.cc.

16 {
17 switch (stage) {
18 case fb::Stage::kVertex:
19 return ArchiveShaderType::kVertex;
20 case fb::Stage::kFragment:
21 return ArchiveShaderType::kFragment;
22 case fb::Stage::kCompute:
23 return ArchiveShaderType::kCompute;
24 }
25 FML_UNREACHABLE();
26 }

References kCompute, kFragment, and kVertex.

Referenced by impeller::ShaderArchive::ShaderArchive().

## ◆ ToStage()

constexpr fb::Stage impeller::ToStage | ( | ArchiveShaderType | type | ) |
| constexpr

Definition at line 86 of file shader_archive_writer.cc.

86 {
87 switch (type) {
88 case ArchiveShaderType::kVertex:
89 return fb::Stage::kVertex;
90 case ArchiveShaderType::kFragment:
91 return fb::Stage::kFragment;
92 case ArchiveShaderType::kCompute:
93 return fb::Stage::kCompute;
94 }
95 FML_UNREACHABLE();
96 }

References kCompute, kFragment, kVertex, and type.

Referenced by impeller::ShaderArchiveWriter::CreateMapping().

## ◆ ToStencilOp()

constexpr GLenum impeller::ToStencilOp | ( | StencilOperation | op | ) |
| constexpr

Definition at line 48 of file formats_gles.h.

48 {
49 switch (op) {
50 case StencilOperation::kKeep:
51 return GL_KEEP;
52 case StencilOperation::kZero:
53 return GL_ZERO;
54 case StencilOperation::kSetToReferenceValue:
55 return GL_REPLACE;
56 case StencilOperation::kIncrementClamp:
57 return GL_INCR;
58 case StencilOperation::kDecrementClamp:
59 return GL_DECR;
60 case StencilOperation::kInvert:
61 return GL_INVERT;
62 case StencilOperation::kIncrementWrap:
63 return GL_INCR_WRAP;
64 case StencilOperation::kDecrementWrap:
65 return GL_DECR_WRAP;
66 }
67 FML_UNREACHABLE();
68 }

References kDecrementClamp, kDecrementWrap, kIncrementClamp, kIncrementWrap, kInvert, kKeep, kSetToReferenceValue, and kZero.

Referenced by ConfigureStencil().

## ◆ ToStyle()

static Paint::Style impeller::ToStyle | ( | flutter::DlDrawStyle | style | ) |
| static

Definition at line 146 of file dl_dispatcher.cc.

146 {
147 switch (style) {
148 case flutter::DlDrawStyle::kFill:
149 return Paint::Style::kFill;
150 case flutter::DlDrawStyle::kStroke:
151 return Paint::Style::kStroke;
152 case flutter::DlDrawStyle::kStrokeAndFill:
153 UNIMPLEMENTED;
154 break;
155 }
156 return Paint::Style::kFill;
157 }

References impeller::Paint::kFill, impeller::Paint::kStroke, and UNIMPLEMENTED.

Referenced by impeller::DlDispatcherBase::setDrawStyle(), and impeller::FirstPassDispatcher::setDrawStyle().

## ◆ ToSwapchainTextureDescriptor()

static TextureDescriptor impeller::ToSwapchainTextureDescriptor | ( | const android::HardwareBufferDescriptor & | ahb_desc | ) |
| static

Definition at line 25 of file ahb_swapchain_impl_vk.cc.

26 {
27 TextureDescriptor desc;
28 desc.storage_mode = StorageMode::kDevicePrivate;
29 desc.type = TextureType::kTexture2D;
30 desc.format = ToPixelFormat(ahb_desc.format);
31 desc.size = ahb_desc.size;
32 desc.mip_count = 1u;
33 desc.usage = TextureUsage::kRenderTarget;
34 desc.sample_count = SampleCount::kCount1;
35 desc.compression_type = CompressionType::kLossless;
36 return desc;
37 }

References impeller::TextureDescriptor::compression_type, impeller::TextureDescriptor::format, impeller::android::HardwareBufferDescriptor::format, kCount1, kDevicePrivate, kLossless, kRenderTarget, kTexture2D, impeller::TextureDescriptor::mip_count, impeller::TextureDescriptor::sample_count, impeller::TextureDescriptor::size, impeller::android::HardwareBufferDescriptor::size, impeller::TextureDescriptor::storage_mode, ToPixelFormat(), impeller::TextureDescriptor::type, and impeller::TextureDescriptor::usage.

## ◆ ToTarget()

static GLenum impeller::ToTarget | ( | DeviceBufferGLES::BindingType | type | ) |
| static

Definition at line 78 of file device_buffer_gles.cc.

78 {
79 switch (type) {
80 case DeviceBufferGLES::BindingType::kArrayBuffer:
81 return GL_ARRAY_BUFFER;
82 case DeviceBufferGLES::BindingType::kElementArrayBuffer:
83 return GL_ELEMENT_ARRAY_BUFFER;
84 case DeviceBufferGLES::BindingType::kUniformBuffer:
85 return GL_UNIFORM_BUFFER;
86 }
87 FML_UNREACHABLE();
88 }

References impeller::DeviceBufferGLES::kArrayBuffer, impeller::DeviceBufferGLES::kElementArrayBuffer, impeller::DeviceBufferGLES::kUniformBuffer, and type.

Referenced by impeller::DeviceBufferGLES::BindAndUploadDataIfNecessary().

## ◆ ToTessWindingRule()

static int impeller::ToTessWindingRule | ( | FillType | fill_type | ) |
| static

Definition at line 46 of file tessellator_libtess.cc.

46 {
47 switch (fill_type) {
48 case FillType::kOdd:
49 return TESS_WINDING_ODD;
50 case FillType::kNonZero:
51 return TESS_WINDING_NONZERO;
52 }
53 return TESS_WINDING_ODD;
54 }

References kNonZero, and kOdd.

Referenced by impeller::TessellatorLibtess::Tessellate().

## ◆ ToTextureDescriptor()

static TextureDescriptor impeller::ToTextureDescriptor | ( | const AHardwareBuffer_Desc & | ahb_desc | ) |
| static

Definition at line 272 of file ahb_texture_source_vk.cc.

273 {
274 const auto ahb_size = ISize{ahb_desc.width, ahb_desc.height};
275 TextureDescriptor desc;
276 // We are not going to touch hardware buffers on the CPU or use them as
277 // transient attachments. Just treat them as device private.
278 desc.storage_mode = StorageMode::kDevicePrivate;
279 desc.format =
280 ToPixelFormat(static_cast<AHardwareBuffer_Format>(ahb_desc.format));
281 desc.size = ahb_size;
282 desc.type = ToTextureType(ahb_desc);
283 desc.sample_count = SampleCount::kCount1;
284 desc.compression_type = CompressionType::kLossless;
285 desc.mip_count = (ahb_desc.usage & AHARDWAREBUFFER_USAGE_GPU_MIPMAP_COMPLETE)
286 ? ahb_size.MipCount()
287 : 1u;
288 if (ahb_desc.usage & AHARDWAREBUFFER_USAGE_COMPOSER_OVERLAY) {
289 desc.usage = TextureUsage::kRenderTarget;
290 }
291 return desc;
292 }

References impeller::TextureDescriptor::compression_type, impeller::TextureDescriptor::format, kCount1, kDevicePrivate, kLossless, kRenderTarget, impeller::TextureDescriptor::mip_count, impeller::TextureDescriptor::sample_count, impeller::TextureDescriptor::size, impeller::TextureDescriptor::storage_mode, ToPixelFormat(), ToTextureType(), impeller::TextureDescriptor::type, impeller::TextureDescriptor::usage, and impeller::TSize< T >::width.

## ◆ ToTextureTarget()

constexpr std::optional<GLenum> impeller::ToTextureTarget | ( | TextureType | type | ) |
| constexpr

Definition at line 185 of file formats_gles.h.

185 {
186 switch (type) {
187 case TextureType::kTexture2D:
188 return GL_TEXTURE_2D;
189 case TextureType::kTexture2DMultisample:
190 return GL_TEXTURE_2D;
191 case TextureType::kTextureCube:
192 return GL_TEXTURE_CUBE_MAP;
193 case TextureType::kTextureExternalOES:
194 return GL_TEXTURE_EXTERNAL_OES;
195 }
196 FML_UNREACHABLE();
197 }

References kTexture2D, kTexture2DMultisample, kTextureCube, kTextureExternalOES, and type.

Referenced by impeller::TextureGLES::Bind(), and impeller::SamplerGLES::ConfigureBoundTexture().

## ◆ ToTextureType() [1/2]

static TextureType impeller::ToTextureType | ( | const AHardwareBuffer_Desc & | ahb_desc | ) |
| static

Definition at line 259 of file ahb_texture_source_vk.cc.

259 {
260 if (ahb_desc.layers == 1u) {
261 return TextureType::kTexture2D;
262 }
263 if (ahb_desc.layers % 6u == 0 &&
264 (ahb_desc.usage & AHARDWAREBUFFER_USAGE_GPU_CUBE_MAP)) {
265 return TextureType::kTextureCube;
266 }
267 // Our texture types seem to understand external OES textures. Should these be
268 // wired up instead?
269 return TextureType::kTexture2D;
270 }

References kTexture2D, and kTextureCube.

## ◆ ToTextureType() [2/2]

constexpr GLenum impeller::ToTextureType | ( | TextureType | type | ) |
| constexpr

Definition at line 171 of file formats_gles.h.

171 {
172 switch (type) {
173 case TextureType::kTexture2D:
174 return GL_TEXTURE_2D;
175 case TextureType::kTexture2DMultisample:
176 return GL_TEXTURE_2D_MULTISAMPLE;
177 case TextureType::kTextureCube:
178 return GL_TEXTURE_CUBE_MAP;
179 case TextureType::kTextureExternalOES:
180 return GL_TEXTURE_EXTERNAL_OES;
181 }
182 FML_UNREACHABLE();
183 }

References kTexture2D, kTexture2DMultisample, kTextureCube, kTextureExternalOES, and type.

Referenced by impeller::TextureGLES::GenerateMipmap(), and ToTextureDescriptor().

## ◆ ToType()

static RuntimeUniformType impeller::ToType | ( | fb::UniformDataType | type | ) |
| static

Definition at line 19 of file runtime_stage.cc.

19 {
20 switch (type) {
21 case fb::UniformDataType::kFloat:
22 return RuntimeUniformType::kFloat;
23 case fb::UniformDataType::kSampledImage:
24 return RuntimeUniformType::kSampledImage;
25 case fb::UniformDataType::kStruct:
26 return RuntimeUniformType::kStruct;
27 }
28 FML_UNREACHABLE();
29 }

References kFloat, kSampledImage, kStruct, and type.

Referenced by impeller::RuntimeStage::RuntimeStage().

## ◆ ToVector()

constexpr Vector4 impeller::ToVector | ( | Color | color | ) |
| inline constexpr

Definition at line 190 of file shader_types.h.

190 {
191 return {color.red, color.green, color.blue, color.alpha};
192 }

References impeller::Color::alpha, impeller::Color::blue, impeller::Color::green, and impeller::Color::red.

Referenced by impeller::TextContents::Render().

## ◆ ToVertexAttribType()

constexpr std::optional<GLenum> impeller::ToVertexAttribType | ( | ShaderType | type | ) |
| constexpr

Definition at line 140 of file formats_gles.h.

140 {
141 switch (type) {
142 case ShaderType::kSignedByte:
143 return GL_BYTE;
144 case ShaderType::kUnsignedByte:
145 return GL_UNSIGNED_BYTE;
146 case ShaderType::kSignedShort:
147 return GL_SHORT;
148 case ShaderType::kUnsignedShort:
149 return GL_UNSIGNED_SHORT;
150 case ShaderType::kFloat:
151 return GL_FLOAT;
152 case ShaderType::kUnknown:
153 case ShaderType::kVoid:
154 case ShaderType::kBoolean:
155 case ShaderType::kSignedInt:
156 case ShaderType::kUnsignedInt:
157 case ShaderType::kSignedInt64:
158 case ShaderType::kUnsignedInt64:
159 case ShaderType::kAtomicCounter:
160 case ShaderType::kHalfFloat:
161 case ShaderType::kDouble:
162 case ShaderType::kStruct:
163 case ShaderType::kImage:
164 case ShaderType::kSampledImage:
165 case ShaderType::kSampler:
166 return std::nullopt;
167 }
168 FML_UNREACHABLE();
169 }

References kAtomicCounter, kBoolean, kDouble, kFloat, kHalfFloat, kImage, kSampledImage, kSampler, kSignedByte, kSignedInt, kSignedInt64, kSignedShort, kStruct, kUnknown, kUnsignedByte, kUnsignedInt, kUnsignedInt64, kUnsignedShort, kVoid, and type.

Referenced by impeller::BufferBindingsGLES::RegisterVertexStageInput().

## ◆ ToVertexDescriptorFormat()

vk::Format impeller::ToVertexDescriptorFormat | ( | const ShaderStageIOSlot & | input | ) |

Definition at line 11 of file vertex_descriptor_vk.cc.

11 {
12 if (input.columns != 1) {
13 // All matrix types are unsupported as vertex inputs.
14 return vk::Format::eUndefined;
15 }
16
17 switch (input.type) {
18 case ShaderType::kFloat: {
19 if (input.bit_width == 8 * sizeof(float)) {
20 switch (input.vec_size) {
21 case 1:
22 return vk::Format::eR32Sfloat;
23 case 2:
24 return vk::Format::eR32G32Sfloat;
25 case 3:
26 return vk::Format::eR32G32B32Sfloat;
27 case 4:
28 return vk::Format::eR32G32B32A32Sfloat;
29 }
30 }
31 return vk::Format::eUndefined;
32 }
33 case ShaderType::kHalfFloat: {
34 if (input.bit_width == 8 * sizeof(float) / 2) {
35 switch (input.vec_size) {
36 case 1:
37 return vk::Format::eR16Sfloat;
38 case 2:
39 return vk::Format::eR16G16Sfloat;
40 case 3:
41 return vk::Format::eR16G16B16Sfloat;
42 case 4:
43 return vk::Format::eR16G16B16A16Sfloat;
44 }
45 }
46 return vk::Format::eUndefined;
47 }
48 case ShaderType::kDouble: {
49 // Unsupported.
50 return vk::Format::eUndefined;
51 }
52 case ShaderType::kBoolean: {
53 if (input.bit_width == 8 * sizeof(bool) && input.vec_size == 1) {
54 return vk::Format::eR8Uint;
55 }
56 return vk::Format::eUndefined;
57 }
58 case ShaderType::kSignedByte: {
59 if (input.bit_width == 8 * sizeof(char)) {
60 switch (input.vec_size) {
61 case 1:
62 return vk::Format::eR8Sint;
63 case 2:
64 return vk::Format::eR8G8Sint;
65 case 3:
66 return vk::Format::eR8G8B8Sint;
67 case 4:
68 return vk::Format::eR8G8B8A8Sint;
69 }
70 }
71 return vk::Format::eUndefined;
72 }
73 case ShaderType::kUnsignedByte: {
74 if (input.bit_width == 8 * sizeof(char)) {
75 switch (input.vec_size) {
76 case 1:
77 return vk::Format::eR8Uint;
78 case 2:
79 return vk::Format::eR8G8Uint;
80 case 3:
81 return vk::Format::eR8G8B8Uint;
82 case 4:
83 return vk::Format::eR8G8B8A8Uint;
84 }
85 }
86 return vk::Format::eUndefined;
87 }
88 case ShaderType::kSignedShort: {
89 if (input.bit_width == 8 * sizeof(int16_t)) {
90 switch (input.vec_size) {
91 case 1:
92 return vk::Format::eR16Sint;
93 case 2:
94 return vk::Format::eR16G16Sint;
95 case 3:
96 return vk::Format::eR16G16B16Sint;
97 case 4:
98 return vk::Format::eR16G16B16A16Sint;
99 }
100 }
101 return vk::Format::eUndefined;
102 }
103 case ShaderType::kUnsignedShort: {
104 if (input.bit_width == 8 * sizeof(uint16_t)) {
105 switch (input.vec_size) {
106 case 1:
107 return vk::Format::eR16Uint;
108 case 2:
109 return vk::Format::eR16G16Uint;
110 case 3:
111 return vk::Format::eR16G16B16Uint;
112 case 4:
113 return vk::Format::eR16G16B16A16Uint;
114 }
115 }
116 return vk::Format::eUndefined;
117 }
118 case ShaderType::kSignedInt: {
119 if (input.bit_width == 8 * sizeof(int32_t)) {
120 switch (input.vec_size) {
121 case 1:
122 return vk::Format::eR32Sint;
123 case 2:
124 return vk::Format::eR32G32Sint;
125 case 3:
126 return vk::Format::eR32G32B32Sint;
127 case 4:
128 return vk::Format::eR32G32B32A32Sint;
129 }
130 }
131 return vk::Format::eUndefined;
132 }
133 case ShaderType::kUnsignedInt: {
134 if (input.bit_width == 8 * sizeof(uint32_t)) {
135 switch (input.vec_size) {
136 case 1:
137 return vk::Format::eR32Uint;
138 case 2:
139 return vk::Format::eR32G32Uint;
140 case 3:
141 return vk::Format::eR32G32B32Uint;
142 case 4:
143 return vk::Format::eR32G32B32A32Uint;
144 }
145 }
146 return vk::Format::eUndefined;
147 }
148 case ShaderType::kSignedInt64: {
149 // Unsupported.
150 return vk::Format::eUndefined;
151 }
152 case ShaderType::kUnsignedInt64: {
153 // Unsupported.
154 return vk::Format::eUndefined;
155 }
156 case ShaderType::kAtomicCounter:
157 case ShaderType::kStruct:
158 case ShaderType::kImage:
159 case ShaderType::kSampledImage:
160 case ShaderType::kUnknown:
161 case ShaderType::kVoid:
162 case ShaderType::kSampler:
163 return vk::Format::eUndefined;
164 }
165 }

References impeller::ShaderStageIOSlot::bit_width, impeller::ShaderStageIOSlot::columns, kAtomicCounter, kBoolean, kDouble, kFloat, kHalfFloat, kImage, kSampledImage, kSampler, kSignedByte, kSignedInt, kSignedInt64, kSignedShort, kStruct, kUnknown, kUnsignedByte, kUnsignedInt, kUnsignedInt64, kUnsignedShort, kVoid, impeller::ShaderStageIOSlot::type, and impeller::ShaderStageIOSlot::vec_size.

## ◆ ToVKAttachmentLoadOp()

constexpr vk::AttachmentLoadOp impeller::ToVKAttachmentLoadOp | ( | LoadAction | load_action | ) |
| constexpr

Definition at line 306 of file formats_vk.h.

306 {
307 switch (load_action) {
308 case LoadAction::kLoad:
309 return vk::AttachmentLoadOp::eLoad;
310 case LoadAction::kClear:
311 return vk::AttachmentLoadOp::eClear;
312 case LoadAction::kDontCare:
313 return vk::AttachmentLoadOp::eDontCare;
314 }
315
316 FML_UNREACHABLE();
317 }

References kClear, kDontCare, and kLoad.

Referenced by impeller::RenderPassBuilderVK::SetColorAttachment(), impeller::RenderPassBuilderVK::SetDepthStencilAttachment(), and impeller::RenderPassBuilderVK::SetStencilAttachment().

## ◆ ToVKAttachmentStoreOp()

constexpr vk::AttachmentStoreOp impeller::ToVKAttachmentStoreOp | ( | StoreAction | store_action,
|  | bool | is_resolve_texture
| ) |  |
| constexpr

Definition at line 319 of file formats_vk.h.

320 {
321 switch (store_action) {
322 case StoreAction::kStore:
323 // Both MSAA and resolve textures need to be stored. A resolve is NOT
324 // performed.
325 return vk::AttachmentStoreOp::eStore;
326 case StoreAction::kDontCare:
327 // Both MSAA and resolve textures can be discarded. A resolve is NOT
328 // performed.
329 return vk::AttachmentStoreOp::eDontCare;
330 case StoreAction::kMultisampleResolve:
331 // The resolve texture is stored but the MSAA texture can be discarded. A
332 // resolve IS performed.
333 return is_resolve_texture ? vk::AttachmentStoreOp::eStore
334 : vk::AttachmentStoreOp::eDontCare;
335 case StoreAction::kStoreAndMultisampleResolve:
336 // Both MSAA and resolve textures need to be stored. A resolve IS
337 // performed.
338 return vk::AttachmentStoreOp::eStore;
339 }
340 FML_UNREACHABLE();
341 }

References kDontCare, kMultisampleResolve, kStore, and kStoreAndMultisampleResolve.

Referenced by impeller::RenderPassBuilderVK::SetColorAttachment(), impeller::RenderPassBuilderVK::SetDepthStencilAttachment(), and impeller::RenderPassBuilderVK::SetStencilAttachment().

## ◆ ToVKBlendFactor()

constexpr vk::BlendFactor impeller::ToVKBlendFactor | ( | BlendFactor | factor | ) |
| constexpr

Definition at line 42 of file formats_vk.h.

42 {
43 switch (factor) {
44 case BlendFactor::kZero:
45 return vk::BlendFactor::eZero;
46 case BlendFactor::kOne:
47 return vk::BlendFactor::eOne;
48 case BlendFactor::kSourceColor:
49 return vk::BlendFactor::eSrcColor;
50 case BlendFactor::kOneMinusSourceColor:
51 return vk::BlendFactor::eOneMinusSrcColor;
52 case BlendFactor::kSourceAlpha:
53 return vk::BlendFactor::eSrcAlpha;
54 case BlendFactor::kOneMinusSourceAlpha:
55 return vk::BlendFactor::eOneMinusSrcAlpha;
56 case BlendFactor::kDestinationColor:
57 return vk::BlendFactor::eDstColor;
58 case BlendFactor::kOneMinusDestinationColor:
59 return vk::BlendFactor::eOneMinusDstColor;
60 case BlendFactor::kDestinationAlpha:
61 return vk::BlendFactor::eDstAlpha;
62 case BlendFactor::kOneMinusDestinationAlpha:
63 return vk::BlendFactor::eOneMinusDstAlpha;
64 case BlendFactor::kSourceAlphaSaturated:
65 return vk::BlendFactor::eSrcAlphaSaturate;
66 case BlendFactor::kBlendColor:
67 return vk::BlendFactor::eConstantColor;
68 case BlendFactor::kOneMinusBlendColor:
69 return vk::BlendFactor::eOneMinusConstantColor;
70 case BlendFactor::kBlendAlpha:
71 return vk::BlendFactor::eConstantAlpha;
72 case BlendFactor::kOneMinusBlendAlpha:
73 return vk::BlendFactor::eOneMinusConstantAlpha;
74 }
75 FML_UNREACHABLE();
76 }

References kBlendAlpha, kBlendColor, kDestinationAlpha, kDestinationColor, kOne, kOneMinusBlendAlpha, kOneMinusBlendColor, kOneMinusDestinationAlpha, kOneMinusDestinationColor, kOneMinusSourceAlpha, kOneMinusSourceColor, kSourceAlpha, kSourceAlphaSaturated, kSourceColor, and kZero.

Referenced by ToVKPipelineColorBlendAttachmentState().

## ◆ ToVKBlendOp()

constexpr vk::BlendOp impeller::ToVKBlendOp | ( | BlendOperation | op | ) |
| constexpr

Definition at line 78 of file formats_vk.h.

78 {
79 switch (op) {
80 case BlendOperation::kAdd:
81 return vk::BlendOp::eAdd;
82 case BlendOperation::kSubtract:
83 return vk::BlendOp::eSubtract;
84 case BlendOperation::kReverseSubtract:
85 return vk::BlendOp::eReverseSubtract;
86 }
87 FML_UNREACHABLE();
88 }

References kAdd, kReverseSubtract, and kSubtract.

Referenced by ToVKPipelineColorBlendAttachmentState().

## ◆ ToVKBufferMemoryPropertyFlags()

static constexpr vk::Flags<vk::MemoryPropertyFlagBits> impeller::ToVKBufferMemoryPropertyFlags | ( | StorageMode | mode | ) |
| static constexpr

Definition at line 22 of file allocator_vk.cc.

22 {
23 switch (mode) {
24 case StorageMode::kHostVisible:
25 return vk::MemoryPropertyFlagBits::eHostVisible;
26 case StorageMode::kDevicePrivate:
27 return vk::MemoryPropertyFlagBits::eDeviceLocal;
28 case StorageMode::kDeviceTransient:
29 return vk::MemoryPropertyFlagBits::eLazilyAllocated;
30 }
31 FML_UNREACHABLE();
32 }

References kDevicePrivate, kDeviceTransient, and kHostVisible.

Referenced by CreateBufferPool().

## ◆ ToVKColorComponentFlags()

constexpr vk::ColorComponentFlags impeller::ToVKColorComponentFlags | ( | ColorWriteMask | type | ) |
| constexpr

Definition at line 90 of file formats_vk.h.

90 {
91 vk::ColorComponentFlags mask;
92
93 if (type & ColorWriteMaskBits::kRed) {
94 mask |= vk::ColorComponentFlagBits::eR;
95 }
96
97 if (type & ColorWriteMaskBits::kGreen) {
98 mask |= vk::ColorComponentFlagBits::eG;
99 }
100
101 if (type & ColorWriteMaskBits::kBlue) {
102 mask |= vk::ColorComponentFlagBits::eB;
103 }
104
105 if (type & ColorWriteMaskBits::kAlpha) {
106 mask |= vk::ColorComponentFlagBits::eA;
107 }
108
109 return mask;
110 }

References kAlpha, kBlue, kGreen, kRed, and type.

Referenced by ToVKPipelineColorBlendAttachmentState().

## ◆ ToVKCompareOp()

constexpr vk::CompareOp impeller::ToVKCompareOp | ( | CompareFunction | op | ) |
| constexpr

Definition at line 453 of file formats_vk.h.

453 {
454 switch (op) {
455 case CompareFunction::kNever:
456 return vk::CompareOp::eNever;
457 case CompareFunction::kAlways:
458 return vk::CompareOp::eAlways;
459 case CompareFunction::kLess:
460 return vk::CompareOp::eLess;
461 case CompareFunction::kEqual:
462 return vk::CompareOp::eEqual;
463 case CompareFunction::kLessEqual:
464 return vk::CompareOp::eLessOrEqual;
465 case CompareFunction::kGreater:
466 return vk::CompareOp::eGreater;
467 case CompareFunction::kNotEqual:
468 return vk::CompareOp::eNotEqual;
469 case CompareFunction::kGreaterEqual:
470 return vk::CompareOp::eGreaterOrEqual;
471 }
472 FML_UNREACHABLE();
473 }

References kAlways, kEqual, kGreater, kGreaterEqual, kLess, kLessEqual, kNever, and kNotEqual.

Referenced by ToVKPipelineDepthStencilStateCreateInfo(), and ToVKStencilOpState().

## ◆ ToVKCullModeFlags()

constexpr vk::CullModeFlags impeller::ToVKCullModeFlags | ( | CullMode | mode | ) |
| constexpr

Definition at line 441 of file formats_vk.h.

441 {
442 switch (mode) {
443 case CullMode::kNone:
444 return vk::CullModeFlagBits::eNone;
445 case CullMode::kFrontFace:
446 return vk::CullModeFlagBits::eFront;
447 case CullMode::kBackFace:
448 return vk::CullModeFlagBits::eBack;
449 }
450 FML_UNREACHABLE();
451 }

References kBackFace, kFrontFace, and kNone.

## ◆ ToVKDescriptorSetLayoutBinding()

constexpr vk::DescriptorSetLayoutBinding impeller::ToVKDescriptorSetLayoutBinding | ( | const DescriptorSetLayout & | layout | ) |
| constexpr

Definition at line 296 of file formats_vk.h.

297 {
298 vk::DescriptorSetLayoutBinding binding;
299 binding.binding = layout.binding;
300 binding.descriptorCount = 1u;
301 binding.descriptorType = ToVKDescriptorType(layout.descriptor_type);
302 binding.stageFlags = ToVkShaderStage(layout.shader_stage);
303 return binding;
304 }

References impeller::DescriptorSetLayout::binding, impeller::DescriptorSetLayout::descriptor_type, impeller::DescriptorSetLayout::shader_stage, ToVKDescriptorType(), and ToVkShaderStage().

## ◆ ToVKDescriptorType()

constexpr vk::DescriptorType impeller::ToVKDescriptorType | ( | DescriptorType | type | ) |
| constexpr

Definition at line 292 of file formats_vk.h.

292 {
293 return static_cast<vk::DescriptorType>(type);
294 }

References type.

Referenced by impeller::testing::TEST(), and ToVKDescriptorSetLayoutBinding().

## ◆ ToVKFrontFace()

constexpr vk::FrontFace impeller::ToVKFrontFace | ( | WindingOrder | order | ) |
| constexpr

Definition at line 31 of file pipeline_vk.cc.

31 {
32 switch (order) {
33 case WindingOrder::kClockwise:
34 return vk::FrontFace::eClockwise;
35 case WindingOrder::kCounterClockwise:
36 return vk::FrontFace::eCounterClockwise;
37 }
38 FML_UNREACHABLE();
39 }

References kClockwise, and kCounterClockwise.

## ◆ ToVKImageAspectFlags()

constexpr vk::ImageAspectFlags impeller::ToVKImageAspectFlags | ( | PixelFormat | format | ) |
| constexpr

Definition at line 513 of file formats_vk.h.

513 {
514 switch (format) {
515 case PixelFormat::kUnknown:
516 case PixelFormat::kA8UNormInt:
517 case PixelFormat::kR8UNormInt:
518 case PixelFormat::kR8G8UNormInt:
519 case PixelFormat::kR8G8B8A8UNormInt:
520 case PixelFormat::kR8G8B8A8UNormIntSRGB:
521 case PixelFormat::kB8G8R8A8UNormInt:
522 case PixelFormat::kB8G8R8A8UNormIntSRGB:
523 case PixelFormat::kR32G32B32A32Float:
524 case PixelFormat::kR16G16B16A16Float:
525 case PixelFormat::kB10G10R10XR:
526 case PixelFormat::kB10G10R10XRSRGB:
527 case PixelFormat::kB10G10R10A10XR:
528 return vk::ImageAspectFlagBits::eColor;
529 case PixelFormat::kS8UInt:
530 return vk::ImageAspectFlagBits::eStencil;
531 case PixelFormat::kD24UnormS8Uint:
532 case PixelFormat::kD32FloatS8UInt:
533 return vk::ImageAspectFlagBits::eDepth |
534 vk::ImageAspectFlagBits::eStencil;
535 }
536 FML_UNREACHABLE();
537 }

References kA8UNormInt, kB10G10R10A10XR, kB10G10R10XR, kB10G10R10XRSRGB, kB8G8R8A8UNormInt, kB8G8R8A8UNormIntSRGB, kD24UnormS8Uint, kD32FloatS8UInt, kR16G16B16A16Float, kR32G32B32A32Float, kR8G8B8A8UNormInt, kR8G8B8A8UNormIntSRGB, kR8G8UNormInt, kR8UNormInt, kS8UInt, and kUnknown.

Referenced by impeller::AllocatedTextureSourceVK::AllocatedTextureSourceVK().

## ◆ ToVKImageCreateFlags()

constexpr vk::ImageCreateFlags impeller::ToVKImageCreateFlags | ( | TextureType | type | ) |
| constexpr

Definition at line 567 of file formats_vk.h.

567 {
568 switch (type) {
569 case TextureType::kTexture2D:
570 case TextureType::kTexture2DMultisample:
571 return {};
572 case TextureType::kTextureCube:
573 return vk::ImageCreateFlagBits::eCubeCompatible;
574 case TextureType::kTextureExternalOES:
575 VALIDATION_LOG
576 << "kTextureExternalOES can not be used with the Vulkan backend.";
577 }
578 FML_UNREACHABLE();
579 }

References kTexture2D, kTexture2DMultisample, kTextureCube, kTextureExternalOES, type, and VALIDATION_LOG.

Referenced by impeller::AllocatedTextureSourceVK::AllocatedTextureSourceVK().

## ◆ ToVKImageFormat()

constexpr vk::Format impeller::ToVKImageFormat | ( | PixelFormat | format | ) |
| constexpr

Definition at line 146 of file formats_vk.h.

146 {
147 switch (format) {
148 case PixelFormat::kUnknown:
149 case PixelFormat::kB10G10R10XR:
150 case PixelFormat::kB10G10R10A10XR:
151 case PixelFormat::kB10G10R10XRSRGB:
152 return vk::Format::eUndefined;
153 case PixelFormat::kA8UNormInt:
154 // TODO(csg): This is incorrect. Don't depend on swizzle support for GLES.
155 return vk::Format::eR8Unorm;
156 case PixelFormat::kR8G8B8A8UNormInt:
157 return vk::Format::eR8G8B8A8Unorm;
158 case PixelFormat::kR8G8B8A8UNormIntSRGB:
159 return vk::Format::eR8G8B8A8Srgb;
160 case PixelFormat::kB8G8R8A8UNormInt:
161 return vk::Format::eB8G8R8A8Unorm;
162 case PixelFormat::kB8G8R8A8UNormIntSRGB:
163 return vk::Format::eB8G8R8A8Srgb;
164 case PixelFormat::kR32G32B32A32Float:
165 return vk::Format::eR32G32B32A32Sfloat;
166 case PixelFormat::kR16G16B16A16Float:
167 return vk::Format::eR16G16B16A16Sfloat;
168 case PixelFormat::kS8UInt:
169 return vk::Format::eS8Uint;
170 case PixelFormat::kD24UnormS8Uint:
171 return vk::Format::eD24UnormS8Uint;
172 case PixelFormat::kD32FloatS8UInt:
173 return vk::Format::eD32SfloatS8Uint;
174 case PixelFormat::kR8UNormInt:
175 return vk::Format::eR8Unorm;
176 case PixelFormat::kR8G8UNormInt:
177 return vk::Format::eR8G8Unorm;
178 }
179
180 FML_UNREACHABLE();
181 }

References kA8UNormInt, kB10G10R10A10XR, kB10G10R10XR, kB10G10R10XRSRGB, kB8G8R8A8UNormInt, kB8G8R8A8UNormIntSRGB, kD24UnormS8Uint, kD32FloatS8UInt, kR16G16B16A16Float, kR32G32B32A32Float, kR8G8B8A8UNormInt, kR8G8B8A8UNormIntSRGB, kR8G8UNormInt, kR8UNormInt, kS8UInt, and kUnknown.

Referenced by impeller::AllocatedTextureSourceVK::AllocatedTextureSourceVK(), ChooseSurfaceFormat(), impeller::AHBSwapchainVK::GetSurfaceFormat(), impeller::KHRSwapchainImageVK::KHRSwapchainImageVK(), impeller::RenderPassBuilderVK::SetColorAttachment(), impeller::RenderPassBuilderVK::SetDepthStencilAttachment(), and impeller::RenderPassBuilderVK::SetStencilAttachment().

## ◆ ToVKImageViewType()

constexpr vk::ImageViewType impeller::ToVKImageViewType | ( | TextureType | type | ) |
| constexpr

Definition at line 553 of file formats_vk.h.

553 {
554 switch (type) {
555 case TextureType::kTexture2D:
556 case TextureType::kTexture2DMultisample:
557 return vk::ImageViewType::e2D;
558 case TextureType::kTextureCube:
559 return vk::ImageViewType::eCube;
560 case TextureType::kTextureExternalOES:
561 VALIDATION_LOG
562 << "kTextureExternalOES can not be used with the Vulkan backend.";
563 }
564 FML_UNREACHABLE();
565 }

References kTexture2D, kTexture2DMultisample, kTextureCube, kTextureExternalOES, type, and VALIDATION_LOG.

Referenced by impeller::AllocatedTextureSourceVK::AllocatedTextureSourceVK().

## ◆ ToVKIndexType()

constexpr vk::IndexType impeller::ToVKIndexType | ( | IndexType | index_type | ) |
| constexpr

Definition at line 355 of file formats_vk.h.

355 {
356 switch (index_type) {
357 case IndexType::k16bit:
358 return vk::IndexType::eUint16;
359 case IndexType::k32bit:
360 return vk::IndexType::eUint32;
361 case IndexType::kUnknown:
362 return vk::IndexType::eUint32;
363 case IndexType::kNone:
364 FML_UNREACHABLE();
365 }
366
367 FML_UNREACHABLE();
368 }

References k16bit, k32bit, kNone, and kUnknown.

## ◆ ToVKPipelineColorBlendAttachmentState()

constexpr vk::PipelineColorBlendAttachmentState impeller::ToVKPipelineColorBlendAttachmentState | ( | const ColorAttachmentDescriptor & | desc | ) |
| constexpr

Definition at line 113 of file formats_vk.h.

113 {
114 vk::PipelineColorBlendAttachmentState res;
115
116 res.setBlendEnable(desc.blending_enabled);
117
118 res.setSrcColorBlendFactor(ToVKBlendFactor(desc.src_color_blend_factor));
119 res.setColorBlendOp(ToVKBlendOp(desc.color_blend_op));
120 res.setDstColorBlendFactor(ToVKBlendFactor(desc.dst_color_blend_factor));
121
122 res.setSrcAlphaBlendFactor(ToVKBlendFactor(desc.src_alpha_blend_factor));
123 res.setAlphaBlendOp(ToVKBlendOp(desc.alpha_blend_op));
124 res.setDstAlphaBlendFactor(ToVKBlendFactor(desc.dst_alpha_blend_factor));
125
126 res.setColorWriteMask(ToVKColorComponentFlags(desc.write_mask));
127
128 return res;
129 }

References impeller::ColorAttachmentDescriptor::alpha_blend_op, impeller::ColorAttachmentDescriptor::blending_enabled, impeller::ColorAttachmentDescriptor::color_blend_op, impeller::ColorAttachmentDescriptor::dst_alpha_blend_factor, impeller::ColorAttachmentDescriptor::dst_color_blend_factor, impeller::ColorAttachmentDescriptor::src_alpha_blend_factor, impeller::ColorAttachmentDescriptor::src_color_blend_factor, ToVKBlendFactor(), ToVKBlendOp(), ToVKColorComponentFlags(), and impeller::ColorAttachmentDescriptor::write_mask.

## ◆ ToVKPipelineDepthStencilStateCreateInfo()

vk::PipelineDepthStencilStateCreateInfo impeller::ToVKPipelineDepthStencilStateCreateInfo | ( | std::optional< DepthAttachmentDescriptor > | depth,
|  | std::optional< StencilAttachmentDescriptor > | front,
|  | std::optional< StencilAttachmentDescriptor > | back
| ) |  |

Definition at line 9 of file formats_vk.cc.

12 {
13 vk::PipelineDepthStencilStateCreateInfo info;
14
15 if (depth.has_value()) {
16 info.depthTestEnable = true;
17 info.depthWriteEnable = depth->depth_write_enabled;
18 info.depthCompareOp = ToVKCompareOp(depth->depth_compare);
19 info.minDepthBounds = 0.0f;
20 info.maxDepthBounds = 1.0f;
21 }
22
23 if (front.has_value()) {
24 info.stencilTestEnable = true;
25 info.front = ToVKStencilOpState(*front);
26 }
27
28 if (back.has_value()) {
29 info.stencilTestEnable = true;
30 info.back = ToVKStencilOpState(*back);
31 }
32
33 return info;
34 }

References ToVKCompareOp(), and ToVKStencilOpState().

## ◆ ToVKPolygonMode()

constexpr vk::PolygonMode impeller::ToVKPolygonMode | ( | PolygonMode | mode | ) |
| constexpr

Definition at line 370 of file formats_vk.h.

370 {
371 switch (mode) {
372 case PolygonMode::kFill:
373 return vk::PolygonMode::eFill;
374 case PolygonMode::kLine:
375 return vk::PolygonMode::eLine;
376 }
377 FML_UNREACHABLE();
378 }

References kFill, and kLine.

## ◆ ToVKPrimitiveTopology()

constexpr vk::PrimitiveTopology impeller::ToVKPrimitiveTopology | ( | PrimitiveType | primitive | ) |
| constexpr

Definition at line 395 of file formats_vk.h.

395 {
396 switch (primitive) {
397 case PrimitiveType::kTriangle:
398 return vk::PrimitiveTopology::eTriangleList;
399 case PrimitiveType::kTriangleStrip:
400 return vk::PrimitiveTopology::eTriangleStrip;
401 case PrimitiveType::kLine:
402 return vk::PrimitiveTopology::eLineList;
403 case PrimitiveType::kLineStrip:
404 return vk::PrimitiveTopology::eLineStrip;
405 case PrimitiveType::kPoint:
406 return vk::PrimitiveTopology::ePointList;
407 case PrimitiveType::kTriangleFan:
408 return vk::PrimitiveTopology::eTriangleFan;
409 }
410
411 FML_UNREACHABLE();
412 }

References kLine, kLineStrip, kPoint, kTriangle, kTriangleFan, and kTriangleStrip.

## ◆ ToVKSampleCount()

constexpr vk::SampleCountFlagBits impeller::ToVKSampleCount | ( | SampleCount | sample_count | ) |
| constexpr

Definition at line 214 of file formats_vk.h.

214 {
215 switch (sample_count) {
216 case SampleCount::kCount1:
217 return vk::SampleCountFlagBits::e1;
218 case SampleCount::kCount4:
219 return vk::SampleCountFlagBits::e4;
220 }
221
222 FML_UNREACHABLE();
223 }

References kCount1, and kCount4.

Referenced by impeller::AllocatedTextureSourceVK::AllocatedTextureSourceVK(), impeller::RenderPassBuilderVK::SetColorAttachment(), impeller::RenderPassBuilderVK::SetDepthStencilAttachment(), and impeller::RenderPassBuilderVK::SetStencilAttachment().

## ◆ ToVKSampleCountFlagBits()

constexpr vk::SampleCountFlagBits impeller::ToVKSampleCountFlagBits | ( | SampleCount | count | ) |
| constexpr

Definition at line 32 of file formats_vk.h.

32 {
33 switch (count) {
34 case SampleCount::kCount1:
35 return vk::SampleCountFlagBits::e1;
36 case SampleCount::kCount4:
37 return vk::SampleCountFlagBits::e4;
38 }
39 FML_UNREACHABLE();
40 }

References kCount1, and kCount4.

## ◆ ToVKSamplerAddressMode()

constexpr vk::SamplerAddressMode impeller::ToVKSamplerAddressMode | ( | SamplerAddressMode | mode | ) |
| constexpr

Definition at line 248 of file formats_vk.h.

249 {
250 switch (mode) {
251 case SamplerAddressMode::kRepeat:
252 return vk::SamplerAddressMode::eRepeat;
253 case SamplerAddressMode::kMirror:
254 return vk::SamplerAddressMode::eMirroredRepeat;
255 case SamplerAddressMode::kClampToEdge:
256 return vk::SamplerAddressMode::eClampToEdge;
257 case SamplerAddressMode::kDecal:
258 return vk::SamplerAddressMode::eClampToBorder;
259 }
260
261 FML_UNREACHABLE();
262 }

References kClampToEdge, kDecal, kMirror, and kRepeat.

Referenced by CreateSampler().

## ◆ ToVKSamplerMinMagFilter()

constexpr vk::Filter impeller::ToVKSamplerMinMagFilter | ( | MinMagFilter | filter | ) |
| constexpr

Definition at line 225 of file formats_vk.h.

225 {
226 switch (filter) {
227 case MinMagFilter::kNearest:
228 return vk::Filter::eNearest;
229 case MinMagFilter::kLinear:
230 return vk::Filter::eLinear;
231 }
232
233 FML_UNREACHABLE();
234 }

References kLinear, and kNearest.

Referenced by CreateSampler().

## ◆ ToVKSamplerMipmapMode()

constexpr vk::SamplerMipmapMode impeller::ToVKSamplerMipmapMode | ( | MipFilter | filter | ) |
| constexpr

Definition at line 236 of file formats_vk.h.

236 {
237 switch (filter) {
238 case MipFilter::kBase:
239 case MipFilter::kNearest:
240 return vk::SamplerMipmapMode::eNearest;
241 case MipFilter::kLinear:
242 return vk::SamplerMipmapMode::eLinear;
243 }
244
245 FML_UNREACHABLE();
246 }

References kBase, kLinear, and kNearest.

## ◆ ToVkShaderStage()

constexpr vk::ShaderStageFlags impeller::ToVkShaderStage | ( | ShaderStage | stage | ) |
| constexpr

Definition at line 264 of file formats_vk.h.

264 {
265 switch (stage) {
266 case ShaderStage::kUnknown:
267 return vk::ShaderStageFlagBits::eAll;
268 case ShaderStage::kFragment:
269 return vk::ShaderStageFlagBits::eFragment;
270 case ShaderStage::kCompute:
271 return vk::ShaderStageFlagBits::eCompute;
272 case ShaderStage::kVertex:
273 return vk::ShaderStageFlagBits::eVertex;
274 }
275
276 FML_UNREACHABLE();
277 }

References kCompute, kFragment, kUnknown, and kVertex.

Referenced by ToVKDescriptorSetLayoutBinding().

## ◆ ToVKShaderStageFlagBits()

constexpr std::optional<vk::ShaderStageFlagBits> impeller::ToVKShaderStageFlagBits | ( | ShaderStage | stage | ) |
| constexpr

Definition at line 131 of file formats_vk.h.

132 {
133 switch (stage) {
134 case ShaderStage::kUnknown:
135 return std::nullopt;
136 case ShaderStage::kVertex:
137 return vk::ShaderStageFlagBits::eVertex;
138 case ShaderStage::kFragment:
139 return vk::ShaderStageFlagBits::eFragment;
140 case ShaderStage::kCompute:
141 return vk::ShaderStageFlagBits::eCompute;
142 }
143 FML_UNREACHABLE();
144 }

References kCompute, kFragment, kUnknown, and kVertex.

## ◆ ToVKStencilOp()

constexpr vk::StencilOp impeller::ToVKStencilOp | ( | StencilOperation | op | ) |
| constexpr

Definition at line 475 of file formats_vk.h.

475 {
476 switch (op) {
477 case StencilOperation::kKeep:
478 return vk::StencilOp::eKeep;
479 case StencilOperation::kZero:
480 return vk::StencilOp::eZero;
481 case StencilOperation::kSetToReferenceValue:
482 return vk::StencilOp::eReplace;
483 case StencilOperation::kIncrementClamp:
484 return vk::StencilOp::eIncrementAndClamp;
485 case StencilOperation::kDecrementClamp:
486 return vk::StencilOp::eDecrementAndClamp;
487 case StencilOperation::kInvert:
488 return vk::StencilOp::eInvert;
489 case StencilOperation::kIncrementWrap:
490 return vk::StencilOp::eIncrementAndWrap;
491 case StencilOperation::kDecrementWrap:
492 return vk::StencilOp::eDecrementAndWrap;
493 break;
494 }
495 FML_UNREACHABLE();
496 }

References kDecrementClamp, kDecrementWrap, kIncrementClamp, kIncrementWrap, kInvert, kKeep, kSetToReferenceValue, and kZero.

Referenced by ToVKStencilOpState().

## ◆ ToVKStencilOpState()

constexpr vk::StencilOpState impeller::ToVKStencilOpState | ( | const StencilAttachmentDescriptor & | desc | ) |
| constexpr

Definition at line 498 of file formats_vk.h.

499 {
500 vk::StencilOpState state;
501 state.failOp = ToVKStencilOp(desc.stencil_failure);
502 state.passOp = ToVKStencilOp(desc.depth_stencil_pass);
503 state.depthFailOp = ToVKStencilOp(desc.depth_failure);
504 state.compareOp = ToVKCompareOp(desc.stencil_compare);
505 state.compareMask = desc.read_mask;
506 state.writeMask = desc.write_mask;
507 // This is irrelevant as the stencil references are always dynamic state and
508 // will be set in the render pass.
509 state.reference = 1988;
510 return state;
511 }

References impeller::StencilAttachmentDescriptor::depth_failure, impeller::StencilAttachmentDescriptor::depth_stencil_pass, impeller::StencilAttachmentDescriptor::read_mask, impeller::StencilAttachmentDescriptor::stencil_compare, impeller::StencilAttachmentDescriptor::stencil_failure, ToVKCompareOp(), ToVKStencilOp(), and impeller::StencilAttachmentDescriptor::write_mask.

Referenced by ToVKPipelineDepthStencilStateCreateInfo().

## ◆ ToVKTextureMemoryPropertyFlags()

static constexpr vk::Flags<vk::MemoryPropertyFlagBits> impeller::ToVKTextureMemoryPropertyFlags | ( | StorageMode | mode,
|  | bool | supports_memoryless_textures
| ) |  |
| static constexpr

Definition at line 254 of file allocator_vk.cc.

255 {
256 switch (mode) {
257 case StorageMode::kHostVisible:
258 return vk::MemoryPropertyFlagBits::eHostVisible |
259 vk::MemoryPropertyFlagBits::eDeviceLocal;
260 case StorageMode::kDevicePrivate:
261 return vk::MemoryPropertyFlagBits::eDeviceLocal;
262 case StorageMode::kDeviceTransient:
263 if (supports_memoryless_textures) {
264 return vk::MemoryPropertyFlagBits::eLazilyAllocated |
265 vk::MemoryPropertyFlagBits::eDeviceLocal;
266 }
267 return vk::MemoryPropertyFlagBits::eDeviceLocal;
268 }
269 FML_UNREACHABLE();
270 }

Referenced by impeller::AllocatedTextureSourceVK::AllocatedTextureSourceVK().

## ◆ ToVmaAllocationBufferCreateFlags()

static VmaAllocationCreateFlags impeller::ToVmaAllocationBufferCreateFlags | ( | StorageMode | mode,
|  | bool | readback
| ) |  |
| static

Definition at line 34 of file allocator_vk.cc.

36 {
37 VmaAllocationCreateFlags flags = 0;
38 switch (mode) {
39 case StorageMode::kHostVisible:
40 if (!readback) {
41 flags |= VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT;
42 } else {
43 flags |= VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT;
44 }
45 flags |= VMA_ALLOCATION_CREATE_MAPPED_BIT;
46 return flags;
47 case StorageMode::kDevicePrivate:
48 FML_DCHECK(!readback);
49 return flags;
50 case StorageMode::kDeviceTransient:
51 FML_DCHECK(!readback);
52 return flags;
53 }
54 FML_UNREACHABLE();
55 }

References kDevicePrivate, kDeviceTransient, and kHostVisible.

Referenced by CreateBufferPool().

## ◆ ToVmaAllocationCreateFlags()

static VmaAllocationCreateFlags impeller::ToVmaAllocationCreateFlags | ( | StorageMode | mode | ) |
| static

Definition at line 272 of file allocator_vk.cc.

272 {
273 VmaAllocationCreateFlags flags = 0;
274 switch (mode) {
275 case StorageMode::kHostVisible:
276 return flags;
277 case StorageMode::kDevicePrivate:
278 return flags;
279 case StorageMode::kDeviceTransient:
280 return flags;
281 }
282 FML_UNREACHABLE();
283 }

Referenced by impeller::AllocatedTextureSourceVK::AllocatedTextureSourceVK().

## ◆ ToVMAMemoryUsage()

static constexpr VmaMemoryUsage impeller::ToVMAMemoryUsage | ( |  | ) |
| static constexpr

Definition at line 249 of file allocator_vk.cc.

249 {
250 return VMA_MEMORY_USAGE_AUTO;
251 }

Referenced by impeller::AllocatedTextureSourceVK::AllocatedTextureSourceVK().

## ◆ UpdateAtlasBitmap()

static bool impeller::UpdateAtlasBitmap | ( | const GlyphAtlas & | atlas,
|  | std::shared_ptr< BlitPass > & | blit_pass,
|  | HostBuffer & | host_buffer,
|  | const std::shared_ptr< Texture > & | texture,
|  | const std::vector< FontGlyphPair > & | new_pairs,
|  | size_t | start_index,
|  | size_t | end_index
| ) |  |
| static

Definition at line 314 of file typographer_context_skia.cc.

320 {
321 TRACE_EVENT0("impeller", __FUNCTION__);
322
323 bool has_color = atlas.GetType() == GlyphAtlas::Type::kColorBitmap;
324
325 for (size_t i = start_index; i < end_index; i++) {
326 const FontGlyphPair& pair = new_pairs[i];
327 auto data = atlas.FindFontGlyphBounds(pair);
328 if (!data.has_value()) {
329 continue;
330 }
331 auto [pos, bounds, placeholder] = data.value();
332 FML_DCHECK(!placeholder);
333
334 Size size = pos.GetSize();
335 if (size.IsEmpty()) {
336 continue;
337 }
338 // The uploaded bitmap is expanded by 1px of padding
339 // on each side.
340 size.width += 2;
341 size.height += 2;
342
343 SkBitmap bitmap;
344 bitmap.setInfo(GetImageInfo(atlas, size));
345 if (!bitmap.tryAllocPixels()) {
346 return false;
347 }
348
349 auto surface = SkSurfaces::WrapPixels(bitmap.pixmap());
350 if (!surface) {
351 return false;
352 }
353 auto canvas = surface->getCanvas();
354 if (!canvas) {
355 return false;
356 }
357
358 DrawGlyph(canvas, SkPoint::Make(1, 1), pair.scaled_font, pair.glyph, bounds,
359 pair.glyph.properties, has_color);
360
361 // Writing to a malloc'd buffer and then copying to the staging buffers
362 // benchmarks as substantially faster on a number of Android devices.
363 BufferView buffer_view = host_buffer.Emplace(
364 bitmap.getAddr(0, 0),
365 size.Area() * BytesPerPixelForPixelFormat(
366 atlas.GetTexture()->GetTextureDescriptor().format),
367 DefaultUniformAlignment());
368
369 // convert_to_read is set to false so that the texture remains in a transfer
370 // dst layout until we finish writing to it below. This only has an impact
371 // on Vulkan where we are responsible for managing image layouts.
372 if (!blit_pass->AddCopy(std::move(buffer_view), //
373 texture, //
374 IRect::MakeXYWH(pos.GetLeft() - 1, pos.GetTop() - 1,
375 size.width, size.height), //
376 /*label=*/"", //
377 /*mip_level=*/0, //
378 /*slice=*/0, //
379 /*convert_to_read=*/false //
380 )) {
381 return false;
382 }
383 }
384 return blit_pass->ConvertTextureToShaderRead(texture);
385 }

References impeller::TSize< T >::Area(), buffer_view, BytesPerPixelForPixelFormat(), data, DefaultUniformAlignment(), DrawGlyph(), impeller::HostBuffer::Emplace(), impeller::GlyphAtlas::FindFontGlyphBounds(), GetImageInfo(), impeller::GlyphAtlas::GetTexture(), impeller::GlyphAtlas::GetType(), impeller::FontGlyphPair::glyph, impeller::TSize< T >::height, impeller::TSize< T >::IsEmpty(), impeller::GlyphAtlas::kColorBitmap, impeller::TRect< T >::MakeXYWH(), impeller::SubpixelGlyph::properties, impeller::FontGlyphPair::scaled_font, and impeller::TSize< T >::width.

Referenced by impeller::TypographerContextSkia::CreateGlyphAtlas().

## ◆ ValidateBlendModes()

static constexpr bool impeller::ValidateBlendModes | ( |  | ) |
| inline static constexpr

Definition at line 28 of file color.cc.

28 {
29 std::underlying_type_t<BlendMode> i = 0;
30 // Ensure the order of the blend modes match.
31 IMPELLER_FOR_EACH_BLEND_MODE(_IMPELLER_ASSERT_BLEND_MODE)
32 // Ensure the total number of blend modes match.
33 if (i - 1 !=
34 static_cast<std::underlying_type_t<BlendMode>>(BlendMode::kLast)) {
35 return false;
36 }
37 return true;
38 }

References _IMPELLER_ASSERT_BLEND_MODE, IMPELLER_FOR_EACH_BLEND_MODE, and kLast.

## ◆ VendorToString()

constexpr const char* impeller::VendorToString | ( | VendorVK | vendor | ) |
| constexpr

Definition at line 182 of file driver_info_vk.cc.

182 {
183 switch (vendor) {
184 case VendorVK::kUnknown:
185 return "Unknown";
186 case VendorVK::kGoogle:
187 return "Google";
188 case VendorVK::kQualcomm:
189 return "Qualcomm";
190 case VendorVK::kARM:
191 return "ARM";
192 case VendorVK::kImgTec:
193 return "ImgTec PowerVR";
194 case VendorVK::kAMD:
195 return "AMD";
196 case VendorVK::kNvidia:
197 return "Nvidia";
198 case VendorVK::kIntel:
199 return "Intel";
200 case VendorVK::kMesa:
201 return "Mesa";
202 case VendorVK::kApple:
203 return "Apple";
204 case VendorVK::kHuawei:
205 return "Huawei";
206 case VendorVK::kSamsung:
207 return "Samsung";
208 }
209 FML_UNREACHABLE();
210 }

References kAMD, kApple, kARM, kGoogle, kHuawei, kImgTec, kIntel, kMesa, kNvidia, kQualcomm, kSamsung, and kUnknown.

Referenced by impeller::DriverInfoVK::DumpToLog().

## ◆ VKClearValueFromColor()

static vk::ClearColorValue impeller::VKClearValueFromColor | ( | Color | color | ) |
| static

Definition at line 36 of file render_pass_vk.cc.

36 {
37 vk::ClearColorValue value;
38 value.setFloat32(
39 std::array<float, 4>{color.red, color.green, color.blue, color.alpha});
40 return value;
41 }

References impeller::Color::alpha, impeller::Color::blue, impeller::Color::green, impeller::Color::red, and value.

Referenced by GetVKClearValues().

## ◆ VKClearValueFromDepthStencil()

static vk::ClearDepthStencilValue impeller::VKClearValueFromDepthStencil | ( | uint32_t | stencil,
|  | Scalar | depth
| ) |  |
| static

Definition at line 43 of file render_pass_vk.cc.

44 {
45 vk::ClearDepthStencilValue value;
46 value.depth = depth;
47 value.stencil = stencil;
48 return value;
49 }

References value.

Referenced by GetVKClearValues().

## ◆ VkFormatToImpellerFormat()

constexpr std::optional<PixelFormat> impeller::VkFormatToImpellerFormat | ( | vk::Format | format | ) |
| constexpr

Definition at line 20 of file formats_vk.h.

21 {
22 switch (format) {
23 case vk::Format::eR8G8B8A8Unorm:
24 return PixelFormat::kR8G8B8A8UNormInt;
25 case vk::Format::eB8G8R8A8Unorm:
26 return PixelFormat::kB8G8R8A8UNormInt;
27 default:
28 return std::nullopt;
29 }
30 }

References kB8G8R8A8UNormInt, and kR8G8B8A8UNormInt.

## ◆ VKShaderNameToShaderKeyName()

static std::string impeller::VKShaderNameToShaderKeyName | ( | const std::string & | name,
|  | ShaderStage | stage
| ) |  |
| static

Definition at line 29 of file shader_library_vk.cc.

30 {
31 std::stringstream stream;
32 stream << name;
33 switch (stage) {
34 case ShaderStage::kUnknown:
35 stream << "_unknown_";
36 break;
37 case ShaderStage::kVertex:
38 stream << "_vertex_";
39 break;
40 case ShaderStage::kFragment:
41 stream << "_fragment_";
42 break;
43 case ShaderStage::kCompute:
44 stream << "_compute_";
45 break;
46 }
47 stream << "main";
48 return stream.str();
49 }

References kCompute, kFragment, kUnknown, and kVertex.

## ◆ WrapInput()

std::shared_ptr< FilterContents > impeller::WrapInput | ( | const flutter::DlImageFilter * | filter,
|  | const FilterInput::Ref & | input
| ) |  |

Generate a new FilterContents using this filter's configuration.

Definition at line 17 of file image_filter.cc.

18 {
19 FML_DCHECK(filter);
20
21 switch (filter->type()) {
22 case flutter::DlImageFilterType::kBlur: {
23 auto blur_filter = filter->asBlur();
24 FML_DCHECK(blur_filter);
25
26 return FilterContents::MakeGaussianBlur(
27 input, //
28 Sigma(blur_filter->sigma_x()), //
29 Sigma(blur_filter->sigma_y()), //
30 static_cast<Entity::TileMode>(blur_filter->tile_mode()), //
31 FilterContents::BlurStyle::kNormal //
32 );
33 }
34 case flutter::DlImageFilterType::kDilate: {
35 auto dilate_filter = filter->asDilate();
36 FML_DCHECK(dilate_filter);
37
38 return FilterContents::MakeMorphology(
39 input, //
40 Radius(dilate_filter->radius_x()), //
41 Radius(dilate_filter->radius_y()), //
42 FilterContents::MorphType::kDilate //
43 );
44 }
45 case flutter::DlImageFilterType::kErode: {
46 auto erode_filter = filter->asErode();
47 FML_DCHECK(erode_filter);
48
49 return FilterContents::MakeMorphology(
50 input, //
51 Radius(erode_filter->radius_x()), //
52 Radius(erode_filter->radius_y()), //
53 FilterContents::MorphType::kErode //
54 );
55 }
56 case flutter::DlImageFilterType::kMatrix: {
57 auto matrix_filter = filter->asMatrix();
58 FML_DCHECK(matrix_filter);
59
60 auto matrix = matrix_filter->matrix();
61 auto desc =
62 skia_conversions::ToSamplerDescriptor(matrix_filter->sampling());
63 return FilterContents::MakeMatrixFilter(input, matrix, desc);
64 }
65 case flutter::DlImageFilterType::kLocalMatrix: {
66 auto matrix_filter = filter->asLocalMatrix();
67 FML_DCHECK(matrix_filter);
68 FML_DCHECK(matrix_filter->image_filter());
69
70 auto matrix = matrix_filter->matrix();
71 return FilterContents::MakeLocalMatrixFilter(
72 FilterInput::Make(
73 WrapInput(matrix_filter->image_filter().get(), input)),
74 matrix);
75 }
76 case flutter::DlImageFilterType::kColorFilter: {
77 auto image_color_filter = filter->asColorFilter();
78 FML_DCHECK(image_color_filter);
79 auto color_filter = image_color_filter->color_filter();
80 FML_DCHECK(color_filter);
81
82 // When color filters are used as image filters, set the color filter's
83 // "absorb opacity" flag to false. For image filters, the snapshot
84 // opacity needs to be deferred until the result of the filter chain is
85 // being blended with the layer.
86 return WrapWithGPUColorFilter(color_filter.get(), input,
87 ColorFilterContents::AbsorbOpacity::kNo);
88 }
89 case flutter::DlImageFilterType::kCompose: {
90 auto compose = filter->asCompose();
91 FML_DCHECK(compose);
92
93 auto outer_dl_filter = compose->outer();
94 auto inner_dl_filter = compose->inner();
95 if (!outer_dl_filter) {
96 return WrapInput(inner_dl_filter.get(), input);
97 }
98 if (!inner_dl_filter) {
99 return WrapInput(outer_dl_filter.get(), input);
100 }
101 FML_DCHECK(outer_dl_filter && inner_dl_filter);
102
103 return WrapInput(
104 outer_dl_filter.get(),
105 FilterInput::Make(WrapInput(inner_dl_filter.get(), input)));
106 }
107 case flutter::DlImageFilterType::kRuntimeEffect: {
108 const flutter::DlRuntimeEffectImageFilter* runtime_filter =
109 filter->asRuntimeEffectFilter();
110 FML_DCHECK(runtime_filter);
111 std::shared_ptr<impeller::RuntimeStage> runtime_stage =
112 runtime_filter->runtime_effect()->runtime_stage();
113
114 std::vector<RuntimeEffectContents::TextureInput> texture_inputs;
115 size_t index = 0;
116 for (const std::shared_ptr<flutter::DlColorSource>& sampler :
117 runtime_filter->samplers()) {
118 if (index == 0 && sampler == nullptr) {
119 // Insert placeholder for filter.
120 texture_inputs.push_back(
121 {.sampler_descriptor = skia_conversions::ToSamplerDescriptor({}),
122 .texture = nullptr});
123 continue;
124 }
125 if (sampler == nullptr) {
126 return nullptr;
127 }
128 auto* image = sampler->asImage();
129 if (!image) {
130 return nullptr;
131 }
132 FML_DCHECK(image->image()->impeller_texture());
133 index++;
134 texture_inputs.push_back({
135 .sampler_descriptor =
136 skia_conversions::ToSamplerDescriptor(image->sampling()),
137 .texture = image->image()->impeller_texture(),
138 });
139 }
140 return FilterContents::MakeRuntimeEffect(input, std::move(runtime_stage),
141 runtime_filter->uniform_data(),
142 std::move(texture_inputs));
143 }
144 }
145 FML_UNREACHABLE();
146 }

References impeller::FilterContents::kDilate, impeller::FilterContents::kErode, impeller::ColorFilterContents::kNo, impeller::FilterContents::kNormal, impeller::FilterInput::Make(), impeller::FilterContents::MakeGaussianBlur(), impeller::FilterContents::MakeLocalMatrixFilter(), impeller::FilterContents::MakeMatrixFilter(), impeller::FilterContents::MakeMorphology(), impeller::FilterContents::MakeRuntimeEffect(), impeller::skia_conversions::ToSamplerDescriptor(), and WrapWithGPUColorFilter().

Referenced by impeller::Canvas::SaveLayer(), and impeller::Paint::WithImageFilter().

## ◆ WrappedResolver()

ProcTableGLES::Resolver impeller::WrappedResolver | ( | const ProcTableGLES::Resolver & | resolver | ) |

Definition at line 52 of file proc_table_gles.cc.

53 {
54 return [resolver](const char* function_name) -> void* {
55 auto resolved = resolver(function_name);
56 if (resolved) {
57 return resolved;
58 }
59 // If there are certain known suffixes (usually for extensions), strip them
60 // out and try to resolve the same proc addresses again.
61 auto function = std::string{function_name};
62 if (function.find("KHR", function.size() - 3) != std::string::npos) {
63 auto truncated = function.substr(0u, function.size() - 3);
64 return resolver(truncated.c_str());
65 }
66 if (function.find("EXT", function.size() - 3) != std::string::npos) {
67 auto truncated = function.substr(0u, function.size() - 3);
68 return resolver(truncated.c_str());
69 }
70 return nullptr;
71 };
72 }

Referenced by impeller::ProcTableGLES::ProcTableGLES().

## ◆ WrapperMTL()

std::shared_ptr<Texture> impeller::WrapperMTL | ( | TextureDescriptor | desc,
|  | const void * | mtl_texture,
|  | std::function< void()> | deletion_proc
| ) |  |

Definition at line 15 of file texture_mtl.mm.

17 {
18 return TextureMTL::Wrapper(desc, (__bridge id<MTLTexture>)mtl_texture,
19 std::move(deletion_proc));
20 }

References impeller::TextureMTL::Wrapper().

## ◆ WrapTextureMTL()

std::shared_ptr< Texture > impeller::WrapTextureMTL | ( | TextureDescriptor | desc,
|  | const void * | mtl_texture,
|  | std::function< void()> | deletion_proc = `nullptr`
| ) |  |

Definition at line 14 of file texture_wrapper_mtl.mm.

16 {
17 auto texture = (__bridge id<MTLTexture>)mtl_texture;
18 desc.format = FromMTLPixelFormat(texture.pixelFormat);
19 return TextureMTL::Wrapper(desc, texture, std::move(deletion_proc));
20 }

References impeller::TextureDescriptor::format, FromMTLPixelFormat(), and impeller::TextureMTL::Wrapper().

## ◆ WrapTextureWithRenderTarget()

static std::optional<RenderTarget> impeller::WrapTextureWithRenderTarget | ( | const std::shared_ptr< SwapchainTransientsMTL > & | transients,
|  | id< MTLTexture > | texture,
|  | bool | requires_blit,
|  | std::optional< IRect > | clip_rect
| ) |  |
| static

Definition at line 51 of file surface_mtl.mm.

55 {
56 ISize root_size = {static_cast<ISize::Type>(texture.width),
57 static_cast<ISize::Type>(texture.height)};
58 PixelFormat format = FromMTLPixelFormat(texture.pixelFormat);
59 if (format == PixelFormat::kUnknown) {
60 VALIDATION_LOG << "Unknown drawable color format.";
61 return std::nullopt;
62 }
63
64 transients->SetSizeAndFormat(root_size, format);
65
66 TextureDescriptor resolve_tex_desc;
67 resolve_tex_desc.format = FromMTLPixelFormat(texture.pixelFormat);
68 resolve_tex_desc.size = root_size;
69 resolve_tex_desc.usage =
70 TextureUsage::kRenderTarget | TextureUsage::kShaderRead;
71 resolve_tex_desc.sample_count = SampleCount::kCount1;
72 resolve_tex_desc.storage_mode = StorageMode::kDevicePrivate;
73
74 // Create color resolve texture.
75 std::shared_ptr<Texture> resolve_tex;
76 if (requires_blit) {
77 resolve_tex = transients->GetResolveTexture();
78 } else {
79 resolve_tex = TextureMTL::Create(resolve_tex_desc, texture);
80 }
81
82 ColorAttachment color0;
83 color0.texture = transients->GetMSAATexture();
84 color0.clear_color = Color::DarkSlateGray();
85 color0.load_action = LoadAction::kClear;
86 color0.store_action = StoreAction::kMultisampleResolve;
87 color0.resolve_texture = std::move(resolve_tex);
88
89 DepthAttachment depth0;
90 depth0.load_action =
91 RenderTarget::kDefaultStencilAttachmentConfig.load_action;
92 depth0.store_action =
93 RenderTarget::kDefaultStencilAttachmentConfig.store_action;
94 depth0.clear_depth = 0u;
95 depth0.texture = transients->GetDepthStencilTexture();
96
97 StencilAttachment stencil0;
98 stencil0.load_action =
99 RenderTarget::kDefaultStencilAttachmentConfig.load_action;
100 stencil0.store_action =
101 RenderTarget::kDefaultStencilAttachmentConfig.store_action;
102 stencil0.clear_stencil = 0u;
103 stencil0.texture = transients->GetDepthStencilTexture();
104
105 RenderTarget render_target;
106 render_target.SetColorAttachment(color0, 0u);
107 render_target.SetDepthAttachment(std::move(depth0));
108 render_target.SetStencilAttachment(std::move(stencil0));
109
110 return render_target;
111 }

References impeller::ColorAttachment::clear_color, impeller::DepthAttachment::clear_depth, impeller::StencilAttachment::clear_stencil, impeller::TextureMTL::Create(), impeller::Color::DarkSlateGray(), impeller::TextureDescriptor::format, FromMTLPixelFormat(), kClear, kCount1, impeller::RenderTarget::kDefaultStencilAttachmentConfig, kDevicePrivate, kMultisampleResolve, kRenderTarget, kShaderRead, kUnknown, impeller::RenderTarget::AttachmentConfig::load_action, impeller::Attachment::load_action, impeller::Attachment::resolve_texture, impeller::TextureDescriptor::sample_count, impeller::RenderTarget::SetColorAttachment(), impeller::RenderTarget::SetDepthAttachment(), impeller::RenderTarget::SetStencilAttachment(), impeller::TextureDescriptor::size, impeller::TextureDescriptor::storage_mode, impeller::RenderTarget::AttachmentConfig::store_action, impeller::Attachment::store_action, impeller::Attachment::texture, impeller::TextureDescriptor::usage, and VALIDATION_LOG.

Referenced by impeller::SurfaceMTL::MakeFromTexture().

## ◆ WrapWithGPUColorFilter()

std::shared_ptr< ColorFilterContents > impeller::WrapWithGPUColorFilter | ( | const flutter::DlColorFilter * | filter,
|  | const std::shared_ptr< FilterInput > & | input,
|  | ColorFilterContents::AbsorbOpacity | absorb_opacity
| ) |  |

Definition at line 24 of file color_filter.cc.

27 {
28 FML_DCHECK(filter);
29
30 switch (filter->type()) {
31 case flutter::DlColorFilterType::kBlend: {
32 const flutter::DlBlendColorFilter* blend_filter = filter->asBlend();
33 FML_DCHECK(blend_filter);
34
35 auto filter = ColorFilterContents::MakeBlend(
36 static_cast<BlendMode>(blend_filter->mode()), {input},
37 skia_conversions::ToColor(blend_filter->color()));
38 filter->SetAbsorbOpacity(absorb_opacity);
39 return filter;
40 }
41 case flutter::DlColorFilterType::kMatrix: {
42 const flutter::DlMatrixColorFilter* matrix_filter = filter->asMatrix();
43 FML_DCHECK(matrix_filter);
44
45 impeller::ColorMatrix color_matrix;
46 matrix_filter->get_matrix(color_matrix.array);
47 auto filter = ColorFilterContents::MakeColorMatrix({input}, color_matrix);
48 filter->SetAbsorbOpacity(absorb_opacity);
49 return filter;
50 }
51 case flutter::DlColorFilterType::kSrgbToLinearGamma: {
52 auto filter = ColorFilterContents::MakeSrgbToLinearFilter({input});
53 filter->SetAbsorbOpacity(absorb_opacity);
54 return filter;
55 }
56 case flutter::DlColorFilterType::kLinearToSrgbGamma: {
57 auto filter = ColorFilterContents::MakeLinearToSrgbFilter({input});
58 filter->SetAbsorbOpacity(absorb_opacity);
59 return filter;
60 }
61 }
62
63 FML_UNREACHABLE();
64 }

References impeller::ColorMatrix::array, impeller::ColorFilterContents::MakeBlend(), impeller::ColorFilterContents::MakeColorMatrix(), impeller::ColorFilterContents::MakeLinearToSrgbFilter(), impeller::ColorFilterContents::MakeSrgbToLinearFilter(), and impeller::skia_conversions::ToColor().

Referenced by impeller::Paint::CreateContents(), impeller::Paint::MaskBlurDescriptor::CreateMaskBlur(), and WrapInput().

## ◆ WrapWithInvertColors()

std::shared_ptr< ColorFilterContents > impeller::WrapWithInvertColors | ( | const std::shared_ptr< FilterInput > & | input,
|  | ColorFilterContents::AbsorbOpacity | absorb_opacity
| ) |  |

Definition at line 16 of file color_filter.cc.

18 {
19 auto filter = ColorFilterContents::MakeColorMatrix({input}, kColorInversion);
20 filter->SetAbsorbOpacity(absorb_opacity);
21 return filter;
22 }

References kColorInversion, and impeller::ColorFilterContents::MakeColorMatrix().

Referenced by impeller::Paint::CreateContents(), and impeller::Paint::MaskBlurDescriptor::CreateMaskBlur().

## Variable Documentation

## ◆ g_all_pools_map_mutex

Mutex impeller::g_all_pools_map_mutex
| static

Definition at line 172 of file command_pool_vk.cc.

Referenced by impeller::CommandPoolRecyclerVK::DestroyThreadLocalPools(), and impeller::CommandPoolRecyclerVK::Get().

## ◆ gHasValidationLayers

bool impeller::gHasValidationLayers = false
| static

Definition at line 51 of file context_vk.cc.

Referenced by HasValidationLayers().

## ◆ gShouldOpenNewPlaygrounds

std::atomic_bool impeller::gShouldOpenNewPlaygrounds = true
| static

Definition at line 162 of file playground.cc.

Referenced by PlaygroundKeyCallback(), and impeller::Playground::ShouldOpenNewPlaygrounds().

## ◆ k1OverPi

constexpr float impeller::k1OverPi = 0.31830988618379067154f
| constexpr

Definition at line 38 of file constants.h.

## ◆ k1OverSqrt2

constexpr float impeller::k1OverSqrt2 = 0.70710678118654752440f
| constexpr

Definition at line 50 of file constants.h.

Referenced by impeller::testing::TEST(), and impeller::testing::TEST_P().

## ◆ k2OverPi

constexpr float impeller::k2OverPi = 0.63661977236758134308f
| constexpr

Definition at line 41 of file constants.h.

## ◆ k2OverSqrtPi

constexpr float impeller::k2OverSqrtPi = 1.12837916709551257390f
| constexpr

Definition at line 44 of file constants.h.

## ◆ k2Pi

constexpr float impeller::k2Pi = 6.28318530717958647693f
| constexpr

Definition at line 29 of file constants.h.

Referenced by impeller::PathBuilder::AddArc(), impeller::testing::TEST(), and impeller::testing::TEST_P().

## ◆ kAdrenoVersions

const std::unordered_map<std::string_view, AdrenoGPU> impeller::kAdrenoVersions

Definition at line 16 of file driver_info_vk.cc.

Referenced by GetAdrenoVersion().

## ◆ kAlloc

const TESSalloc impeller::kAlloc
| static

Initial value:
= {
HeapAlloc, HeapRealloc, HeapFree, 0,
16,
16,
16,
16,
16,
0
}

Definition at line 24 of file tessellator_libtess.cc.

Referenced by impeller::TessellatorLibtess::TessellatorLibtess().

## ◆ kAllocatorBlockSize

constexpr size_t impeller::kAllocatorBlockSize = 1024000
| constexpr

Definition at line 19 of file host_buffer.cc.

## ◆ kAngleInputAttachmentPrefix

constexpr std::string_view impeller::kAngleInputAttachmentPrefix
| static constexpr

Initial value:
=
"ANGLEInputAttachment"

Definition at line 24 of file buffer_bindings_gles.cc.

## ◆ kBlendModeNames

constexpr const char* impeller::kBlendModeNames[]
| static constexpr

Initial value:
= {
IMPELLER_FOR_EACH_BLEND_MODE(_IMPELLER_BLEND_MODE_NAME_LIST)}

Definition at line 44 of file color.cc.

Referenced by BlendModeToString().

## ◆ kColorInversion

const constexpr ColorMatrix impeller::kColorInversion
| static constexpr

Initial value:
= {
.array = {
-1.0, 0, 0, 1.0, 0,
0, -1.0, 0, 1.0, 0,
0, 0, -1.0, 1.0, 0,
1.0, 1.0, 1.0, 1.0, 0
}
}

A color matrix which inverts colors.

Definition at line 16 of file color_filter.h.

Referenced by WrapWithInvertColors().

## ◆ kDefaultBindingSize

const constexpr DescriptorPoolSize impeller::kDefaultBindingSize
| static constexpr

Initial value:
=
DescriptorPoolSize{
.buffer_bindings = 512u,
.texture_bindings = 256u,
.storage_bindings = 32,
.subpass_bindings = 4u
}

Descriptor pools are always allocated with the following sizes.

Definition at line 24 of file descriptor_pool_vk.cc.

## ◆ kE

constexpr float impeller::kE = 2.7182818284590452354f
| constexpr

Definition at line 11 of file constants.h.

## ◆ kEhCloseEnough

constexpr float impeller::kEhCloseEnough = 1e-3f
| constexpr

Definition at line 56 of file constants.h.

Referenced by impeller::Color::Blend(), ClipColor(), impeller::SolidRRectBlurContents::Render(), impeller::TextureContents::RenderToSnapshot(), impeller::Tessellator::RoundCapLine(), impeller::skia_conversions::SkScalarsNearlyEqual(), and impeller::testing::TEST().

## ◆ kEmptyResult

const GeometryResult impeller::kEmptyResult
| static

Initial value:
= {
.vertex_buffer =
{
.index_type = IndexType::kNone,
},
}

Definition at line 43 of file geometry.h.

## ◆ kFramebufferFetchExt

const constexpr char* impeller::kFramebufferFetchExt
| static constexpr

Initial value:
=
"GL_EXT_shader_framebuffer_fetch"

Definition at line 13 of file capabilities_gles.cc.

Referenced by impeller::CapabilitiesGLES::CapabilitiesGLES().

## ◆ kGaussianBlurMaxKernelSize

constexpr int32_t impeller::kGaussianBlurMaxKernelSize = 50
| static constexpr

Definition at line 17 of file gaussian_blur_filter_contents.h.

Referenced by LerpHackKernelSamples(), and impeller::testing::TEST().

## ◆ kHostBufferArenaSize

const constexpr size_t impeller::kHostBufferArenaSize = 4u
| static constexpr

Approximately the same size as the max frames in flight.

Definition at line 22 of file host_buffer.h.

Referenced by impeller::HostBuffer::Reset().

## ◆ kImageSizeThresholdForDedicatedMemoryAllocation

constexpr size_t impeller::kImageSizeThresholdForDedicatedMemoryAllocation
| constexpr

Initial value:
=
4 * 1024 * 1024

Definition at line 12 of file limits_vk.h.

## ◆ kInstanceLayer

constexpr const char* impeller::kInstanceLayer = "ImpellerInstance"
| static constexpr

Definition at line 17 of file capabilities_vk.cc.

Referenced by impeller::CapabilitiesVK::CapabilitiesVK().

## ◆ kKernelRadiusPerSigma

constexpr static float impeller::kKernelRadiusPerSigma = 1.73205080757
| static constexpr

For filters that use a Gaussian distribution, this is the `Radius` size to use per `Sigma` (standard deviation).

This cutoff (sqrt(3)) is taken from Flutter and Skia (where the multiplicative inverse of this constant is used (1 / sqrt(3)): https://api.flutter.dev/flutter/dart-ui/Shadow/convertRadiusToSigma.html

In practice, this value is somewhat arbitrary, and can be changed to a higher number to integrate more of the Gaussian function and render higher quality blurs (with exponentially diminishing returns for the same sigma input). Making this value any lower results in a noticable loss of quality in the blur.

Definition at line 24 of file sigma.h.

Referenced by impeller::Sigma::operator Radius(), and impeller::Radius::operator Sigma().

## ◆ kLog10E

constexpr float impeller::kLog10E = 0.43429448190325182765f
| constexpr

Definition at line 17 of file constants.h.

## ◆ kLog2E

constexpr float impeller::kLog2E = 1.4426950408889634074f
| constexpr

Definition at line 14 of file constants.h.

## ◆ kLogE10

constexpr float impeller::kLogE10 = 2.30258509299404568402f
| constexpr

Definition at line 23 of file constants.h.

## ◆ kLogE2

constexpr float impeller::kLogE2 = 0.69314718055994530942f
| constexpr

Definition at line 20 of file constants.h.

## ◆ kMagicSubpassInputBinding

constexpr size_t impeller::kMagicSubpassInputBinding = 64u
| static constexpr

Definition at line 34 of file render_pass_vk.cc.

## ◆ kMaliVersions

const std::unordered_map<std::string_view, MaliGPU> impeller::kMaliVersions

Definition at line 71 of file driver_info_vk.cc.

Referenced by GetMaliVersion().

## ◆ kMatrixBT601FullRange

constexpr Matrix impeller::kMatrixBT601FullRange
| constexpr

Initial value:
= {
1.0, 1.0, 1.0, 0.0,
0.0, -0.344, 1.772, 0.0,
1.402, -0.714, 0.0, 0.0,
0.0, 0.0, 0.0, 1.0
}

Definition at line 24 of file yuv_to_rgb_filter_contents.cc.

## ◆ kMatrixBT601LimitedRange

constexpr Matrix impeller::kMatrixBT601LimitedRange
| constexpr

Initial value:
= {
1.164, 1.164, 1.164, 0.0,
0.0, -0.392, 2.017, 0.0,
1.596, -0.813, 0.0, 0.0,
0.0, 0.0, 0.0, 1.0
}

Definition at line 17 of file yuv_to_rgb_filter_contents.cc.

## ◆ kMaxAttachments

constexpr size_t impeller::kMaxAttachments
| static constexpr

Initial value:
=
(kMaxColorAttachments * 2) + 1

Definition at line 18 of file render_pass_builder_vk.h.

## ◆ kMaxBindings

constexpr size_t impeller::kMaxBindings = 32
| static constexpr

Definition at line 26 of file pipeline_vk.h.

## ◆ kMaxColorAttachments

constexpr size_t impeller::kMaxColorAttachments = 16
| static constexpr

Definition at line 17 of file render_pass_builder_vk.h.

## ◆ kMaxFramesInFlight

constexpr size_t impeller::kMaxFramesInFlight = 2u
| static constexpr

Definition at line 21 of file khr_swapchain_impl_vk.cc.

## ◆ kMaxPendingPresents

constexpr const size_t impeller::kMaxPendingPresents = 3u
| static constexpr

The maximum number of presents pending in the compositor after which the acquire calls will block. This value is 2 images given to the system compositor and one for the raster thread, Because the semaphore is acquired when the CPU begins working on the texture

Definition at line 23 of file ahb_swapchain_impl_vk.cc.

Referenced by impeller::AHBSwapchainImplVK::AcquireNextDrawable().

## ◆ kMaxUniformGradientStops

constexpr uint32_t impeller::kMaxUniformGradientStops = 256u
| static constexpr

Definition at line 47 of file gradient_generator.h.

Referenced by PopulateUniformGradientColors(), impeller::ConicalGradientContents::Render(), impeller::RadialGradientContents::Render(), impeller::LinearGradientContents::Render(), and impeller::SweepGradientContents::Render().

## ◆ kMaxVertexBuffers

constexpr size_t impeller::kMaxVertexBuffers = 16
| constexpr

Definition at line 13 of file vertex_buffer.h.

Referenced by impeller::RenderPass::ValidateVertexBuffers().

## ◆ kMinStrokeSize

constexpr Scalar impeller::kMinStrokeSize = 1.0f
| static constexpr

Definition at line 19 of file geometry.h.

Referenced by impeller::LineGeometry::ComputePixelHalfWidth(), and impeller::Geometry::ComputeStrokeAlphaCoverage().

## ◆ kMultisampledRenderToTexture2Ext

const constexpr char* impeller::kMultisampledRenderToTexture2Ext
| static constexpr

Initial value:
=
"GL_EXT_multisampled_render_to_texture2"

Definition at line 26 of file capabilities_gles.cc.

Referenced by impeller::CapabilitiesGLES::CapabilitiesGLES().

## ◆ kMultisampledRenderToTextureExt

const constexpr char* impeller::kMultisampledRenderToTextureExt
| static constexpr

Initial value:
=
"GL_EXT_multisampled_render_to_texture"

Definition at line 22 of file capabilities_gles.cc.

Referenced by impeller::CapabilitiesGLES::CapabilitiesGLES().

## ◆ kNullGlyphAtlas

const std::shared_ptr<GlyphAtlas> impeller::kNullGlyphAtlas = nullptr
| static

Definition at line 18 of file lazy_glyph_atlas.cc.

Referenced by impeller::LazyGlyphAtlas::CreateOrGetGlyphAtlas().

## ◆ kNvidiaTextureBorderClampExt

const constexpr char* impeller::kNvidiaTextureBorderClampExt
| static constexpr

Initial value:
=
"GL_NV_texture_border_clamp"

Definition at line 18 of file capabilities_gles.cc.

Referenced by impeller::CapabilitiesGLES::CapabilitiesGLES().

## ◆ kPadding

constexpr auto impeller::kPadding = 2
| constexpr

Definition at line 49 of file typographer_context_skia.cc.

Referenced by AppendToExistingAtlas(), and PairsFitInAtlasOfSize().

## ◆ kPhi

constexpr float impeller::kPhi = 1.61803398874989484820f
| constexpr

Definition at line 53 of file constants.h.

Referenced by impeller::testing::TEST_P().

## ◆ kPi

constexpr float impeller::kPi = 3.14159265358979323846f
| constexpr

Definition at line 26 of file constants.h.

Referenced by impeller::Degrees::operator Radians(), impeller::testing::TEST(), and impeller::testing::TEST_P().

## ◆ kPiOver2

constexpr float impeller::kPiOver2 = 1.57079632679489661923f
| constexpr

Definition at line 32 of file constants.h.

Referenced by impeller::PathBuilder::AddArc(), impeller::testing::TEST(), and impeller::testing::TEST_P().

## ◆ kPiOver4

constexpr float impeller::kPiOver4 = 0.78539816339744830962f
| constexpr

Definition at line 35 of file constants.h.

Referenced by ComputeQuadrantDivisions(), and impeller::testing::TEST().

## ◆ kPipelineCacheFileName

constexpr const char* impeller::kPipelineCacheFileName
| static constexpr

Initial value:
=
"flutter.impeller.vkcache"

Definition at line 13 of file pipeline_cache_data_vk.cc.

Referenced by PipelineCacheDataPersist(), and PipelineCacheDataRetrieve().

## ◆ kPointArenaSize

constexpr size_t impeller::kPointArenaSize = 4096u
| static constexpr

The size of the point arena buffer stored on the tessellator.

Definition at line 22 of file tessellator.h.

Referenced by impeller::testing::TEST_P().

## ◆ kPoolSize

constexpr uint32_t impeller::kPoolSize = 128u
| static constexpr

Definition at line 20 of file gpu_tracer_vk.cc.

Referenced by impeller::GPUTracerVK::InitializeQueryPool().

## ◆ kPorterDuffCoefficients

constexpr std::array<std::array<Scalar, 5>, 15> impeller::kPorterDuffCoefficients
| constexpr

Initial value:
= {{
{0, 0, 0, 0, 0},
{1, 0, 0, 0, 0},
{0, 0, 1, 0, 0},
{1, 0, 1, -1, 0},
{1, -1, 1, 0, 0},
{0, 1, 0, 0, 0},
{0, 0, 0, 1, 0},
{1, -1, 0, 0, 0},
{0, 0, 1, -1, 0},
{0, 1, 1, -1, 0},
{1, -1, 0, 1, 0},
{1, -1, 1, -1, 0},
{1, 0, 1, 0, 0},
{0, 0, 0, 0, 1},
{0, 0, 1, 0, -1},
}}

Definition at line 15 of file blend_filter_contents.h.

## ◆ kPrecomputedDivisionCount

constexpr int impeller::kPrecomputedDivisionCount = 1024
| static constexpr

Definition at line 176 of file tessellator.cc.

Referenced by ComputeQuadrantDivisions().

## ◆ kPrecomputedDivisions

int impeller::kPrecomputedDivisions[kPrecomputedDivisionCount]
| static

Definition at line 177 of file tessellator.cc.

Referenced by ComputeQuadrantDivisions().

## ◆ kSelfDependencyDstAccessMask

constexpr auto impeller::kSelfDependencyDstAccessMask
| constexpr

Initial value:
=
vk::AccessFlagBits::eInputAttachmentRead

Definition at line 19 of file render_pass_builder_vk.cc.

Referenced by impeller::RenderPassBuilderVK::Build(), and InsertBarrierForInputAttachmentRead().

## ◆ kSelfDependencyDstStageMask

constexpr auto impeller::kSelfDependencyDstStageMask
| constexpr

Initial value:
=
vk::PipelineStageFlagBits::eFragmentShader

Definition at line 17 of file render_pass_builder_vk.cc.

Referenced by impeller::RenderPassBuilderVK::Build(), and InsertBarrierForInputAttachmentRead().

## ◆ kSelfDependencyFlags

constexpr auto impeller::kSelfDependencyFlags = vk::DependencyFlagBits::eByRegion
| constexpr

Definition at line 22 of file render_pass_builder_vk.cc.

Referenced by impeller::RenderPassBuilderVK::Build(), and InsertBarrierForInputAttachmentRead().

## ◆ kSelfDependencySrcAccessMask

constexpr auto impeller::kSelfDependencySrcAccessMask
| constexpr

Initial value:
=
vk::AccessFlagBits::eColorAttachmentWrite

Definition at line 14 of file render_pass_builder_vk.cc.

Referenced by impeller::RenderPassBuilderVK::Build(), and InsertBarrierForInputAttachmentRead().

## ◆ kSelfDependencySrcStageMask

constexpr auto impeller::kSelfDependencySrcStageMask
| constexpr

Initial value:
=
vk::PipelineStageFlagBits::eColorAttachmentOutput

Definition at line 12 of file render_pass_builder_vk.cc.

Referenced by impeller::RenderPassBuilderVK::Build(), and InsertBarrierForInputAttachmentRead().

## ◆ kSkipTests

const std::vector<std::string> impeller::kSkipTests
| static

Initial value:
= {
IMP_AIKSTEST(TextRotated),
"impeller_Play_AiksTest_CanRenderClippedRuntimeEffects_Vulkan",
}

Definition at line 69 of file golden_playground_test_mac.cc.

Referenced by impeller::GoldenPlaygroundTest::SetUp().

## ◆ kSqrt2

constexpr float impeller::kSqrt2 = 1.41421356237309504880f
| constexpr

Definition at line 47 of file constants.h.

Referenced by SetupFragInfo(), and impeller::testing::TEST().

## ◆ kTextureBorderClampExt

const constexpr char* impeller::kTextureBorderClampExt
| static constexpr

Initial value:
=
"GL_EXT_texture_border_clamp"

Definition at line 16 of file capabilities_gles.cc.

Referenced by impeller::CapabilitiesGLES::CapabilitiesGLES().

## ◆ kTwoOverSqrtPi

Scalar impeller::kTwoOverSqrtPi = 2.0 / std::sqrt(kPi)
| static

Definition at line 57 of file solid_rrect_blur_contents.cc.

Referenced by computeErf7().

## ◆ kUnusedAttachmentReference

constexpr vk::AttachmentReference impeller::kUnusedAttachmentReference
| static constexpr

Initial value:
= {
VK_ATTACHMENT_UNUSED, vk::ImageLayout::eUndefined}

Definition at line 438 of file formats_vk.h.

Referenced by impeller::RenderPassBuilderVK::Build().

## ◆ sLastID

std::atomic_size_t impeller::sLastID
| static

Definition at line 11 of file comparable.cc.

## ◆ sValidationFailureCallback

ValidationFailureCallback impeller::sValidationFailureCallback
| static

Definition at line 15 of file validation.cc.

Referenced by ImpellerValidationBreak(), and ImpellerValidationErrorsSetCallback().

## ◆ sValidationLogsAreFatal

std::atomic_int32_t impeller::sValidationLogsAreFatal = 0
| static

Definition at line 14 of file validation.cc.

Referenced by ImpellerValidationErrorsAreFatal(), ImpellerValidationErrorsSetFatal(), impeller::ScopedValidationFatal::ScopedValidationFatal(), and impeller::ScopedValidationFatal::~ScopedValidationFatal().

## ◆ sValidationLogsDisabledCount

std::atomic_int32_t impeller::sValidationLogsDisabledCount = 0
| static

Definition at line 13 of file validation.cc.

Referenced by impeller::ScopedValidationDisable::ScopedValidationDisable(), impeller::ScopedValidationDisable::~ScopedValidationDisable(), and impeller::ValidationLog::~ValidationLog().

## ◆ tess

TessellatorLibtess impeller::tess
| static

Definition at line 38 of file geometry_benchmarks.cc.

## ◆ tls_command_pool_map

thread_local std::unique_ptr<CommandPoolMap> impeller::tls_command_pool_map
| static

Definition at line 168 of file command_pool_vk.cc.

Referenced by impeller::CommandPoolRecyclerVK::DestroyThreadLocalPools(), impeller::CommandPoolRecyclerVK::Dispose(), and impeller::CommandPoolRecyclerVK::Get().

impeller::AdrenoGPU::kAdreno685
@ kAdreno685
impeller::CanvasDlDispatcher
Definition: dl_dispatcher.h:253
impeller::ISize
ISize64 ISize
Definition: size.h:174
impeller::StoreAction::kMultisampleResolve
@ kMultisampleResolve
impeller::MaliGPU::kG51
@ kG51
impeller::PixelFormat::kS8UInt
@ kS8UInt
impeller::TextureType::kTextureExternalOES
@ kTextureExternalOES
impeller::MipFilter::kBase
@ kBase
The texture is sampled as if it only had a single mipmap level.
impeller::RequiredAndroidDeviceExtensionVK::kKHRExternalSemaphore
@ kKHRExternalSemaphore
impeller::BlendSelectValues::kSaturation
@ kSaturation
impeller::PipelineRef
raw_ptr< Pipeline< PipelineDescriptor > > PipelineRef
A raw ptr to a pipeline object.
Definition: pipeline.h:86
impeller::kFloat
@ kFloat
Definition: runtime_types.h:25
impeller::FromBytesTag::kFromBytes
@ kFromBytes
impeller::DeepComparePointer
bool DeepComparePointer(const std::shared_ptr< ComparableType > &lhs, const std::shared_ptr< ComparableType > &rhs)
Definition: comparable.h:57
impeller::OptionsFromPass
ContentContextOptions OptionsFromPass(const RenderPass &pass)
Definition: contents.cc:19
impeller::ToMTLColorWriteMask
constexpr MTLColorWriteMask ToMTLColorWriteMask(ColorWriteMask type)
Definition: formats_mtl.h:213
impeller::RuntimeStageBackend::kOpenGLES3
@ kOpenGLES3
impeller::RequiredAndroidDeviceExtensionVK::kKHRExternalSemaphoreFd
@ kKHRExternalSemaphoreFd
impeller::GetShaderType
static ShaderType GetShaderType(RuntimeUniformType type)
Definition: runtime_effect_contents.cc:74
impeller::MaliGPU::kG310
@ kG310
impeller::CompareFunction::kGreater
@ kGreater
Comparison test passes if new_value > current_value.
impeller::PrimitiveType::kLineStrip
@ kLineStrip
impeller::LoadAction::kLoad
@ kLoad
impeller::VKClearValueFromDepthStencil
static vk::ClearDepthStencilValue VKClearValueFromDepthStencil(uint32_t stencil, Scalar depth)
Definition: render_pass_vk.cc:43
impeller::HandleType::kRenderBuffer
@ kRenderBuffer
impeller::ConfigureStencil
void ConfigureStencil(const ProcTableGLES &gl, const PipelineDescriptor &pipeline, uint32_t stencil_reference)
Definition: render_pass_gles.cc:97
impeller::TextureUsage::kShaderWrite
@ kShaderWrite
impeller::BlendMode::kDestinationATop
@ kDestinationATop
impeller::ApplyBlendedColor
static constexpr Color ApplyBlendedColor(Color dst, Color src, Vector3 blend_result)
Definition: color.cc:124
impeller::StencilOperation::kDecrementClamp
@ kDecrementClamp
Decrement the current stencil value by 1. Clamp it to zero.
impeller::gHasValidationLayers
static bool gHasValidationLayers
Definition: context_vk.cc:51
polyline
const Path::Polyline & polyline
Definition: stroke_path_geometry.cc:311
impeller::ToVKColorComponentFlags
constexpr vk::ColorComponentFlags ToVKColorComponentFlags(ColorWriteMask type)
Definition: formats_vk.h:90
impeller::StoreAction::kStoreAndMultisampleResolve
@ kStoreAndMultisampleResolve
impeller::ColorToString
std::string ColorToString(const Color &color)
Definition: color.cc:333
impeller::AdrenoGPU::kAdreno530
@ kAdreno530
impeller::RequiredAndroidDeviceExtensionVK::kKHRExternalFence
@ kKHRExternalFence
impeller::ShaderType::kAtomicCounter
@ kAtomicCounter
impeller::ConfigureColorAttachment
static bool ConfigureColorAttachment(const ColorAttachment &desc, MTLRenderPassColorAttachmentDescriptor *attachment)
Definition: render_pass_mtl.mm:73
impeller::IndexType::k16bit
@ k16bit
impeller::PixelFormatToString
constexpr const char * PixelFormatToString(PixelFormat format)
Definition: formats.h:140
impeller::Scalar
float Scalar
Definition: scalar.h:18
impeller::BlendSelectValues::kColorBurn
@ kColorBurn
impeller::SamplerAddressMode::kDecal
@ kDecal
decal sampling mode is only supported on devices that pass the Capabilities.SupportsDecalSamplerAddre...
impeller::SourceRectConstraint::kFast
@ kFast
Faster, but may sample outside the bounds of the source rectangle.
impeller::ShaderType::kDouble
@ kDouble
impeller::ContentBoundsPromise::kMayClipContents
@ kMayClipContents
The caller claims the bounds are a subset of an estimate of the reasonably tight bounds but likely cl...
impeller::DeviceTypeVK::kDiscreteGPU
@ kDiscreteGPU
impeller::DrawGlyph
static void DrawGlyph(SkCanvas *canvas, const SkPoint position, const ScaledFont &scaled_font, const SubpixelGlyph &glyph, const Rect &scaled_bounds, const std::optional< GlyphProperties > &prop, bool has_color)
Definition: typographer_context_skia.cc:208
impeller::DeviceTypeVK::kIntegratedGPU
@ kIntegratedGPU
impeller::DefaultUniformAlignment
constexpr size_t DefaultUniformAlignment()
Definition: platform.h:14
impeller::sValidationLogsAreFatal
static std::atomic_int32_t sValidationLogsAreFatal
Definition: validation.cc:14
impeller::BlendSelectValues::kMultiply
@ kMultiply
impeller::ToVKSamplerAddressMode
constexpr vk::SamplerAddressMode ToVKSamplerAddressMode(SamplerAddressMode mode)
Definition: formats_vk.h:248
impeller::DeviceSupportsComputeSubgroups
static bool DeviceSupportsComputeSubgroups(id< MTLDevice > device)
Definition: context_mtl.mm:44
impeller::MaliGPU::kG610
@ kG610
impeller::PixelFormat::kB10G10R10A10XR
@ kB10G10R10A10XR
impeller::AdrenoGPU::kAdreno619L
@ kAdreno619L
impeller::PixelFormat::kB8G8R8A8UNormIntSRGB
@ kB8G8R8A8UNormIntSRGB
impeller::ConfigureStencilAttachment
static bool ConfigureStencilAttachment(const StencilAttachment &desc, MTLRenderPassStencilAttachmentDescriptor *attachment)
Definition: render_pass_mtl.mm:93
impeller::AdrenoGPU::kAdreno720
@ kAdreno720
impeller::MaliGPU::kT820
@ kT820
impeller::kSqrt2
constexpr float kSqrt2
Definition: constants.h:47
impeller::skia_conversions::ToPixelFormat
std::optional< impeller::PixelFormat > ToPixelFormat(SkColorType type)
Definition: skia_conversions.cc:100
impeller::SafeMTLPixelFormatBGRA10_XR
MTLPixelFormat SafeMTLPixelFormatBGRA10_XR()
Definition: formats_mtl.mm:138
impeller::PixelFormat::kA8UNormInt
@ kA8UNormInt
impeller::ToVKBlendFactor
constexpr vk::BlendFactor ToVKBlendFactor(BlendFactor factor)
Definition: formats_vk.h:42
impeller::AdrenoGPU::kAdreno644
@ kAdreno644
impeller::DeleteFBO
static void DeleteFBO(const ProcTableGLES &gl, GLuint fbo, GLenum type)
Definition: blit_command_gles.cc:43
impeller::BlendFactor::kSourceAlphaSaturated
@ kSourceAlphaSaturated
impeller::SamplerAddressMode::kMirror
@ kMirror
impeller::MyMaskBits::kBaz
@ kBaz
impeller::ReportPipelineCreationFeedbackToTrace
static void ReportPipelineCreationFeedbackToTrace(const PipelineDescriptor &desc, const vk::PipelineCreationFeedbackCreateInfoEXT &feedback)
Definition: pipeline_vk.cc:83
impeller::FillType::kOdd
@ kOdd
impeller::NearZero
static bool NearZero(Scalar a)
Definition: path_component.cc:374
external_format
GLenum external_format
Definition: blit_command_gles.cc:150
impeller::MaliGPU::kG710
@ kG710
impeller::compiler::SourceType::kUnknown
@ kUnknown
impeller::BlendMode
BlendMode
Definition: color.h:58
impeller::PixelFormat::kR8UNormInt
@ kR8UNormInt
impeller::kSelfDependencyDstAccessMask
constexpr auto kSelfDependencyDstAccessMask
Definition: render_pass_builder_vk.cc:19
impeller::HeapRealloc
static void * HeapRealloc(void *userData, void *ptr, unsigned int size)
Definition: tessellator_libtess.cc:15
impeller::ReportPipelineCreationFeedbackToLog
static void ReportPipelineCreationFeedbackToLog(const PipelineDescriptor &desc, const vk::PipelineCreationFeedbackCreateInfoEXT &feedback)
Definition: pipeline_vk.cc:58
impeller::Color::Unpremultiply
constexpr Color Unpremultiply() const
Definition: color.h:215
impeller::ColorWriteMaskBits::kGreen
@ kGreen
impeller::CompareFunction::kEqual
@ kEqual
Comparison test passes if new_value == current_value.
impeller::ToVKDescriptorType
constexpr vk::DescriptorType ToVKDescriptorType(DescriptorType type)
Definition: formats_vk.h:292
impeller::BlendFactor::kOneMinusSourceAlpha
@ kOneMinusSourceAlpha
impeller::kEhCloseEnough
constexpr float kEhCloseEnough
Definition: constants.h:56
impeller::kSelfDependencySrcStageMask
constexpr auto kSelfDependencySrcStageMask
Definition: render_pass_builder_vk.cc:12
value
int32_t value
Definition: dl_golden_unittests.cc:444
impeller::GetShaderClipDepth
static Scalar GetShaderClipDepth(uint32_t clip_depth)
Definition: clip_contents.cc:19
impeller::CompareFunction::kGreaterEqual
@ kGreaterEqual
Comparison test passes if new_value >= current_value.
impeller::ToBlendFactor
constexpr GLenum ToBlendFactor(BlendFactor factor)
Definition: formats_gles.h:92
data
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:64
impeller::ToMTLStencilOperation
constexpr MTLStencilOperation ToMTLStencilOperation(StencilOperation op)
Definition: formats_mtl.h:257
impeller::StencilOperation::kKeep
@ kKeep
Don't modify the current stencil value.
impeller::TextureDescriptor::format
PixelFormat format
Definition: texture_descriptor.h:41
impeller::HeapFree
static void HeapFree(void *userData, void *ptr)
Definition: tessellator_libtess.cc:19
impeller::LoadActionToString
constexpr const char * LoadActionToString(LoadAction action)
Definition: formats.h:215
impeller::BlendMode::kSource
@ kSource
impeller::VS
GlyphAtlasPipeline::VertexShader VS
Definition: text_contents.cc:25
impeller::AdrenoGPU::kAdreno735
@ kAdreno735
impeller::PixelFormat::kR8G8B8A8UNormInt
@ kR8G8B8A8UNormInt
impeller::BlendMode::kDestination
@ kDestination
impeller::VendorVK::kPowerVR
@ kPowerVR
impeller::HandleType::kTexture
@ kTexture
impeller::ConfigureAttachment
static bool ConfigureAttachment(const Attachment &desc, MTLRenderPassAttachmentDescriptor *attachment)
Definition: render_pass_mtl.mm:56
impeller::TRect::TransformBounds
constexpr TRect TransformBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle.
Definition: rect.h:476
impeller::ShaderType::kSignedInt64
@ kSignedInt64
impeller::HasSuitableDepthStencilFormat
static bool HasSuitableDepthStencilFormat(const vk::PhysicalDevice &device, vk::Format format)
Definition: capabilities_vk.cc:326
impeller::AdrenoGPU::kAdreno509
@ kAdreno509
impeller::PointStyle::kRound
@ kRound
Points are drawn as squares.
impeller::TRect::Intersection
constexpr std::optional< TRect > Intersection(const TRect &o) const
Definition: rect.h:532
impeller::MaliGPU::kG68
@ kG68
impeller::StencilOperation::kIncrementClamp
@ kIncrementClamp
Increment the current stencil value by 1. Clamp it to the maximum.
impeller::ShaderType::kImage
@ kImage
impeller::MaliGPU::kG715
@ kG715
impeller::MTLCommandBufferErrorToString
static NSString * MTLCommandBufferErrorToString(MTLCommandBufferError code)
Definition: command_buffer_mtl.mm:35
impeller::BlendMode::kDestinationOver
@ kDestinationOver
impeller::BlendMode::kPlus
@ kPlus
impeller::BlendSelectValues::kSoftLight
@ kSoftLight
impeller::AdrenoGPU::kAdreno618
@ kAdreno618
impeller::kSampledImage
@ kSampledImage
Definition: runtime_types.h:26
impeller::SafeMTLPixelFormatDepth24Unorm_Stencil8
MTLPixelFormat SafeMTLPixelFormatDepth24Unorm_Stencil8()
Definition: formats_mtl.mm:113
impeller::skia_conversions::ToColor
Color ToColor(const flutter::DlColor &color)
Definition: skia_conversions.cc:89
impeller::TextureDescriptorToString
std::string TextureDescriptorToString(const TextureDescriptor &desc)
Definition: texture_descriptor.cc:11
impeller::AdrenoGPU::kAdreno663
@ kAdreno663
impeller::computeErf7
static Scalar computeErf7(Scalar x)
Definition: solid_rrect_blur_contents.cc:60
impeller::StencilOperation::kInvert
@ kInvert
Perform a logical bitwise invert on the current stencil value.
impeller::ShaderType::kVoid
@ kVoid
impeller::MaliGPU::kT760
@ kT760
impeller::AdrenoGPU::kAdreno730
@ kAdreno730
impeller::AdrenoGPU::kAdreno710
@ kAdreno710
impeller::WindingOrder::kClockwise
@ kClockwise
buffer_view
BufferView buffer_view
Definition: blit_command_gles.cc:152
impeller::MaliGPU::kG925
@ kG925
impeller::BlendFactor::kDestinationAlpha
@ kDestinationAlpha
impeller::AdrenoGPU::kAdreno660
@ kAdreno660
impeller::ToMTLStoreAction
constexpr MTLStoreAction ToMTLStoreAction(StoreAction action)
Definition: formats_mtl.h:307
impeller::Size
TSize< Scalar > Size
Definition: size.h:171
impeller::BlendSelectValues::kDifference
@ kDifference
impeller::ShaderType::kSignedByte
@ kSignedByte
impeller::IndexType::k32bit
@ k32bit
impeller::AdrenoGPU::kAdrenoX145
@ kAdrenoX145
impeller::TextureUsage::kRenderTarget
@ kRenderTarget
impeller::StorageMode::kHostVisible
@ kHostVisible
impeller::kGaussianBlurMaxKernelSize
static constexpr int32_t kGaussianBlurMaxKernelSize
Definition: gaussian_blur_filter_contents.h:17
impeller::OptionalDeviceExtensionVK::kEXTPipelineCreationFeedback
@ kEXTPipelineCreationFeedback
impeller::ToMTLCompareFunction
constexpr MTLCompareFunction ToMTLCompareFunction(CompareFunction func)
Definition: formats_mtl.h:235
impeller::kSelfDependencyFlags
constexpr auto kSelfDependencyFlags
Definition: render_pass_builder_vk.cc:22
impeller::GetShaderSource
static std::string GetShaderSource(const ProcTableGLES &gl, GLuint shader)
Definition: pipeline_library_gles.cc:36
impeller::Cap::kButt
@ kButt
impeller::AdrenoGPU::kAdreno642
@ kAdreno642
impeller::kPipelineCacheFileName
static constexpr const char * kPipelineCacheFileName
Definition: pipeline_cache_data_vk.cc:13
impeller::ToFont
static Font ToFont(const SkTextBlobRunIterator &run, AxisAlignment alignment)
Definition: text_frame_skia.cc:22
x
int32_t x
Definition: dl_golden_unittests.cc:443
impeller::AdrenoGPU::kAdreno650
@ kAdreno650
impeller::BindVertexBuffer
static bool BindVertexBuffer(const ProcTableGLES &gl, BufferBindingsGLES *vertex_desc_gles, const BufferView &vertex_buffer_view, size_t buffer_index)
Definition: render_pass_gles.cc:147
impeller::CreateMappingFromAllocation
std::shared_ptr< fml::Mapping > CreateMappingFromAllocation(const std::shared_ptr< Allocation > &allocation)
Creates a mapping from allocation.
Definition: allocation.cc:99
impeller::MaliGPU::kG620
@ kG620
impeller::ShaderType::kUnsignedShort
@ kUnsignedShort
impeller::AdrenoGPU::kAdreno640
@ kAdreno640
impeller::AdrenoGPU::kAdreno725
@ kAdreno725
stroke_width
const Scalar stroke_width
Definition: stroke_path_geometry.cc:312
impeller::AdrenoGPU::kAdreno680
@ kAdreno680
impeller::ToVKStencilOpState
constexpr vk::StencilOpState ToVKStencilOpState(const StencilAttachmentDescriptor &desc)
Definition: formats_vk.h:498
impeller::WindingOrder
WindingOrder
Definition: formats.h:22
impeller::NormalizeUniformKey
static std::string NormalizeUniformKey(const std::string &key)
Definition: buffer_bindings_gles.cc:69
offset
SeparatedVector2 offset
Definition: stroke_path_geometry.cc:319
impeller::ToMTLClearColor
MTLClearColor ToMTLClearColor(const Color &color)
Definition: formats_mtl.h:374
UNIMPLEMENTED
#define UNIMPLEMENTED
Definition: dl_dispatcher.cc:118
impeller::MinMagFilter::kNearest
@ kNearest
Select nearest to the sample point. Most widely supported.
impeller::HandleType::kFence
@ kFence
IMP_AIKSTEST
#define IMP_AIKSTEST(name)
Definition: golden_playground_test_mac.cc:62
impeller::skia_conversions::ToBlendMode
BlendMode ToBlendMode(flutter::DlBlendMode mode)
Definition: skia_conversions.cc:176
impeller::BlendMode::kModulate
@ kModulate
impeller::PolygonMode::kFill
@ kFill
impeller::MyMaskBits::kFoo
@ kFoo
impeller::StencilOperation::kSetToReferenceValue
@ kSetToReferenceValue
Reset the stencil value to the reference value.
impeller::MaliGPU::kG52
@ kG52
impeller::ToVKCompareOp
constexpr vk::CompareOp ToVKCompareOp(CompareFunction op)
Definition: formats_vk.h:453
impeller::MaliGPU::kG625
@ kG625
impeller::AdrenoGPU::kAdreno504
@ kAdreno504
impeller::Join::kMiter
@ kMiter
impeller::BlendFactor::kSourceColor
@ kSourceColor
impeller::ShaderType::kUnsignedInt64
@ kUnsignedInt64
impeller::PixelFormat::kD32FloatS8UInt
@ kD32FloatS8UInt
impeller::BlendMode::kSourceOut
@ kSourceOut
impeller::ToMTLDepthStencilDescriptor
MTLDepthStencilDescriptor * ToMTLDepthStencilDescriptor(std::optional< DepthAttachmentDescriptor > depth, std::optional< StencilAttachmentDescriptor > front, std::optional< StencilAttachmentDescriptor > back)
Definition: formats_mtl.mm:54
impeller::PixelFormat
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition: formats.h:99
impeller::MyMaskBits::kBar
@ kBar
impeller::VendorVK::kARM
@ kARM
impeller::VendorVK::kGoogle
@ kGoogle
impeller::RuntimeShaderStage::kVertex
@ kVertex
impeller::BuildGLArgumentsStream
void BuildGLArgumentsStream(std::stringstream &stream, Type arg, Rest... other_args)
Definition: proc_table_gles.h:56
impeller::PrimitiveType::kLine
@ kLine
impeller::BlendFactor::kDestinationColor
@ kDestinationColor
IPLR_ACQUIRE
#define IPLR_ACQUIRE(...)
Definition: thread_safety.h:36
impeller::BlendSelectValues::kDarken
@ kDarken
impeller::ShaderType::kUnsignedByte
@ kUnsignedByte
impeller::ToVKStencilOp
constexpr vk::StencilOp ToVKStencilOp(StencilOperation op)
Definition: formats_vk.h:475
impeller::SamplerDescriptor::mag_filter
MinMagFilter mag_filter
Definition: sampler_descriptor.h:16
impeller::TextureCoordinateSystem::kUploadFromHost
@ kUploadFromHost
impeller::SamplerDescriptor
Definition: sampler_descriptor.h:14
impeller::AdrenoGPU::kAdreno615
@ kAdreno615
impeller::PrimitiveType::kTriangle
@ kTriangle
impeller::BlendSelectValues::kExclusion
@ kExclusion
impeller::BlendFactor::kZero
@ kZero
impeller::RequiredAndroidDeviceExtensionVK::kKHRExternalFenceFd
@ kKHRExternalFenceFd
impeller::TextureType::kTexture2DMultisample
@ kTexture2DMultisample
impeller::RenderTargetAllocator::CreateOffscreen
virtual RenderTarget CreateOffscreen(const Context &context, ISize size, int mip_count, std::string_view label="Offscreen", RenderTarget::AttachmentConfig color_attachment_config=RenderTarget::kDefaultColorAttachmentConfig, std::optional< RenderTarget::AttachmentConfig > stencil_attachment_config=RenderTarget::kDefaultStencilAttachmentConfig, const std::shared_ptr< Texture > &existing_color_texture=nullptr, const std::shared_ptr< Texture > &existing_depth_stencil_texture=nullptr)
Definition: render_target.cc:322
impeller::CullMode
CullMode
Definition: formats.h:337
impeller::ConfigureDepthAttachment
static bool ConfigureDepthAttachment(const DepthAttachment &desc, MTLRenderPassDepthAttachmentDescriptor *attachment)
Definition: render_pass_mtl.mm:83
impeller::TextureCoordinateSystem::kRenderToTexture
@ kRenderToTexture
impeller::ToSamplerDescriptor
static impeller::SamplerDescriptor ToSamplerDescriptor(const flutter::DlFilterMode options)
Definition: dl_dispatcher.cc:121
impeller::SourceRectConstraint::kStrict
@ kStrict
Sample only within the source rectangle. May be slower.
impeller::ColorWriteMaskBits::kAll
@ kAll
impeller::ToIndexType
constexpr GLenum ToIndexType(IndexType type)
Definition: formats_gles.h:35
impeller::LoadAction::kClear
@ kClear
impeller::StencilOperation::kDecrementWrap
@ kDecrementWrap
Decrement the current stencil value by 1. If at zero, set to maximum.
impeller::BlendFactor::kOneMinusDestinationColor
@ kOneMinusDestinationColor
impeller::kPrecomputedDivisions
static int kPrecomputedDivisions[kPrecomputedDivisionCount]
Definition: tessellator.cc:177
impeller::PointStyle::kSquare
@ kSquare
Points are drawn as circles.
impeller::PrimitiveType::kTriangleStrip
@ kTriangleStrip
impeller::RuntimeShaderStage::kFragment
@ kFragment
impeller::RequiredAndroidDeviceExtensionVK::kKHRExternalMemory
@ kKHRExternalMemory
impeller::SamplerDescriptor::min_filter
MinMagFilter min_filter
Definition: sampler_descriptor.h:15
impeller::ToCompareFunction
constexpr GLenum ToCompareFunction(CompareFunction func)
Definition: formats_gles.h:70
impeller::StorageMode::kDeviceTransient
@ kDeviceTransient
impeller::Point
TPoint< Scalar > Point
Definition: point.h:327
impeller::CullMode::kBackFace
@ kBackFace
impeller::ToMTLLoadAction
constexpr MTLLoadAction ToMTLLoadAction(LoadAction action)
Definition: formats_mtl.h:279
impeller::AdrenoGPU::kAdreno643L
@ kAdreno643L
impeller::VendorVK::kAMD
@ kAMD
impeller::CullMode::kNone
@ kNone
InternalHalf
uint16_t InternalHalf
Definition: half.h:23
impeller::RenderTarget::GetRenderTargetTexture
std::shared_ptr< Texture > GetRenderTargetTexture() const
Definition: render_target.cc:176
impeller::ToMTLBlendOperation
constexpr MTLBlendOperation ToMTLBlendOperation(BlendOperation type)
Definition: formats_mtl.h:201
impeller::ToMTLStencilDescriptor
MTLStencilDescriptor * ToMTLStencilDescriptor(const StencilAttachmentDescriptor &descriptor)
Definition: formats_mtl.mm:38
impeller::ToVKImageFormat
constexpr vk::Format ToVKImageFormat(PixelFormat format)
Definition: formats_vk.h:146
impeller::BlendOperation::kReverseSubtract
@ kReverseSubtract
impeller::ToTextureType
static TextureType ToTextureType(const AHardwareBuffer_Desc &ahb_desc)
Definition: ahb_texture_source_vk.cc:259
impeller::BytesPerPixelForPixelFormat
constexpr size_t BytesPerPixelForPixelFormat(PixelFormat format)
Definition: formats.h:466
IPLR_RELEASE
#define IPLR_RELEASE(...)
Definition: thread_safety.h:42
impeller::ShaderType::kBoolean
@ kBoolean
type
GLenum type
Definition: texture_gles.cc:63
impeller::BlendFactor::kBlendAlpha
@ kBlendAlpha
impeller::BlendSelectValues::kColor
@ kColor
impeller::RequiredAndroidDeviceExtensionVK::kKHRDedicatedAllocation
@ kKHRDedicatedAllocation
impeller::MaliGPU::kG76
@ kG76
impeller::compiler::TargetPlatform::kVulkan
@ kVulkan
impeller::SPrintF
std::string SPrintF(const char *format,...)
Definition: strings.cc:12
impeller::AdrenoGPU::kAdreno690
@ kAdreno690
impeller::PrimitiveType::kPoint
@ kPoint
Draws a point at each input vertex.
transform
Matrix transform
Definition: gaussian_blur_filter_contents.cc:214
impeller::PixelFormat::kR8G8UNormInt
@ kR8G8UNormInt
impeller::AdrenoGPU::kAdreno620
@ kAdreno620
impeller::NegPos
static Point NegPos(Scalar v)
Definition: solid_rrect_blur_contents.cc:67
impeller::AdrenoGPU::kAdreno505
@ kAdreno505
impeller::ContainsFormat
static bool ContainsFormat(const std::vector< vk::SurfaceFormatKHR > &formats, vk::SurfaceFormatKHR format)
Definition: khr_swapchain_impl_vk.cc:70
impeller::CreateVertexBuffer
VertexBuffer CreateVertexBuffer(std::array< VertexType, size > input, HostBuffer &host_buffer)
Create an index-less vertex buffer from a fixed size array.
Definition: vertex_buffer_builder.h:24
impeller::gShouldOpenNewPlaygrounds
static std::atomic_bool gShouldOpenNewPlaygrounds
Definition: playground.cc:162
impeller::AdrenoGPU::kAdreno675
@ kAdreno675
impeller::RequiredAndroidDeviceExtensionVK::kANDROIDExternalMemoryAndroidHardwareBuffer
@ kANDROIDExternalMemoryAndroidHardwareBuffer
impeller::ToMTLRenderPipelineColorAttachmentDescriptor
MTLRenderPipelineColorAttachmentDescriptor * ToMTLRenderPipelineColorAttachmentDescriptor(ColorAttachmentDescriptor descriptor)
Definition: formats_mtl.mm:15
impeller::DeviceSupportsFramebufferFetch
static bool DeviceSupportsFramebufferFetch(id< MTLDevice > device)
Definition: context_mtl.mm:24
impeller::YUVColorSpace::kBT601FullRange
@ kBT601FullRange
impeller::ToMode
constexpr GLenum ToMode(PrimitiveType primitive_type)
Definition: formats_gles.h:17
impeller::VendorVK::kMesa
@ kMesa
impeller::ComputeQuadradicSubdivisions
Scalar ComputeQuadradicSubdivisions(Scalar scale_factor, const QuadraticPathComponent &quad)
Definition: wangs_formula.cc:42
impeller::BlendOperation::kAdd
@ kAdd
impeller::VendorVK::kApple
@ kApple
impeller::ShaderType::kSampler
@ kSampler
impeller::StorageMode::kDevicePrivate
@ kDevicePrivate
impeller::StorageModeToString
constexpr const char * StorageModeToString(StorageMode mode)
Definition: formats.h:60
impeller::kSelfDependencyDstStageMask
constexpr auto kSelfDependencyDstStageMask
Definition: render_pass_builder_vk.cc:17
impeller::AdrenoGPU::kAdreno506
@ kAdreno506
impeller::WrapWithGPUColorFilter
std::shared_ptr< ColorFilterContents > WrapWithGPUColorFilter(const flutter::DlColorFilter *filter, const std::shared_ptr< FilterInput > &input, ColorFilterContents::AbsorbOpacity absorb_opacity)
Definition: color_filter.cc:24
impeller::BlendFactor::kBlendColor
@ kBlendColor
impeller::kTwoOverSqrtPi
static Scalar kTwoOverSqrtPi
Definition: solid_rrect_blur_contents.cc:57
impeller::VendorVK::kImgTec
@ kImgTec
impeller::AdrenoGPU::kAdreno613
@ kAdreno613
impeller::RequiredAndroidDeviceExtensionVK::kKHRSamplerYcbcrConversion
@ kKHRSamplerYcbcrConversion
impeller::ColorMatrix::array
Scalar array[20]
Definition: color.h:117
impeller::RequiredCommonDeviceExtensionVK::kKHRSwapchain
@ kKHRSwapchain
impeller::PixelFormat::kB10G10R10XR
@ kB10G10R10XR
impeller::CompressionType::kLossless
@ kLossless
impeller::ToParam
static GLint ToParam(MinMagFilter minmag_filter, MipFilter mip_filter)
Definition: sampler_gles.cc:30
impeller::AttachmentToString
std::string AttachmentToString(const Attachment &attachment)
Definition: formats.cc:104
impeller::PixelFormat::kD24UnormS8Uint
@ kD24UnormS8Uint
type
GLenum type
Definition: blit_command_gles.cc:151
impeller::WindingOrder::kCounterClockwise
@ kCounterClockwise
impeller::SamplerAddressMode::kClampToEdge
@ kClampToEdge
impeller::BlendFactor::kOneMinusBlendColor
@ kOneMinusBlendColor
impeller::SamplerAddressMode::kRepeat
@ kRepeat
impeller::StencilOperation::kIncrementWrap
@ kIncrementWrap
Increment the current stencil value by 1. If at maximum, set to zero.
impeller::TextureType::kTextureCube
@ kTextureCube
impeller::MaliGPU::kT830
@ kT830
impeller::FillType
FillType
Definition: path.h:31
impeller::AdrenoGPU::kAdreno642L
@ kAdreno642L
impeller::MaliGPU::kG720
@ kG720
impeller::PixelFormat::kR16G16B16A16Float
@ kR16G16B16A16Float
impeller::ScalarNearlyZero
constexpr bool ScalarNearlyZero(Scalar x, Scalar tolerance=kEhCloseEnough)
Definition: scalar.h:30
impeller::RenderTarget
Definition: render_target.h:38
impeller::MaliGPU::kG72
@ kG72
impeller::VendorVK::kQualcomm
@ kQualcomm
impeller::StoreAction::kStore
@ kStore
impeller::AxisAlignment
AxisAlignment
Determines the axis along which there is subpixel positioning.
Definition: font.h:20
impeller::AdrenoGPU::kAdreno732
@ kAdreno732
impeller::ToVkShaderStage
constexpr vk::ShaderStageFlags ToVkShaderStage(ShaderStage stage)
Definition: formats_vk.h:264
impeller::CompressionTypeToString
constexpr const char * CompressionTypeToString(CompressionType type)
Definition: texture_descriptor.h:24
impeller::Absolute
constexpr T Absolute(const T &val)
Definition: scalar.h:21
impeller::Rect
TRect< Scalar > Rect
Definition: rect.h:792
impeller::DeviceTypeVK::kVirtualGPU
@ kVirtualGPU
impeller::CompareFunction::kLessEqual
@ kLessEqual
Comparison test passes if new_value <= current_value.
impeller::BlendFactor::kOne
@ kOne
impeller::Luminosity
static constexpr Scalar Luminosity(Vector3 color)
Definition: color.cc:63
impeller::BlendFactor::kOneMinusBlendAlpha
@ kOneMinusBlendAlpha
impeller::CompressionType::kLossy
@ kLossy
impeller::AxisAlignment::kX
@ kX
impeller::DebugResourceType::kShader
@ kShader
impeller::AdrenoGPU::kAdreno512
@ kAdreno512
impeller::kStruct
@ kStruct
Definition: runtime_types.h:27
impeller::AppendColor
static void AppendColor(const Color &color, GradientData *data)
Definition: gradient.cc:12
impeller::CompareFunction::kAlways
@ kAlways
Comparison test passes always passes.
impeller::RenderTargetAllocator
a wrapper around the impeller [Allocator] instance that can be used to provide caching of allocated r...
Definition: render_target.h:149
impeller::FindSwiftShaderICDAtKnownPaths
static void FindSwiftShaderICDAtKnownPaths()
Definition: swiftshader_utilities.cc:20
impeller::kMaliVersions
const std::unordered_map< std::string_view, MaliGPU > kMaliVersions
Definition: driver_info_vk.cc:71
impeller::YUVColorSpace::kBT601LimitedRange
@ kBT601LimitedRange
impeller::ConfigureResolveTextureAttachment
static bool ConfigureResolveTextureAttachment(const Attachment &desc, MTLRenderPassAttachmentDescriptor *attachment)
Definition: render_pass_mtl.mm:27
impeller::TextureType::kTexture2D
@ kTexture2D
impeller::TSize::width
Type width
Definition: size.h:28
impeller::FillType::kNonZero
@ kNonZero
impeller::PixelFormat::kR32G32B32A32Float
@ kR32G32B32A32Float
impeller::DescriptorType::kUniformBuffer
@ kUniformBuffer
impeller::OptionalDeviceExtensionVK::kVKKHRPortabilitySubset
@ kVKKHRPortabilitySubset
IMPELLER_FOR_EACH_BLEND_MODE
#define IMPELLER_FOR_EACH_BLEND_MODE(V)
Definition: color.h:19
impeller::FirstPassDispatcher
Definition: dl_dispatcher.h:301
impeller::HandleType::kProgram
@ kProgram
impeller::TPoint::x
Type x
Definition: point.h:30
impeller::ShaderType::kUnsignedInt
@ kUnsignedInt
impeller::WrapInput
std::shared_ptr< FilterContents > WrapInput(const flutter::DlImageFilter *filter, const FilterInput::Ref &input)
Generate a new FilterContents using this filter's configuration.
Definition: image_filter.cc:17
impeller::ToMTLPixelFormat
constexpr MTLPixelFormat ToMTLPixelFormat(PixelFormat format)
Definition: formats_mtl.h:76
impeller::CompareFunction::kNever
@ kNever
Comparison test never passes.
impeller::SafeMTLPixelFormatBGR10_XR
MTLPixelFormat SafeMTLPixelFormatBGR10_XR()
Definition: formats_mtl.mm:130
impeller::StripPrefix
std::string StripPrefix(const std::string &string, const std::string &to_strip)
Definition: strings.cc:42
impeller::LogShaderCompilationFailure
static void LogShaderCompilationFailure(const ProcTableGLES &gl, GLuint shader, std::string_view name, const fml::Mapping &source_mapping, ShaderStage stage)
Definition: pipeline_library_gles.cc:49
impeller::MaliGPU::kG615
@ kG615
impeller::HeapAlloc
static void * HeapAlloc(void *userData, unsigned int size)
Definition: tessellator_libtess.cc:11
impeller::MinMagFilter::kLinear
@ kLinear
impeller::TextureDescriptor::size
ISize size
Definition: texture_descriptor.h:42
impeller::AdrenoGPU::kAdreno608
@ kAdreno608
impeller::AdrenoGPU::kAdreno702
@ kAdreno702
impeller::NearEqual
static bool NearEqual(Scalar a, Scalar b, Scalar epsilon)
Definition: path_component.cc:370
impeller::BlendMode::kDestinationIn
@ kDestinationIn
impeller::ToMTLTextureType
constexpr MTLTextureType ToMTLTextureType(TextureType type)
Definition: formats_mtl.h:378
impeller::Join::kBevel
@ kBevel
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:91
impeller::CullMode::kFrontFace
@ kFrontFace
impeller::AdrenoGPU::kAdreno510
@ kAdreno510
impeller::DeviceMaxTextureSizeSupported
ISize DeviceMaxTextureSizeSupported(id< MTLDevice > device)
Definition: allocator_mtl.mm:55
impeller::ColorWriteMaskBits::kAlpha
@ kAlpha
impeller::RenderTargetAllocator::CreateOffscreenMSAA
virtual RenderTarget CreateOffscreenMSAA(const Context &context, ISize size, int mip_count, std::string_view label="Offscreen MSAA", RenderTarget::AttachmentConfigMSAA color_attachment_config=RenderTarget::kDefaultColorAttachmentConfigMSAA, std::optional< RenderTarget::AttachmentConfig > stencil_attachment_config=RenderTarget::kDefaultStencilAttachmentConfig, const std::shared_ptr< Texture > &existing_color_msaa_texture=nullptr, const std::shared_ptr< Texture > &existing_color_resolve_texture=nullptr, const std::shared_ptr< Texture > &existing_depth_stencil_texture=nullptr)
Definition: render_target.cc:376
_IMPELLER_ASSERT_BLEND_MODE
#define _IMPELLER_ASSERT_BLEND_MODE(blend_mode)
Definition: color.cc:20
impeller::TextureTypeToString
constexpr const char * TextureTypeToString(TextureType type)
Definition: formats.h:269
impeller::BlendMode::kDestinationOut
@ kDestinationOut
impeller::AdrenoGPU::kAdreno616
@ kAdreno616
impeller::AdrenoGPU::kAdreno619
@ kAdreno619
impeller::DeviceTypeVK::kCPU
@ kCPU
impeller::VendorVK::kIntel
@ kIntel
impeller::MaliGPU::kG57
@ kG57
impeller::ShaderType::kSignedShort
@ kSignedShort
impeller::TPoint::GetLengthSquared
constexpr Type GetLengthSquared() const
Definition: point.h:204
impeller::AdrenoGPU::kAdreno630
@ kAdreno630
impeller::ShaderType::kHalfFloat
@ kHalfFloat
impeller::ClipColor
static constexpr Vector3 ClipColor(Vector3 color)
Definition: color.cc:67
impeller::ToVKSamplerMinMagFilter
constexpr vk::Filter ToVKSamplerMinMagFilter(MinMagFilter filter)
Definition: formats_vk.h:225
impeller::ShaderType::kSignedInt
@ kSignedInt
impeller::MyMaskBits::kBang
@ kBang
impeller::ComputeCubicSubdivisions
Scalar ComputeCubicSubdivisions(float scale_factor, const CubicPathComponent &cub)
Definition: wangs_formula.cc:47
impeller::GetExtensionName
static const char * GetExtensionName(OptionalDeviceExtensionVK ext)
Definition: capabilities_vk.cc:210
impeller::MaliGPU::kG71
@ kG71
impeller::PixelFormat::kR8G8B8A8UNormIntSRGB
@ kR8G8B8A8UNormIntSRGB
impeller::SafeMTLPixelFormatBGR10_XR_sRGB
MTLPixelFormat SafeMTLPixelFormatBGR10_XR_sRGB()
Definition: formats_mtl.mm:122
impeller::AdrenoGPU::kAdreno508
@ kAdreno508
impeller::VendorVK::kHuawei
@ kHuawei
impeller::DrawPlaygroundPoint
Point DrawPlaygroundPoint(PlaygroundPoint &point)
Definition: widgets.cc:9
impeller::HasSuitableColorFormat
static bool HasSuitableColorFormat(const vk::PhysicalDevice &device, vk::Format format)
Definition: capabilities_vk.cc:318
impeller::TRect::MakeSize
constexpr static TRect MakeSize(const TSize< U > &size)
Definition: rect.h:150
impeller::kMaxColorAttachments
static constexpr size_t kMaxColorAttachments
Definition: render_pass_builder_vk.h:17
impeller::BlendSelectValues::kHardLight
@ kHardLight
impeller::ConfigureBlending
void ConfigureBlending(const ProcTableGLES &gl, const ColorAttachmentDescriptor *color)
Definition: render_pass_gles.cc:46
impeller::AdrenoGPU::kAdreno695
@ kAdreno695
impeller::ImpellerValidationErrorsAreFatal
bool ImpellerValidationErrorsAreFatal()
Definition: validation.cc:71
impeller::LoadAction::kDontCare
@ kDontCare
impeller::BlendSelectValues::kScreen
@ kScreen
impeller::ColorWriteMask
Mask< ColorWriteMaskBits > ColorWriteMask
Definition: formats.h:464
impeller::AdrenoGPU::kAdreno610
@ kAdreno610
impeller::TPoint< Scalar >
impeller::saturated::b
SI b
Definition: saturated_math.h:87
impeller::AdrenoGPU::kAdreno750
@ kAdreno750
impeller::ToMTLBlendFactor
constexpr MTLBlendFactor ToMTLBlendFactor(BlendFactor type)
Definition: formats_mtl.h:114
impeller::MaliGPU::kG31
@ kG31
impeller::BlendFactor::kOneMinusSourceColor
@ kOneMinusSourceColor
impeller::ColorWriteMaskBits::kRed
@ kRed
impeller::MaliGPU::kT860
@ kT860
impeller::HasPrefix
bool HasPrefix(const std::string &string, const std::string &prefix)
Definition: strings.cc:30
impeller::compiler::TargetPlatform::kOpenGLES
@ kOpenGLES
impeller::BlendSelectValues::kLighten
@ kLighten
impeller::TextureUsage::kShaderRead
@ kShaderRead
impeller::AdrenoGPU::kAdreno740
@ kAdreno740
impeller::BlendMode::kSourceIn
@ kSourceIn
impeller::RuntimeShaderStage::kCompute
@ kCompute
impeller::FromMTLPixelFormat
constexpr PixelFormat FromMTLPixelFormat(MTLPixelFormat format)
Definition: formats_mtl.h:22
impeller::ColorWriteMaskBits::kBlue
@ kBlue
scale
const Scalar scale
Definition: stroke_path_geometry.cc:316
impeller::VendorVK::kNvidia
@ kNvidia
impeller::AdrenoGPU::kAdrenoX185
@ kAdrenoX185
impeller::ScalarNearlyEqual
constexpr bool ScalarNearlyEqual(Scalar x, Scalar y, Scalar tolerance=kEhCloseEnough)
Definition: scalar.h:35
impeller::FromRGB
static constexpr Color FromRGB(Vector3 color, Scalar alpha)
Definition: color.cc:115
impeller::BlendMode::kLast
@ kLast
impeller::SampleCount::kCount1
@ kCount1
impeller::BlendSelectValues::kHue
@ kHue
impeller::SampleCount::kCount4
@ kCount4
impeller::BlendSelectValues::kLuminosity
@ kLuminosity
impeller::TextureDescriptor::storage_mode
StorageMode storage_mode
Definition: texture_descriptor.h:39
impeller::kPrecomputedDivisionCount
static constexpr int kPrecomputedDivisionCount
Definition: tessellator.cc:176
impeller::StoreActionToString
constexpr const char * StoreActionToString(StoreAction action)
Definition: formats.h:226
impeller::DescriptorType::kInputAttachment
@ kInputAttachment
impeller::eccentricity
static Point eccentricity(Point v, double sInverse)
Definition: solid_rrect_blur_contents.cc:51
impeller::TextureDescriptor
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...
Definition: texture_descriptor.h:38
impeller::AdrenoGPU::kAdreno605
@ kAdreno605
impeller::kAdrenoVersions
const std::unordered_map< std::string_view, AdrenoGPU > kAdrenoVersions
Definition: driver_info_vk.cc:16
impeller::ToBlendOperation
constexpr GLenum ToBlendOperation(BlendOperation op)
Definition: formats_gles.h:128
IMPELLER_GL_CLAMP_TO_BORDER
#define IMPELLER_GL_CLAMP_TO_BORDER
Definition: gles.h:12
impeller::kBlendModeNames
static constexpr const char * kBlendModeNames[]
Definition: color.cc:44
impeller::CompareFunction::kNotEqual
@ kNotEqual
Comparison test passes if new_value != current_value.
impeller::HandleType::kFrameBuffer
@ kFrameBuffer
impeller::PixelFormat::kB10G10R10XRSRGB
@ kB10G10R10XRSRGB
impeller::kPadding
constexpr auto kPadding
Definition: typographer_context_skia.cc:49
impeller::ToVKBlendOp
constexpr vk::BlendOp ToVKBlendOp(BlendOperation op)
Definition: formats_vk.h:78
impeller::BlendMode::kXor
@ kXor
impeller::RequiredAndroidDeviceExtensionVK::kEXTQueueFamilyForeign
@ kEXTQueueFamilyForeign
impeller::kSelfDependencySrcAccessMask
constexpr auto kSelfDependencySrcAccessMask
Definition: render_pass_builder_vk.cc:14
impeller::MaliGPU::kG78
@ kG78
impeller::HandleType::kBuffer
@ kBuffer
impeller::YUVConversionDescriptorVK
vk::StructureChain< vk::SamplerYcbcrConversionCreateInfo > YUVConversionDescriptorVK
Definition: yuv_conversion_vk.h:30
impeller::Convexity::kConvex
@ kConvex
impeller::PixelFormat::kB8G8R8A8UNormInt
@ kB8G8R8A8UNormInt
impeller::BlendFactor::kSourceAlpha
@ kSourceAlpha
impeller::AttachmentTypeString
static const char * AttachmentTypeString(GLint type)
Definition: proc_table_gles.cc:233
impeller::MaliGPU::kG77
@ kG77
impeller::interop::Create
ScopedObject< Object > Create(CtorArgs &&... args)
Definition: object.h:160
impeller::ToVKBufferMemoryPropertyFlags
static constexpr vk::Flags< vk::MemoryPropertyFlagBits > ToVKBufferMemoryPropertyFlags(StorageMode mode)
Definition: allocator_vk.cc:22
impeller::ColorMatrix
Definition: color.h:116
impeller::GetShaderInfoLog
static std::string GetShaderInfoLog(const ProcTableGLES &gl, GLuint shader)
Definition: pipeline_library_gles.cc:22
impeller::ToStencilOp
constexpr GLenum ToStencilOp(StencilOperation op)
Definition: formats_gles.h:48
impeller::sValidationFailureCallback
static ValidationFailureCallback sValidationFailureCallback
Definition: validation.cc:15
impeller::RuntimeStageBackend::kMetal
@ kMetal
impeller::MaliGPU::kT880
@ kT880
impeller::ToRect
static Rect ToRect(const SkRect &rect)
Definition: text_frame_skia.cc:38
impeller::ContentBoundsPromise::kContainsContents
@ kContainsContents
The caller claims the bounds are a reasonably tight estimate of the coverage of the contents and shou...
impeller::MaliGPU::kG510
@ kG510
impeller::ToVmaAllocationBufferCreateFlags
static VmaAllocationCreateFlags ToVmaAllocationBufferCreateFlags(StorageMode mode, bool readback)
Definition: allocator_vk.cc:34
impeller::TextureUsageToString
constexpr const char * TextureUsageToString(TextureUsage usage)
Definition: formats.h:310
impeller::CompareFunction::kLess
@ kLess
Comparison test passes if new_value < current_value.
impeller::FS
GlyphAtlasPipeline::FragmentShader FS
Definition: text_contents.cc:26
impeller::VendorVK::kSamsung
@ kSamsung
impeller::BlendMode::kSourceATop
@ kSourceATop
impeller::kPiOver4
constexpr float kPiOver4
Definition: constants.h:35
impeller::PairsFitInAtlasOfSize
static size_t PairsFitInAtlasOfSize(const std::vector< FontGlyphPair > &pairs, const ISize &atlas_size, std::vector< Rect > &glyph_positions, const std::vector< Rect > &glyph_sizes, int64_t height_adjustment, const std::shared_ptr< RectanglePacker > &rect_packer, size_t start_index)
Definition: typographer_context_skia.cc:137
impeller::BlendSelectValues::kColorDodge
@ kColorDodge
impeller::BlendOperation::kSubtract
@ kSubtract
impeller::Color::Premultiply
constexpr Color Premultiply() const
Definition: color.h:211
impeller::kMaxUniformGradientStops
static constexpr uint32_t kMaxUniformGradientStops
Definition: gradient_generator.h:47
impeller::MaliGPU::kG725
@ kG725
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
impeller::Bytes
AllocationSize< 1u > Bytes
Definition: allocation_size.h:151
impeller::GetImageInfo
static SkImageInfo GetImageInfo(const GlyphAtlas &atlas, Size size)
Definition: typographer_context_skia.cc:90
impeller::PrimitiveType::kTriangleFan
@ kTriangleFan
impeller::BlendMode::kSourceOver
@ kSourceOver
impeller::DebugToFramebufferError
std::string DebugToFramebufferError(int status)
Definition: formats_gles.cc:9
impeller::kColorInversion
static const constexpr ColorMatrix kColorInversion
A color matrix which inverts colors.
Definition: color_filter.h:16
impeller::BlendSelectValues::kOverlay
@ kOverlay
impeller::BlendFactor::kOneMinusDestinationAlpha
@ kOneMinusDestinationAlpha
impeller::AdrenoGPU::kAdreno540
@ kAdreno540
impeller::VKClearValueFromColor
static vk::ClearColorValue VKClearValueFromColor(Color color)
Definition: render_pass_vk.cc:36
impeller::compiler::TargetPlatform::kSkSL
@ kSkSL
impeller::ToPixelFormat
static PixelFormat ToPixelFormat(AHardwareBuffer_Format format)
Definition: ahb_texture_source_vk.cc:225
impeller::DescriptorType::kStorageBuffer
@ kStorageBuffer
impeller::DescriptorType
DescriptorType
Definition: shader_types.h:158
impeller::AdrenoGPU::kAdreno612
@ kAdreno612
impeller::AxisAlignment::kY
@ kY
impeller::ToRGB
static constexpr Vector3 ToRGB(Color color)
Definition: color.cc:111
_IMPELLER_BLEND_MODE_NAME_LIST
#define _IMPELLER_BLEND_MODE_NAME_LIST(blend_mode)
Definition: color.cc:42
impeller::OptionalDeviceExtensionVK::kEXTImageCompressionControl
@ kEXTImageCompressionControl
impeller::SamplerDescriptor::label
std::string_view label
Definition: sampler_descriptor.h:23