final class SWPresentable extends SWRTTexture implements Presentable
Texture.Usage, Texture.WrapMode
Modifier and Type | Field and Description |
---|---|
private Pixels |
pixels |
private QueuedPixelSource |
pixelSource |
private PresentableState |
pState |
allocated, contentHeight, contentWidth, employcount, permanent, physicalHeight, physicalWidth
Constructor and Description |
---|
SWPresentable(PresentableState pState,
SWResourceFactory factory) |
Modifier and Type | Method and Description |
---|---|
int |
getContentHeight()
Returns the content height of this texture, in pixels.
|
int |
getContentWidth()
Returns the content width of this texture, in pixels.
|
float |
getPixelScaleFactor() |
boolean |
isMSAA() |
boolean |
lockResources(PresentableState pState)
Locks any underlying resources needed for a createGraphics/prepare/present
sequence and returns a boolean indicating if the presentable needs to be
recreated.
|
boolean |
prepare(Rectangle dirtyregion)
display the indicated region to the user.
|
boolean |
present()
present the prepared region to the user.
|
createGraphics, getAssociatedScreen, getDimensions, getPixels, getSurface, isOpaque, isVolatile, readPixels, readPixels, setOpaque
allocateBuffer, applyCompositeAlpha, checkDimensions, createSharedLockedTexture, getDataNoClone, getOffset, getPixelFormat, hasAlpha, update, update
allocate, assertLocked, contentsNotUseful, contentsUseful, create, dispose, getContentX, getContentY, getLastImageSerial, getLinearFiltering, getLockCount, getMaxContentHeight, getMaxContentWidth, getPhysicalHeight, getPhysicalWidth, getResourceFactory, getSharedTexture, getUseMipmap, getWrapMode, isLocked, isSurfaceLost, lock, makePermanent, setContentHeight, setContentWidth, setLastImageSerial, setLinearFiltering, unlock, update, update, update, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createGraphics, getAssociatedScreen, isOpaque, setOpaque
getContentX, getContentY, getPhysicalHeight, getPhysicalWidth
assertLocked, contentsNotUseful, contentsUseful, getContentX, getContentY, getLastImageSerial, getLinearFiltering, getLockCount, getMaxContentHeight, getMaxContentWidth, getPhysicalHeight, getPhysicalWidth, getPixelFormat, getSharedTexture, getUseMipmap, getWrapMode, isLocked, isSurfaceLost, lock, makePermanent, setContentHeight, setContentWidth, setLastImageSerial, setLinearFiltering, unlock, update, update, update, update, update, update
dispose
private final PresentableState pState
private Pixels pixels
private QueuedPixelSource pixelSource
public SWPresentable(PresentableState pState, SWResourceFactory factory)
public boolean lockResources(PresentableState pState)
Presentable
GraphicsResource
then its dispose()
method will be
called prior to recreating a new Presentable
object and
so no resource should need to be locked in that case.
The resources will be unlocked in either #prepare()
or
Presentable.present()
.lockResources
in interface Presentable
pState
- The presentation state for the upcoming pulsepublic boolean prepare(Rectangle dirtyregion)
Presentable
prepare
in interface Presentable
dirtyregion
- display region or null for full areapublic boolean present()
Presentable
present
in interface Presentable
public float getPixelScaleFactor()
getPixelScaleFactor
in interface Presentable
public int getContentWidth()
Texture
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.
getContentWidth
in interface Surface
getContentWidth
in interface Texture
getContentWidth
in class SWTexture
public int getContentHeight()
Texture
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.
getContentHeight
in interface Surface
getContentHeight
in interface Texture
getContentHeight
in class SWTexture
public boolean isMSAA()
isMSAA
in interface RenderTarget
isMSAA
in class SWRTTexture