src/share/classes/sun/java2d/SurfaceData.java
Print this page
*** 46,56 ****
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;
--- 46,55 ----
*** 518,541 ****
}
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 (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 &&
sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON &&
! sg2d.clipState != sg2d.CLIP_SHAPE)
{
if (havePgramSolidLoop == LOOP_UNKNOWN) {
FillParallelogram loop =
FillParallelogram.locate(SurfaceType.AnyColor,
CompositeType.SrcNoEa,
--- 517,540 ----
}
return false; /* for now - in the future we may want to search */
}
public boolean canRenderParallelograms(SunGraphics2D sg2d) {
! 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 <= SunGraphics2D.COMP_ISCOPY &&
sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON &&
! sg2d.clipState != SunGraphics2D.CLIP_SHAPE)
{
if (havePgramSolidLoop == LOOP_UNKNOWN) {
FillParallelogram loop =
FillParallelogram.locate(SurfaceType.AnyColor,
CompositeType.SrcNoEa,
*** 549,560 ****
return false;
}
public void validatePipe(SunGraphics2D sg2d) {
sg2d.imagepipe = imagepipe;
! if (sg2d.compositeState == sg2d.COMP_XOR) {
! if (sg2d.paintState > sg2d.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
--- 548,559 ----
return false;
}
public void validatePipe(SunGraphics2D sg2d) {
sg2d.imagepipe = imagepipe;
! 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,584 ****
sg2d.shapepipe = colorViaPgram;
} else {
converter = colorViaShape;
sg2d.shapepipe = colorPrimitives;
}
! if (sg2d.clipState == sg2d.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
--- 573,583 ----
sg2d.shapepipe = colorViaPgram;
} else {
converter = colorViaShape;
sg2d.shapepipe = colorPrimitives;
}
! 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,614 ****
// 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) {
sg2d.drawpipe = converter;
sg2d.fillpipe = converter;
} else {
! if (sg2d.strokeState != sg2d.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) {
if (sg2d.antialiasHint == SunHints.INTVAL_ANTIALIAS_ON) {
! if (sg2d.clipState == sg2d.CLIP_SHAPE) {
sg2d.drawpipe = AAClipCompViaShape;
sg2d.fillpipe = AAClipCompViaShape;
sg2d.shapepipe = AAClipCompViaShape;
sg2d.textpipe = clipCompText;
} else {
--- 586,613 ----
// 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 >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
sg2d.drawpipe = converter;
sg2d.fillpipe = converter;
} else {
! 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 == SunGraphics2D.COMP_CUSTOM) {
if (sg2d.antialiasHint == SunHints.INTVAL_ANTIALIAS_ON) {
! if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
sg2d.drawpipe = AAClipCompViaShape;
sg2d.fillpipe = AAClipCompViaShape;
sg2d.shapepipe = AAClipCompViaShape;
sg2d.textpipe = clipCompText;
} else {
*** 619,639 ****
}
} else {
sg2d.drawpipe = compViaShape;
sg2d.fillpipe = compViaShape;
sg2d.shapepipe = compShape;
! if (sg2d.clipState == sg2d.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) {
sg2d.drawpipe = AAClipColorViaShape;
sg2d.fillpipe = AAClipColorViaShape;
sg2d.shapepipe = AAClipColorViaShape;
sg2d.textpipe = clipColorText;
} else {
--- 618,638 ----
}
} else {
sg2d.drawpipe = compViaShape;
sg2d.fillpipe = compViaShape;
sg2d.shapepipe = compShape;
! 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 == SunGraphics2D.CLIP_SHAPE) {
sg2d.drawpipe = AAClipColorViaShape;
sg2d.fillpipe = AAClipColorViaShape;
sg2d.shapepipe = AAClipColorViaShape;
sg2d.textpipe = clipColorText;
} else {
*** 642,661 ****
? AAColorViaPgram
: AAColorViaShape);
sg2d.drawpipe = converter;
sg2d.fillpipe = converter;
sg2d.shapepipe = converter;
! if (sg2d.paintState > sg2d.PAINT_ALPHACOLOR ||
! sg2d.compositeState > sg2d.COMP_ISCOPY)
{
sg2d.textpipe = colorText;
} else {
sg2d.textpipe = getTextPipe(sg2d, true /* AA==ON */);
}
}
} else {
! if (sg2d.clipState == sg2d.CLIP_SHAPE) {
sg2d.drawpipe = AAClipPaintViaShape;
sg2d.fillpipe = AAClipPaintViaShape;
sg2d.shapepipe = AAClipPaintViaShape;
sg2d.textpipe = clipPaintText;
} else {
--- 641,660 ----
? AAColorViaPgram
: AAColorViaShape);
sg2d.drawpipe = converter;
sg2d.fillpipe = converter;
sg2d.shapepipe = converter;
! 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 == SunGraphics2D.CLIP_SHAPE) {
sg2d.drawpipe = AAClipPaintViaShape;
sg2d.fillpipe = AAClipPaintViaShape;
sg2d.shapepipe = AAClipPaintViaShape;
sg2d.textpipe = clipPaintText;
} else {
*** 663,689 ****
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)
{
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) {
sg2d.textpipe = clipColorText;
} else {
sg2d.textpipe = colorText;
}
} else {
! if (sg2d.clipState == sg2d.CLIP_SHAPE) {
sg2d.textpipe = clipPaintText;
} else {
sg2d.textpipe = paintText;
}
}
--- 662,688 ----
sg2d.fillpipe = AAPaintViaShape;
sg2d.shapepipe = AAPaintViaShape;
sg2d.textpipe = paintText;
}
}
! } 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 == SunGraphics2D.CLIP_SHAPE) {
sg2d.textpipe = clipColorText;
} else {
sg2d.textpipe = colorText;
}
} else {
! if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
sg2d.textpipe = clipPaintText;
} else {
sg2d.textpipe = paintText;
}
}
*** 698,712 ****
sg2d.shapepipe = colorViaPgram;
} else {
converter = colorViaShape;
sg2d.shapepipe = colorPrimitives;
}
! if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
sg2d.drawpipe = converter;
sg2d.fillpipe = converter;
} else {
! if (sg2d.strokeState != sg2d.STROKE_THIN) {
sg2d.drawpipe = converter;
} else {
sg2d.drawpipe = colorPrimitives;
}
sg2d.fillpipe = colorPrimitives;
--- 697,711 ----
sg2d.shapepipe = colorViaPgram;
} else {
converter = colorViaShape;
sg2d.shapepipe = colorPrimitives;
}
! if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
sg2d.drawpipe = converter;
sg2d.fillpipe = converter;
} else {
! if (sg2d.strokeState != SunGraphics2D.STROKE_THIN) {
sg2d.drawpipe = converter;
} else {
sg2d.drawpipe = colorPrimitives;
}
sg2d.fillpipe = colorPrimitives;
*** 815,825 ****
}
}
private static CompositeType getFillCompositeType(SunGraphics2D sg2d) {
CompositeType compType = sg2d.imageComp;
! if (sg2d.compositeState == sg2d.COMP_ISCOPY) {
if (compType == CompositeType.SrcOverNoEa) {
compType = CompositeType.OpaqueSrcOverNoEa;
} else {
compType = CompositeType.SrcNoEa;
}
--- 814,824 ----
}
}
private static CompositeType getFillCompositeType(SunGraphics2D sg2d) {
CompositeType compType = sg2d.imageComp;
! if (sg2d.compositeState == SunGraphics2D.COMP_ISCOPY) {
if (compType == CompositeType.SrcOverNoEa) {
compType = CompositeType.OpaqueSrcOverNoEa;
} else {
compType = CompositeType.SrcNoEa;
}