Namespaces

Enumerations

enum class HostPointerAccessMode : uint32_t
Name Value
kReadOnly 0b01
kWriteOnly 0b10
kReadWrite 0b11

Defined at line 86 of file ../../src/ui/scenic/lib/flatland/buffers/util.h

Records

Functions

  • const std::vector<vk::Format> & SupportedClientImageFormats ()

    The full list of supported vk::Formats for client images. These are used in sysmem negotiations.

    Defined at line 26 of file ../../src/ui/scenic/lib/flatland/image_formats.cc

  • std::pair<std::unique_ptr<escher::Escher>, std::unique_ptr<VkRenderer>> CreateEscherAndPrewarmedRenderer (bool use_protected_memory)

    Defined at line 16 of file ../../src/ui/scenic/lib/flatland/renderer/tests/common.cc

  • fuchsia_sysmem2::BufferUsage get_none_usage ()

    Defined at line 12 of file ../../src/ui/scenic/lib/flatland/buffers/util.cc

  • const std::vector<vk::Format> & SupportedClientYuvImageFormats ()

    Subset of the formats from SupportedClientImageFormats(), containing only the YUV formats.

    Defined at line 30 of file ../../src/ui/scenic/lib/flatland/image_formats.cc

  • fuchsia_sysmem2::BufferUsage get_cpu_usage_read ()

    Defined at line 36 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.cc

  • void ExpectMatrix (const UberStruct * uber_struct, TransformHandle target_handle, const glm::mat3 & expected_matrix, cpp20::source_location location)

    Searches for a local matrix associated with a specific TransformHandle.

    |uber_struct| is the UberStruct to search to find the matrix. |target_handle| is the

    TransformHandle of the matrix to compare. |expected_matrix| is the expected value of that

    matrix.

    Defined at line 93 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

  • void ExpectMatrix (const std::shared_ptr<const UberStruct> & uber_struct, TransformHandle target_handle, const glm::mat3 & expected_matrix, cpp20::source_location location)

    Defined at line 109 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

  • void ExpectMatrix (const std::shared_ptr<UberStruct> & uber_struct, TransformHandle target_handle, const glm::mat3 & expected_matrix, cpp20::source_location location)

    Defined at line 115 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

  • fuchsia_ui_composition::wire::ViewBoundProtocols NoViewProtocols ()

    Defined at line 125 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

  • void DumpScene (const flatland::UberStruct::InstanceMap & snapshot, const flatland::GlobalTopologyData & topology_data, const std::vector<flatland::ResolvedLayer> & layers, std::ostream & output)

    Dumps information about a flatland scene to an output stream.

    Defined at line 204 of file ../../src/ui/scenic/lib/flatland/scene_dumper.cc

  • void ImportCollectionTest (async::TestLoop & loop, Renderer * renderer, fidl::WireClient<fuchsia_sysmem2::Allocator> & sysmem_allocator)

    Make sure a valid token can be used to import a buffer collection.

    Defined at line 215 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.cc

  • void SameTokenTwiceTest (async::TestLoop & loop, Renderer * renderer, fidl::WireClient<fuchsia_sysmem2::Allocator> & sysmem_allocator, bool use_vulkan)

    Multiple clients may need to reference the same buffer collection in the renderer

    (for example if they both need access to a global camera feed). In this case, both

    clients will be passing their own duped tokens to the same collection to the renderer,

    and will each get back a different ID. The collection itself (which is just a pointer)

    will be in the renderer's map twice. So if all tokens are set, both server-side

    importer collections should be allocated (since they are just pointers that refer

    to the same collection).

    Defined at line 244 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.cc

  • void BadImageInputTest (async::TestLoop & loop, Renderer * renderer, fidl::WireClient<fuchsia_sysmem2::Allocator> & sysmem_allocator, bool use_vulkan)

    Defined at line 308 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.cc

  • GlobalOpacityVector ComputeGlobalOpacityValues (const GlobalTopologyData::TopologyVector & global_topology, const GlobalTopologyData::ParentIndexVector & parent_indices, const UberStruct::InstanceMap & uber_structs)

    Computes a list of global opacity values for the global topology.

    Defined at line 366 of file ../../src/ui/scenic/lib/flatland/global_resolved_layers.cc

  • void ComputeGlobalOpacityValues (GlobalOpacityVector & output, const GlobalTopologyData::TopologyVector & global_topology, const GlobalTopologyData::ParentIndexVector & parent_indices, const UberStruct::InstanceMap & uber_structs)

    Defined at line 375 of file ../../src/ui/scenic/lib/flatland/global_resolved_layers.cc

  • escher::Rectangle2D GetNormalizedUvRect (const ResolvedLayer & layer)

    Helper function to normalize UV coordinates and build an escher::Rectangle2D from a

    ResolvedLayer.

    Defined at line 334 of file ../../src/ui/scenic/lib/flatland/renderer/vk_renderer.cc

  • GlobalMatrixVector ComputeGlobalMatrices (const GlobalTopologyData::TopologyVector & global_topology, const GlobalTopologyData::ParentIndexVector & parent_indices, const UberStruct::InstanceMap & uber_structs)

    Computes the global transform matrix for each transform in |global_topology| using the local

    matrices in the |uber_structs|. If a transform doesn't have a local matrix present in the

    appropriate UberStruct, this function assumes that transform's local matrix is the identity

    matrix.

    Defined at line 290 of file ../../src/ui/scenic/lib/flatland/global_matrix_data.cc

  • void ComputeGlobalMatrices (GlobalMatrixVector & output, const GlobalTopologyData::TopologyVector & global_topology, const GlobalTopologyData::ParentIndexVector & parent_indices, const UberStruct::InstanceMap & uber_structs)

    Defined at line 299 of file ../../src/ui/scenic/lib/flatland/global_matrix_data.cc

  • void ComputeGlobalResolvedLayers (std::vector<ResolvedLayer> & output, const GlobalTopologyData & topology, const UberStruct::InstanceMap & snapshot, const std::vector<glm::mat3> & global_matrices, const std::vector<TransformClipRegion> & clip_regions, const GlobalOpacityVector & inherited_opacities)

    Computes the resolved layers list for the global topology.

    Walks |topology| in DFS order; for each node whose UberStruct has a

    layer_stacks entry, emits one ResolvedLayer per visible stack layer.

    Defined at line 213 of file ../../src/ui/scenic/lib/flatland/global_resolved_layers.cc

  • GlobalTransformClipRegionVector ComputeGlobalTransformClipRegions (const GlobalTopologyData::TopologyVector & global_topology, const GlobalTopologyData::ParentIndexVector & parent_indices, const GlobalMatrixVector & matrix_vector, const UberStruct::InstanceMap & uber_structs)

    Gathers the clip regions for each transform in |global_topology| using the local clip regions in

    the |uber_structs|. If a transform doesn't have clip regions present in the appropriate

    UberStruct, this function assumes the region is null. Since clip regions are specified in the

    local space of the transform they are attached to, this function transforms those into global

    clip regions before returning them. This requires the global matrix vector to be passed along as

    a parameter.

    Defined at line 349 of file ../../src/ui/scenic/lib/flatland/global_matrix_data.cc

  • std::ostream & operator<< (std::ostream & out, const flatland::LayerHandle & h)

    Defined at line 51 of file ../../src/ui/scenic/lib/flatland/flatland_types.cc

  • void ComputeGlobalTransformClipRegions (GlobalTransformClipRegionVector & output, const GlobalTopologyData::TopologyVector & global_topology, const GlobalTopologyData::ParentIndexVector & parent_indices, const GlobalMatrixVector & matrix_vector, const UberStruct::InstanceMap & uber_structs)

    Defined at line 359 of file ../../src/ui/scenic/lib/flatland/global_matrix_data.cc

  • const std::pair<fuchsia_sysmem2::BufferUsage, fuchsia_sysmem2::BufferMemoryConstraints> GetUsageAndMemoryConstraintsForCpuWriteOften ()

    TODO(https://fxbug.dev/42132796): The default memory constraints set by Sysmem only allows using

    CPU domain for buffers with CPU usage, while Mali driver asks for only

    RAM and Inaccessible domains for buffer allocation, which caused failure in

    sysmem allocation. So here we add RAM domain support to clients in order

    to get buffer allocated correctly.

    Defined at line 18 of file ../../src/ui/scenic/lib/flatland/buffers/util.cc

  • void CullLayersInPlace (std::vector<flatland::ResolvedLayer> * layers_in_out, uint64_t display_width, uint64_t display_height)

    Simple culling algorithm that checks if any of the input rectangles cover the entire display,

    and if so, culls all rectangles that came before them (since rectangles are implicitly sorted

    according to depth, with the first entry being the furthest back, this has the effect of

    eliminating all rectangles behind the full-screen one). Also culls any rectangle that has

    no size (width is zero, or height is zero).

    Defined at line 20 of file ../../src/ui/scenic/lib/flatland/global_resolved_layers.cc

  • void SetClientConstraintsAndWaitForAllocated (fidl::WireClient<fuchsia_sysmem2::Allocator> & sysmem_allocator, fidl::ClientEnd<fuchsia_sysmem2::BufferCollectionToken> token, uint32_t image_count, uint32_t width, uint32_t height, fuchsia_sysmem2::BufferUsage usage, const std::vector<fuchsia_images2::PixelFormatModifier> & additional_format_modifiers, std::optional<fuchsia_sysmem2::BufferMemoryConstraints> memory_constraints)

    Sets the client constraints on a sysmem buffer collection, including the number of images,

    the dimensionality (width, height) of those images, the usage and memory constraints. This

    is a blocking function that will wait until the constraints have been fully set.

    Defined at line 34 of file ../../src/ui/scenic/lib/flatland/buffers/util.cc

  • std::vector<ResolvedLayer> ComputeGlobalResolvedLayers (const GlobalTopologyData & topology, const UberStruct::InstanceMap & snapshot, const std::vector<glm::mat3> & global_matrices, const std::vector<TransformClipRegion> & clip_regions, const GlobalOpacityVector & inherited_opacities)

    Helper which returns a new vector instead of taking the output vector as an argument.

    Defined at line 45 of file ../../src/ui/scenic/lib/flatland/global_resolved_layers.h

  • GlobalHitRegionsMap ComputeGlobalHitRegions (const GlobalTopologyData::TopologyVector & global_topology, const GlobalTopologyData::ParentIndexVector & parent_indices, const GlobalMatrixVector & matrix_vector, const UberStruct::InstanceMap & uber_structs)

    Aggregates the set of local hit regions for each transform in |global_topology| into a map of

    global hit regions. This process involves two steps: first, convert all hit regions which are

    in each transform's local space into world space, and then clip the hit regions to the

    transform's clip region.

    Defined at line 423 of file ../../src/ui/scenic/lib/flatland/global_matrix_data.cc

  • std::pair<fuchsia_ui_composition::Orientation, fuchsia_ui_composition::ImageFlip> DecomposeRotateFlip (types::RotateFlip rf)

    Exposed for testing. Inverts RotateFlip::From(Orientation, ImageFlip).

    Defined at line 67 of file ../../src/ui/scenic/lib/flatland/global_resolved_layers.cc

  • glm::mat3 GetLayerLocalMatrix (const types::Rectangle & display_rect, fuchsia_ui_composition::Orientation orientation)

    Exposed for testing.

    Defined at line 130 of file ../../src/ui/scenic/lib/flatland/global_resolved_layers.cc

  • SrcToDest CreateSrcToDest (const glm::mat3 & matrix, const TransformClipRegion & clip, const types::RectangleF & src, const fuchsia_ui_composition::ImageFlip image_flip)

    Constructs a SrcToDest by projecting the destination (display) rectangle into screen space

    using the given matrix and clipping it to the provided clip region. The source (texture) region

    is clipped proportionally, using the flip and orientation properties to map the screen-space clip

    boundaries back to the correct source axes and edges.

    Defined at line 137 of file ../../src/ui/scenic/lib/flatland/global_matrix_data.cc

  • fidl::SyncClient<fuchsia_sysmem2::BufferCollection> CreateBufferCollectionSyncPtrAndSetConstraints (fidl::WireClient<fuchsia_sysmem2::Allocator> & sysmem_allocator, fidl::ClientEnd<fuchsia_sysmem2::BufferCollectionToken> token, uint32_t image_count, uint32_t width, uint32_t height, fuchsia_sysmem2::BufferUsage usage, fuchsia_images2::PixelFormat pixel_format, std::optional<fuchsia_sysmem2::BufferMemoryConstraints> memory_constraints, std::optional<fuchsia_images2::PixelFormatModifier> pixel_format_modifier)

    Sets the constraints on a client buffer collection pointer and returns that pointer back to

    the caller, *without* waiting for the constraint setting to finish. It is up to the caller

    to wait until constraints are set.

    Defined at line 97 of file ../../src/ui/scenic/lib/flatland/buffers/util.cc

  • fuchsia_ui_views::wire::ViewIdentityOnCreation NewWireViewIdentityOnCreation ()

    Defined at line 127 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

  • fuchsia_ui_composition::wire::BufferCollectionImportToken ToWire (fuchsia_ui_composition::BufferCollectionImportToken token)

    Defined at line 138 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

  • fuchsia_ui_views::wire::ViewportCreationToken ToWire (fuchsia_ui_views::ViewportCreationToken token)

    Defined at line 143 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

  • fuchsia_ui_views::wire::ViewCreationToken ToWire (fuchsia_ui_views::ViewCreationToken token)

    Defined at line 148 of file ../../src/ui/scenic/lib/flatland/tests/flatland_unittest.h

  • ResolvedBlend ResolveBlendAndOpacity (types::BlendMode stored_blend, float effective_opacity, bool pin_replace)

    Exposed for testing. Encapsulates the difference between how Flatland1 and Flatland2 APIs treat

    REPLACE blend mode when `opacity

    <

    1`; `pin_replace` is the selector for this differing behavior.

    In Flatland1 *for images only*, RGB is scaled and blend stays REPLACE (fade toward "black").

    Flatland2, and Flatland1 for solid color fills, "demote" REPLACE to PREMULTIPLIED_ALPHA,

    so there is no visual discontinuity at `opacity == 0` (where the layer is treated as invisible);

    this allows e.g. a window manager to fade out a child app even if it uses REPLACE.

    NOTE: `effective_opacity` combines layer opacity with inherited transform opacity. It does not

    involve "content opacity", neither the alpha of a solid color fill, nor the alpha channel of

    image pixels.

    TODO(https://fxbug.dev/523371761): ratified DESIGN-blend_mode_and_opacity

    decision must match the behavior implemented here.

    Defined at line 194 of file ../../src/ui/scenic/lib/flatland/global_resolved_layers.cc

  • std::ostream & operator<< (std::ostream & str, const flatland::SrcToDest & s2d)

    Defined at line 11 of file ../../src/ui/scenic/lib/flatland/flatland_types.cc

  • void MapHostPointer (const fuchsia_sysmem2::BufferCollectionInfo & collection_info, uint32_t vmo_idx, HostPointerAccessMode host_pointer_access_mode, std::function<void (uint8_t *, uint32_t)> callback)

    Maps a sysmem vmo's bytes into host memory that can be accessed via a callback function. The

    callback provides the caller with a raw pointer to the vmo memory as well as an int for the

    number of bytes. If an out of bounds vmo_idx is provided, the callback function will call the

    user callback with mapped_ptr equal to nullptr. Once the callback function returns, the host

    pointer is unmapped and so cannot continue to be used outside of the scope of the callback.

    Defined at line 188 of file ../../src/ui/scenic/lib/flatland/buffers/util.cc

  • void MapHostPointer (const zx::vmo & vmo, HostPointerAccessMode host_pointer_access_mode, std::function<void (uint8_t *, uint32_t)> callback, uint64_t vmo_bytes)

    Maps a given vmo's bytes into host memory that can be accessed via a callback function. The

    callback provides the caller with a raw pointer to the vmo memory as well as an int for the

    number of bytes. Once the callback function returns, the host

    pointer is unmapped and so cannot continue to be used outside of the scope of the callback.

    Defined at line 204 of file ../../src/ui/scenic/lib/flatland/buffers/util.cc

  • std::ostream & operator<< (std::ostream & str, const flatland::ResolvedLayer & rl)

    Defined at line 56 of file ../../src/ui/scenic/lib/flatland/flatland_types.cc

  • std::ostream & operator<< (std::ostream & out, const UberStructLayer::ImageModeProperties & image)

    Defined at line 165 of file ../../src/ui/scenic/lib/flatland/uber_struct_system.cc

  • std::ostream & operator<< (std::ostream & out, const UberStructLayer::SolidColorModeProperties & solid)

    Defined at line 170 of file ../../src/ui/scenic/lib/flatland/uber_struct_system.cc

  • std::ostream & operator<< (std::ostream & out, const UberStructLayer & layer)

    Defined at line 176 of file ../../src/ui/scenic/lib/flatland/uber_struct_system.cc

  • std::ostream & operator<< (std::ostream & out, const UberStruct & us)

    Defined at line 191 of file ../../src/ui/scenic/lib/flatland/uber_struct_system.cc

  • void ImportImageTest (async::TestLoop & loop, Renderer * renderer, fidl::WireClient<fuchsia_sysmem2::Allocator> & sysmem_allocator, bool use_vulkan)

    Test the ImportBufferImage() function. First call ImportBufferImage() without setting the client

    constraints, which should return false, and then set the client constraints which

    should cause it to return true.

    Defined at line 363 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.cc

  • void DeregistrationTest (async::TestLoop & loop, Renderer * renderer, fidl::WireClient<fuchsia_sysmem2::Allocator> & sysmem_allocator, bool use_vulkan)

    Simple release test that calls ReleaseBufferCollection() directly without

    any zx::events just to make sure that the method's functionality itself is

    working as intended.

    Defined at line 401 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.cc

  • void RenderImageAfterBufferCollectionReleasedTest (async::TestLoop & loop, Renderer * renderer, fidl::WireClient<fuchsia_sysmem2::Allocator> & sysmem_allocator, bool use_vulkan)

    Test that calls ReleaseBufferCollection() before ReleaseBufferImage() and makes sure that

    imported Image can still be rendered.

    Defined at line 447 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.cc

  • void RenderAfterImageReleasedTest (async::TestLoop & loop, Renderer * renderer, fidl::WireClient<fuchsia_sysmem2::Allocator> & sysmem_allocator, bool use_vulkan)

    Defined at line 520 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.cc

  • void MultithreadingTest (Renderer * renderer, bool use_vulkan)

    Test to make sure we can call the functions import kRenderTarget and kClientImage collections

    and ImportBufferImage() simultaneously from multiple threads and have it work.

    Defined at line 583 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.cc

  • void AsyncEventSignalTest (async::TestLoop & loop, Renderer * renderer, fidl::WireClient<fuchsia_sysmem2::Allocator> & sysmem_allocator, bool use_vulkan)

    This test checks to make sure that the Render() function properly signals

    a zx::event which can be used by an async::Wait object to asynchronously

    call a custom function.

    Defined at line 660 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.cc

  • bool operator<= (const glm::tvec4<int, glm::packed_highp> & a, const glm::tvec4<int, glm::packed_highp> & b)

    Partial ordering, true if it's true for all components.

    Defined at line 2283 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.cc

  • template <>
    InRangeMatcherP2<low_type, high_type> InRange (low_type gmock_p0, high_type gmock_p1)

    Defined at line 2288 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.cc

Variables

const std::array<float, 9> kDefaultColorConversionCoefficients

Defined at line 9 of file ../../src/ui/scenic/lib/flatland/engine/color_conversion_state_machine.cc

const std::array<float, 3> kDefaultColorConversionOffsets

Defined at line 10 of file ../../src/ui/scenic/lib/flatland/engine/color_conversion_state_machine.cc

const TransformClipRegion kUnclippedRegion

Defined at line 19 of file ../../src/ui/scenic/lib/flatland/global_matrix_data.cc