class RectangleCompositor
Defined at line 21 of file ../../src/ui/lib/escher/flatland/rectangle_compositor.h
|RectangleCompositor| provides an interface for rendering axis-aligned rectangles in 2D space,
to support the implementation of the `fuchsia.ui.composition/Flatland` API.
It composites opaque and (premultiplied/straight) images to generate a premultiplied output
image.
Public Members
static Flags kRenderTargetUsageFlags
static Flags kTextureUsageFlags
Public Methods
void ~RectangleCompositor ()
Defined at line 44 of file ../../src/ui/lib/escher/flatland/rectangle_compositor.h
void RectangleCompositor (EscherWeakPtr escher)
RectangleCompositor constructor. Initializes the shader program and allocates
GPU buffers to store mesh data.
Defined at line 262 of file ../../src/ui/lib/escher/flatland/rectangle_compositor.cc
void DrawBatch (CommandBuffer * cmd_buf, const std::vector<Rectangle2D> & rectangles, const std::vector<TexturePtr> & textures, const std::vector<ColorData> & color_data, const ImagePtr & output_image, const TexturePtr & depth_buffer, bool apply_color_conversion)
DrawBatch generates the Vulkan data needed to render the batch (e.g. renderpass,
bounds, etc) and calls |TraverseBatch| which iterates over the renderables and
submits them for rendering.
Defined at line 270 of file ../../src/ui/lib/escher/flatland/rectangle_compositor.cc
void SetColorConversionParams (const ColorConversionParams & color_conversion_params)
This data is used to apply a color-conversion post processing effect over the entire
rendered output, when making a call to |DrawBatch|. The color conversion formula
used is matrix * (color + preoffsets) + postoffsets.
Defined at line 356 of file ../../src/ui/lib/escher/flatland/rectangle_compositor.cc
vk::ImageCreateInfo GetDefaultImageConstraints (const vk::Format & vk_format, vk::ImageUsageFlags usage)
Minimal image constraints to be set on textures and render targets passed into
DrawBatch. These are meant to also be compatible with AFBC
(Arm Framebuffer Compression).
Defined at line 405 of file ../../src/ui/lib/escher/flatland/rectangle_compositor.cc
void WarmPipelineCache (vk::Format output_format, vk::ImageLayout output_swapchain_layout, vk::Format depth_format, const std::vector<SamplerPtr> & immutable_samplers, bool use_protected_memory)
Pre-generate and cache Vulkan render passes and pipelines at startup to avoid subsequent
jank at runtime: when DrawBatch() looks for the renderpasses and pipelines in their respective
caches, they will already be there.
WarmPipelineCache() may be called several times with different parameters to accommodate
e.g. different framebuffer formats and layouts.
Args:
- |output_format| Describes the target framebuffer.
- |output_swapchain_layout| Describes the target framebuffer.
- |depth_format| Describes the target framebuffer.
- |depth_swapchain_layout| Describes the target framebuffer.
- |immutable_samplers| Support various types of YUV video.
- |use_protected_memory| If true, allows rendering protected (and unprotected) content into
a protected framebuffer. If false, only unprotected content can be
rendered by the generated pipelines.
Defined at line 505 of file ../../src/ui/lib/escher/flatland/rectangle_compositor.cc
Enumerations
enum Opacity
| Name | Value |
|---|---|
| Opaque | 0 |
| Translucent | 1 |
| NonPremultipliedTranslucent | 2 |
Defined at line 26 of file ../../src/ui/lib/escher/flatland/rectangle_compositor.h