APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.javafx.tk.quantum

pack-priv abstract Class ViewPainter

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable
Known Direct Subclasses
com.sun.javafx.tk.quantum.PresentingPainter, com.sun.javafx.tk.quantum.UploadingPainter
Imports
java.util.ArrayList, .List, java.util.concurrent.locks.ReentrantLock, com.sun.javafx.geom.DirtyRegionContainer, .DirtyRegionPool, .RectBounds, .Rectangle, com.sun.javafx.geom.transform.Affine3D, .BaseTransform, .GeneralTransform3D, com.sun.javafx.sg.prism.NGCamera, .NGNode, .NGPerspectiveCamera, .NodePath, com.sun.prism.Graphics, .GraphicsResource, .Image, .Presentable, .RTTexture, .ResourceFactory, .Texture, com.sun.prism.impl.PrismSettings, com.sun.prism.paint.Color, .Paint, com.sun.javafx.logging.PulseLogger

Responsible for "painting" a scene. It invokes as appropriate API on the root NGNode of a scene to determine dirty regions, render roots, etc. Also calls the render root to render. Also invokes code to print dirty opts and paint overdraw rectangles according to debug flags.

Field Summary

Modifier and TypeField and Description
private RectBounds
private Rectangle
private DirtyRegionContainer
private DirtyRegionPool
private RectBounds
protected ResourceFactory
protected boolean
private int
private NGNode
overlayRoot

root is the root node of the scene.

protected int
protected int
protected Presentable
private GeneralTransform3D
protected static final ReentrantLock
private NGNode
root

root is the root node of the scene.

private static NodePath[]
ROOT_PATHS

An array of initially empty ROOT_PATHS.

private Affine3D
private RTTexture
sceneBuffer

This is used for drawing dirty regions and overdraw rectangles in cases where we are not drawing the entire scene every time (specifically, when depth buffer is disabled).

protected final SceneState
private Affine3D
protected int
private GeneralTransform3D
protected int
private int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
private void
protected void
private void
doPaint(Graphics g, NodePath renderRootPath)

protected float
protected float
private static NodePath
getRootPath(int i)

protected void
paintImpl(final Graphics backBufferGraphics)

private void
paintOverdraw(final Graphics g, final Rectangle clip)

Utility method for painting the overdraw rectangles.

protected final void
protected final void
protected boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clipback to summary
private RectBounds clip
dirtyRectback to summary
private Rectangle dirtyRect
dirtyRegionContainerback to summary
private DirtyRegionContainer dirtyRegionContainer
dirtyRegionPoolback to summary
private DirtyRegionPool dirtyRegionPool
dirtyRegionTempback to summary
private RectBounds dirtyRegionTemp
factoryback to summary
protected ResourceFactory factory
freshBackBufferback to summary
protected boolean freshBackBuffer
heightback to summary
private int height
overlayRootback to summary
private NGNode overlayRoot

root is the root node of the scene. overlayRoot is the root node of any overlay which may be present (such as used for full screen overlay).

penHeightback to summary
protected int penHeight
penWidthback to summary
protected int penWidth
presentableback to summary
protected Presentable presentable
projTxback to summary
private GeneralTransform3D projTx
renderLockback to summary
protected static final ReentrantLock renderLock
rootback to summary
private NGNode root

root is the root node of the scene. overlayRoot is the root node of any overlay which may be present (such as used for full screen overlay).

ROOT_PATHSback to summary
private static NodePath[] ROOT_PATHS

An array of initially empty ROOT_PATHS. They are created on demand as needed. Each path is associated with a different dirty region. We have up to PrismSettings.dirtyRegionCount max dirty regions

scaleTxback to summary
private Affine3D scaleTx
sceneBufferback to summary
private RTTexture sceneBuffer

This is used for drawing dirty regions and overdraw rectangles in cases where we are not drawing the entire scene every time (specifically, when depth buffer is disabled). In those cases we will draw the scene to the sceneBuffer, clear the actual back buffer, blit the sceneBuffer into the back buffer, and then scribble on top of the back buffer with the dirty regions and/or overdraw rectangles. When the depthBuffer is enabled on a scene, we always end up drawing the entire scene anyway, so we don't bother with this sceneBuffer in that case. Of course, if dirty region / overdraw rectangle drawing is turned off, then we don't use this. Thus, only when you are doing some kind of debugging would this field be used and the extra buffer copy incurred.

sceneStateback to summary
protected final SceneState sceneState
txback to summary
private Affine3D tx
viewHeightback to summary
protected int viewHeight
viewProjTxback to summary
private GeneralTransform3D viewProjTx
viewWidthback to summary
protected int viewWidth
widthback to summary
private int width

Constructor Detail

ViewPainterback to summary
protected ViewPainter(GlassScene gs)

Method Detail

adjustPerspectiveback to summary
private void adjustPerspective(NGCamera camera)
disposePresentableback to summary
protected void disposePresentable()
doPaintback to summary
private void doPaint(Graphics g, NodePath renderRootPath)
getPixelScaleFactorXback to summary
protected float getPixelScaleFactorX()
getPixelScaleFactorYback to summary
protected float getPixelScaleFactorY()
getRootPathback to summary
private static NodePath getRootPath(int i)
paintImplback to summary
protected void paintImpl(final Graphics backBufferGraphics)
paintOverdrawback to summary
private void paintOverdraw(final Graphics g, final Rectangle clip)

Utility method for painting the overdraw rectangles. Right now we're using a computationally intensive approach of having an array of integers (image data) that we then write to in the NGNodes, recording how many times each pixel position has been touched (well, technically, we're just recording the bounds of drawn objects, so some pixels might be "red" but actually were never drawn).

setOverlayRootback to summary
protected final void setOverlayRoot(NGNode node)
setRootback to summary
protected final void setRoot(NGNode node)
validateStageGraphicsback to summary
protected boolean validateStageGraphics()