src/share/classes/sun/java2d/SurfaceData.java
Print this page
@@ -46,11 +46,10 @@
import sun.java2d.loops.DrawPath;
import sun.java2d.loops.FillPath;
import sun.java2d.loops.FillSpans;
import sun.java2d.loops.FillParallelogram;
import sun.java2d.loops.DrawParallelogram;
-import sun.java2d.loops.FontInfo;
import sun.java2d.loops.DrawGlyphList;
import sun.java2d.loops.DrawGlyphListAA;
import sun.java2d.loops.DrawGlyphListLCD;
import sun.java2d.pipe.LoopPipe;
import sun.java2d.pipe.ShapeDrawPipe;
@@ -518,24 +517,24 @@
}
return false; /* for now - in the future we may want to search */
}
public boolean canRenderParallelograms(SunGraphics2D sg2d) {
- if (sg2d.paintState <= sg2d.PAINT_ALPHACOLOR) {
- if (sg2d.compositeState == sg2d.COMP_XOR) {
+ if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR) {
+ if (sg2d.compositeState == SunGraphics2D.COMP_XOR) {
if (havePgramXORLoop == LOOP_UNKNOWN) {
FillParallelogram loop =
FillParallelogram.locate(SurfaceType.AnyColor,
CompositeType.Xor,
getSurfaceType());
havePgramXORLoop =
(loop != null) ? LOOP_FOUND : LOOP_NOTFOUND;
}
return havePgramXORLoop == LOOP_FOUND;
- } else if (sg2d.compositeState <= sg2d.COMP_ISCOPY &&
+ } else if (sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY &&
sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON &&
- sg2d.clipState != sg2d.CLIP_SHAPE)
+ sg2d.clipState != SunGraphics2D.CLIP_SHAPE)
{
if (havePgramSolidLoop == LOOP_UNKNOWN) {
FillParallelogram loop =
FillParallelogram.locate(SurfaceType.AnyColor,
CompositeType.SrcNoEa,
@@ -549,12 +548,12 @@
return false;
}
public void validatePipe(SunGraphics2D sg2d) {
sg2d.imagepipe = imagepipe;
- if (sg2d.compositeState == sg2d.COMP_XOR) {
- if (sg2d.paintState > sg2d.PAINT_ALPHACOLOR) {
+ if (sg2d.compositeState == SunGraphics2D.COMP_XOR) {
+ if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR) {
sg2d.drawpipe = paintViaShape;
sg2d.fillpipe = paintViaShape;
sg2d.shapepipe = paintShape;
// REMIND: Ideally custom paint mode would use glyph
// rendering as opposed to outline rendering but the
@@ -574,11 +573,11 @@
sg2d.shapepipe = colorViaPgram;
} else {
converter = colorViaShape;
sg2d.shapepipe = colorPrimitives;
}
- if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+ if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
sg2d.drawpipe = converter;
sg2d.fillpipe = converter;
// REMIND: We should not be changing text strategies
// between outline and glyph rendering based upon the
// presence of a complex clip as that could cause a
@@ -587,28 +586,28 @@
// Unfortunately, all of the clipped glyph rendering
// pipelines rely on the use of the MaskBlit operation
// which is not defined for XOR.
sg2d.textpipe = outlineTextRenderer;
} else {
- if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
+ if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
sg2d.drawpipe = converter;
sg2d.fillpipe = converter;
} else {
- if (sg2d.strokeState != sg2d.STROKE_THIN) {
+ if (sg2d.strokeState != SunGraphics2D.STROKE_THIN) {
sg2d.drawpipe = converter;
} else {
sg2d.drawpipe = colorPrimitives;
}
sg2d.fillpipe = colorPrimitives;
}
sg2d.textpipe = solidTextRenderer;
}
// assert(sg2d.surfaceData == this);
}
- } else if (sg2d.compositeState == sg2d.COMP_CUSTOM) {
+ } else if (sg2d.compositeState == SunGraphics2D.COMP_CUSTOM) {
if (sg2d.antialiasHint == SunHints.INTVAL_ANTIALIAS_ON) {
- if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+ if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
sg2d.drawpipe = AAClipCompViaShape;
sg2d.fillpipe = AAClipCompViaShape;
sg2d.shapepipe = AAClipCompViaShape;
sg2d.textpipe = clipCompText;
} else {
@@ -619,21 +618,21 @@
}
} else {
sg2d.drawpipe = compViaShape;
sg2d.fillpipe = compViaShape;
sg2d.shapepipe = compShape;
- if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+ if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
sg2d.textpipe = clipCompText;
} else {
sg2d.textpipe = compText;
}
}
} else if (sg2d.antialiasHint == SunHints.INTVAL_ANTIALIAS_ON) {
sg2d.alphafill = getMaskFill(sg2d);
// assert(sg2d.surfaceData == this);
if (sg2d.alphafill != null) {
- if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+ if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
sg2d.drawpipe = AAClipColorViaShape;
sg2d.fillpipe = AAClipColorViaShape;
sg2d.shapepipe = AAClipColorViaShape;
sg2d.textpipe = clipColorText;
} else {
@@ -642,20 +641,20 @@
? AAColorViaPgram
: AAColorViaShape);
sg2d.drawpipe = converter;
sg2d.fillpipe = converter;
sg2d.shapepipe = converter;
- if (sg2d.paintState > sg2d.PAINT_ALPHACOLOR ||
- sg2d.compositeState > sg2d.COMP_ISCOPY)
+ if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR ||
+ sg2d.compositeState > SunGraphics2D.COMP_ISCOPY)
{
sg2d.textpipe = colorText;
} else {
sg2d.textpipe = getTextPipe(sg2d, true /* AA==ON */);
}
}
} else {
- if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+ if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
sg2d.drawpipe = AAClipPaintViaShape;
sg2d.fillpipe = AAClipPaintViaShape;
sg2d.shapepipe = AAClipPaintViaShape;
sg2d.textpipe = clipPaintText;
} else {
@@ -663,27 +662,27 @@
sg2d.fillpipe = AAPaintViaShape;
sg2d.shapepipe = AAPaintViaShape;
sg2d.textpipe = paintText;
}
}
- } else if (sg2d.paintState > sg2d.PAINT_ALPHACOLOR ||
- sg2d.compositeState > sg2d.COMP_ISCOPY ||
- sg2d.clipState == sg2d.CLIP_SHAPE)
+ } else if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR ||
+ sg2d.compositeState > SunGraphics2D.COMP_ISCOPY ||
+ sg2d.clipState == SunGraphics2D.CLIP_SHAPE)
{
sg2d.drawpipe = paintViaShape;
sg2d.fillpipe = paintViaShape;
sg2d.shapepipe = paintShape;
sg2d.alphafill = getMaskFill(sg2d);
// assert(sg2d.surfaceData == this);
if (sg2d.alphafill != null) {
- if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+ if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
sg2d.textpipe = clipColorText;
} else {
sg2d.textpipe = colorText;
}
} else {
- if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+ if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
sg2d.textpipe = clipPaintText;
} else {
sg2d.textpipe = paintText;
}
}
@@ -698,15 +697,15 @@
sg2d.shapepipe = colorViaPgram;
} else {
converter = colorViaShape;
sg2d.shapepipe = colorPrimitives;
}
- if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
+ if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
sg2d.drawpipe = converter;
sg2d.fillpipe = converter;
} else {
- if (sg2d.strokeState != sg2d.STROKE_THIN) {
+ if (sg2d.strokeState != SunGraphics2D.STROKE_THIN) {
sg2d.drawpipe = converter;
} else {
sg2d.drawpipe = colorPrimitives;
}
sg2d.fillpipe = colorPrimitives;
@@ -815,11 +814,11 @@
}
}
private static CompositeType getFillCompositeType(SunGraphics2D sg2d) {
CompositeType compType = sg2d.imageComp;
- if (sg2d.compositeState == sg2d.COMP_ISCOPY) {
+ if (sg2d.compositeState == SunGraphics2D.COMP_ISCOPY) {
if (compType == CompositeType.SrcOverNoEa) {
compType = CompositeType.OpaqueSrcOverNoEa;
} else {
compType = CompositeType.SrcNoEa;
}