class BufferCollectionImporter
Defined at line 29 of file ../../src/ui/scenic/lib/allocation/buffer_collection_importer.h
This interface is used for importing Flatland buffer collections and images to external services
that would like to also have access to the collection and set their own constraints. This
interface allows Flatland to remain agnostic as to the implementation details of a buffer
collection consumer.
Public Methods
bool ImportBufferCollection (GlobalBufferCollectionId collection_id, fuchsia::sysmem2::Allocator_Sync * sysmem_allocator, fidl::InterfaceHandle<fuchsia::sysmem2::BufferCollectionToken> token, BufferCollectionUsage usage, std::optional<fuchsia::math::SizeU> size)
Allows the service to set its own constraints on the buffer collection. Must be set before
the buffer collection is fully allocated/validated. The return value indicates successful
importation via |true| and a failed importation via |false|. Returns false if |collection_id|
is already imported. The collection_id can be reused if the importation fails.
|token| must be a valid sysmem token.
|usage| determines the type of buffer collection to be imported.
|size| may be optionally set to indicate the intended size usage so that it may be specified
when setting constraints in |token|, i.e. for kRenderTarget allocations.
void ReleaseBufferCollection (GlobalBufferCollectionId collection_id, BufferCollectionUsage usage_type)
Releases the buffer collection from the service. It may be called while there are associated
Images alive.
bool ImportBufferImage (const ImageMetadata & metadata, BufferCollectionUsage usage_type)
Has the service create an image for itself from the provided buffer collection. Returns
true upon a successful import and false otherwise.
TODO(https://fxbug.dev/42140615): Give more detailed errors.
void ReleaseBufferImage (GlobalImageId image_id)
Releases the provided image from the service.
void ~BufferCollectionImporter ()
Defined at line 59 of file ../../src/ui/scenic/lib/allocation/buffer_collection_importer.h