java.lang.Object | |
↳ | sun.java2d.pipe.RenderingEngine |
![]() |
This class abstracts a number of features for which the Java 2D implementation relies on proprietary licensed software libraries. Access to those features is now achieved by retrieving the singleton instance of this class and calling the appropriate methods on it. The 3 primary features abstracted here include:
BasicStroke
class.
PathConsumer2D
object.
This procedure avoids having to create an intermediate Shape
object to hold the results of the createStrokedShape
method.
The main user of this method is the Java 2D non-antialiasing renderer.
AATileGenerator
object are explained in its class comments.
sun.java2d.renderer
.
Additionally, a runtime System property flag can be set to trace
all calls to methods on the RenderingEngine
in use by
setting the sun.java2d.renderer.trace property to any non-null value.
Parts of the system that need to use any of the above features should
call RenderingEngine.getInstance()
to obtain the properly
registered (and possibly trace-enabled) version of the RenderingEngine.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a widened path as specified by the parameters.
| |||||||||||
Utility method to feed a
PathConsumer2D object from a
given PathIterator . | |||||||||||
Construct an antialiased tile generator for the given shape with
the given rendering attributes and store the bounds of the tile
iteration in the bbox parameter.
| |||||||||||
Returns an instance of
RenderingEngine as determined
by the installation environment and runtime flags. | |||||||||||
Returns the minimum pen width that the antialiasing rasterizer
can represent without dropouts occuring.
| |||||||||||
Sends the geometry for a widened path as specified by the parameters
to the specified consumer.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Create a widened path as specified by the parameters.
The specified src
Shape
is widened according
to the specified attribute parameters as per the
BasicStroke
specification.
src | the source path to be widened |
---|---|
width | the width of the widened path as per BasicStroke |
caps | the end cap decorations as per BasicStroke |
join | the segment join decorations as per BasicStroke |
miterlimit | the miter limit as per BasicStroke |
dashes | the dash length array as per BasicStroke |
dashphase | the initial dash phase as per BasicStroke |
Shape
objectUtility method to feed a PathConsumer2D
object from a
given PathIterator
.
This method deals with the details of running the iterator and
feeding the consumer a segment at a time.
Construct an antialiased tile generator for the given shape with
the given rendering attributes and store the bounds of the tile
iteration in the bbox parameter.
The at
parameter specifies a transform that should affect
both the shape and the BasicStroke
attributes.
The clip
parameter specifies the current clip in effect
in device coordinates and can be used to prune the data for the
operation, but the renderer is not required to perform any
clipping.
If the BasicStroke
parameter is null then the shape
should be filled as is, otherwise the attributes of the
BasicStroke
should be used to specify a draw operation.
The thin
parameter indicates whether or not the
transformed BasicStroke
represents coordinates smaller
than the minimum resolution of the antialiasing rasterizer as
specified by the getMinimumAAPenWidth()
method.
Upon returning, this method will fill the bbox
parameter
with 4 values indicating the bounds of the iteration of the
tile generator.
The iteration order of the tiles will be as specified by the
pseudo-code:
for (y = bbox[1]; y < bbox[3]; y += tileheight) { for (x = bbox[0]; x < bbox[2]; x += tilewidth) { } }If there is no output to be rendered, this method may return null.
s | the shape to be rendered (fill or draw) |
---|---|
at | the transform to be applied to the shape and the stroke attributes |
clip | the current clip in effect in device coordinates |
bs | if non-null, a BasicStroke whose attributes
should be applied to this operation |
thin | true if the transformed stroke attributes are smaller than the minimum dropout pen width |
normalize | true if the VALUE_STROKE_NORMALIZE
RenderingHint is in effect |
bbox | returns the bounds of the iteration |
AATileGenerator
instance to be consulted
for tile coverages, or null if there is no output to renderReturns an instance of RenderingEngine
as determined
by the installation environment and runtime flags.
A specific instance of the RenderingEngine
can be
chosen by specifying the runtime flag:
java -Dsun.java2d.renderer=<classname>If no specific
RenderingEngine
is specified on the command
line then the last one returned by enumerating all subclasses of
RenderingEngine
known to the ServiceLoader is used.
Runtime tracing of the actions of the RenderingEngine
can be enabled by specifying the runtime flag:
java -Dsun.java2d.renderer.trace=<any string>
RenderingEngine
Returns the minimum pen width that the antialiasing rasterizer can represent without dropouts occuring.
Sends the geometry for a widened path as specified by the parameters to the specified consumer.
The specified src
Shape
is widened according
to the parameters specified by the BasicStroke
object.
Adjustments are made to the path as appropriate for the
VALUE_STROKE_NORMALIZE hint if the normalize
boolean parameter is true.
Adjustments are made to the path as appropriate for the
VALUE_ANTIALIAS_ON hint if the antialias
boolean parameter is true.
The geometry of the widened path is forwarded to the indicated
PathConsumer2D
object as it is calculated.
src | the source path to be widened |
---|---|
bs | the BasicSroke object specifying the
decorations to be applied to the widened path |
normalize | indicates whether stroke normalization should be applied |
antialias | indicates whether or not adjustments appropriate to antialiased rendering should be applied |
consumer | the PathConsumer2D instance to forward
the widened geometry to |