APIdia Launch Partner
Top Inners Fields Constructors Methods
com.sun.scenario.effect.impl

public abstract Class Renderer

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.scenario.effect.impl.prism.PrRenderer
Imports
java.util.Collection, .HashMap, .Iterator, .Map, com.sun.javafx.geom.Rectangle, com.sun.javafx.geom.transform.Affine2D, .BaseTransform, com.sun.scenario.effect.Effect, .Effect.AccelType, .FilterContext, .Filterable, .FloatMap, .ImageData, .LockableResource

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static enum
Renderer.RendererState

Enumeration describing the lifecycle states of the renderer.

Field Summary

Modifier and TypeField and Description
private final ImagePool
private final Map<Renderer.PeerCacheKey, EffectPeer<?>>
private final Renderer.PeerCacheKey
private static final Map<FilterContext, Renderer>
public static final String
protected static final boolean

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public abstract void
clearImage(Filterable
the image to be cleared
image
)

Mainly used by ImagePool for the purpose of clearing an image before handing it back to the user.

protected final void
clearPeers()

Clears and disposes all effect peers of this renderer.

public abstract PoolFilterable
createCompatibleImage(int w, int h)

public LockableResource
createFloatTexture(int w, int h)

public abstract ImageData

Returns:

a new ImageData
createImageData
(FilterContext
the filter context
fctx
,
Filterable src)

Mainly used by the Identity effect for the purpose of creating a cached ImageData from the given platform-specific image (e.g. a BufferedImage wrapped in a J2DImage).

protected abstract EffectPeer<T extends RenderState>

Returns:

new peer
createPeer
(FilterContext
context shared with the renderer
fctx
,
String
of the peer
name
,
int
unroll count
unrollCount
)

Creates a new peer given the context, name and unroll count.

public abstract Effect.AccelType

Returns:

the AccelType used by typical peers of this renderer
getAccelType
()

Returns the AccelType used by default for peers of this renderer.

protected abstract Renderer

Returns:

backup renderer
getBackupRenderer
()

Returns an instance of backup renderer to be used if this renderer is in LOST state.

public abstract int
public PoolFilterable
getCompatibleImage(int w, int h)

public abstract int
public final EffectPeer<T extends RenderState>

Returns:

cached peer for this name and unroll count
getPeerInstance
(FilterContext
filter context - same as this renderer's context
fctx
,
String
not-unrolled name of the peer
name
,
int
the unroll count of the peer
unrollCount
)

Returns a (cached) instance of peer given the context, name and unroll count.

public static synchronized Renderer

Returns:

renderer
getRenderer
(FilterContext
context to create the renderer for
fctx
)

Returns a renderer associated with given filter context based on the environment and flags set.

public static Renderer

Returns:

renderer
getRenderer
(FilterContext
context to create the renderer for
fctx
,
Effect
uses in the rendering
effect
,
int
approximate input width
approxW
,
int
approximate input height
approxH
)

Returns a renderer that is most optimal for the approximate size of the filtering operation.

protected Renderer

Returns:

the Renderer best suited for this size
getRendererForSize
(Effect effect, int
approximate input width
approxW
,
int
approximate input height
approxH
)

Returns a Renderer instance that is most appropriate for the given size of the source data.

public abstract Renderer.RendererState

Returns:

the state
getRendererState
()

Returns this renderer's current state.

protected static Renderer

Returns:

an instance of Renderer that uses CPU filtering
getSoftwareRenderer
()

This method can be used by subclasses to create a backup renderer, either a SW (Java) renderer or an SSE (native) renderer, depending on what is available.

public abstract boolean

Returns:

true if this image data is compatible, false otherwise
isImageDataCompatible
(ImageData
ImageData to be checked
id
)

Determines whether the passed ImageData is compatible with this renderer (that is, if it can be used as a input source for this renderer's peers).

public void
public void
releasePurgatory()

This is a temporary workaround for a PowerVR SGX issue.

public ImageData
transform(FilterContext fctx, ImageData img, int xpow2scales, int ypow2scales)

public abstract Filterable
transform(FilterContext fctx, Filterable original, BaseTransform transform, Rectangle origBounds, Rectangle xformBounds)

public abstract ImageData
transform(FilterContext fctx, ImageData original, BaseTransform transform, Rectangle origBounds, Rectangle xformBounds)

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

imagePoolback to summary
private final ImagePool imagePool
peerCacheback to summary
private final Map<Renderer.PeerCacheKey, EffectPeer<?>> peerCache
peerCacheKeyback to summary
private final Renderer.PeerCacheKey peerCacheKey
rendererMapback to summary
private static final Map<FilterContext, Renderer> rendererMap
rootPkgback to summary
public static final String rootPkg
verboseback to summary
protected static final boolean verbose

Constructor Detail

Rendererback to summary
protected Renderer()

Method Detail

clearImageback to summary
public abstract void clearImage(Filterable image)

Mainly used by ImagePool for the purpose of clearing an image before handing it back to the user.

Parameters
image:Filterable

the image to be cleared

clearPeersback to summary
protected final void clearPeers()

Clears and disposes all effect peers of this renderer.

createCompatibleImageback to summary
public abstract PoolFilterable createCompatibleImage(int w, int h)
createFloatTextureback to summary
public LockableResource createFloatTexture(int w, int h)
createImageDataback to summary
public abstract ImageData createImageData(FilterContext fctx, Filterable src)

Mainly used by the Identity effect for the purpose of creating a cached ImageData from the given platform-specific image (e.g. a BufferedImage wrapped in a J2DImage).

Parameters
fctx:FilterContext

the filter context

Returns:ImageData

a new ImageData

createPeerback to summary
protected abstract EffectPeer<T extends RenderState> createPeer(FilterContext fctx, String name, int unrollCount)

Creates a new peer given the context, name and unroll count.

Parameters
fctx:FilterContext

context shared with the renderer

name:String

of the peer

unrollCount:int

unroll count

Returns:EffectPeer<T extends RenderState>

new peer

getAccelTypeback to summary
public abstract Effect.AccelType getAccelType()

Returns the AccelType used by default for peers of this renderer. Note that the Renderer may specialize in peers of this type, and it may create them in general by default, but the renderers all look for an Intrinsic peer for a given operation as well so the actual peer implementaiton for a given effect may sometimes differ from this AccelType. Care should be taken if the actual AccelType for a specific operation is needed, then the EffectPeer#getAccelType() should be consulted directly in those cases.

Returns:Effect.AccelType

the AccelType used by typical peers of this renderer

getBackupRendererback to summary
protected abstract Renderer getBackupRenderer()

Returns an instance of backup renderer to be used if this renderer is in LOST state.

Returns:Renderer

backup renderer

getCompatibleHeightback to summary
public abstract int getCompatibleHeight(int h)
getCompatibleImageback to summary
public PoolFilterable getCompatibleImage(int w, int h)
getCompatibleWidthback to summary
public abstract int getCompatibleWidth(int w)
getPeerInstanceback to summary
public final EffectPeer<T extends RenderState> getPeerInstance(FilterContext fctx, String name, int unrollCount)

Returns a (cached) instance of peer given the context, name and unroll count.

Parameters
fctx:FilterContext

filter context - same as this renderer's context

name:String

not-unrolled name of the peer

unrollCount:int

the unroll count of the peer

Returns:EffectPeer<T extends RenderState>

cached peer for this name and unroll count

getRendererback to summary
public static synchronized Renderer getRenderer(FilterContext fctx)

Returns a renderer associated with given filter context based on the environment and flags set. Renderers are per filter context cached.

Parameters
fctx:FilterContext

context to create the renderer for

Returns:Renderer

renderer

getRendererback to summary
public static Renderer getRenderer(FilterContext fctx, Effect effect, int approxW, int approxH)

Returns a renderer that is most optimal for the approximate size of the filtering operation.

Parameters
fctx:FilterContext

context to create the renderer for

effect:Effect

uses in the rendering

approxW:int

approximate input width

approxH:int

approximate input height

Returns:Renderer

renderer

getRendererForSizeback to summary
protected Renderer getRendererForSize(Effect effect, int approxW, int approxH)

Returns a Renderer instance that is most appropriate for the given size of the source data. The default implementation simply returns "this" renderer, but subclasses may override this method and return a different renderer depending on the size of the operation. For example, a GPU-based renderer may wish to return a software renderer for small-sized operations (because of lower overhead, etc).

Parameters
approxW:int

approximate input width

approxH:int

approximate input height

Returns:Renderer

the Renderer best suited for this size

getRendererStateback to summary
public abstract Renderer.RendererState getRendererState()

Returns this renderer's current state.

Returns:Renderer.RendererState

the state

See Also
RendererState
getSoftwareRendererback to summary
protected static Renderer getSoftwareRenderer()

This method can be used by subclasses to create a backup renderer, either a SW (Java) renderer or an SSE (native) renderer, depending on what is available.

Returns:Renderer

an instance of Renderer that uses CPU filtering

isImageDataCompatibleback to summary
public abstract boolean isImageDataCompatible(ImageData id)

Determines whether the passed ImageData is compatible with this renderer (that is, if it can be used as a input source for this renderer's peers).

Parameters
id:ImageData

ImageData to be checked

Returns:boolean

true if this image data is compatible, false otherwise

releaseCompatibleImageback to summary
public void releaseCompatibleImage(Filterable image)
releasePurgatoryback to summary
public void releasePurgatory()

This is a temporary workaround for a PowerVR SGX issue. See ImagePool for more details.

transformback to summary
public ImageData transform(FilterContext fctx, ImageData img, int xpow2scales, int ypow2scales)
transformback to summary
public abstract Filterable transform(FilterContext fctx, Filterable original, BaseTransform transform, Rectangle origBounds, Rectangle xformBounds)
transformback to summary
public abstract ImageData transform(FilterContext fctx, ImageData original, BaseTransform transform, Rectangle origBounds, Rectangle xformBounds)
updateFloatTextureback to summary
public void updateFloatTexture(LockableResource texture, FloatMap map)
com.sun.scenario.effect.impl back to summary

private final Class Renderer.PeerCacheKey

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv String
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv
PeerCacheKey(String name, int unrollCount)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object o)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

nameback to summary
pack-priv String name
unrollCountback to summary
pack-priv int unrollCount

Constructor Detail

PeerCacheKeyback to summary
pack-priv PeerCacheKey(String name, int unrollCount)

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
com.sun.scenario.effect.impl back to summary

public final Enum Renderer.RendererState

extends Enum<Renderer.RendererState>
Class Inheritance

Enumeration describing the lifecycle states of the renderer. When the renderer is created, it will either start in the OK state, or it will start in the NOTREADY state until the first time it is used during rendering, then transition to the OK state. It could become LOST at some point. This may happen for example if the renderer is susceptible to display changes.

When the renderer is in the LOST state it can't be used for rendering, instead a backup renderer must be used.

Sometime later the renderer could enter the DISPOSED state, at which point it will be removed from the cache and a new renderer will be created for the particular context.

Thus the lifecycle of a renderer is: [NOTREADY =>] OK [=> LOST [=> DISPOSED]]

Field Summary

Modifier and TypeField and Description
public static final Renderer.RendererState
DISPOSED

Renderer is disposed, it is no longer usable and must be replaced.

public static final Renderer.RendererState
LOST

Renderer is lost, a backup renderer must be used.

public static final Renderer.RendererState
NOTREADY

Renderer is not ready; it might be able to be used for rendering.

public static final Renderer.RendererState
OK

Renderer can be used for rendering.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Renderer.RendererState
public static Renderer.RendererState[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DISPOSEDback to summary
public static final Renderer.RendererState DISPOSED

Renderer is disposed, it is no longer usable and must be replaced.

LOSTback to summary
public static final Renderer.RendererState LOST

Renderer is lost, a backup renderer must be used.

NOTREADYback to summary
public static final Renderer.RendererState NOTREADY

Renderer is not ready; it might be able to be used for rendering.

OKback to summary
public static final Renderer.RendererState OK

Renderer can be used for rendering.

Constructor Detail

RendererStateback to summary
private RendererState()

Method Detail

valueOfback to summary
public static Renderer.RendererState valueOf(String name)
valuesback to summary
public static Renderer.RendererState[] values()