public class NGCanvas extends NGNode
Modifier and Type | Class and Description |
---|---|
(package private) static class |
NGCanvas.EffectInput |
(package private) static class |
NGCanvas.InitType |
(package private) static class |
NGCanvas.MyBlend |
private static class |
NGCanvas.PixelData |
(package private) static class |
NGCanvas.RenderBuf |
(package private) class |
NGCanvas.RenderInput |
NGNode.DirtyFlag, NGNode.RenderRootResult
Modifier and Type | Field and Description |
---|---|
private int |
align |
static byte |
ALIGN_CENTER |
static byte |
ALIGN_JUSTIFY |
static byte |
ALIGN_LEFT |
static byte |
ALIGN_RIGHT |
static byte |
ARC_CHORD |
static byte |
ARC_OPEN |
static byte |
ARC_PIE |
static byte |
ARC_TYPE |
private int |
arctype |
static byte |
ATTR_BASE |
static byte |
BASE_ALPHABETIC |
static byte |
BASE_BOTTOM |
static byte |
BASE_MIDDLE |
static byte |
BASE_TOP |
private int |
baseline |
private static Blend |
BLENDER |
private Blend.Mode |
blendmode |
static byte |
CAP_BUTT |
static byte |
CAP_ROUND |
static byte |
CAP_SQUARE |
private int |
ch |
static byte |
CLEAR_RECT |
private NGCanvas.RenderBuf |
clip |
private boolean |
clipIsRect |
private Rectangle |
clipRect |
private static float |
CLIPRECT_TOLERANCE |
private int |
clipsRendered |
private java.util.LinkedList<Path2D> |
clipStack |
static byte |
CLOSEPATH |
static byte |
COMP_MODE |
static byte |
CUBICTO |
private NGCanvas.RenderBuf |
cv |
private int |
cw |
static byte |
DASH_ARRAY |
static byte |
DASH_OFFSET |
private double[] |
dashes |
private float |
dashOffset |
static byte |
DRAW_IMAGE |
static byte |
DRAW_SUBIMAGE |
private Effect |
effect |
static byte |
EFFECT |
static byte |
FILL_ARC |
static byte |
FILL_OVAL |
static byte |
FILL_PAINT |
static byte |
FILL_PATH |
static byte |
FILL_RECT |
static byte |
FILL_ROUND_RECT |
static byte |
FILL_RULE |
static byte |
FILL_RULE_EVEN_ODD |
static byte |
FILL_RULE_NON_ZERO |
static byte |
FILL_TEXT |
private Paint |
fillPaint |
static byte |
FONT |
static byte |
FONT_SMOOTH |
static byte |
FX_APPLY_EFFECT |
static byte |
FX_BASE |
static byte |
GLOBAL_ALPHA |
private float |
globalAlpha |
private float |
highestPixelScale |
static byte |
IMG_BASE |
private boolean |
inversedirty |
private Affine2D |
inverseTransform |
static byte |
JOIN_BEVEL |
static byte |
JOIN_MITER |
static byte |
JOIN_ROUND |
static byte |
LINE_CAP |
static byte |
LINE_JOIN |
static byte |
LINE_WIDTH |
private int |
linecap |
private int |
linejoin |
static byte |
LINETO |
private float |
linewidth |
static byte |
MITER_LIMIT |
private float |
miterlimit |
static byte |
MOVETO |
private NGText |
ngtext |
(package private) static int[] |
numCoords |
static byte |
OP_BASE |
private Path2D |
path |
static byte |
PATH_BASE |
static byte |
PATHEND |
static byte |
PATHSTART |
private PGFont |
pgfont |
static byte |
POP_CLIP |
private static int[] |
prbases |
private static int[] |
prcaps |
private static int[] |
prjoins |
static byte |
PUSH_CLIP |
static byte |
PUT_ARGB |
static byte |
PUT_ARGBPRE_BUF |
static byte |
QUADTO |
static byte |
RESET |
static byte |
SET_DIMS |
static byte |
SMOOTH_GRAY |
static byte |
SMOOTH_LCD |
private int |
smoothing |
private BasicStroke |
stroke |
static byte |
STROKE_ARC |
static byte |
STROKE_LINE |
static byte |
STROKE_OVAL |
static byte |
STROKE_PAINT |
static byte |
STROKE_PATH |
static byte |
STROKE_RECT |
static byte |
STROKE_ROUND_RECT |
static byte |
STROKE_TEXT |
private Paint |
strokePaint |
private NGCanvas.RenderBuf |
temp |
private static Arc2D |
TEMP_ARC |
(package private) static float[] |
TEMP_COORDS |
(package private) static Affine2D |
TEMP_PATH_TX |
private static Rectangle |
TEMP_RECT |
private static RectBounds |
TEMP_RECTBOUNDS |
private static Affine2D |
TEMP_TX |
static byte |
TEXT_ALIGN |
static byte |
TEXT_BASELINE |
private PrismTextLayout |
textLayout |
private int |
th |
private GrowableDataBuffer |
thebuf |
private Affine2D |
transform |
static byte |
TRANSFORM |
private int |
tw |
(package private) Shape |
untransformedPath |
static byte |
UTIL_BASE |
childDirty, contentBounds, cullingBits, dirty, DIRTY_CHILDREN_ACCUMULATED_THRESHOLD, DIRTY_REGION_CONTAINS_NODE_BOUNDS, DIRTY_REGION_CONTAINS_OR_INTERSECTS_NODE_BOUNDS, DIRTY_REGION_INTERSECTS_NODE_BOUNDS, dirtyBounds, dirtyChildrenAccumulated, TEMP_TRANSFORM, transformedBounds
Constructor and Description |
---|
NGCanvas() |
Modifier and Type | Method and Description |
---|---|
private Rectangle |
applyEffectOnAintoC(Effect definput,
Effect effect,
BaseTransform transform,
Rectangle outputClip,
CompositeMode comp,
NGCanvas.RenderBuf destbuf) |
private void |
blendAthruBintoC(NGCanvas.RenderBuf drawbuf,
Blend.Mode mode,
NGCanvas.RenderBuf clipbuf,
RectBounds bounds,
CompositeMode comp,
NGCanvas.RenderBuf destbuf) |
private void |
clearCanvas(int x,
int y,
int w,
int h) |
(package private) void |
computeTextLayoutBounds(RectBounds bounds,
BaseTransform transform,
float scaleX,
float layoutX,
float layoutY,
int token) |
private Affine2D |
getInverseTransform() |
private BasicStroke |
getStroke() |
void |
handleRenderOp(int token,
GrowableDataBuffer buf,
Graphics gr,
RectBounds bounds)
Calculate bounds and/or render one single rendering operation.
|
protected boolean |
hasOverlappingContents() |
private void |
initAttributes() |
private void |
initCanvas(Graphics g) |
private boolean |
initClip() |
(package private) static void |
inverseTxBounds(RectBounds bounds,
BaseTransform transform) |
private boolean |
printedCanvas(Graphics g) |
private void |
renderClip(Shape clippath) |
protected void |
renderContent(Graphics g) |
void |
renderForcedContent(Graphics 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.
|
private void |
renderStream(GrowableDataBuffer buf) |
private void |
resetClip(boolean andDispose) |
private static void |
runOnRenderThread(java.lang.Runnable r) |
private void |
setupFill(Graphics gr) |
private void |
setupStroke(Graphics gr) |
private static void |
shapebounds(Shape shape,
RectBounds bounds,
BaseTransform transform) |
private static void |
strokebounds(BasicStroke stroke,
Shape shape,
RectBounds bounds,
BaseTransform transform) |
(package private) static void |
txBounds(RectBounds bounds,
BaseTransform transform) |
void |
updateBounds(float w,
float h) |
boolean |
updateRendering(GrowableDataBuffer buf) |
accumulateDirtyRegions, accumulateGroupDirtyRegion, accumulateNodeDirtyRegion, applyClip, applyEffect, applyTransform, checkBoundsInQuad, clearDirty, clearDirtyTree, clearPainted, computeNodeRenderRoot, computeOpaqueRegion, computePadding, computeRenderRoot, doPreCulling, doRender, drawDirtyOpts, effectChanged, geometryChanged, getCacheFilter, getClipNode, getClippedBounds, getCompleteBounds, getContentBounds, getEffect, getEffectBounds, getEffectFilter, getFilterContext, getName, getNodeBlendMode, getOpacity, getOpaqueRegion, getParent, getRenderRoot, getTransform, hasOpaqueRegion, hasVisuals, invalidateCache, invalidateCacheByTranslation, invalidateOpaqueRegion, isClean, isContentBounds2D, isDepthTest, isOpaqueRegionInvalid, isReadbackSupported, isRectClip, isShape3D, isVisible, markCullRegions, markDirty, markTreeDirty, markTreeDirtyNoIncrement, needsBlending, printDirtyOpts, release, render, renderClip, renderEffect, renderForClip, setCachedAsBitmap, setClipNode, setContentBounds, setDepthTest, setEffect, setName, setNodeBlendMode, setOpacity, setParent, setTransformedBounds, setTransformMatrix, setVisible, supportsOpaqueRegions, toString, visualsChanged
public static final byte ATTR_BASE
public static final byte GLOBAL_ALPHA
public static final byte COMP_MODE
public static final byte FILL_PAINT
public static final byte STROKE_PAINT
public static final byte LINE_WIDTH
public static final byte LINE_CAP
public static final byte LINE_JOIN
public static final byte MITER_LIMIT
public static final byte FONT
public static final byte TEXT_ALIGN
public static final byte TEXT_BASELINE
public static final byte TRANSFORM
public static final byte EFFECT
public static final byte PUSH_CLIP
public static final byte POP_CLIP
public static final byte ARC_TYPE
public static final byte FILL_RULE
public static final byte DASH_ARRAY
public static final byte DASH_OFFSET
public static final byte FONT_SMOOTH
public static final byte OP_BASE
public static final byte FILL_RECT
public static final byte STROKE_RECT
public static final byte CLEAR_RECT
public static final byte STROKE_LINE
public static final byte FILL_OVAL
public static final byte STROKE_OVAL
public static final byte FILL_ROUND_RECT
public static final byte STROKE_ROUND_RECT
public static final byte FILL_ARC
public static final byte STROKE_ARC
public static final byte FILL_TEXT
public static final byte STROKE_TEXT
public static final byte PATH_BASE
public static final byte PATHSTART
public static final byte MOVETO
public static final byte LINETO
public static final byte QUADTO
public static final byte CUBICTO
public static final byte CLOSEPATH
public static final byte PATHEND
public static final byte FILL_PATH
public static final byte STROKE_PATH
public static final byte IMG_BASE
public static final byte DRAW_IMAGE
public static final byte DRAW_SUBIMAGE
public static final byte PUT_ARGB
public static final byte PUT_ARGBPRE_BUF
public static final byte FX_BASE
public static final byte FX_APPLY_EFFECT
public static final byte UTIL_BASE
public static final byte RESET
public static final byte SET_DIMS
public static final byte CAP_BUTT
public static final byte CAP_ROUND
public static final byte CAP_SQUARE
public static final byte JOIN_MITER
public static final byte JOIN_ROUND
public static final byte JOIN_BEVEL
public static final byte ARC_OPEN
public static final byte ARC_CHORD
public static final byte ARC_PIE
public static final byte SMOOTH_GRAY
public static final byte SMOOTH_LCD
public static final byte ALIGN_LEFT
public static final byte ALIGN_CENTER
public static final byte ALIGN_RIGHT
public static final byte ALIGN_JUSTIFY
public static final byte BASE_TOP
public static final byte BASE_MIDDLE
public static final byte BASE_ALPHABETIC
public static final byte BASE_BOTTOM
public static final byte FILL_RULE_NON_ZERO
public static final byte FILL_RULE_EVEN_ODD
private static Blend BLENDER
private GrowableDataBuffer thebuf
private final float highestPixelScale
private int tw
private int th
private int cw
private int ch
private NGCanvas.RenderBuf cv
private NGCanvas.RenderBuf temp
private NGCanvas.RenderBuf clip
private float globalAlpha
private Blend.Mode blendmode
private Paint fillPaint
private Paint strokePaint
private float linewidth
private int linecap
private int linejoin
private float miterlimit
private double[] dashes
private float dashOffset
private BasicStroke stroke
private Path2D path
private NGText ngtext
private PrismTextLayout textLayout
private PGFont pgfont
private int smoothing
private int align
private int baseline
private Affine2D transform
private Affine2D inverseTransform
private boolean inversedirty
private java.util.LinkedList<Path2D> clipStack
private int clipsRendered
private boolean clipIsRect
private Rectangle clipRect
private Effect effect
private int arctype
static float[] TEMP_COORDS
private static Arc2D TEMP_ARC
private static RectBounds TEMP_RECTBOUNDS
static final Affine2D TEMP_PATH_TX
static final int[] numCoords
Shape untransformedPath
private static final float CLIPRECT_TOLERANCE
private static final Rectangle TEMP_RECT
private static final int[] prcaps
private static final int[] prjoins
private static final int[] prbases
private static final Affine2D TEMP_TX
private void initAttributes()
private Affine2D getInverseTransform()
protected boolean hasOverlappingContents()
hasOverlappingContents
in class NGNode
private static void shapebounds(Shape shape, RectBounds bounds, BaseTransform transform)
private static void strokebounds(BasicStroke stroke, Shape shape, RectBounds bounds, BaseTransform transform)
private static void runOnRenderThread(java.lang.Runnable r)
private boolean printedCanvas(Graphics g)
protected void renderContent(Graphics g)
renderContent
in class NGNode
public void renderForcedContent(Graphics gOptional)
NGNode
renderForcedContent
in class NGNode
gOptional
- the Graphics object that was used to render the
Scene, or nullprivate void initCanvas(Graphics g)
private void clearCanvas(int x, int y, int w, int h)
private void resetClip(boolean andDispose)
private boolean initClip()
private void renderClip(Shape clippath)
private Rectangle applyEffectOnAintoC(Effect definput, Effect effect, BaseTransform transform, Rectangle outputClip, CompositeMode comp, NGCanvas.RenderBuf destbuf)
private void blendAthruBintoC(NGCanvas.RenderBuf drawbuf, Blend.Mode mode, NGCanvas.RenderBuf clipbuf, RectBounds bounds, CompositeMode comp, NGCanvas.RenderBuf destbuf)
private void setupFill(Graphics gr)
private BasicStroke getStroke()
private void setupStroke(Graphics gr)
private void renderStream(GrowableDataBuffer buf)
public void handleRenderOp(int token, GrowableDataBuffer buf, Graphics gr, RectBounds bounds)
token
- the stream token for the rendering opbuf
- the GrowableDataBuffer to get rendering info fromgr
- the Graphics to render to, if not nullbounds
- the RectBounds to accumulate bounds into, if not nullvoid computeTextLayoutBounds(RectBounds bounds, BaseTransform transform, float scaleX, float layoutX, float layoutY, int token)
static void txBounds(RectBounds bounds, BaseTransform transform)
static void inverseTxBounds(RectBounds bounds, BaseTransform transform)
public void updateBounds(float w, float h)
public boolean updateRendering(GrowableDataBuffer buf)