During synchronization, the FX scene graph will pass down to us the transform which takes us from local space to parent space, the content bounds (ie: geom bounds), and the transformed bounds (ie: boundsInParent), and the clippedBounds. The effect bounds have already been passed to the Effect peer (if there is one).
Whenever the transformedBounds of the NGNode are changed, we update the dirtyBounds, so that the next time we need to accumulate dirty regions, we will have the information we need to make sure we create an appropriate dirty region.
NGNode maintains a single "dirty" flag, which indicates that this node itself is dirty and must contribute to the dirty region. More specifically, it indicates that this node is now dirty with respect to the back buffer. Any rendering of the scene which will go on the back buffer will cause the dirty flag to be cleared, whereas a rendering of the scene which is for an intermediate image will not clear this dirty flag.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | |
| private static class | |
| private static class | NGNode.
A custom effect implementation that has a filter() method that simply wraps the given pre-rendered PrDrawable in an ImageData and returns that result. |
| protected static enum | NGNode.
* Identifying render roots * * |
| Modifier and Type | Field and Description |
|---|---|
| private CacheFilter | cacheFilter
A filter used when the node is cached. |
| protected boolean | childDirty
If this node is an NGGroup, then this flag will be used to indicate whether one or more of its children is dirty. |
| private NGNode | clipNode
The node used for specifying the clipping shape for this node. |
| protected BaseBounds | contentBounds
The cached bounds. |
| protected int | cullingBits
Marks position of this node in dirty regions. |
| private boolean | depthTest
The depth test flag for this node. |
| protected NGNode. | dirty
Indicates that this NGNode is itself dirty and needs its full bounds included in the next repaint. |
| protected static final int | DIRTY_CHILDREN_ACCUMULATED_THRESHOLD
Do not iterate over all children in group. |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | DIRTY_REGION_INTERSECTS_NODE_BOUNDS
Statics for defining what the culling bits are. |
| pack-priv BaseBounds | dirtyBounds
We keep a reference to the last transform bounds that were valid and known. |
| protected int | dirtyChildrenAccumulated
How many children are going to be accumulated |
| private EffectFilter | effectFilter
A filter used whenever an effect is placed on the node. |
| private static final Boolean | |
| private DirtyHint | |
| private boolean | isClip
True if this node is a clip. |
| private String | name
Used for debug purposes. |
| private Blend. | nodeBlendMode
The blend mode that controls how the pixels of this node blend into the rest of the scene behind it. |
| private float | opacity
The opacity of this node. |
| private RectBounds | opaqueRegion
A cached representation of the opaque region for this node. |
| private boolean | opaqueRegionInvalid
To avoid object churn we keep opaqueRegion around, and just toggle this boolean to indicate whether we need to recompute the opaqueRegion. |
| private int | painted
Used for debug purposes. |
| private NGNode | parent
The parent of the node. |
| private static final GraphicsPipeline | |
| private static final BoxBounds | TEMP_BOUNDS
Temporary bounds for use by this class or subclasses, designed to reduce the amount of garbage we generate. |
| private static Point2D[] | |
| private static final RectBounds | |
| protected static final Affine3D | |
| private BaseTransform | transform
The transform for this node. |
| protected BaseBounds | transformedBounds
The cached transformed bounds. |
| private double | viewOrder
The view order of this node. |
| private boolean | visible
Whether the node is visible. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: The dirty region container. If the returned value is null, then that means the clip should be used as the dirty region. This is a special case indicating that there is no more need to walk the tree but we can take a shortcut. Note that returning null is *always* safe. Returning something other than null is simply an optimization for cases where the dirty region is substantially smaller than the clip.Todo Only made non-final for the sake of testing (see javafx-sg-prism tests) (JDK-8090845) must not be null, the clip in scene coordinates, supplied by the
rendering system. At most, this is usually the bounds of the window's
content area, however it might be smaller. clip, final RectBounds must not be null, the dirty region in scene coordinates.
When this method is initially invoked by the rendering system, the
dirtyRegion should be marked as invalid. dirtyRegionTemp, DirtyRegionPool regionPool, final DirtyRegionContainer must not be null, the container of dirty regions in scene
coordinates. dirtyRegionContainer, final BaseTransform must not be null, the accumulated transform up to but not
including this node's transform. When this method concludes, it must
restore this transform if it was changed within the function. tx, final GeneralTransform3D must not be null, it's the perspective transform of the current
perspective camera or identity transform if parallel camera is used. pvTx)Accumulates and returns the dirty regions in transformed coordinates for this node. |
| pack-priv int | accumulateGroupDirtyRegion(final RectBounds clip, final RectBounds dirtyRegionTemp, final DirtyRegionPool regionPool, DirtyRegionContainer dirtyRegionContainer, final BaseTransform tx, final GeneralTransform3D pvTx)
Accumulates the dirty region of an NGGroup. |
| pack-priv int | accumulateNodeDirtyRegion(final RectBounds clip, final RectBounds dirtyRegionTemp, final DirtyRegionContainer dirtyRegionContainer, final BaseTransform tx, final GeneralTransform3D pvTx)
Accumulates the dirty region of a node. |
| public void | |
| public void | |
| public void | |
| private static int | |
| pack-priv static boolean | checkBoundsInQuad(RectBounds untransformedQuad, RectBounds innerBounds, BaseTransform tx, GeneralTransform3D pvTx)
|
| public void | |
| public void | |
| private BaseBounds | |
| private BaseBounds | computeDirtyRegion(final RectBounds
A temporary RectBounds that this method can use for scratch.
In the case that no perspective transform occurs, it is best if
the returned BaseBounds is this instance. dirtyRegionTemp, final BaseTransform Any transform that needs to be applied tx, final GeneralTransform3D must not be null, it's the perspective transform of the current
perspective camera or identity transform if parallel camera is used. pvTx)Computes the dirty region for this Node. |
| pack-priv final NGNode. | Returns: NO_RENDER_ROOT if this node does not have an opaque region that fills the entire dirty region. Returns HAS_RENDER_ROOT if the opaque region fills the dirty region.the NodePath to populate with the path to the render root. Cannot be null. path, RectBounds the current dirty region. Cannot be null. dirtyRegion, int index of culling information, -1 means culling information should not be used cullingIndex, BaseTransform current transform. Cannot be null. tx, GeneralTransform3D current perspective transform. Cannot be null. pvTx)Check if this node can serve as rendering root for this dirty region. |
| protected RectBounds | |
| protected BaseBounds | computePadding(BaseBounds region)
LCD Text creates some painful situations where, due to the LCD text algorithm, we end up with some pixels touched that are normally outside the bounds. |
| pack-priv NGNode. | Returns: The result of visiting this node.the NodePath to populate with the path to the render root. Cannot be null. path, RectBounds the current dirty region. Cannot be null. dirtyRegion, int index of culling information cullingIndex, BaseTransform current transform. Cannot be null. tx, GeneralTransform3D current perspective transform. Cannot be null. pvTx)Searches for the last node that covers all of the specified dirty region with an opaque region, in this node's subtree. |
| public final void | doPreCulling(DirtyRegionContainer
Array of dirty regions. Cannot be null. drc, BaseTransform The transform for this render operation. Cannot be null. tx, GeneralTransform3D Perspective camera transformation. Cannot be null. pvTx)Culling support for multiple dirty regions. |
| protected void | |
| public void | drawDirtyOpts(final BaseTransform
The scene->parent transform. tx, final GeneralTransform3D The perspective camera transform. pvTx, Rectangle The bounds in scene coordinates clipBounds, int[] A pixel array where each pixel contains a color indicating how many times
it has been "drawn" colorBuffer, int the index of the dirty region we're gathering information for. This is
needed so we can shift the "painted" field to find out if this node
was drawn in this dirty region. dirtyRegionIndex)Helper method draws rectangles indicating the overdraw rectangles. |
| public void | effectChanged()
Called by the FX scene graph when an effect in the effect chain on the node changes internally. |
| protected void | |
| public final CacheFilter | |
| public final NGNode | |
| public final BaseBounds | |
| public final BaseBounds | |
| public BaseBounds | |
| protected final Effect | |
| public final BaseBounds | |
| public final EffectFilter | |
| pack-priv static FilterContext | |
| public final String | |
| public final Blend. | |
| public final float | |
| public final RectBounds | Returns: The opaque region for this node, or null.Gets the opaque region for this node, if there is one, or returns null. |
| public NGNode | |
| public final void | getRenderRoot(NodePath
node path to store the node path path, RectBounds dirtyRegion, int cullingIndex, BaseTransform tx, GeneralTransform3D pvTx)Called after preCullingBits in order to get the node from which we should begin drawing. |
| public final BaseTransform | |
| protected boolean | Returns: Whether this NGNode currently has an opaque region.Called only on NGNode subclasses which override |
| protected abstract boolean | |
| protected boolean | Returns: true if the node has some visualsMarks if the node has some visuals and that the bounds change should be taken into account when using the dirty region. |
| protected final void | |
| protected final void | invalidateCacheByTranslation(DirtyHint hint)
Mark the cache as invalid due to a translation of a child. |
| protected final void | |
| public final boolean | |
| public boolean | |
| public final boolean | |
| pack-priv final boolean | Returns: value of opaqueRegionInvalidThis method exists only for the sake of testing. |
| pack-priv boolean | |
| protected boolean | Returns: whether this rectangle is axis aligned when rendered given node's and rendering transformReturns whether a clip represented by this node can be rendered using axis aligned rect clip. |
| pack-priv boolean | |
| public boolean | |
| pack-priv void | markCullRegions(DirtyRegionContainer
The array of dirty regions. drc, int culling bits of parent. -1 if there's no parent. cullingRegionsBitsOfParent, BaseTransform The transform for this render operation. Cannot be null. tx, GeneralTransform3D Perspective camera transform. Cannot be null. pvTx)Marks placement of the node in dirty region encoded into 2 bit flag: 00 - node outside dirty region 01 - node intersecting dirty region 11 - node completely within dirty region 32 bits = 15 regions max. |
| public final void | markDirty()
Makes this node dirty, meaning that it needs to be included in the next repaint to the back buffer, and its bounds should be included in the dirty region. |
| private void | |
| protected final void | markTreeDirty()
Notifies the parent (whether an NGGroup or just a NGNode) that a child has become dirty. |
| protected final void | |
| protected boolean | Returns: true if this node needs special blending supportReturn true if this node has a blend mode that requires special processing. |
| private static boolean | |
| public final void | printDirtyOpts(StringBuilder
A StringBuilder to fill with the output. s, List<NGNode> The list of render roots (may be empty, must not be null). roots)Fills the given StringBuilder with text representing the structure of the NG graph insofar as dirty opts is concerned. |
| private final void | printDirtyOpts(StringBuilder
The String builder s, NGNode The node that we're printing out information about node, BaseTransform The transform tx, String Some prefix to put in front of the node output (mostly spacing) prefix, List<NGNode> The different dirty roots, if any. roots)Used for debug purposes. |
| public void | |
| public final void | |
| private void | |
| pack-priv void | |
| protected abstract void | |
| protected void | |
| public void | renderForcedContent(Graphics
the Graphics object that was used to render the
Scene, or null gOptional)Called on every render pulse for all nodes in case they have render-time operations that must be completed on a pulse, but were not otherwise rendered by the ordinary damage management logic. |
| pack-priv void | |
| private void | |
| private void | |
| private void | |
| public void | setCachedAsBitmap(boolean
specifies whether or not this node should be cached cached, CacheHint never null, indicates some hint as to how to cache cacheHint)Called by the FX scene graph whenever "cached" or "cacheHint" changes. |
| public void | setClipNode(NGNode
can be null if the clip node is being cleared clipNode)Called by the FX scene graph whenever the clip node for this node changes. |
| public void | setContentBounds(BaseBounds
must not be null bounds)Called by the FX scene graph to tell us what our new content bounds are. |
| public void | setDepthTest(boolean
indicates whether to perform a depth test operation
(if the window has a depth buffer). depthTest)Called by the FX scene graph whenever the derived depth test flag for the node changes. |
| public void | |
| public final void | |
| public void | |
| public void | setOpacity(float
A value between 0 and 1. opacity)Called by the FX scene graph whenever the opacity for the node changes. |
| public void | |
| private void | |
| public void | setTransformedBounds(BaseBounds
must not be null bounds, boolean byTransformChangeOnly)Called by the FX scene graph to tell us what our transformed bounds are. |
| public void | setTransformMatrix(BaseTransform
must not be null tx)Called by the FX scene graph to tell us what our transform matrix is. |
| public void | setViewOrder(double
A value between the range of negative Double.MAX_VALUE
and positive Double.MAX_VALUE. viewOrder)Called by the FX scene graph whenever the view order for the node changes. |
| public void | setVisible(boolean
whether it is visible value)Called by the FX scene graph to tell us whether we should be visible or not. |
| protected boolean | Returns: Whether this NGNode implementation supports opaque regions. This could also have been implemented via an interface that some NGNodes implemented, but then we'd have instanceof checks which I'd rather avoid.Gets whether this NGNode supports opaque regions at all. |
| public String | |
| protected void |