Top Description Fields Constructors Methods
com.sun.prism

public final Class MultiTexture

extends Object
implements Texture
Class Inheritance
All Implemented Interfaces
com.sun.prism.Texture, com.sun.prism.GraphicsResource
Imports
java.nio.Buffer, .ByteBuffer, java.util.ArrayList

A "texture" that wraps a list of sub-textures and values needed for multitexturing.

Field Summary

Modifier and TypeField and Description
private PixelFormat
private int
private int
private boolean
private final ArrayList<Texture>
private int
private Texture.WrapMode

Constructor Summary

AccessConstructor and Description
public
MultiTexture(PixelFormat format, Texture.WrapMode wrapMode, int width, int height)

private

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
public void
public int
getContentHeight()

Implements com.sun.prism.Texture.getContentHeight.

Returns the content height of this texture, in pixels.

public int
getContentWidth()

Implements com.sun.prism.Texture.getContentWidth.

Returns the content width of this texture, in pixels.

public int
getContentX()

Implements com.sun.prism.Texture.getContentX.

Returns the content x-origin of this texture relative to the upper-left corner, in pixels.

public int
getContentY()

Implements com.sun.prism.Texture.getContentY.

Returns the content y-origin of this texture relative to the upper-left corner, in pixels.

public int
public boolean
getLinearFiltering()

Implements com.sun.prism.Texture.getLinearFiltering.

Returns whether linear (smooth) filtering will be used when rendering this texture.

public int
public int
getMaxContentHeight()

Implements com.sun.prism.Texture.getMaxContentHeight.

Returns the max content height of this texture, in pixels.

public int
getMaxContentWidth()

Implements com.sun.prism.Texture.getMaxContentWidth.

Returns the max content width of this texture, in pixels.

public int
getPhysicalHeight()

Implements com.sun.prism.Texture.getPhysicalHeight.

Returns the physical height of this texture, in pixels.

public int
getPhysicalWidth()

Implements com.sun.prism.Texture.getPhysicalWidth.

Returns the physical width of this texture, in pixels.

public PixelFormat
getPixelFormat()

Implements com.sun.prism.Texture.getPixelFormat.

Returns the PixelFormat of this texture.

public Texture
getSharedTexture(Texture.WrapMode altMode)

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 Texture
getTexture(int index)

public Texture[]
public boolean
getUseMipmap()

Implements com.sun.prism.Texture.getUseMipmap.

Returns the true if mipmapping is used for this texture.

public Texture.WrapMode
getWrapMode()

Implements com.sun.prism.Texture.getWrapMode.

Returns the WrapMode for this texture.

public boolean
public boolean
isSurfaceLost()

Implements com.sun.prism.Texture.isSurfaceLost.

Called by code wanting to know if the RTTexture's surface is lost.

public void
public void
public void
public void
removeTexture(int index)

public void
setContentHeight(int
The actual new height of user pixels.
contentHeight
)

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
The actual new width of user pixels.
contentWidth
)

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
setLinearFiltering(boolean
if true, enables linear filtering; if false, enables nearest neighbor filtering
linear
)

Implements com.sun.prism.Texture.setLinearFiltering.

Sets whether linear filtering will be used when rendering this texture.

public void
setTexture(Texture tex, int index)

public int
public void
public void
update(Image
the image data to be uploaded to this texture
img
)

Implements com.sun.prism.Texture.update.

Updates this texture using the contents of the given Image.

public void
update(Image
the image data to be uploaded to this texture
img
,
int
the x-offset of the image data, in pixels, relative to the contentX of this texture
dstx
,
int
the y-offset of the image data, in pixels, relative to the contentY of this texture
dsty
)

Implements com.sun.prism.Texture.update.

Updates this texture using the contents of the given Image.

public void
update(Image
the image data to be uploaded to this texture
img
,
int
the x-offset of the image data, in pixels, relative to the contentX of this texture
dstx
,
int
the y-offset of the image data, in pixels, relative to the contentY of this texture
dsty
,
int
the width of the pixel region from the source image
srcw
,
int
the height of the pixel region from the source image
srch
)

Implements com.sun.prism.Texture.update.

Updates this texture using the contents of the given Image.

public void
update(Image
the image data to be uploaded to this texture
img
,
int
the x-offset of the image data, in pixels, relative to the contentX of this texture
dstx
,
int
the y-offset of the image data, in pixels, relative to the contentY of this texture
dsty
,
int
the width of the pixel region from the source image
srcw
,
int
the height of the pixel region from the source image
srch
,
boolean
if true, the vertex buffer will not be flushed
skipFlush
)

Implements com.sun.prism.Texture.update.

Updates this texture using the contents of the given Image.

public void
update(Buffer buffer, PixelFormat
the format of the data contained in the pixel buffer
format
,
int
the x-offset of the image data, in pixels, relative to the contentX of this texture
dstx
,
int
the y-offset of the image data, in pixels, relative to the contentY of this texture
dsty
,
int
the x-offset into the source buffer, in pixels
srcx
,
int
the y-offset into the source buffer, in pixels
srcy
,
int
the width of the pixel region from the source buffer
srcw
,
int
the height of the pixel region from the source buffer
srch
,
int
the scanline stride of the source buffer, in bytes
srcscan
,
boolean
if true, the vertex buffer will not be flushed
skipFlush
)

Implements com.sun.prism.Texture.update.

Updates this texture using the contents of the given Buffer.

public void
update(MediaFrame
the source video buffer to update the texture data from
frame
,
boolean
if true, the vertex buffer will not be flushed
skipFlush
)

Implements com.sun.prism.Texture.update.

Updates this texture using the contents of the provided MediaFrame.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

formatback to summary
private PixelFormat format
heightback to summary
private int height
lastImageSerialback to summary
private int lastImageSerial
linearFilteringback to summary
private boolean linearFiltering
texturesback to summary
private final ArrayList<Texture> textures
widthback to summary
private int width
wrapModeback to summary
private Texture.WrapMode wrapMode

Constructor Detail

MultiTextureback to summary
public MultiTexture(PixelFormat format, Texture.WrapMode wrapMode, int width, int height)
MultiTextureback to summary
private MultiTexture(MultiTexture sharedTex, Texture.WrapMode newMode)

Method Detail

assertLockedback to summary
public void assertLocked()

Implements com.sun.prism.Texture.assertLocked.

Annotations
@Override
contentsNotUsefulback to summary
public void contentsNotUseful()

Implements com.sun.prism.Texture.contentsNotUseful.

Annotations
@Override
contentsUsefulback to summary
public void contentsUseful()

Implements com.sun.prism.Texture.contentsUseful.

Annotations
@Override
disposeback to summary
public void dispose()

Implements com.sun.prism.GraphicsResource.dispose.

Annotations
@Override
getContentHeightback to summary
public int getContentHeight()

Implements com.sun.prism.Texture.getContentHeight.

Doc from com.sun.prism.Texture.getContentHeight.

Returns the content height of this texture, in pixels. Note that the content size of a texture may be smaller than the requested size due to hardware restrictions (e.g. lack of non-power-of-two texture support). The content height will be less than or equal to the content height.

For example, if the hardware does not support non-power-of-two textures, and you call ResourceFactory.createTexture(400, 200), the returned Texture will have physical dimensions of 512x256, but the content dimensions will be 400x200.

Returns:int

the content height of this texture, in pixels

Annotations
@Override
getContentWidthback to summary
public int getContentWidth()

Implements com.sun.prism.Texture.getContentWidth.

Doc from com.sun.prism.Texture.getContentWidth.

Returns the content width of this texture, in pixels. Note that the content size of a texture may be smaller than the requested size due to hardware restrictions (e.g. lack of non-power-of-two texture support). The content width will be less than or equal to the content width.

For example, if the hardware does not support non-power-of-two textures, and you call ResourceFactory.createTexture(400, 200), the returned Texture will have physical dimensions of 512x256, but the content dimensions will be 400x200.

Returns:int

the content width of this texture, in pixels

Annotations
@Override
getContentXback to summary
public int getContentX()

Implements com.sun.prism.Texture.getContentX.

Doc from com.sun.prism.Texture.getContentX.

Returns the content x-origin of this texture relative to the upper-left corner, in pixels. This value will be greater than equal to zero.

Returns:int

the content x-origin of this texture

Annotations
@Override
getContentYback to summary
public int getContentY()

Implements com.sun.prism.Texture.getContentY.

Doc from com.sun.prism.Texture.getContentY.

Returns the content y-origin of this texture relative to the upper-left corner, in pixels. This value will be greater than equal to zero.

Returns:int

the content y-origin of this texture

Annotations
@Override
getLastImageSerialback to summary
public int getLastImageSerial()

Implements com.sun.prism.Texture.getLastImageSerial.

Annotations
@Override
getLinearFilteringback to summary
public boolean getLinearFiltering()

Implements com.sun.prism.Texture.getLinearFiltering.

Doc from com.sun.prism.Texture.getLinearFiltering.

Returns whether linear (smooth) filtering will be used when rendering this texture. If false, a simple nearest neighbor algorithm will be used.

Returns:boolean

whether linear filtering will be used for this texture

Annotations
@Override
getLockCountback to summary
public int getLockCount()

Implements com.sun.prism.Texture.getLockCount.

Annotations
@Override
getMaxContentHeightback to summary
public int getMaxContentHeight()

Implements com.sun.prism.Texture.getMaxContentHeight.

Doc from com.sun.prism.Texture.getMaxContentHeight.

Returns the max content height of this texture, in pixels. Note that the content size of a texture may be smaller than the requested size due to hardware restrictions (e.g. lack of non-power-of-two texture support). The content height will be less than or equal to the max content height.

For example, if the hardware does not support non-power-of-two textures, and you call ResourceFactory.createTexture(400, 200), the returned Texture will have physical dimensions of 512x256 and the max content dimensions will be 512x256 minus any padding needed by the implementation to simulate edge conditions., but the content dimensions will be 400x200.

Returns:int

the max content height of this texture, in pixels

Annotations
@Override
getMaxContentWidthback to summary
public int getMaxContentWidth()

Implements com.sun.prism.Texture.getMaxContentWidth.

Doc from com.sun.prism.Texture.getMaxContentWidth.

Returns the max content width of this texture, in pixels. Note that the content size of a texture may be smaller than the requested size due to hardware restrictions (e.g. lack of non-power-of-two texture support). The content width will be less than or equal to the max content width.

For example, if the hardware does not support non-power-of-two textures, and you call ResourceFactory.createTexture(400, 200), the returned Texture will have physical dimensions of 512x256 and the max content dimensions will be 512x256 minus any padding needed by the implementation to simulate edge conditions., but the content dimensions will be 400x200.

Returns:int

the max content width of this texture, in pixels

Annotations
@Override
getPhysicalHeightback to summary
public int getPhysicalHeight()

Implements com.sun.prism.Texture.getPhysicalHeight.

Doc from com.sun.prism.Texture.getPhysicalHeight.

Returns the physical height of this texture, in pixels. Note that the physical size of a texture may be larger than the requested size due to hardware restrictions (e.g. lack of non-power-of-two texture support). The physical height will be greater than or equal to the content height.

Returns:int

the physical height of this texture, in pixels

Annotations
@Override
getPhysicalWidthback to summary
public int getPhysicalWidth()

Implements com.sun.prism.Texture.getPhysicalWidth.

Doc from com.sun.prism.Texture.getPhysicalWidth.

Returns the physical width of this texture, in pixels. Note that the physical size of a texture may be larger than the requested size due to hardware restrictions (e.g. lack of non-power-of-two texture support). The physical width will be greater than or equal to the content width.

Returns:int

the physical width of this texture, in pixels

Annotations
@Override
getPixelFormatback to summary
public PixelFormat getPixelFormat()

Implements com.sun.prism.Texture.getPixelFormat.

Doc from com.sun.prism.Texture.getPixelFormat.

Returns the PixelFormat of this texture.

Returns:PixelFormat

the PixelFormat of this texture

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

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
getTextureback to summary
public Texture getTexture(int index)
getTexturesback to summary
public Texture[] getTextures()
getUseMipmapback to summary
public boolean getUseMipmap()

Implements com.sun.prism.Texture.getUseMipmap.

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

Returns the true if mipmapping is used for this texture.

Returns:boolean

the useMipmap flag for this texture

Annotations
@Override
getWrapModeback to summary
public Texture.WrapMode getWrapMode()

Implements com.sun.prism.Texture.getWrapMode.

Doc from com.sun.prism.Texture.getWrapMode.

Returns the WrapMode for this texture.

Returns:Texture.WrapMode

the WrapMode for this texture

Annotations
@Override
isLockedback to summary
public boolean isLocked()

Implements com.sun.prism.Texture.isLocked.

Annotations
@Override
isSurfaceLostback to summary
public boolean isSurfaceLost()

Implements com.sun.prism.Texture.isSurfaceLost.

Doc from com.sun.prism.Texture.isSurfaceLost.

Called by code wanting to know if the RTTexture's surface is lost. This happens in some cases (mostly on Windows) when, for example, the user presses Ctrl+Alt+Delete, or the system goes to sleep.

Returns:boolean

True if the backing surface of this RTTexture is gone and the image is therefore no longer usable. False if it is still OK.

Annotations
@Override
lockback to summary
public void lock()

Implements com.sun.prism.Texture.lock.

Annotations
@Override
makePermanentback to summary
public void makePermanent()

Implements com.sun.prism.Texture.makePermanent.

Annotations
@Override
removeTextureback to summary
public void removeTexture(Texture tex)
removeTextureback to summary
public void removeTexture(int index)
setContentHeightback to summary
public void setContentHeight(int contentHeight)

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 . *

Parameters
contentHeight:int

The actual new height of user pixels.

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

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

Parameters
contentWidth:int

The actual new width of user pixels.

Annotations
@Override
setLastImageSerialback to summary
public void setLastImageSerial(int serial)

Implements com.sun.prism.Texture.setLastImageSerial.

Annotations
@Override
setLinearFilteringback to summary
public void setLinearFiltering(boolean linear)

Implements com.sun.prism.Texture.setLinearFiltering.

Doc from com.sun.prism.Texture.setLinearFiltering.

Sets whether linear filtering will be used when rendering this texture.

Parameters
linear:boolean

if true, enables linear filtering; if false, enables nearest neighbor filtering

Annotations
@Override
setTextureback to summary
public void setTexture(Texture tex, int index)
textureCountback to summary
public int textureCount()
unlockback to summary
public void unlock()

Implements com.sun.prism.Texture.unlock.

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

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);
Parameters
img:Image

the image data to be uploaded to this texture

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

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());
Parameters
img:Image

the image data to be uploaded to this texture

dstx:int

the x-offset of the image data, in pixels, relative to the contentX of this texture

dsty:int

the y-offset of the image data, in pixels, relative to the contentY of this texture

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

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);
Parameters
img:Image

the image data to be uploaded to this texture

dstx:int

the x-offset of the image data, in pixels, relative to the contentX of this texture

dsty:int

the y-offset of the image data, in pixels, relative to the contentY of this texture

srcw:int

the width of the pixel region from the source image

srch:int

the height of the pixel region from the source image

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

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);
Parameters
img:Image

the image data to be uploaded to this texture

dstx:int

the x-offset of the image data, in pixels, relative to the contentX of this texture

dsty:int

the y-offset of the image data, in pixels, relative to the contentY of this texture

srcw:int

the width of the pixel region from the source image

srch:int

the height of the pixel region from the source image

skipFlush:boolean

if true, the vertex buffer will not be flushed

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)

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.

Parameters
format:PixelFormat

the format of the data contained in the pixel buffer

dstx:int

the x-offset of the image data, in pixels, relative to the contentX of this texture

dsty:int

the y-offset of the image data, in pixels, relative to the contentY of this texture

srcx:int

the x-offset into the source buffer, in pixels

srcy:int

the y-offset into the source buffer, in pixels

srcw:int

the width of the pixel region from the source buffer

srch:int

the height of the pixel region from the source buffer

srcscan:int

the scanline stride of the source buffer, in bytes

skipFlush:boolean

if true, the vertex buffer will not be flushed

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

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.

Parameters
frame:MediaFrame

the source video buffer to update the texture data from

skipFlush:boolean

if true, the vertex buffer will not be flushed

Annotations
@Override