final class SWResourceFactory extends BaseResourceFactory implements ResourceFactory
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Map<Image,Texture> |
clampTexCache |
private SWContext |
context |
private static java.util.Map<Image,Texture> |
mipmapTexCache |
private static ShapeRep |
rectRep |
private static java.util.Map<Image,Texture> |
repeatTexCache |
private Screen |
screen |
private static ShapeRep |
theRep |
| Constructor and Description |
|---|
SWResourceFactory(Screen screen) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canClampToZero() |
ShapeRep |
createArcRep() |
ShapeRep |
createEllipseRep() |
Mesh |
createMesh() |
MeshView |
createMeshView(Mesh mesh) |
ShapeRep |
createPathRep() |
PhongMaterial |
createPhongMaterial() |
Presentable |
createPresentable(PresentableState pState) |
ShapeRep |
createRoundRectRep() |
RTTexture |
createRTTexture(int width,
int height,
Texture.WrapMode wrapMode) |
RTTexture |
createRTTexture(int width,
int height,
Texture.WrapMode wrapMode,
boolean msaa) |
Texture |
createTexture(MediaFrame vdb)
Returns a new
Texture that can contain the video image as specified
in the provided MediaFrame. |
Texture |
createTexture(PixelFormat formatHint,
Texture.Usage usageHint,
Texture.WrapMode wrapMode,
int w,
int h)
Returns a new
Texture with the given format and edge wrapping
support. |
Texture |
createTexture(PixelFormat formatHint,
Texture.Usage usageHint,
Texture.WrapMode wrapMode,
int w,
int h,
boolean useMipmap)
Returns a new
Texture with the given format and edge wrapping
support. |
void |
dispose() |
(package private) SWContext |
getContext() |
int |
getMaximumTextureSize()
Returns the maximum supported texture dimension for this device.
|
int |
getRTTHeight(int h,
Texture.WrapMode wrapMode) |
int |
getRTTWidth(int w,
Texture.WrapMode wrapMode) |
Screen |
getScreen() |
TextureResourcePool |
getTextureResourcePool() |
boolean |
isCompatibleTexture(Texture tex)
A Texture may have been obtained from a different resource factory.
|
boolean |
isFormatSupported(PixelFormat format)
Returns true if the given
PixelFormat is supported; otherwise
returns false. |
addFactoryListener, canClampToEdge, canRepeat, clearTextureCache, clearTextureCache, createFloatTexture, createMaskTexture, createTexture, createTexture, getCachedTexture, getCachedTexture, getFactoryListeners, getGlyphTexture, getRegionTexture, isDeviceReady, isSuperShaderAllowed, isWrapModeSupported, notifyReleased, notifyReset, removeFactoryListener, setGlyphTexture, setRegionTextureclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddFactoryListener, createFloatTexture, createMaskTexture, createTexture, createTexture, getCachedTexture, getCachedTexture, getGlyphTexture, getRegionTexture, isDeviceReady, isSuperShaderAllowed, isWrapModeSupported, removeFactoryListener, setGlyphTexture, setRegionTextureprivate static final ShapeRep theRep
private static final ShapeRep rectRep
private Screen screen
private final SWContext context
public SWResourceFactory(Screen screen)
public TextureResourcePool getTextureResourcePool()
getTextureResourcePool in interface ResourceFactorypublic Screen getScreen()
SWContext getContext()
public void dispose()
dispose in interface GraphicsResourcedispose in interface ResourceFactorypublic ShapeRep createArcRep()
createArcRep in interface ResourceFactorypublic ShapeRep createEllipseRep()
createEllipseRep in interface ResourceFactorypublic ShapeRep createRoundRectRep()
createRoundRectRep in interface ResourceFactorypublic ShapeRep createPathRep()
createPathRep in interface ResourceFactorypublic Presentable createPresentable(PresentableState pState)
createPresentable in interface ResourceFactorypublic int getRTTWidth(int w,
Texture.WrapMode wrapMode)
getRTTWidth in interface ResourceFactorypublic int getRTTHeight(int h,
Texture.WrapMode wrapMode)
getRTTHeight in interface ResourceFactorypublic boolean isCompatibleTexture(Texture tex)
ResourceFactoryisCompatibleTexture in interface ResourceFactorytex - the texture to check.public RTTexture createRTTexture(int width, int height, Texture.WrapMode wrapMode, boolean msaa)
createRTTexture in interface ResourceFactorypublic RTTexture createRTTexture(int width, int height, Texture.WrapMode wrapMode)
createRTTexture in interface ResourceFactorypublic int getMaximumTextureSize()
ResourceFactorygetMaximumTextureSize in interface ResourceFactorypublic boolean isFormatSupported(PixelFormat format)
ResourceFactoryPixelFormat is supported; otherwise
returns false.
Note that the following formats are guaranteed to be supported across all devices:
BYTE_RGB
BYTE_RGBA_PRE
BYTE_GRAY
BYTE_ALPHA
Support for the other formats depends on the capabilities of the
device. Be sure to call this method before attempting to create
a Texture with a non-standard format and plan to have an
alternate codepath if the given format is not supported.
isFormatSupported in interface ResourceFactoryformat - the PixelFormat to testprotected boolean canClampToZero()
canClampToZero in class BaseResourceFactorypublic Texture createTexture(MediaFrame vdb)
ResourceFactoryTexture that can contain the video image as specified
in the provided MediaFrame. Note that padding is almost implicit
since this method has to accommodate the line strides of each plane. Also
due to renderer limitations, some format conversion may be necessary so
the texture format may end up being different from the video image format.createTexture in interface ResourceFactoryvdb - the video image that we need to create a new texture forpublic Texture createTexture(PixelFormat formatHint, Texture.Usage usageHint, Texture.WrapMode wrapMode, int w, int h)
ResourceFactoryTexture with the given format and edge wrapping
support. Note that the dimensions of the returned texture may be larger
than those requested and the wrap mode may be a simulated version of
the type requested.createTexture in interface ResourceFactoryformatHint - intended pixel format of the data to be stored
in this textureusageHint - the Dynamic vs. Static nature of the texture datawrapMode - intended wrap mode to be used for the texturew - width of the content in the textureh - height of the content in the texturepublic Texture createTexture(PixelFormat formatHint, Texture.Usage usageHint, Texture.WrapMode wrapMode, int w, int h, boolean useMipmap)
ResourceFactoryTexture with the given format and edge wrapping
support. Note that the dimensions of the returned texture may be larger
than those requested and the wrap mode may be a simulated version of
the type requested.createTexture in interface ResourceFactoryformatHint - intended pixel format of the data to be stored
in this textureusageHint - the Dynamic vs. Static nature of the texture datawrapMode - intended wrap mode to be used for the texturew - width of the content in the textureh - height of the content in the textureuseMipmap - the flag indicates should texture be created with mipmappublic PhongMaterial createPhongMaterial()
createPhongMaterial in interface ResourceFactorypublic MeshView createMeshView(Mesh mesh)
createMeshView in interface ResourceFactorypublic Mesh createMesh()
createMesh in interface ResourceFactory