Name Description Size
BackendSemaphore.h 1797
BackendTexture.h 5793
Context.h Returns true if there is work that was submitted to the GPU that has not finished. 12378
ContextOptions.h Disables correctness workarounds that are enabled for particular GPUs, OSes, or drivers. This does not affect code path choices that are made for perfomance reasons nor does it override other ContextOption settings. 3586
dawn
GraphiteTypes.h The fFinishedProc is called when the Recording has been submitted and finished on the GPU, or when there is a failure that caused it not to be submitted. The callback will always be called and the caller can use the callback to know it is safe to free any resources associated with the Recording that they may be holding onto. If the Recording is successfully submitted to the GPU the callback will be called with CallbackResult::kSuccess once the GPU has finished. All other cases where some failure occured it will be called with CallbackResult::kFailed. The fTargetSurface, if provided, is used as a target for any draws recorded onto a deferred canvas returned from Recorder::makeDeferredCanvas. This target surface must be provided iff the Recording contains any such draws. It must be Graphite-backed and its backing texture's TextureInfo must match the info provided to the Recorder when making the deferred canvas. fTargetTranslation is an additional translation applied to draws targeting fTargetSurface. The client may pass in two arrays of initialized BackendSemaphores to be included in the command stream. At some time before issuing commands in the Recording, the fWaitSemaphores will be waited on by the gpu. We only guarantee these wait semaphores block transfer and fragment shader work. Similarly, at some time after issuing the Recording's commands, the fSignalSemaphores will be signaled by the gpu. Depending on the platform, the timing of the wait and signal operations will either be immediately before or after the given Recording's command stream, respectively, or before and after the entire CommandBuffer's command stream. The semaphores are not sent to the GPU until the next Context::submit call is made. The client will own and be responsible for deleting the underlying semaphore objects after the submission completes, however the BackendSemaphore objects themselves can be deleted as soon as this function returns. 5440
Image.h Creates an SkImage from a GPU texture associated with the recorder. The client is still responsible for managing the backend texture's lifetime. SkImage is returned if the format of backendTexture is recognized and supported. Recognized formats vary by GPU back-end. @param recorder The recorder @param backendTexture texture residing on GPU @param colorSpace This describes the color space of this image's contents, as seen after sampling. In general, if the format of the backend texture is SRGB, some linear colorSpace should be supplied (e.g., SkColorSpace::MakeSRGBLinear()). If the format of the backend texture is linear, then the colorSpace should include a description of the transfer function as well (e.g., SkColorSpace::MakeSRGB()). @param origin Whether the Texture logically treats the origin as TopLeft or BottomLeft @param generateMipmapsFromBase If kYes then the pixel contents of the textures upper mipmap levels are generated by successive downsampling of the base level. If the texture is not mipmapped or isn't renderable then image creation will fail. If kNo and the texture is mipmapped then the contents of upper levels are assumed to already be valid. @return created SkImage, or nullptr 21351
ImageProvider.h This class provides a centralized location for clients to perform any caching of images they desire. Whenever Graphite encounters an SkImage which is not Graphite-backed it will call ImageProvider::findOrCreate. The client's derived version of this class should return a Graphite-backed version of the provided SkImage that meets the specified requirements. Skia requires that 'findOrCreate' return a Graphite-backed image that preserves the dimensions and alpha type of the original image. The bit depth of the individual channels can change (e.g., 4444 -> 8888 is allowed) as well as the channels - as long as the returned image has a superset of the original image's channels (e.g., 565 -> 8888 opaque is allowed). Wrt mipmapping, the returned image can have different mipmap settings than requested. If mipmapping was requested but not returned, the sampling level will be reduced to linear. If the requirements are not met by the returned image (modulo the flexibility wrt mipmapping) Graphite will drop the draw. All returned images must be backed by textures that have a TopLeft origin. If Skia is used to create the texture (e.g. using makeTextureImage) then this is always guaranteed. If the client returns a texture they created themselves and wrapped in Skia, they must ensure that texture has a TopLeft origin. Note: by default, Graphite will not perform any caching of images Threading concerns: If the same ImageProvider is given to multiple Recorders it is up to the client to handle any required thread synchronization. This is not limited to just restricting access to whatever map a derived class may have but extends to ensuring that an image created on one Recorder has had its creation work submitted before it is used by any work submitted by another Recording. Please note, this requirement (re the submission of creation work and image usage on different threads) is common to all graphite SkImages and isn't unique to SkImages returned by the ImageProvider. TODO(b/240996632): add documentation re shutdown order. TODO(b/240997067): add unit tests 3181
mtl
Recorder.h Creates a new backend gpu texture matching the dimensions and TextureInfo. If an invalid TextureInfo or a TextureInfo Skia can't support is passed in, this will return an invalid BackendTexture. Thus the client should check isValid on the returned BackendTexture to know if it succeeded or not. If this does return a valid BackendTexture, the caller is required to use Recorder::deleteBackendTexture or Context::deleteBackendTexture to delete the texture. It is safe to use the Context that created this Recorder or any other Recorder created from the same Context to call deleteBackendTexture. 11729
Recording.h 2858
Surface.h The 'AsImage' and 'AsImageCopy' API/entry points are currently only available for Graphite. In this API, SkSurface no longer supports copy-on-write behavior. Instead, when creating an image for a surface, the client must explicitly indicate if a copy should be made. In both of the below calls the resource backing the surface will never change. The 'AsImage' entry point has some major ramifications for the mutability of the returned SkImage. Since the originating surface and the returned image share the same backing, care must be taken by the client to ensure that the contents of the image reflect the desired contents when it is consumed by the gpu. Note: if the backing GPU buffer isn't textureable this method will return null. Graphite will not attempt to make a copy. Note: For 'AsImage', the mipmapping of the image will match that of the source surface. The 'AsImageCopy' entry point allows subsetting and the addition of mipmaps (since a copy is already being made). In Graphite, the legacy API call (i.e., makeImageSnapshot) will just always make a copy. 3947
TextureInfo.h 4611
vk
YUVABackendTextures.h A description of a set of BackendTextures that hold the planar data described by a SkYUVAInfo. 4992