java.lang.Object | |
↳ | sun.java2d.pipe.BufferedContext |
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.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | NO_CONTEXT_FLAGS | Indicates that no flags are needed; take all default code paths. | |||||||||
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). | |||||||||
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. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
buf | |||||||||||
currentContext | This is a reference to the most recently validated BufferedContext. | ||||||||||
rq |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Invalidates the surfaces associated with this context.
| |||||||||||
Validates the given parameters against the current state for this
context.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Indicates that no flags are needed; take all default code paths.
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.
Indicates that the operation uses an alpha mask, which may determine the code path that is used when setting up the current paint state.
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.
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.
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.