Namespaces

Enumerations

enum HostPointerAccessMode
Name Value
kReadOnly 0b01
kWriteOnly 0b10
kReadWrite 0b11

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

Records

Functions

  • fuchsia::sysmem2::BufferUsage get_none_usage ()

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

  • 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 17 of file ../../src/ui/scenic/lib/flatland/renderer/tests/common.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 12 of file ../../src/ui/scenic/lib/flatland/global_image_data.cc

  • fuchsia::sysmem2::BufferUsage get_cpu_usage_read ()

    Defined at line 35 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.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 286 of file ../../src/ui/scenic/lib/flatland/global_matrix_data.cc

  • GlobalImageData ComputeGlobalImageData (const GlobalTopologyData::TopologyVector & global_topology, const GlobalTopologyData::ParentIndexVector & parent_indices, const UberStruct::InstanceMap & uber_structs)

    Computes the list of Images given a |global_topology| and the |uber_structs| used to generate

    that topology. Note that not all TransformHandles will have Images, so the return value will

    have fewer entries than there are in the global topology.

    Defined at line 57 of file ../../src/ui/scenic/lib/flatland/global_image_data.cc

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

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

  • void ComputeGlobalImageData (GlobalIndexVector & output_indices, GlobalImageVector & output_images, const GlobalTopologyData::TopologyVector & global_topology, const GlobalTopologyData::ParentIndexVector & parent_indices, const UberStruct::InstanceMap & uber_structs)

    static

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

  • void ImportCollectionTest (Renderer * renderer, fuchsia::sysmem2::Allocator_Sync * sysmem_allocator)

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

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

  • void DumpScene (const flatland::UberStruct::InstanceMap & snapshot, const flatland::GlobalTopologyData & topology_data, const flatland::GlobalImageVector & images, const flatland::GlobalIndexVector & image_indices, const flatland::GlobalRectangleVector & image_rectangles, std::ostream & output)

    Dumps information about a flatland scene to an output stream.

    Defined at line 197 of file ../../src/ui/scenic/lib/flatland/scene_dumper.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

  • GlobalImageSampleRegionVector ComputeGlobalImageSampleRegions (const GlobalTopologyData::TopologyVector & global_topology, const GlobalTopologyData::ParentIndexVector & parent_indices, const UberStruct::InstanceMap & uber_structs)

    Gathers the image sample regions for each transform in |global_topology| using the local

    image sample regions in the |uber_structs|. If a transform doesn't have image sample

    regions present in the appropriate UberStruct, this function assumes the region is null.

    Defined at line 344 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 ComputeGlobalImageSampleRegions (GlobalImageSampleRegionVector & output, const GlobalTopologyData::TopologyVector & global_topology, const GlobalTopologyData::ParentIndexVector & parent_indices, const UberStruct::InstanceMap & uber_structs)

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

  • void SetClientConstraintsAndWaitForAllocated (fuchsia::sysmem2::Allocator_Sync * sysmem_allocator, fuchsia::sysmem2::BufferCollectionTokenSyncPtr 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

  • 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 376 of file ../../src/ui/scenic/lib/flatland/global_matrix_data.cc

  • fuchsia::sysmem2::BufferCollectionSyncPtr CreateBufferCollectionSyncPtrAndSetConstraints (fuchsia::sysmem2::Allocator_Sync * sysmem_allocator, fuchsia::sysmem2::BufferCollectionTokenSyncPtr token, uint32_t image_count, uint32_t width, uint32_t height, fuchsia::sysmem2::BufferUsage usage, fuchsia::images2::PixelFormat 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 90 of file ../../src/ui/scenic/lib/flatland/buffers/util.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 386 of file ../../src/ui/scenic/lib/flatland/global_matrix_data.cc

  • 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 449 of file ../../src/ui/scenic/lib/flatland/global_matrix_data.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 165 of file ../../src/ui/scenic/lib/flatland/buffers/util.cc

  • std::ostream & operator<< (std::ostream & str, const flatland::ImageRect & r)

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

  • void SameTokenTwiceTest (Renderer * renderer, fuchsia::sysmem2::Allocator_Sync * 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 173 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.cc

  • GlobalRectangleVector ComputeGlobalRectangles (const GlobalMatrixVector & matrices, const GlobalImageSampleRegionVector & sample_regions, const GlobalTransformClipRegionVector & clip_regions, const GlobalIndexVector & image_indices, const std::vector<allocation::ImageMetadata> & images)

    Computes the global rectangle for each matrix in |matrices|.

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

  • void ComputeGlobalRectangles (GlobalRectangleVector & output, const GlobalMatrixVector & matrices, const GlobalImageSampleRegionVector & sample_regions, const GlobalTransformClipRegionVector & clip_regions, const GlobalIndexVector & image_indices, const std::vector<allocation::ImageMetadata> & images)

    Defined at line 497 of file ../../src/ui/scenic/lib/flatland/global_matrix_data.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 181 of file ../../src/ui/scenic/lib/flatland/buffers/util.cc

  • void BadImageInputTest (Renderer * renderer, fuchsia::sysmem2::Allocator_Sync * sysmem_allocator, bool use_vulkan)

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

  • void ImportImageTest (Renderer * renderer, fuchsia::sysmem2::Allocator_Sync * 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 277 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.cc

  • void DeregistrationTest (Renderer * renderer, fuchsia::sysmem2::Allocator_Sync * 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 313 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.cc

  • void RenderImageAfterBufferCollectionReleasedTest (Renderer * renderer, fuchsia::sysmem2::Allocator_Sync * sysmem_allocator, bool use_vulkan)

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

    imported Image can still be rendered.

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

  • void RenderAfterImageReleasedTest (Renderer * renderer, fuchsia::sysmem2::Allocator_Sync * sysmem_allocator, bool use_vulkan)

    Defined at line 424 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 488 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.cc

  • void CullRectanglesInPlace (GlobalRectangleVector * rectangles_in_out, GlobalImageVector * images_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 541 of file ../../src/ui/scenic/lib/flatland/global_matrix_data.cc

  • void AsyncEventSignalTest (async::TestLoop * loop, Renderer * renderer, fuchsia::sysmem2::Allocator_Sync * 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 564 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 2047 of file ../../src/ui/scenic/lib/flatland/renderer/tests/renderer_unittest.cc

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

    Defined at line 2052 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 ImageSampleRegion kInvalidSampleRegion

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

const TransformClipRegion kUnclippedRegion

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