Top Description Fields Constructors Methods
com.sun.prism.impl.ps

public Class CachingShapeRep

Additional top-level class in compilation unit: CachingShapeRepState.

extends Object
implements ShapeRep
Class Inheritance
All Implemented Interfaces
com.sun.prism.shape.ShapeRep
Known Direct Subclasses
com.sun.prism.impl.ps.CachingEllipseRep, com.sun.prism.impl.ps.CachingRoundRectRep
Imports
com.sun.javafx.geom.BaseBounds, .RectBounds, .Shape, com.sun.javafx.geom.transform.BaseTransform, com.sun.prism.BasicStroke, .Graphics, .Texture, .Texture.WrapMode, com.sun.prism.paint.Paint, com.sun.prism.shape.ShapeRep, com.sun.prism.impl.Disposer, .PrismSettings, .VertexBuffer, com.sun.prism.impl.ps.BaseShaderContext.MaskType, com.sun.prism.impl.shape.ShapeUtil, .MaskData, com.sun.prism.ps.Shader, java.util.Arrays, .Comparator

An implementation of ShapeRep that attempts to cache and reuse the mask texture that is used to render the filled/stroked geometry. There is an artificial cap on the size of shapes that are considered for caching, so that we do not fill up VRAM with lots of large shape masks. The shape is considered for caching only when it is rendered a certain number of times with unchanging transform (ignoring the translation components) and geometry. This means that this class is good for caching static shapes that are either completely stationary or being translated. This class will also attempt to reuse a mask that corresponds to a completely different shape instance as long as the two shapes are equal and the transforms only differ by their translation components. This means that if you have 1000 Path nodes all with exactly the same geometry but with different translation factors, then we will only rasterize and cache a single mask texture and reuse it among all the Path nodes. (Of course, the fact that we reuse the same mask texture for different sub-pixel translation factors means we're knowingly being a bit sloppy, so when caching is enabled you may see some dancing at the shape edges for slowly animating translations, but otherwise will hopefully not be too noticeable.) The current implementation limits the size of the cache (512 pixels in each dimension, and 4 MB in total) so that it doesn't grow without bound. Space is granted on a first come first served basis.

Field Summary

Modifier and TypeField and Description
private CachingShapeRepState
private CachingShapeRepState

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv CachingShapeRepState
public void
public void
public void
public void
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

drawStateback to summary
private CachingShapeRepState drawState
fillStateback to summary
private CachingShapeRepState fillState

Constructor Detail

CachingShapeRepback to summary
public CachingShapeRep()

Method Detail

createStateback to summary
pack-priv CachingShapeRepState createState()
disposeback to summary
public void dispose()

Implements com.sun.prism.shape.ShapeRep.dispose.

Annotations
@Override
drawback to summary
public void draw(Graphics g, Shape shape, BaseBounds bounds)

Implements com.sun.prism.shape.ShapeRep.draw.

Annotations
@Override
fillback to summary
public void fill(Graphics g, Shape shape, BaseBounds bounds)

Implements com.sun.prism.shape.ShapeRep.fill.

Annotations
@Override
invalidateback to summary
public void invalidate(ShapeRep.InvalidationType type)

Implements com.sun.prism.shape.ShapeRep.invalidate.

Annotations
@Override
is3DCapableback to summary
public boolean is3DCapable()

Implements com.sun.prism.shape.ShapeRep.is3DCapable.

Annotations
@Override