Package com.jetbrains

Interface SharedTextures


@Service @Provided public interface SharedTextures
The service provides functionality for working with shared textures in JetBrainsRuntime.
  • Field Summary Link icon

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Metal textures are supported.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    int
    Returns the texture type supported by the current rendering pipeling.
    Wraps the specified texture into an image that is compatible with the given graphics configuration.
  • Field Details Link icon

    • METAL_TEXTURE_TYPE Link icon

      static final int METAL_TEXTURE_TYPE
      Metal textures are supported.
      See Also:
  • Method Details Link icon

    • getTextureType Link icon

      int getTextureType()
      Returns the texture type supported by the current rendering pipeling.
      Returns:
      the type of shared texture supported.
    • wrapTexture Link icon

      Image wrapTexture(GraphicsConfiguration gc, long texture)
      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 target GraphicsConfiguration.
      texture - the texture to be wrapped.

      Platform-specific:

      • macOS (with the Metal rendering pipeline): a pointer to an MTLTexture object
      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 in J2D_TRACE_ERROR.