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

pack-priv abstract Class SWTexture

extends Object
implements Texture
Class Inheritance
All Implemented Interfaces
com.sun.prism.Texture, com.sun.prism.GraphicsResource
Known Direct Subclasses
com.sun.prism.sw.SWArgbPreTexture, com.sun.prism.sw.SWMaskTexture
Imports
com.sun.prism.Image, .PixelFormat, .Texture, com.sun.prism.impl.PrismSettings

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv int
pack-priv int
pack-priv int
private SWResourceFactory
private int
private boolean
private int
pack-priv boolean
pack-priv int
pack-priv int
private final Texture.WrapMode

Constructor Summary

AccessConstructor and Description
pack-priv
SWTexture(SWResourceFactory factory, Texture.WrapMode wrapMode, int w, int h)

pack-priv
SWTexture(SWTexture sharedTex, Texture.WrapMode altMode)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv abstract void
public void
public void
public void
pack-priv static Texture
create(SWResourceFactory factory, PixelFormat formatHint, Texture.WrapMode wrapMode, int w, int h)

pack-priv abstract Texture

Returns:

a new, locked, texture object sharing all information with this texture except for the WrapMode
createSharedLockedTexture
(Texture.WrapMode
the new WrapMode for the new texture
altMode
)

Returns a new Texture object sharing all of the information from this texture, but using the new WrapMode.

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.

pack-priv int
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.

pack-priv SWResourceFactory
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 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
setContentHeight(int 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 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 linear)

Implements com.sun.prism.Texture.setLinearFiltering.

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

public void
public void
update(Image img)

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)

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)

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)

Implements com.sun.prism.Texture.update.

Updates this texture using the contents of the given Image.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allocatedback to summary
pack-priv boolean allocated
contentHeightback to summary
pack-priv int contentHeight
contentWidthback to summary
pack-priv int contentWidth
employcountback to summary
pack-priv int employcount
factoryback to summary
private SWResourceFactory factory
lastImageSerialback to summary
private int lastImageSerial
linearFilteringback to summary
private boolean linearFiltering
lockcountback to summary
private int lockcount
permanentback to summary
pack-priv boolean permanent
physicalHeightback to summary
pack-priv int physicalHeight
physicalWidthback to summary
pack-priv int physicalWidth
wrapModeback to summary
private final Texture.WrapMode wrapMode

Constructor Detail

SWTextureback to summary
pack-priv SWTexture(SWResourceFactory factory, Texture.WrapMode wrapMode, int w, int h)
SWTextureback to summary
pack-priv SWTexture(SWTexture sharedTex, Texture.WrapMode altMode)

Method Detail

allocateback to summary
pack-priv void allocate()
allocateBufferback to summary
pack-priv abstract void allocateBuffer()
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
createback to summary
pack-priv static Texture create(SWResourceFactory factory, PixelFormat formatHint, Texture.WrapMode wrapMode, int w, int h)
createSharedLockedTextureback to summary
pack-priv abstract Texture createSharedLockedTexture(Texture.WrapMode altMode)

Returns a new Texture object sharing all of the information from this texture, but using the new WrapMode. The new texture will be locked (in contrast to the similarly-named method in BaseTexture).

Parameters
altMode:Texture.WrapMode

the new WrapMode for the new texture

Returns:Texture

a new, locked, texture object sharing all information with this texture except for the WrapMode

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.

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.

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.

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.

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.

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.

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.

Annotations
@Override
getOffsetback to summary
pack-priv int getOffset()
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.

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.

Annotations
@Override
getResourceFactoryback to summary
pack-priv SWResourceFactory getResourceFactory()
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
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.

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.

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.

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

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

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.

Annotations
@Override
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);
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());
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);
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);
Annotations
@Override