APIdia Launch Partner
Top Fields Constructors Methods
com.sun.prism.impl.ps

public abstract Class BaseShaderGraphics

extends BaseGraphics
implements ShaderGraphics, ReadbackGraphics, MaskTextureGraphics
Class Inheritance
All Implemented Interfaces
com.sun.prism.MaskTextureGraphics, com.sun.prism.Graphics, com.sun.prism.ReadbackGraphics, com.sun.prism.ps.ShaderGraphics
Known Direct Subclasses
com.sun.prism.mtl.MTLGraphics, com.sun.prism.null3d.DummyGraphics, com.sun.prism.d3d.D3DGraphics, com.sun.prism.es2.ES2Graphics
Imports
com.sun.javafx.font.FontResource, .FontStrike, .Metrics, .PrismFontFactory, com.sun.javafx.geom.BaseBounds, .Point2D, .RectBounds, .Rectangle, .Shape, com.sun.javafx.geom.transform.Affine2D, .Affine3D, .AffineBase, .BaseTransform, .NoninvertibleTransformException, com.sun.javafx.scene.text.GlyphList, com.sun.javafx.sg.prism.NGLightBase, com.sun.prism.BasicStroke, .CompositeMode, .MaskTextureGraphics, .MultiTexture, .PixelFormat, .RTTexture, .ReadbackGraphics, .ReadbackRenderTarget, .RenderTarget, .Texture, com.sun.prism.impl.BaseGraphics, .GlyphCache, .PrismSettings, .VertexBuffer, com.sun.prism.impl.ps.BaseShaderContext.MaskType, com.sun.prism.impl.shape.MaskData, .ShapeUtil, com.sun.prism.paint.Color, .Gradient, .ImagePattern, .LinearGradient, .Paint, .RadialGradient, com.sun.prism.ps.Shader, .ShaderGraphics

Field Summary

Modifier and TypeField and Description
private final BaseShaderContext
private Shader
private static final float
private boolean
private boolean
private NGLightBase[]
private static final double
private static Affine2D
private static Affine3D
private static RectBounds
Inherited from com.sun.prism.impl.BaseGraphics:
IDENTisSimpleTranslatenodeBoundspaintscratchEllipsescratchLinescratchRRectstroketransXtransY

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
blit(RTTexture srcTex, RTTexture dstTex, int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1)

Implements com.sun.prism.Graphics.blit.

private static float
calculateScaleFactor(float contentDim, float physicalDim)

public boolean
private static boolean
private boolean
checkInnerCurvature(float arcw, float arch)

public void
clearQuad(float x1, float y1, float x2, float y2)

Implements com.sun.prism.Graphics.clearQuad.

Clears the region represented by the given quad with transparent pixels.

public void
drawEllipse(float x, float y, float w, float h)

Implements com.sun.prism.Graphics.drawEllipse.

private void
drawLCDBuffer(float bx, float by, float bw, float bh, float tx1, float ty1, float tx2, float ty2)

public void
drawLine(float x1, float y1, float x2, float y2)

Implements com.sun.prism.Graphics.drawLine.

public void
drawMappedTextureRaw2(Texture src1, Texture src2, float dx1, float dy1, float dx2, float dy2, float t1x11, float t1y11, float t1x21, float t1y21, float t1x12, float t1y12, float t1x22, float t1y22, float t2x11, float t2y11, float t2x21, float t2y21, float t2x12, float t2y12, float t2x22, float t2y22)

Implements com.sun.prism.ps.ShaderGraphics.drawMappedTextureRaw2.

protected void
drawMultiTexture(MultiTexture tex, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2)

public void
drawPixelsMasked(RTTexture imgtex, RTTexture masktex, int dx, int dy, int dw, int dh, int ix, int iy, int mx, int my)

Implements com.sun.prism.MaskTextureGraphics.drawPixelsMasked.

Apply a mask to the pixels of an image and render the results onto the destination in device space.

pack-priv boolean
drawPrimDiagonal(float x1, float y1, float x2, float y2, float lw, int cap, float bx, float by, float bw, float bh)

pack-priv boolean
drawPrimRect(float x, float y, float w, float h)

public void
drawRect(float x, float y, float w, float h)

Implements com.sun.prism.Graphics.drawRect.

public void
drawRoundRect(float x, float y, float w, float h, float arcw, float arch)

Implements com.sun.prism.Graphics.drawRoundRect.

public void
drawString(GlyphList gl, FontStrike strike, float x, float y, Color selectColor, int selectStart, int selectEnd)

Implements com.sun.prism.Graphics.drawString.

public void
drawTexture(Texture tex, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2)

Overrides com.sun.prism.impl.BaseGraphics.drawTexture.

Implements com.sun.prism.Graphics.drawTexture.

public void
drawTexture3SliceH(Texture tex, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2, float dh1, float dh2, float sh1, float sh2)

Overrides com.sun.prism.impl.BaseGraphics.drawTexture3SliceH.

Implements com.sun.prism.Graphics.drawTexture3SliceH.

public void
drawTexture3SliceV(Texture tex, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2, float dv1, float dv2, float sv1, float sv2)

Overrides com.sun.prism.impl.BaseGraphics.drawTexture3SliceV.

Implements com.sun.prism.Graphics.drawTexture3SliceV.

public void
drawTexture9Slice(Texture tex, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2, float dh1, float dv1, float dh2, float dv2, float sh1, float sv1, float sh2, float sv2)

Overrides com.sun.prism.impl.BaseGraphics.drawTexture9Slice.

Implements com.sun.prism.Graphics.drawTexture9Slice.

public void
drawTextureRaw2(Texture src1, Texture src2, float dx1, float dy1, float dx2, float dy2, float t1x1, float t1y1, float t1x2, float t1y2, float t2x1, float t2y1, float t2x2, float t2y2)

Implements com.sun.prism.ps.ShaderGraphics.drawTextureRaw2.

private BaseTransform
public void
fillEllipse(float x, float y, float w, float h)

Implements com.sun.prism.Graphics.fillEllipse.

pack-priv boolean
fillPrimRect(float x, float y, float w, float h, Texture rectTex, Texture wrapTex, float bx, float by, float bw, float bh)

public void
fillQuad(float x1, float y1, float x2, float y2)

Implements com.sun.prism.Graphics.fillQuad.

public void
fillRect(float x, float y, float w, float h)

Implements com.sun.prism.Graphics.fillRect.

public void
fillRoundRect(float x, float y, float w, float h, float arcw, float arch)

Implements com.sun.prism.Graphics.fillRoundRect.

pack-priv BaseShaderContext
public Shader
public final NGLightBase[]
public void
pack-priv AffineBase
getPaintTextureTx(BaseTransform renderTx, Shader shader, float rx, float ry, float rw, float rh)

private static float
private void
pack-priv boolean
private static float
len(float x, float y)

public void
maskInterpolatePixels(RTTexture imgtex, RTTexture masktex, int dx, int dy, int dw, int dh, int ix, int iy, int mx, int my)

Implements com.sun.prism.MaskTextureGraphics.maskInterpolatePixels.

Use a mask to determine which pixels of an image are to be rendered onto the destination in device space.

public RTTexture
public void
private void
renderGeneralRoundedPgram(float ox, float oy, float wvecx, float wvecy, float hvecx, float hvecy, float arcfractw, float arcfracth, float ifractw, float ifracth, BaseTransform rendertx, BaseShaderContext.MaskType type, float rx, float ry, float rw, float rh)

private void
renderGeneralRoundedRect(float rx, float ry, float rw, float rh, float arcw, float arch, BaseShaderContext.MaskType type, BasicStroke stroke)

protected void
renderShape(Shape shape, BasicStroke stroke, float bx, float by, float bw, float bh)

Implements abstract com.sun.prism.impl.BaseGraphics.renderShape.

private void
renderWithComplexPaint(Shape shape, BasicStroke stroke, float bx, float by, float bw, float bh)

public void
public void
public void
setNodeBounds(RectBounds bounds)

Implements com.sun.prism.Graphics.setNodeBounds.

Set the node bounds for any node that would like to render objects of a different size to self.

public void
public void
Inherited from com.sun.prism.impl.BaseGraphics:
cleardrawdrawMappedTextureRawdrawTexturedrawTextureRawdrawTextureVOfillgetAssociatedScreengetCameragetCameraNoClonegetClipRectgetClipRectIndexgetClipRectNoClonegetCompositeModegetExtraAlphagetFinalClipNoClonegetPaintgetPixelScaleFactorXgetPixelScaleFactorYgetRenderRootgetRenderTargetgetResourceFactorygetStrokegetTransformNoClonehasPreCullingBitsisAlphaTestShaderisAntialiasedShapeisDepthBufferisDepthTestisState3DscalescalesetAntialiasedShapesetCamerasetClipRectsetClipRectIndexsetCompositeModesetDepthBuffersetDepthTestsetExtraAlphasetHasPreCullingBitssetPerspectiveTransformsetPixelScaleFactorssetRenderRootsetState3DsetStrokesetTransformsetTransformsetTransform3Dtransformtranslatetranslate

Field Detail

contextback to summary
private final BaseShaderContext context

Hides com.sun.prism.impl.BaseGraphics.context.

externalShaderback to summary
private Shader externalShader
FRINGE_FACTORback to summary
private static final float FRINGE_FACTOR
isComplexPaintback to summary
private boolean isComplexPaint
lcdSampleInvalidback to summary
private boolean lcdSampleInvalid
lightsback to summary
private NGLightBase[] lights
SQRT_2back to summary
private static final double SQRT_2
TEMP_TX2Dback to summary
private static Affine2D TEMP_TX2D
TEMP_TX3Dback to summary
private static Affine3D TEMP_TX3D
TMP_BOUNDSback to summary
private static RectBounds TMP_BOUNDS

Constructor Detail

BaseShaderGraphicsback to summary
protected BaseShaderGraphics(BaseShaderContext context, RenderTarget renderTarget)

Method Detail

blitback to summary
public void blit(RTTexture srcTex, RTTexture dstTex, int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1)

Implements com.sun.prism.Graphics.blit.

Annotations
@Override
calculateScaleFactorback to summary
private static float calculateScaleFactor(float contentDim, float physicalDim)
canReadBackback to summary
public boolean canReadBack()

Implements com.sun.prism.ReadbackGraphics.canReadBack.

Annotations
@Override
canUseStrokeShaderback to summary
private static boolean canUseStrokeShader(BasicStroke bs)
checkInnerCurvatureback to summary
private boolean checkInnerCurvature(float arcw, float arch)
clearQuadback to summary
public void clearQuad(float x1, float y1, float x2, float y2)

Implements com.sun.prism.Graphics.clearQuad.

Doc from com.sun.prism.Graphics.clearQuad.

Clears the region represented by the given quad with transparent pixels. Note that this operation is affected by the current clip rectangle, if set, as well as the current transform (the quad is specified in user space). Also note that unlike the clear() methods, this method does not attempt to clear the depth buffer.

Annotations
@Override
drawEllipseback to summary
public void drawEllipse(float x, float y, float w, float h)

Implements com.sun.prism.Graphics.drawEllipse.

Annotations
@Override
drawLCDBufferback to summary
private void drawLCDBuffer(float bx, float by, float bw, float bh, float tx1, float ty1, float tx2, float ty2)
drawLineback to summary
public void drawLine(float x1, float y1, float x2, float y2)

Implements com.sun.prism.Graphics.drawLine.

Annotations
@Override
drawMappedTextureRaw2back to summary
public void drawMappedTextureRaw2(Texture src1, Texture src2, float dx1, float dy1, float dx2, float dy2, float t1x11, float t1y11, float t1x21, float t1y21, float t1x12, float t1y12, float t1x22, float t1y22, float t2x11, float t2y11, float t2x21, float t2y21, float t2x12, float t2y12, float t2x22, float t2y22)

Implements com.sun.prism.ps.ShaderGraphics.drawMappedTextureRaw2.

Annotations
@Override
drawMultiTextureback to summary
protected void drawMultiTexture(MultiTexture tex, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2)
drawPixelsMaskedback to summary
public void drawPixelsMasked(RTTexture imgtex, RTTexture masktex, int dx, int dy, int dw, int dh, int ix, int iy, int mx, int my)

Implements com.sun.prism.MaskTextureGraphics.drawPixelsMasked.

Doc from com.sun.prism.MaskTextureGraphics.drawPixelsMasked.

Apply a mask to the pixels of an image and render the results onto the destination in device space. All coordinates specify pixel coordinates and are integers to reinforce the fact that these are pixel operations, not coordinate rendering operations.

The image texture is combined with the mask texture by multiplying the pixels in the image texture by the alpha in the mask texture and then the result is applied to the destination using the current compositing rule (which should likely be SrcOver in most cases).

    dst.argb = (img.argb * mask.a) Composite dst.argb
Annotations
@Override
drawPrimDiagonalback to summary
pack-priv boolean drawPrimDiagonal(float x1, float y1, float x2, float y2, float lw, int cap, float bx, float by, float bw, float bh)
drawPrimRectback to summary
pack-priv boolean drawPrimRect(float x, float y, float w, float h)
drawRectback to summary
public void drawRect(float x, float y, float w, float h)

Implements com.sun.prism.Graphics.drawRect.

Annotations
@Override
drawRoundRectback to summary
public void drawRoundRect(float x, float y, float w, float h, float arcw, float arch)

Implements com.sun.prism.Graphics.drawRoundRect.

Annotations
@Override
drawStringback to summary
public void drawString(GlyphList gl, FontStrike strike, float x, float y, Color selectColor, int selectStart, int selectEnd)

Implements com.sun.prism.Graphics.drawString.

Annotations
@Override
drawTextureback to summary
public void drawTexture(Texture tex, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2)

Overrides com.sun.prism.impl.BaseGraphics.drawTexture.

Implements com.sun.prism.Graphics.drawTexture.

Annotations
@Override
drawTexture3SliceHback to summary
public void drawTexture3SliceH(Texture tex, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2, float dh1, float dh2, float sh1, float sh2)

Overrides com.sun.prism.impl.BaseGraphics.drawTexture3SliceH.

Implements com.sun.prism.Graphics.drawTexture3SliceH.

Annotations
@Override
drawTexture3SliceVback to summary
public void drawTexture3SliceV(Texture tex, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2, float dv1, float dv2, float sv1, float sv2)

Overrides com.sun.prism.impl.BaseGraphics.drawTexture3SliceV.

Implements com.sun.prism.Graphics.drawTexture3SliceV.

Annotations
@Override
drawTexture9Sliceback to summary
public void drawTexture9Slice(Texture tex, float dx1, float dy1, float dx2, float dy2, float sx1, float sy1, float sx2, float sy2, float dh1, float dv1, float dh2, float dv2, float sh1, float sv1, float sh2, float sv2)

Overrides com.sun.prism.impl.BaseGraphics.drawTexture9Slice.

Implements com.sun.prism.Graphics.drawTexture9Slice.

Annotations
@Override
drawTextureRaw2back to summary
public void drawTextureRaw2(Texture src1, Texture src2, float dx1, float dy1, float dx2, float dy2, float t1x1, float t1y1, float t1x2, float t1y2, float t2x1, float t2y1, float t2x2, float t2y2)

Implements com.sun.prism.ps.ShaderGraphics.drawTextureRaw2.

Annotations
@Override
extract3Dremainderback to summary
private BaseTransform extract3Dremainder(BaseTransform xform)
fillEllipseback to summary
public void fillEllipse(float x, float y, float w, float h)

Implements com.sun.prism.Graphics.fillEllipse.

Annotations
@Override
fillPrimRectback to summary
pack-priv boolean fillPrimRect(float x, float y, float w, float h, Texture rectTex, Texture wrapTex, float bx, float by, float bw, float bh)
fillQuadback to summary
public void fillQuad(float x1, float y1, float x2, float y2)

Implements com.sun.prism.Graphics.fillQuad.

Annotations
@Override
fillRectback to summary
public void fillRect(float x, float y, float w, float h)

Implements com.sun.prism.Graphics.fillRect.

Annotations
@Override
fillRoundRectback to summary
public void fillRoundRect(float x, float y, float w, float h, float arcw, float arch)

Implements com.sun.prism.Graphics.fillRoundRect.

Annotations
@Override
getContextback to summary
pack-priv BaseShaderContext getContext()
getExternalShaderback to summary
public Shader getExternalShader()
getLightsback to summary
public final NGLightBase[] getLights()

Implements com.sun.prism.Graphics.getLights.

Annotations
@Override
getPaintShaderTransformback to summary
public void getPaintShaderTransform(Affine3D ret)

Implements com.sun.prism.ps.ShaderGraphics.getPaintShaderTransform.

Annotations
@Override
getPaintTextureTxback to summary
pack-priv AffineBase getPaintTextureTx(BaseTransform renderTx, Shader shader, float rx, float ry, float rw, float rh)
getStrokeExpansionFactorback to summary
private static float getStrokeExpansionFactor(BasicStroke stroke)
initLCDSampleRTback to summary
private void initLCDSampleRT()
isComplexPaintback to summary
pack-priv boolean isComplexPaint()
lenback to summary
private static float len(float x, float y)
maskInterpolatePixelsback to summary
public void maskInterpolatePixels(RTTexture imgtex, RTTexture masktex, int dx, int dy, int dw, int dh, int ix, int iy, int mx, int my)

Implements com.sun.prism.MaskTextureGraphics.maskInterpolatePixels.

Doc from com.sun.prism.MaskTextureGraphics.maskInterpolatePixels.

Use a mask to determine which pixels of an image are to be rendered onto the destination in device space. All coordinates specify pixel coordinates and are integers to reinforce the fact that these are pixel operations, not coordinate rendering operations.

The mask texture controls the contribution of source and destination pixels in the resulting output. Note that a simple multiply of the source texture by the mask texture may not produce the correct masking operation for the case where a non-SrcOver blending mode is in use. In those conditions, it is more accurate to first compute the result of blending the source into the destination and to then use this method to choose how much of the result should be taken from the results of the blending and how much should remain the original destination pixel value. Mathematically, the mask alpha controls a linear interpolation between the image and destination pixels.

    dst.argb = (mask.a * img.argb) + ((1 - mask.a) * dst.argb)
Note that the current composite mode is ignored during this operation.
Annotations
@Override
readBackback to summary
public RTTexture readBack(Rectangle view)

Implements com.sun.prism.ReadbackGraphics.readBack.

Annotations
@Override
releaseReadBackBufferback to summary
public void releaseReadBackBuffer(RTTexture rtt)

Implements com.sun.prism.ReadbackGraphics.releaseReadBackBuffer.

Annotations
@Override
renderGeneralRoundedPgramback to summary
private void renderGeneralRoundedPgram(float ox, float oy, float wvecx, float wvecy, float hvecx, float hvecy, float arcfractw, float arcfracth, float ifractw, float ifracth, BaseTransform rendertx, BaseShaderContext.MaskType type, float rx, float ry, float rw, float rh)
renderGeneralRoundedRectback to summary
private void renderGeneralRoundedRect(float rx, float ry, float rw, float rh, float arcw, float arch, BaseShaderContext.MaskType type, BasicStroke stroke)
renderShapeback to summary
protected void renderShape(Shape shape, BasicStroke stroke, float bx, float by, float bw, float bh)

Implements abstract com.sun.prism.impl.BaseGraphics.renderShape.

Annotations
@Override
renderWithComplexPaintback to summary
private void renderWithComplexPaint(Shape shape, BasicStroke stroke, float bx, float by, float bw, float bh)
setExternalShaderback to summary
public void setExternalShader(Shader shader)

Implements com.sun.prism.ps.ShaderGraphics.setExternalShader.

Annotations
@Override
setLightsback to summary
public void setLights(NGLightBase[] lights)

Implements com.sun.prism.Graphics.setLights.

Annotations
@Override
setNodeBoundsback to summary
public void setNodeBounds(RectBounds bounds)

Implements com.sun.prism.Graphics.setNodeBounds.

Doc from com.sun.prism.Graphics.setNodeBounds.

Set the node bounds for any node that would like to render objects of a different size to self. This is useful for proportional paints, where by definition proportional paint should be stretched across node bounds to which it has been applied. In most cases nodes/shapes are rendered in a single draw call, and if needed bounds can be determined by inspecting object to be drawn. However not all nodes are so simple, NGText for example can have hundreds of Graphics.drawString(...), draw(...), and fill(...) calls per a single NGText.renderContent(). Use: Before making several draw calls from a single node, setNodeBounds(bounds), when complete invalidate nodeBounds by setNodeBounds(null).

Annotations
@Override
setPaintback to summary
public void setPaint(Paint paint)

Overrides com.sun.prism.impl.BaseGraphics.setPaint.

Implements com.sun.prism.Graphics.setPaint.

Annotations
@Override
setup3DRenderingback to summary
public void setup3DRendering()

Implements com.sun.prism.Graphics.setup3DRendering.

Annotations
@Override