The service provides functionality for working with shared textures in JetBrainsRuntime.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Metal textures are supported. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the texture type supported by the current rendering pipeling.wrapTexture
(GraphicsConfiguration gc, long texture) Wraps the specified texture into an image that is compatible with the given graphics configuration.
-
Field Details
-
Method Details
-
getTextureType
int getTextureType()Returns the texture type supported by the current rendering pipeling.- Returns:
- the type of shared texture supported.
-
wrapTexture
Wraps the specified texture into an image that is compatible with the given graphics configuration.Notes:
- The resulting image cannot be used as a drawing destination.
- The resulting image is compatible with the provided
GraphicsConfiguration
. It is the responsibility of client code to track graphics configuration changes and recreate the wrapping image. - Wrapping a texture has some overhead (allocating stencil data on Metal). It is advisable to reuse the
image during the texture's lifetime unless the
GraphicsConfiguration
changes. - Client code is responsible for ensuring proper synchronization. All operations involving the texture must have been completed before the resulting image is used within the JBR rendering pipeline.
- Texture liftime:
- Metal: This texture is retained for the wrapping image lifetime and will be released after the image has been disposed.
- Parameters:
gc
- the targetGraphicsConfiguration
.texture
- the texture to be wrapped.Platform-specific:
- macOS (with the Metal rendering pipeline): a pointer to an
MTLTexture
object
- macOS (with the Metal rendering pipeline): a pointer to an
- Returns:
- a wrapping image compatible with the specified
GraphicsConfiguration
. - Throws:
UnsupportedOperationException
- if the current pipeline is not supported.IllegalArgumentException
- if the texture cannot be wrapped. The details are logged inJ2D_TRACE_ERROR
.
-