APIdia Launch Partner
Top Fields Constructors Methods
com.sun.prism.mtl

pack-priv Class MTLRTTexture

extends MTLTexture<MTLTextureData>
implements RTTexture, ReadbackRenderTarget
Class Inheritance
All Implemented Interfaces
com.sun.prism.ReadbackRenderTarget, com.sun.prism.RenderTarget, com.sun.prism.Surface, com.sun.prism.RTTexture, com.sun.prism.Texture, com.sun.prism.GraphicsResource
Imports
com.sun.glass.ui.Screen, com.sun.prism.Graphics, .Image, .MediaFrame, .PixelFormat, .RTTexture, .ReadbackRenderTarget, .Texture, java.nio.Buffer, .IntBuffer

Field Summary

Modifier and TypeField and Description
private final boolean
private final long
private boolean
private final int[]
private final int
private final int

Constructor Summary

AccessConstructor and Description
private
MTLRTTexture(MTLContext context, MTLTextureResource<MTLTextureData> resource, Texture.WrapMode wrapMode, int physicalWidth, int physicalHeight, int contentX, int contentY, int contentWidth, int contentHeight, int maxContentWidth, int maxContentHeight, boolean msaa)

Method Summary

Modifier and TypeMethod and Description
pack-priv static MTLRTTexture
create(MTLContext context, int physicalWidth, int physicalHeight, int contentWidth, int contentHeight, Texture.WrapMode wrapMode, boolean msaa, long size)

pack-priv static MTLRTTexture
create(MTLContext context, long pTex, int width, int height, long size)

public Graphics
public Screen
public Texture
public long
public int[]
public Texture
getSharedTexture(Texture.WrapMode altMode)

Overrides com.sun.prism.impl.BaseTexture.getSharedTexture.

Implements com.sun.prism.Texture.getSharedTexture.

Constructs an alternate version of this Texture with an alternate WrapMode if the two modes allow the underlying texture to be shared, otherwise a null value is returned.

public boolean
getUseMipmap()

Overrides com.sun.prism.impl.BaseTexture.getUseMipmap.

Implements com.sun.prism.Texture.getUseMipmap.

Returns the true if mipmapping is used for this texture.

public boolean
public boolean
public boolean
private static native long
nCreateRT(long context, int pw, int ph, int cw, int ch, Texture.WrapMode wrapMode, boolean msaa)

private static native long
nCreateRT2(long context, long pTex, int pw, int ph)

private static native long
nGetPixelDataPtr(long nativeHandle)

private static native void
nInitRTT(long pTex, int[] pix)

private static native void
nReadPixels(long nativeHandle, int[] pixBuffer)

private static native void
nReadPixelsFromRTT(long nativeHandle, IntBuffer pixBuffer)

public boolean
public boolean
readPixels(Buffer pixels, int x, int y, int width, int height)

Implements com.sun.prism.RTTexture.readPixels.

public void
setContentHeight(int contentHeight)

Overrides com.sun.prism.impl.BaseTexture.setContentHeight.

Implements com.sun.prism.Texture.setContentHeight.

Allows the content height, which is the current height of the actual content in pixels, to be adjusted.

public void
setContentWidth(int contentWidth)

Overrides com.sun.prism.impl.BaseTexture.setContentWidth.

Implements com.sun.prism.Texture.setContentWidth.

Allows the content width, which is the current width of the actual content in pixels, to be adjusted.

public void
public void
update(Image img)

Overrides com.sun.prism.impl.BaseTexture.update.

Implements com.sun.prism.Texture.update.

Updates this texture using the contents of the given Image.

public void
update(Image img, int dstx, int dsty)

Overrides com.sun.prism.impl.BaseTexture.update.

Implements com.sun.prism.Texture.update.

Updates this texture using the contents of the given Image.

public void
update(Image img, int dstx, int dsty, int srcw, int srch)

Overrides com.sun.prism.impl.BaseTexture.update.

Implements com.sun.prism.Texture.update.

Updates this texture using the contents of the given Image.

public void
update(Image img, int dstx, int dsty, int srcw, int srch, boolean skipFlush)

Overrides com.sun.prism.impl.BaseTexture.update.

Implements com.sun.prism.Texture.update.

Updates this texture using the contents of the given Image.

public void
update(Buffer buffer, PixelFormat format, int dstx, int dsty, int srcx, int srcy, int srcw, int srch, int srcscan, boolean skipFlush)

Overrides com.sun.prism.mtl.MTLTexture.update.

Implements com.sun.prism.Texture.update.

Updates this texture using the contents of the given Buffer.

public void
update(MediaFrame frame, boolean skipFlush)

Overrides com.sun.prism.mtl.MTLTexture.update.

Implements com.sun.prism.Texture.update.

Updates this texture using the contents of the provided MediaFrame.

Inherited from com.sun.prism.mtl.MTLTexture:
createSharedTexturegetContext

Field Detail

MSAAback to summary
private final boolean MSAA
nTexPtrback to summary
private final long nTexPtr
opaqueback to summary
private boolean opaque
pixelsback to summary
private final int[] pixels
rttHeightback to summary
private final int rttHeight
rttWidthback to summary
private final int rttWidth

Constructor Detail

MTLRTTextureback to summary
private MTLRTTexture(MTLContext context, MTLTextureResource<MTLTextureData> resource, Texture.WrapMode wrapMode, int physicalWidth, int physicalHeight, int contentX, int contentY, int contentWidth, int contentHeight, int maxContentWidth, int maxContentHeight, boolean msaa)

Method Detail

createback to summary
pack-priv static MTLRTTexture create(MTLContext context, int physicalWidth, int physicalHeight, int contentWidth, int contentHeight, Texture.WrapMode wrapMode, boolean msaa, long size)
createback to summary
pack-priv static MTLRTTexture create(MTLContext context, long pTex, int width, int height, long size)
createGraphicsback to summary
public Graphics createGraphics()

Implements com.sun.prism.RenderTarget.createGraphics.

Annotations
@Override
getAssociatedScreenback to summary
public Screen getAssociatedScreen()

Implements com.sun.prism.RenderTarget.getAssociatedScreen.

Annotations
@Override
getBackBufferback to summary
public Texture getBackBuffer()

Implements com.sun.prism.ReadbackRenderTarget.getBackBuffer.

Annotations
@Override
getNativeHandleback to summary
public long getNativeHandle()

Overrides com.sun.prism.mtl.MTLTexture.getNativeHandle.

Annotations
@Override
getPixelsback to summary
public int[] getPixels()

Implements com.sun.prism.RTTexture.getPixels.

Annotations
@Override
getSharedTextureback to summary
public Texture getSharedTexture(Texture.WrapMode altMode)

Overrides com.sun.prism.impl.BaseTexture.getSharedTexture.

Implements com.sun.prism.Texture.getSharedTexture.

Doc from com.sun.prism.Texture.getSharedTexture.

Constructs an alternate version of this Texture with an alternate WrapMode if the two modes allow the underlying texture to be shared, otherwise a null value is returned. This method can only be used to create a shared texture for REPEAT or CLAMP_TO_EDGE textures, which must necessarily have content that spans their entire physical dimensions (if their content was smaller then they would have a _SIMULATED type of wrap mode). This method expects the texture to be already locked (and checked for a valid surface) and if it returns a non-null value then that return value will have an outstanding lock in addition to retaining the lock on the original texture. Note that if the requested WrapMode is the same as the wrap mode of this texture, then this same object will be returned after having its lock count increased by 1. Thus, in all cases, the caller is responsible for locking this texture before the call, and eventually unlocking this texture after the call, and also for eventually unlocking the return value if it is non-null.

Annotations
@Override
getUseMipmapback to summary
public boolean getUseMipmap()

Overrides com.sun.prism.impl.BaseTexture.getUseMipmap.

Implements com.sun.prism.Texture.getUseMipmap.

Doc from com.sun.prism.Texture.getUseMipmap.

Returns the true if mipmapping is used for this texture.

Annotations
@Override
isMSAAback to summary
public boolean isMSAA()

Implements com.sun.prism.RenderTarget.isMSAA.

Annotations
@Override
isOpaqueback to summary
public boolean isOpaque()

Implements com.sun.prism.RenderTarget.isOpaque.

Annotations
@Override
isVolatileback to summary
public boolean isVolatile()

Implements com.sun.prism.RTTexture.isVolatile.

Annotations
@Override
nCreateRTback to summary
private static native long nCreateRT(long context, int pw, int ph, int cw, int ch, Texture.WrapMode wrapMode, boolean msaa)
nCreateRT2back to summary
private static native long nCreateRT2(long context, long pTex, int pw, int ph)
nGetPixelDataPtrback to summary
private static native long nGetPixelDataPtr(long nativeHandle)
nInitRTTback to summary
private static native void nInitRTT(long pTex, int[] pix)
nReadPixelsback to summary
private static native void nReadPixels(long nativeHandle, int[] pixBuffer)
nReadPixelsFromRTTback to summary
private static native void nReadPixelsFromRTT(long nativeHandle, IntBuffer pixBuffer)
readPixelsback to summary
public boolean readPixels(Buffer pix)

Implements com.sun.prism.RTTexture.readPixels.

Annotations
@Override
readPixelsback to summary
public boolean readPixels(Buffer pixels, int x, int y, int width, int height)

Implements com.sun.prism.RTTexture.readPixels.

Annotations
@Override
setContentHeightback to summary
public void setContentHeight(int contentHeight)

Overrides com.sun.prism.impl.BaseTexture.setContentHeight.

Implements com.sun.prism.Texture.setContentHeight.

Doc from com.sun.prism.Texture.setContentHeight.

Allows the content height, which is the current height of the actual content in pixels, to be adjusted. The height must be between 0 and maxContentHeight . *

Annotations
@Override
setContentWidthback to summary
public void setContentWidth(int contentWidth)

Overrides com.sun.prism.impl.BaseTexture.setContentWidth.

Implements com.sun.prism.Texture.setContentWidth.

Doc from com.sun.prism.Texture.setContentWidth.

Allows the content width, which is the current width of the actual content in pixels, to be adjusted. The height must be between 0 and maxContentHeight

Annotations
@Override
setOpaqueback to summary
public void setOpaque(boolean opaque)

Implements com.sun.prism.RenderTarget.setOpaque.

Annotations
@Override
updateback to summary
public void update(Image img)

Overrides com.sun.prism.impl.BaseTexture.update.

Implements com.sun.prism.Texture.update.

Doc from com.sun.prism.Texture.update.

Updates this texture using the contents of the given Image. The upper-left corner of the image data will be positioned at (contentX, contentY) of the texture, and the full width and height of the image will be uploaded. This method will cause the vertex buffer to be flushed prior to uploading the pixels.

This is equivalent to calling:

    update(img, 0, 0);
Annotations
@Override
updateback to summary
public void update(Image img, int dstx, int dsty)

Overrides com.sun.prism.impl.BaseTexture.update.

Implements com.sun.prism.Texture.update.

Doc from com.sun.prism.Texture.update.

Updates this texture using the contents of the given Image. The upper-left corner of the image data will be positioned at (contentX+dstx, contentY+dsty) of the texture, and the full width and height of the image will be uploaded. This method will cause the vertex buffer to be flushed prior to uploading the pixels.

This is equivalent to calling:

    update(img, dstx, dsty, img.getWidth(), img.getHeight());
Annotations
@Override
updateback to summary
public void update(Image img, int dstx, int dsty, int srcw, int srch)

Overrides com.sun.prism.impl.BaseTexture.update.

Implements com.sun.prism.Texture.update.

Doc from com.sun.prism.Texture.update.

Updates this texture using the contents of the given Image. The upper-left corner of the image data will be positioned at (contentX+dstx, contentY+dsty) of the texture, and the source region to be uploaded will be srcw by srch pixels. This method will cause the vertex buffer to be flushed prior to uploading the pixels.

This is equivalent to calling:

    update(img, dstx, dsty, srcw, srch, false);
Annotations
@Override
updateback to summary
public void update(Image img, int dstx, int dsty, int srcw, int srch, boolean skipFlush)

Overrides com.sun.prism.impl.BaseTexture.update.

Implements com.sun.prism.Texture.update.

Doc from com.sun.prism.Texture.update.

Updates this texture using the contents of the given Image. The upper-left corner of the image data will be positioned at (contentX+dstx, contentY+dsty) of the texture, and the source region to be uploaded will be srcw by srch pixels. This method will cause the vertex buffer to be flushed unless skipFlush is true.

This is equivalent to calling:

    update(img.getPixelBuffer(), img.getPixelFormat(),
           dstx, dsty, img.getMinX(), img.getMinY(),
           srcw, srch, img.getScanlineStride(), skipFlush);
Annotations
@Override
updateback to summary
public void update(Buffer buffer, PixelFormat format, int dstx, int dsty, int srcx, int srcy, int srcw, int srch, int srcscan, boolean skipFlush)

Overrides com.sun.prism.mtl.MTLTexture.update.

Implements com.sun.prism.Texture.update.

Doc from com.sun.prism.Texture.update.

Updates this texture using the contents of the given Buffer. The upper-left corner of the image data will be positioned at (contentX+dstx, contentY+dsty) of the texture, and the source region to be uploaded will be srcw by srch pixels. This method will cause the vertex buffer to be flushed unless skipFlush is true.

Annotations
@Override
updateback to summary
public void update(MediaFrame frame, boolean skipFlush)

Overrides com.sun.prism.mtl.MTLTexture.update.

Implements com.sun.prism.Texture.update.

Doc from com.sun.prism.Texture.update.

Updates this texture using the contents of the provided MediaFrame. The source and destination coordinates are implicit, you can only update the entire video texture.

Annotations
@Override