Top Fields Constructors Methods
com.sun.prism.sw

pack-priv final Class SWResourceFactory

extends BaseResourceFactory
Class Inheritance
Imports
com.sun.glass.ui.Screen, com.sun.prism.Image, .MediaFrame, .Mesh, .MeshView, .PhongMaterial, .PixelFormat, .Presentable, .PresentableState, .RTTexture, .Texture, .Texture.Usage, .Texture.WrapMode, com.sun.prism.impl.BaseResourceFactory, .PrismSettings, .TextureResourcePool, com.sun.prism.impl.shape.BasicRoundRectRep, .BasicShapeRep, com.sun.prism.shape.ShapeRep, java.util.Map, .WeakHashMap

Field Summary

Modifier and TypeField and Description
private static final Map<Image, Texture>
private final SWContext
private static final Map<Image, Texture>
private static final ShapeRep
private static final Map<Image, Texture>
private Screen
private static final ShapeRep

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected boolean
public ShapeRep
public ShapeRep
public Mesh
public MeshView
public ShapeRep
public PhongMaterial
public Presentable
public ShapeRep
public RTTexture
createRTTexture(int width, int height, Texture.WrapMode wrapMode, boolean msaa)

Implements com.sun.prism.ResourceFactory.createRTTexture.

public RTTexture
public Texture
createTexture(MediaFrame
the video image that we need to create a new texture for
vdb
)

Implements com.sun.prism.ResourceFactory.createTexture.

Returns a new Texture that can contain the video image as specified in the provided MediaFrame.

public Texture
createTexture(PixelFormat
intended pixel format of the data to be stored in this texture
formatHint
,
Texture.Usage
the Dynamic vs. Static nature of the texture data
usageHint
,
Texture.WrapMode
intended wrap mode to be used for the texture
wrapMode
,
int
width of the content in the texture
w
,
int
height of the content in the texture
h
)

Implements com.sun.prism.ResourceFactory.createTexture.

Returns a new Texture with the given format and edge wrapping support.

public Texture
createTexture(PixelFormat
intended pixel format of the data to be stored in this texture
formatHint
,
Texture.Usage
the Dynamic vs. Static nature of the texture data
usageHint
,
Texture.WrapMode
intended wrap mode to be used for the texture
wrapMode
,
int
width of the content in the texture
w
,
int
height of the content in the texture
h
,
boolean
the flag indicates should texture be created with mipmap
useMipmap
)

Implements com.sun.prism.ResourceFactory.createTexture.

Returns a new Texture with the given format and edge wrapping support.

public void
pack-priv SWContext
public int
getMaximumTextureSize()

Implements com.sun.prism.ResourceFactory.getMaximumTextureSize.

Returns the maximum supported texture dimension for this device.

public int
public int
public Screen
public TextureResourcePool<T>
public boolean
isCompatibleTexture(Texture
the texture to check.
tex
)

Implements com.sun.prism.ResourceFactory.isCompatibleTexture.

A Texture may have been obtained from a different resource factory.

public boolean
isFormatSupported(PixelFormat
the PixelFormat to test
format
)

Implements com.sun.prism.ResourceFactory.isFormatSupported.

Returns true if the given PixelFormat is supported; otherwise returns false.

Inherited from com.sun.prism.impl.BaseResourceFactory:
addFactoryListenercanClampToEdgecanRepeatcheckDisposedclearTextureCacheclearTextureCachecreateFloatTexturecreateMaskTexturecreateTexturecreateTexturegetCachedTexturegetCachedTexturegetFactoryListenersgetGlyphTexturegetRegionTextureisDeviceReadyisDisposedisSuperShaderAllowedisWrapModeSupportednotifyResetremoveFactoryListenersetGlyphTexturesetRegionTexture

Field Detail

clampTexCacheback to summary
private static final Map<Image, Texture> clampTexCache

Hides com.sun.prism.impl.BaseResourceFactory.clampTexCache.

contextback to summary
private final SWContext context
mipmapTexCacheback to summary
private static final Map<Image, Texture> mipmapTexCache

Hides com.sun.prism.impl.BaseResourceFactory.mipmapTexCache.

rectRepback to summary
private static final ShapeRep rectRep
repeatTexCacheback to summary
private static final Map<Image, Texture> repeatTexCache

Hides com.sun.prism.impl.BaseResourceFactory.repeatTexCache.

screenback to summary
private Screen screen
theRepback to summary
private static final ShapeRep theRep

Constructor Detail

SWResourceFactoryback to summary
public SWResourceFactory(Screen screen)

Method Detail

canClampToZeroback to summary
protected boolean canClampToZero()

Overrides com.sun.prism.impl.BaseResourceFactory.canClampToZero.

Annotations
@Override
createArcRepback to summary
public ShapeRep createArcRep()

Implements com.sun.prism.ResourceFactory.createArcRep.

Annotations
@Override
createEllipseRepback to summary
public ShapeRep createEllipseRep()

Implements com.sun.prism.ResourceFactory.createEllipseRep.

Annotations
@Override
createMeshback to summary
public Mesh createMesh()

Implements com.sun.prism.ResourceFactory.createMesh.

Annotations
@Override
createMeshViewback to summary
public MeshView createMeshView(Mesh mesh)

Implements com.sun.prism.ResourceFactory.createMeshView.

Annotations
@Override
createPathRepback to summary
public ShapeRep createPathRep()

Implements com.sun.prism.ResourceFactory.createPathRep.

Annotations
@Override
createPhongMaterialback to summary
public PhongMaterial createPhongMaterial()

Implements com.sun.prism.ResourceFactory.createPhongMaterial.

Annotations
@Override
createPresentableback to summary
public Presentable createPresentable(PresentableState pState)

Implements com.sun.prism.ResourceFactory.createPresentable.

Annotations
@Override
createRoundRectRepback to summary
public ShapeRep createRoundRectRep()

Implements com.sun.prism.ResourceFactory.createRoundRectRep.

Annotations
@Override
createRTTextureback to summary
public RTTexture createRTTexture(int width, int height, Texture.WrapMode wrapMode, boolean msaa)

Implements com.sun.prism.ResourceFactory.createRTTexture.

Annotations
@Override
createRTTextureback to summary
public RTTexture createRTTexture(int width, int height, Texture.WrapMode wrapMode)

Implements com.sun.prism.ResourceFactory.createRTTexture.

Annotations
@Override
createTextureback to summary
public Texture createTexture(MediaFrame vdb)

Implements com.sun.prism.ResourceFactory.createTexture.

Doc from com.sun.prism.ResourceFactory.createTexture.

Returns a new Texture 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.

Parameters
vdb:MediaFrame

the video image that we need to create a new texture for

Returns:Texture

texture most appropriate for the given video image.

Annotations
@Override
createTextureback to summary
public Texture createTexture(PixelFormat formatHint, Texture.Usage usageHint, Texture.WrapMode wrapMode, int w, int h)

Implements com.sun.prism.ResourceFactory.createTexture.

Doc from com.sun.prism.ResourceFactory.createTexture.

Returns a new Texture 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.

Parameters
formatHint:PixelFormat

intended pixel format of the data to be stored in this texture

usageHint:Texture.Usage

the Dynamic vs. Static nature of the texture data

wrapMode:Texture.WrapMode

intended wrap mode to be used for the texture

w:int

width of the content in the texture

h:int

height of the content in the texture

Returns:Texture

texture most appropriate for the given intended format, wrap mode and dimensions

Annotations
@Override
createTextureback to summary
public Texture createTexture(PixelFormat formatHint, Texture.Usage usageHint, Texture.WrapMode wrapMode, int w, int h, boolean useMipmap)

Implements com.sun.prism.ResourceFactory.createTexture.

Doc from com.sun.prism.ResourceFactory.createTexture.

Returns a new Texture 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.

Parameters
formatHint:PixelFormat

intended pixel format of the data to be stored in this texture

usageHint:Texture.Usage

the Dynamic vs. Static nature of the texture data

wrapMode:Texture.WrapMode

intended wrap mode to be used for the texture

w:int

width of the content in the texture

h:int

height of the content in the texture

useMipmap:boolean

the flag indicates should texture be created with mipmap

Returns:Texture

texture most appropriate for the given intended format, wrap mode and dimensions

Annotations
@Override
disposeback to summary
public void dispose()

Overrides com.sun.prism.impl.BaseResourceFactory.dispose.

Implements com.sun.prism.GraphicsResource.dispose.

Annotations
@Override
getContextback to summary
pack-priv SWContext getContext()
getMaximumTextureSizeback to summary
public int getMaximumTextureSize()

Implements com.sun.prism.ResourceFactory.getMaximumTextureSize.

Doc from com.sun.prism.ResourceFactory.getMaximumTextureSize.

Returns the maximum supported texture dimension for this device. For example, if this method returns 2048, it means that textures larger than 2048x2048 cannot be created.

Returns:int

the maximum supported texture dimension

Annotations
@Override
getRTTHeightback to summary
public int getRTTHeight(int h, Texture.WrapMode wrapMode)

Implements com.sun.prism.ResourceFactory.getRTTHeight.

Annotations
@Override
getRTTWidthback to summary
public int getRTTWidth(int w, Texture.WrapMode wrapMode)

Implements com.sun.prism.ResourceFactory.getRTTWidth.

Annotations
@Override
getScreenback to summary
public Screen getScreen()
getTextureResourcePoolback to summary
public TextureResourcePool<T> getTextureResourcePool()

Implements com.sun.prism.ResourceFactory.getTextureResourcePool.

Annotations
@Override
isCompatibleTextureback to summary
public boolean isCompatibleTexture(Texture tex)

Implements com.sun.prism.ResourceFactory.isCompatibleTexture.

Doc from com.sun.prism.ResourceFactory.isCompatibleTexture.

A Texture may have been obtained from a different resource factory.

Parameters
tex:Texture

the texture to check.

Returns:boolean

whether this texture is compatible.

Annotations
@Override
isFormatSupportedback to summary
public boolean isFormatSupported(PixelFormat format)

Implements com.sun.prism.ResourceFactory.isFormatSupported.

Doc from com.sun.prism.ResourceFactory.isFormatSupported.

Returns true if the given PixelFormat 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.

Parameters
format:PixelFormat

the PixelFormat to test

Returns:boolean

true if the given format is supported; false otherwise

Annotations
@Override