| java.lang.Object sun.java2d.pipe.BufferedContext
All known Subclasses: sun.java2d.opengl.OGLContext,
BufferedContext | public class BufferedContext (Code) | | Base context class for managing state in a single-threaded rendering
environment. Each state-setting operation (e.g. SET_COLOR) is added to
the provided RenderQueue, which will be processed at a later time by a
single thread. Note that the RenderQueue lock must be acquired before
calling the validate() method (or any other method in this class). See
the RenderQueue class comments for a sample usage scenario.
|
Field Summary | |
final public static int | NO_CONTEXT_FLAGS Indicates that no flags are needed; take all default code paths. | final public static int | SRC_IS_OPAQUE Indicates that the source surface (or color value, if it is a simple
rendering operation) is opaque (has an alpha value of 1.0). | final public static int | USE_MASK Indicates that the operation uses an alpha mask, which may determine
the code path that is used when setting up the current paint state. | protected RenderBuffer | buf | protected static BufferedContext | currentContext This is a reference to the most recently validated BufferedContext. | protected RenderQueue | rq |
NO_CONTEXT_FLAGS | final public static int NO_CONTEXT_FLAGS(Code) | | Indicates that no flags are needed; take all default code paths.
|
SRC_IS_OPAQUE | final public static int SRC_IS_OPAQUE(Code) | | Indicates that the source surface (or color value, if it is a simple
rendering operation) is opaque (has an alpha value of 1.0). If this
flag is present, it allows us to disable blending in certain
situations in order to improve performance.
|
USE_MASK | final public static int USE_MASK(Code) | | Indicates that the operation uses an alpha mask, which may determine
the code path that is used when setting up the current paint state.
|
currentContext | protected static BufferedContext currentContext(Code) | | This is a reference to the most recently validated BufferedContext. If
this value is null, it means that there is no current context. It is
provided here so that validate() only needs to do a quick reference
check to see if the BufferedContext passed to that method is the same
as the one we've cached here.
|
invalidateSurfaces | public void invalidateSurfaces()(Code) | | Invalidates the surfaces associated with this context. This is
useful when the context is no longer needed, and we want to break
the chain caused by these surface references.
|
validate | public void validate(SurfaceData srcData, SurfaceData dstData, Region clip, Composite comp, AffineTransform xform, Paint paint, SunGraphics2D sg2d, int flags)(Code) | | Validates the given parameters against the current state for this
context. If this context is not current, it will be made current
for the given source and destination surfaces, and the viewport will
be updated. Then each part of the context state (clip, composite,
etc.) is checked against the previous value. If the value has changed
since the last call to validate(), it will be updated accordingly.
Note that the SunGraphics2D parameter is only used for the purposes
of validating a (non-null) Paint parameter. In all other cases it
is safe to pass a null SunGraphics2D and it will be ignored.
|
|
|