src/solaris/classes/sun/java2d/x11/X11Renderer.java
Print this page
*** 26,49 ****
package sun.java2d.x11;
import java.awt.Polygon;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
- import java.awt.geom.PathIterator;
import java.awt.geom.Path2D;
! import java.awt.geom.IllegalPathStateException;
import sun.awt.SunToolkit;
import sun.java2d.SunGraphics2D;
- import sun.java2d.SurfaceData;
import sun.java2d.loops.GraphicsPrimitive;
! import sun.java2d.pipe.Region;
import sun.java2d.pipe.PixelDrawPipe;
import sun.java2d.pipe.PixelFillPipe;
import sun.java2d.pipe.ShapeDrawPipe;
- import sun.java2d.pipe.SpanIterator;
import sun.java2d.pipe.ShapeSpanIterator;
! import sun.java2d.pipe.LoopPipe;
public class X11Renderer implements
PixelDrawPipe,
PixelFillPipe,
ShapeDrawPipe
--- 26,47 ----
package sun.java2d.x11;
import java.awt.Polygon;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Path2D;
!
import sun.awt.SunToolkit;
import sun.java2d.SunGraphics2D;
import sun.java2d.loops.GraphicsPrimitive;
! import sun.java2d.pipe.LoopPipe;
import sun.java2d.pipe.PixelDrawPipe;
import sun.java2d.pipe.PixelFillPipe;
+ import sun.java2d.pipe.Region;
import sun.java2d.pipe.ShapeDrawPipe;
import sun.java2d.pipe.ShapeSpanIterator;
! import sun.java2d.pipe.SpanIterator;
public class X11Renderer implements
PixelDrawPipe,
PixelFillPipe,
ShapeDrawPipe
*** 297,307 ****
boolean isFill);
private void doPath(SunGraphics2D sg2d, Shape s, boolean isFill) {
Path2D.Float p2df;
int transx, transy;
! if (sg2d.transformState <= sg2d.TRANSFORM_INT_TRANSLATE) {
if (s instanceof Path2D.Float) {
p2df = (Path2D.Float)s;
} else {
p2df = new Path2D.Float(s);
}
--- 295,305 ----
boolean isFill);
private void doPath(SunGraphics2D sg2d, Shape s, boolean isFill) {
Path2D.Float p2df;
int transx, transy;
! if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
if (s instanceof Path2D.Float) {
p2df = (Path2D.Float)s;
} else {
p2df = new Path2D.Float(s);
}
*** 321,344 ****
SunToolkit.awtUnlock();
}
}
public void draw(SunGraphics2D sg2d, Shape s) {
! if (sg2d.strokeState == sg2d.STROKE_THIN) {
// Delegate to drawPolygon() if possible...
if (s instanceof Polygon &&
! sg2d.transformState < sg2d.TRANSFORM_TRANSLATESCALE)
{
Polygon p = (Polygon) s;
drawPolygon(sg2d, p.xpoints, p.ypoints, p.npoints);
return;
}
// Otherwise we will use drawPath() for
// high-quality thin paths.
doPath(sg2d, s, false);
! } else if (sg2d.strokeState < sg2d.STROKE_CUSTOM) {
// REMIND: X11 can handle uniform scaled wide lines
// and dashed lines itself if we set the appropriate
// XGC attributes (TBD).
ShapeSpanIterator si = LoopPipe.getStrokeSpans(sg2d, s);
try {
--- 319,342 ----
SunToolkit.awtUnlock();
}
}
public void draw(SunGraphics2D sg2d, Shape s) {
! if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
// Delegate to drawPolygon() if possible...
if (s instanceof Polygon &&
! sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE)
{
Polygon p = (Polygon) s;
drawPolygon(sg2d, p.xpoints, p.ypoints, p.npoints);
return;
}
// Otherwise we will use drawPath() for
// high-quality thin paths.
doPath(sg2d, s, false);
! } else if (sg2d.strokeState < SunGraphics2D.STROKE_CUSTOM) {
// REMIND: X11 can handle uniform scaled wide lines
// and dashed lines itself if we set the appropriate
// XGC attributes (TBD).
ShapeSpanIterator si = LoopPipe.getStrokeSpans(sg2d, s);
try {
*** 358,371 ****
fill(sg2d, sg2d.stroke.createStrokedShape(s));
}
}
public void fill(SunGraphics2D sg2d, Shape s) {
! if (sg2d.strokeState == sg2d.STROKE_THIN) {
// Delegate to fillPolygon() if possible...
if (s instanceof Polygon &&
! sg2d.transformState < sg2d.TRANSFORM_TRANSLATESCALE)
{
Polygon p = (Polygon) s;
fillPolygon(sg2d, p.xpoints, p.ypoints, p.npoints);
return;
}
--- 356,369 ----
fill(sg2d, sg2d.stroke.createStrokedShape(s));
}
}
public void fill(SunGraphics2D sg2d, Shape s) {
! if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
// Delegate to fillPolygon() if possible...
if (s instanceof Polygon &&
! sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE)
{
Polygon p = (Polygon) s;
fillPolygon(sg2d, p.xpoints, p.ypoints, p.npoints);
return;
}
*** 376,386 ****
return;
}
AffineTransform at;
int transx, transy;
! if (sg2d.transformState < sg2d.TRANSFORM_TRANSLATESCALE) {
// Transform (translation) will be done by XFillSpans
at = null;
transx = sg2d.transX;
transy = sg2d.transY;
} else {
--- 374,384 ----
return;
}
AffineTransform at;
int transx, transy;
! if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
// Transform (translation) will be done by XFillSpans
at = null;
transx = sg2d.transX;
transy = sg2d.transY;
} else {