Package sun.java2d.pipe

Examples of sun.java2d.pipe.ShapeSpanIterator


                clipRegion = devClip.getIntersection(usrClip.getBounds());
            }
        } else {
            PathIterator cpi = usrClip.getPathIterator(null);
            int box[] = new int[4];
            ShapeSpanIterator sr = LoopPipe.getFillSSI(this);
            try {
                sr.setOutputArea(devClip);
                sr.appendPath(cpi);
                sr.getPathBox(box);
                Region r = Region.getInstance(box);
                r.appendSpans(sr);
                clipRegion = r;
                clipState =
                    r.isRectangular() ? CLIP_RECTANGULAR : CLIP_SHAPE;
            } finally {
                sr.dispose();
            }
        }
        if (origClipState != clipState &&
            (clipState == CLIP_SHAPE || origClipState == CLIP_SHAPE))
        {
View Full Code Here


    public void draw(SunGraphics2D sg2d, Shape s) {
        if (sg2d.strokeState == sg2d.STROKE_THIN) {
            doShape(sg2d, s, false);
        } else if (sg2d.strokeState < sg2d.STROKE_CUSTOM) {
            ShapeSpanIterator si = LoopPipe.getStrokeSpans(sg2d, s);
            try {
                doFillSpans(sg2d, si);
            } finally {
                si.dispose();
            }
        } else {
            doShape(sg2d, sg2d.stroke.createStrokedShape(s), true);
        }
    }
View Full Code Here

            }
            if (p.npoints > 1) {
                drawPolyline(sg2d, p.xpoints, p.ypoints, p.npoints);
            }
        } else if (sg2d.strokeState < sg2d.STROKE_CUSTOM) {
            ShapeSpanIterator si = LoopPipe.getStrokeSpans(sg2d, s);
            try {
                synchronized (D3DContext.LOCK) {
                    int ctxflags = (sg2d.eargb >>> 24) == 0xff ?
                        SRC_IS_OPAQUE : NO_CONTEXT_FLAGS;
                    // in this case the spans will be pre-transformed, so we
                    // pass null transform to getContext
                    long pCtx = D3DContext.getContext(null, sg2d.surfaceData,
                                                      sg2d.getCompClip(),
                                                      sg2d.getComposite(),
                                                      null /*transform*/,
                                                      sg2d.eargb/*pixel*/,
                                                      ctxflags);
                    devFillSpans(sg2d.surfaceData.getNativeOps(), pCtx, si,
                                 si.getNativeIterator(), 0, 0);
                }
            } finally {
                si.dispose();
            }
        } else {
            fill(sg2d, sg2d.stroke.createStrokedShape(s));
        }
    }
View Full Code Here

            // Transform will be done by the PathIterator
            at = sg2d.transform;
            transx = transy = 0;
        }

        ShapeSpanIterator ssi = LoopPipe.getFillSSI(sg2d);
        try {
            // Subtract transx/y from the SSI clip to match the
            // (potentially untranslated) geometry fed to it
            Region clip = sg2d.getCompClip();
            ssi.setOutputAreaXYXY(clip.getLoX() - transx,
                                  clip.getLoY() - transy,
                                  clip.getHiX() - transx,
                                  clip.getHiY() - transy);
            ssi.appendPath(s.getPathIterator(at));
            synchronized (D3DContext.LOCK) {
                int ctxflags = (sg2d.eargb >>> 24) == 0xff ?
                    SRC_IS_OPAQUE : NO_CONTEXT_FLAGS;
                long pCtx = D3DContext.getContext(null, sg2d.surfaceData,
                                                  sg2d.getCompClip(),
                                                  sg2d.getComposite(),
                                                  null/*transform*/,
                                                  sg2d.eargb/*pixel*/,
                                                  ctxflags);
                devFillSpans(sg2d.surfaceData.getNativeOps(), pCtx, ssi,
                             ssi.getNativeIterator(),
                             transx, transy);
            }
        } finally {
            ssi.dispose();
        }
    }
View Full Code Here

                transx = 0;
                transy = 0;
            }
            drawPath(sg2d, p2df, transx, transy);
        } else if (sg2d.strokeState < SunGraphics2D.STROKE_CUSTOM) {
            ShapeSpanIterator si = LoopPipe.getStrokeSpans(sg2d, s);
            try {
                fillSpans(sg2d, si, 0, 0);
            } finally {
                si.dispose();
            }
        } else {
            fill(sg2d, sg2d.stroke.createStrokedShape(s));
        }
    }
View Full Code Here

            // Transform will be done by the PathIterator
            at = sg2d.transform;
            transx = transy = 0;
        }

        ShapeSpanIterator ssi = LoopPipe.getFillSSI(sg2d);
        try {
            // Subtract transx/y from the SSI clip to match the
            // (potentially untranslated) geometry fed to it
            Region clip = sg2d.getCompClip();
            ssi.setOutputAreaXYXY(clip.getLoX() - transx,
                                  clip.getLoY() - transy,
                                  clip.getHiX() - transx,
                                  clip.getHiY() - transy);
            ssi.appendPath(s.getPathIterator(at));
            fillSpans(sg2d, ssi, transx, transy);
        } finally {
            ssi.dispose();
        }
    }
View Full Code Here

                   clipRegion = devClip.getIntersection(usrClip.getBounds());
               }
           } else {
               PathIterator cpi = usrClip.getPathIterator(null);
               int box[] = new int[4];
               ShapeSpanIterator sr = new ShapeSpanIterator(this, false);
               try {
                   sr.setOutputArea(devClip);
                   sr.appendPath(cpi);
                   sr.getPathBox(box);
                   Region r = Region.getInstance(box);
                   r.appendSpans(sr);
                   clipRegion = r;
                   clipState = r.isRectangular() ? CLIP_RECTANGULAR :
                                                    CLIP_SHAPE;
               } finally {
                   sr.dispose();
               }
           }
        }
        if (origClipState != clipState &&
            (clipState == CLIP_SHAPE || origClipState == CLIP_SHAPE))
View Full Code Here

            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 {
                SunToolkit.awtLock();
                try {
                    long xgc = validate(sg2d);
                    XFillSpans(sg2d.surfaceData.getNativeOps(), xgc,
                               si, si.getNativeIterator(),
                               0, 0);
                } finally {
                    SunToolkit.awtUnlock();
                }
            } finally {
                si.dispose();
            }
        } else {
            fill(sg2d, sg2d.stroke.createStrokedShape(s));
        }
    }
View Full Code Here

            // Transform will be done by the PathIterator
            at = sg2d.transform;
            transx = transy = 0;
        }

        ShapeSpanIterator ssi = LoopPipe.getFillSSI(sg2d);
        try {
            // Subtract transx/y from the SSI clip to match the
            // (potentially untranslated) geometry fed to it
            Region clip = sg2d.getCompClip();
            ssi.setOutputAreaXYXY(clip.getLoX() - transx,
                                  clip.getLoY() - transy,
                                  clip.getHiX() - transx,
                                  clip.getHiY() - transy);
            ssi.appendPath(s.getPathIterator(at));
            SunToolkit.awtLock();
            try {
                long xgc = validate(sg2d);
                XFillSpans(sg2d.surfaceData.getNativeOps(), xgc,
                           ssi, ssi.getNativeIterator(),
                           transx, transy);
            } finally {
                SunToolkit.awtUnlock();
            }
        } finally {
            ssi.dispose();
        }
    }
View Full Code Here

TOP

Related Classes of sun.java2d.pipe.ShapeSpanIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.