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

pack-priv Class MTLResourceFactory

extends BaseShaderFactory
Class Inheritance
Imports
com.sun.glass.ui.Screen, com.sun.prism.MediaFrame, .Mesh, .MeshView, .MultiTexture, .PhongMaterial, .PixelFormat, .Presentable, .PresentableState, .RTTexture, .Texture.Usage, .Texture.WrapMode, .Texture, com.sun.prism.impl.PrismSettings, .TextureResourcePool, com.sun.prism.impl.ps.BaseShaderFactory, com.sun.prism.ps.Shader, .ShaderFactory, java.io.ByteArrayInputStream, .InputStream, java.lang.reflect.Method, java.nio.ByteBuffer, java.util.Arrays, .Map, .Objects

Field Summary

Modifier and TypeField and Description
private final MTLContext

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
checkTextureSize(int width, int height)

public Mesh
public MeshView
public PhongMaterial
public Presentable
public RTTexture
public RTTexture
createRTTexture(int width, int height, Texture.WrapMode wrapMode, boolean msaa)

Implements com.sun.prism.ResourceFactory.createRTTexture.

public Shader
createShader(String pixelShaderName, InputStream pixelShaderCode, Map<String, Integer> samplers, Map<String, Integer> params, int maxTexCoordIndex, boolean isPixcoordUsed, boolean isPerVertexColorUsed)

Implements com.sun.prism.ps.ShaderFactory.createShader.

public Shader
createShader(String shaderName, Map<String, Integer> samplers, Map<String, Integer> params, int maxTexCoordIndex, boolean isPixcoordUsed, boolean isPerVertexColorUsed)

Implements com.sun.prism.ps.ShaderFactory.createShader.

public Shader
public Texture
createTexture(PixelFormat formatHint, Texture.Usage usageHint, Texture.WrapMode wrapMode, int w, int h)

Implements com.sun.prism.ResourceFactory.createTexture.

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

public Texture
createTexture(PixelFormat formatHint, Texture.Usage usageHint, Texture.WrapMode wrapMode, int w, int h, boolean useMipmap)

Implements com.sun.prism.ResourceFactory.createTexture.

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

public Texture
createTexture(MediaFrame frame)

Implements com.sun.prism.ResourceFactory.createTexture.

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

public void
public MTLContext
public int
getMaximumTextureSize()

Implements com.sun.prism.ResourceFactory.getMaximumTextureSize.

Returns the maximum supported texture dimension for this device.

public int
public int
public TextureResourcePool<?>
public boolean
isCompatibleTexture(Texture tex)

Implements com.sun.prism.ResourceFactory.isCompatibleTexture.

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

public boolean
isFormatSupported(PixelFormat format)

Implements com.sun.prism.ResourceFactory.isFormatSupported.

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

pack-priv static native long
nCreateTexture(long pContext, int format, int hint, boolean isRTT, int width, int height, int samples, boolean useMipmap)

pack-priv static int
nextPowerOf64(int val, int max)

pack-priv static int
nextPowerOfTwo(int val, int max)

pack-priv static native void
nReleaseTexture(long pTexture)

pack-priv static void
releaseTexture(long resource)

Inherited from com.sun.prism.impl.ps.BaseShaderFactory:
createArcRepcreateEllipseRepcreatePathRepcreateRoundRectRep

Field Detail

contextback to summary
private final MTLContext context

Constructor Detail

MTLResourceFactoryback to summary
pack-priv MTLResourceFactory(Screen screen)

Method Detail

checkTextureSizeback to summary
private void checkTextureSize(int width, int height)
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
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
createRTTextureback to summary
public RTTexture createRTTexture(int width, int height, Texture.WrapMode wrapMode)

Implements com.sun.prism.ResourceFactory.createRTTexture.

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
createShaderback to summary
public Shader createShader(String pixelShaderName, InputStream pixelShaderCode, Map<String, Integer> samplers, Map<String, Integer> params, int maxTexCoordIndex, boolean isPixcoordUsed, boolean isPerVertexColorUsed)

Implements com.sun.prism.ps.ShaderFactory.createShader.

Annotations
@Override
createShaderback to summary
public Shader createShader(String shaderName, Map<String, Integer> samplers, Map<String, Integer> params, int maxTexCoordIndex, boolean isPixcoordUsed, boolean isPerVertexColorUsed)

Implements com.sun.prism.ps.ShaderFactory.createShader.

Annotations
@Override
createStockShaderback to summary
public Shader createStockShader(String shaderName)

Implements com.sun.prism.ps.ShaderFactory.createStockShader.

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.

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.

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

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.

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
public MTLContext 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.

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
getTextureResourcePoolback to summary
public TextureResourcePool<?> 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.

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.

Annotations
@Override
nCreateTextureback to summary
pack-priv static native long nCreateTexture(long pContext, int format, int hint, boolean isRTT, int width, int height, int samples, boolean useMipmap)
nextPowerOf64back to summary
pack-priv static int nextPowerOf64(int val, int max)
nextPowerOfTwoback to summary
pack-priv static int nextPowerOfTwo(int val, int max)
nReleaseTextureback to summary
pack-priv static native void nReleaseTexture(long pTexture)
releaseTextureback to summary
pack-priv static void releaseTexture(long resource)