Java Code Examples for sun.awt.geom.PathConsumer2D#quadTo()

The following examples show how to use sun.awt.geom.PathConsumer2D#quadTo() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Stroker.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void pop(PathConsumer2D io) {
    numCurves--;
    int type = curveTypes[numCurves];
    end -= (type - 2);
    switch(type) {
    case 8:
        io.curveTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3],
                   curves[end+4], curves[end+5]);
        break;
    case 6:
        io.quadTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3]);
         break;
    case 4:
        io.lineTo(curves[end], curves[end+1]);
    }
}
 
Example 2
Source File: Stroker.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void pop(PathConsumer2D io) {
    numCurves--;
    int type = curveTypes[numCurves];
    end -= (type - 2);
    switch(type) {
    case 8:
        io.curveTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3],
                   curves[end+4], curves[end+5]);
        break;
    case 6:
        io.quadTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3]);
         break;
    case 4:
        io.lineTo(curves[end], curves[end+1]);
    }
}
 
Example 3
Source File: Stroker.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void pop(PathConsumer2D io) {
    numCurves--;
    int type = curveTypes[numCurves];
    end -= (type - 2);
    switch(type) {
    case 8:
        io.curveTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3],
                   curves[end+4], curves[end+5]);
        break;
    case 6:
        io.quadTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3]);
         break;
    case 4:
        io.lineTo(curves[end], curves[end+1]);
    }
}
 
Example 4
Source File: Stroker.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void pop(PathConsumer2D io) {
    numCurves--;
    int type = curveTypes[numCurves];
    end -= (type - 2);
    switch(type) {
    case 8:
        io.curveTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3],
                   curves[end+4], curves[end+5]);
        break;
    case 6:
        io.quadTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3]);
         break;
    case 4:
        io.lineTo(curves[end], curves[end+1]);
    }
}
 
Example 5
Source File: Stroker.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void pop(PathConsumer2D io) {
    numCurves--;
    int type = curveTypes[numCurves];
    end -= (type - 2);
    switch(type) {
    case 8:
        io.curveTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3],
                   curves[end+4], curves[end+5]);
        break;
    case 6:
        io.quadTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3]);
         break;
    case 4:
        io.lineTo(curves[end], curves[end+1]);
    }
}
 
Example 6
Source File: Stroker.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void pop(PathConsumer2D io) {
    numCurves--;
    int type = curveTypes[numCurves];
    end -= (type - 2);
    switch(type) {
    case 8:
        io.curveTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3],
                   curves[end+4], curves[end+5]);
        break;
    case 6:
        io.quadTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3]);
         break;
    case 4:
        io.lineTo(curves[end], curves[end+1]);
    }
}
 
Example 7
Source File: Stroker.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void pop(PathConsumer2D io) {
    numCurves--;
    int type = curveTypes[numCurves];
    end -= (type - 2);
    switch(type) {
    case 8:
        io.curveTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3],
                   curves[end+4], curves[end+5]);
        break;
    case 6:
        io.quadTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3]);
         break;
    case 4:
        io.lineTo(curves[end], curves[end+1]);
    }
}
 
Example 8
Source File: Stroker.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void pop(PathConsumer2D io) {
    numCurves--;
    int type = curveTypes[numCurves];
    end -= (type - 2);
    switch(type) {
    case 8:
        io.curveTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3],
                   curves[end+4], curves[end+5]);
        break;
    case 6:
        io.quadTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3]);
         break;
    case 4:
        io.lineTo(curves[end], curves[end+1]);
    }
}
 
Example 9
Source File: Stroker.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void pop(PathConsumer2D io) {
    numCurves--;
    int type = curveTypes[numCurves];
    end -= (type - 2);
    switch(type) {
    case 8:
        io.curveTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3],
                   curves[end+4], curves[end+5]);
        break;
    case 6:
        io.quadTo(curves[end+0], curves[end+1],
                   curves[end+2], curves[end+3]);
         break;
    case 4:
        io.lineTo(curves[end], curves[end+1]);
    }
}
 
Example 10
Source File: RenderingEngine.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Utility method to feed a {@link PathConsumer2D} object from a
 * given {@link PathIterator}.
 * This method deals with the details of running the iterator and
 * feeding the consumer a segment at a time.
 */
public static void feedConsumer(PathIterator pi, PathConsumer2D consumer) {
    float coords[] = new float[6];
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            consumer.moveTo(coords[0], coords[1]);
            break;
        case PathIterator.SEG_LINETO:
            consumer.lineTo(coords[0], coords[1]);
            break;
        case PathIterator.SEG_QUADTO:
            consumer.quadTo(coords[0], coords[1],
                            coords[2], coords[3]);
            break;
        case PathIterator.SEG_CUBICTO:
            consumer.curveTo(coords[0], coords[1],
                             coords[2], coords[3],
                             coords[4], coords[5]);
            break;
        case PathIterator.SEG_CLOSE:
            consumer.closePath();
            break;
        }
        pi.next();
    }
}
 
Example 11
Source File: RenderingEngine.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Utility method to feed a {@link PathConsumer2D} object from a
 * given {@link PathIterator}.
 * This method deals with the details of running the iterator and
 * feeding the consumer a segment at a time.
 */
public static void feedConsumer(PathIterator pi, PathConsumer2D consumer) {
    float coords[] = new float[6];
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            consumer.moveTo(coords[0], coords[1]);
            break;
        case PathIterator.SEG_LINETO:
            consumer.lineTo(coords[0], coords[1]);
            break;
        case PathIterator.SEG_QUADTO:
            consumer.quadTo(coords[0], coords[1],
                            coords[2], coords[3]);
            break;
        case PathIterator.SEG_CUBICTO:
            consumer.curveTo(coords[0], coords[1],
                             coords[2], coords[3],
                             coords[4], coords[5]);
            break;
        case PathIterator.SEG_CLOSE:
            consumer.closePath();
            break;
        }
        pi.next();
    }
}
 
Example 12
Source File: RenderingEngine.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Utility method to feed a {@link PathConsumer2D} object from a
 * given {@link PathIterator}.
 * This method deals with the details of running the iterator and
 * feeding the consumer a segment at a time.
 */
public static void feedConsumer(PathIterator pi, PathConsumer2D consumer) {
    float coords[] = new float[6];
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            consumer.moveTo(coords[0], coords[1]);
            break;
        case PathIterator.SEG_LINETO:
            consumer.lineTo(coords[0], coords[1]);
            break;
        case PathIterator.SEG_QUADTO:
            consumer.quadTo(coords[0], coords[1],
                            coords[2], coords[3]);
            break;
        case PathIterator.SEG_CUBICTO:
            consumer.curveTo(coords[0], coords[1],
                             coords[2], coords[3],
                             coords[4], coords[5]);
            break;
        case PathIterator.SEG_CLOSE:
            consumer.closePath();
            break;
        }
        pi.next();
    }
}
 
Example 13
Source File: RenderingEngine.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Utility method to feed a {@link PathConsumer2D} object from a
 * given {@link PathIterator}.
 * This method deals with the details of running the iterator and
 * feeding the consumer a segment at a time.
 */
public static void feedConsumer(PathIterator pi, PathConsumer2D consumer) {
    float coords[] = new float[6];
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            consumer.moveTo(coords[0], coords[1]);
            break;
        case PathIterator.SEG_LINETO:
            consumer.lineTo(coords[0], coords[1]);
            break;
        case PathIterator.SEG_QUADTO:
            consumer.quadTo(coords[0], coords[1],
                            coords[2], coords[3]);
            break;
        case PathIterator.SEG_CUBICTO:
            consumer.curveTo(coords[0], coords[1],
                             coords[2], coords[3],
                             coords[4], coords[5]);
            break;
        case PathIterator.SEG_CLOSE:
            consumer.closePath();
            break;
        }
        pi.next();
    }
}
 
Example 14
Source File: TransformingPathConsumer2D.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
static void emitCurrent(final int type, final float[] pts,
                        final int off, final PathConsumer2D out)
{
    // if instead of switch (perf + most probable cases first)
    if (type == 8) {
        out.curveTo(pts[off + 2], pts[off + 3],
                    pts[off + 4], pts[off + 5],
                    pts[off + 6], pts[off + 7]);
    } else if (type == 4) {
        out.lineTo(pts[off + 2], pts[off + 3]);
    } else {
        out.quadTo(pts[off + 2], pts[off + 3],
                   pts[off + 4], pts[off + 5]);
    }
}
 
Example 15
Source File: RenderingEngine.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Utility method to feed a {@link PathConsumer2D} object from a
 * given {@link PathIterator}.
 * This method deals with the details of running the iterator and
 * feeding the consumer a segment at a time.
 */
public static void feedConsumer(PathIterator pi, PathConsumer2D consumer) {
    float coords[] = new float[6];
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            consumer.moveTo(coords[0], coords[1]);
            break;
        case PathIterator.SEG_LINETO:
            consumer.lineTo(coords[0], coords[1]);
            break;
        case PathIterator.SEG_QUADTO:
            consumer.quadTo(coords[0], coords[1],
                            coords[2], coords[3]);
            break;
        case PathIterator.SEG_CUBICTO:
            consumer.curveTo(coords[0], coords[1],
                             coords[2], coords[3],
                             coords[4], coords[5]);
            break;
        case PathIterator.SEG_CLOSE:
            consumer.closePath();
            break;
        }
        pi.next();
    }
}
 
Example 16
Source File: RenderingEngine.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Utility method to feed a {@link PathConsumer2D} object from a
 * given {@link PathIterator}.
 * This method deals with the details of running the iterator and
 * feeding the consumer a segment at a time.
 */
public static void feedConsumer(PathIterator pi, PathConsumer2D consumer) {
    float coords[] = new float[6];
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            consumer.moveTo(coords[0], coords[1]);
            break;
        case PathIterator.SEG_LINETO:
            consumer.lineTo(coords[0], coords[1]);
            break;
        case PathIterator.SEG_QUADTO:
            consumer.quadTo(coords[0], coords[1],
                            coords[2], coords[3]);
            break;
        case PathIterator.SEG_CUBICTO:
            consumer.curveTo(coords[0], coords[1],
                             coords[2], coords[3],
                             coords[4], coords[5]);
            break;
        case PathIterator.SEG_CLOSE:
            consumer.closePath();
            break;
        }
        pi.next();
    }
}
 
Example 17
Source File: RenderingEngine.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Utility method to feed a {@link PathConsumer2D} object from a
 * given {@link PathIterator}.
 * This method deals with the details of running the iterator and
 * feeding the consumer a segment at a time.
 */
public static void feedConsumer(PathIterator pi, PathConsumer2D consumer) {
    float coords[] = new float[6];
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            consumer.moveTo(coords[0], coords[1]);
            break;
        case PathIterator.SEG_LINETO:
            consumer.lineTo(coords[0], coords[1]);
            break;
        case PathIterator.SEG_QUADTO:
            consumer.quadTo(coords[0], coords[1],
                            coords[2], coords[3]);
            break;
        case PathIterator.SEG_CUBICTO:
            consumer.curveTo(coords[0], coords[1],
                             coords[2], coords[3],
                             coords[4], coords[5]);
            break;
        case PathIterator.SEG_CLOSE:
            consumer.closePath();
            break;
        }
        pi.next();
    }
}
 
Example 18
Source File: RenderingEngine.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Utility method to feed a {@link PathConsumer2D} object from a
 * given {@link PathIterator}.
 * This method deals with the details of running the iterator and
 * feeding the consumer a segment at a time.
 */
public static void feedConsumer(PathIterator pi, PathConsumer2D consumer) {
    float coords[] = new float[6];
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            consumer.moveTo(coords[0], coords[1]);
            break;
        case PathIterator.SEG_LINETO:
            consumer.lineTo(coords[0], coords[1]);
            break;
        case PathIterator.SEG_QUADTO:
            consumer.quadTo(coords[0], coords[1],
                            coords[2], coords[3]);
            break;
        case PathIterator.SEG_CUBICTO:
            consumer.curveTo(coords[0], coords[1],
                             coords[2], coords[3],
                             coords[4], coords[5]);
            break;
        case PathIterator.SEG_CLOSE:
            consumer.closePath();
            break;
        }
        pi.next();
    }
}
 
Example 19
Source File: Helpers.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
void pullAll(final PathConsumer2D io) {
    final int nc = numCurves;
    if (nc == 0) {
        return;
    }
    if (DO_STATS) {
        // update used marks:
        if (numCurves > curveTypesUseMark) {
            curveTypesUseMark = numCurves;
        }
        if (end > curvesUseMark) {
            curvesUseMark = end;
        }
    }
    final byte[]  _curveTypes = curveTypes;
    final float[] _curves = curves;
    int e = 0;

    for (int i = 0; i < nc; i++) {
        switch(_curveTypes[i]) {
        case TYPE_LINETO:
            io.lineTo(_curves[e], _curves[e+1]);
            e += 2;
            continue;
        case TYPE_CUBICTO:
            io.curveTo(_curves[e],   _curves[e+1],
                       _curves[e+2], _curves[e+3],
                       _curves[e+4], _curves[e+5]);
            e += 6;
            continue;
        case TYPE_QUADTO:
            io.quadTo(_curves[e],   _curves[e+1],
                      _curves[e+2], _curves[e+3]);
            e += 4;
            continue;
        default:
        }
    }
    numCurves = 0;
    end = 0;
}
 
Example 20
Source File: Helpers.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
void pullAll(final PathConsumer2D io) {
    final int nc = numCurves;
    if (nc == 0) {
        return;
    }
    if (DO_STATS) {
        // update used marks:
        if (numCurves > curveTypesUseMark) {
            curveTypesUseMark = numCurves;
        }
        if (end > curvesUseMark) {
            curvesUseMark = end;
        }
    }
    final byte[]  _curveTypes = curveTypes;
    final float[] _curves = curves;
    int e = 0;

    for (int i = 0; i < nc; i++) {
        switch(_curveTypes[i]) {
        case TYPE_LINETO:
            io.lineTo(_curves[e], _curves[e+1]);
            e += 2;
            continue;
        case TYPE_CUBICTO:
            io.curveTo(_curves[e],   _curves[e+1],
                       _curves[e+2], _curves[e+3],
                       _curves[e+4], _curves[e+5]);
            e += 6;
            continue;
        case TYPE_QUADTO:
            io.quadTo(_curves[e],   _curves[e+1],
                      _curves[e+2], _curves[e+3]);
            e += 4;
            continue;
        default:
        }
    }
    numCurves = 0;
    end = 0;
}