rawFillShape(segs, minX, minY, maxX, maxY);
{ if (antialias) fillShapeAntialias(segs, minX, minY, maxX, maxY, userBounds); else rawFillShape(segs, minX, minY, maxX, maxY, userBounds); }
  protected void fillShape(Shape s)  {    PathIterator path = s.getPathIterator(getTransform(), 1.0);    // Build up polygons and let the native backend render this using    // rawFillPolygon() which would provide a default implementation for    // drawPixel using a PolyScan algorithm.    double[] seg = new double[6];    // TODO: Use ArrayList<PolyEdge> here when availble.    ArrayList segs = new ArrayList();    double segX = 0.; // The start point of the current edge.    double segY = 0.;     double polyX = 0.; // The start point of the current polygon.    double polyY = 0.;    double minX = Integer.MAX_VALUE;    double maxX = Integer.MIN_VALUE;    double minY = Integer.MAX_VALUE;    double maxY = Integer.MIN_VALUE;    //System.err.println("fill polygon");    while (! path.isDone())      {        int segType = path.currentSegment(seg);        minX = Math.min(minX, seg[0]);        maxX = Math.max(maxX, seg[0]);        minY = Math.min(minY, seg[1]);        maxY = Math.max(maxY, seg[1]);        //System.err.println("segment: " + segType + ", " + seg[0] + ", " + seg[1]);        if (segType == PathIterator.SEG_MOVETO)          {            segX = seg[0];            segY = seg[1];            polyX = seg[0];            polyY = seg[1];          }        else if (segType == PathIterator.SEG_CLOSE)          {            // Close the polyline.            PolyEdge edge = new PolyEdge(segX, segY, polyX, polyY);            segs.add(edge);          }        else if (segType == PathIterator.SEG_LINETO)          {            PolyEdge edge = new PolyEdge(segX, segY, seg[0], seg[1]);            segs.add(edge);            segX = seg[0];            segY = seg[1];          }        path.next();      }    if (segs.size() > 0)      rawFillShape(segs, minX, minY, maxX, maxY);  }