--- old/src/java.desktop/share/classes/sun/java2d/marlin/DRenderer.java 2017-08-24 23:37:04.024471225 +0200 +++ new/src/java.desktop/share/classes/sun/java2d/marlin/DRenderer.java 2017-08-24 23:37:03.820464530 +0200 @@ -46,6 +46,9 @@ static final int SUBPIXEL_MASK_X = SUBPIXEL_POSITIONS_X - 1; static final int SUBPIXEL_MASK_Y = SUBPIXEL_POSITIONS_Y - 1; + static final double RDR_OFFSET_X = 0.501d / SUBPIXEL_SCALE_X; + static final double RDR_OFFSET_Y = 0.501d / SUBPIXEL_SCALE_Y; + // number of subpixels corresponding to a tile line private static final int SUBPIXEL_TILE = TILE_H << SUBPIXEL_LG_POSITIONS_Y; @@ -688,24 +691,26 @@ } @Override - public void curveTo(double x1, double y1, - double x2, double y2, - double x3, double y3) + public void curveTo(double pix_x1, double pix_y1, + double pix_x2, double pix_y2, + double pix_x3, double pix_y3) { - final double xe = tosubpixx(x3); - final double ye = tosubpixy(y3); - curve.set(x0, y0, tosubpixx(x1), tosubpixy(y1), - tosubpixx(x2), tosubpixy(y2), xe, ye); + final double xe = tosubpixx(pix_x3); + final double ye = tosubpixy(pix_y3); + curve.set(x0, y0, tosubpixx(pix_x1), tosubpixy(pix_y1), + tosubpixx(pix_x2), tosubpixy(pix_y2), xe, ye); curveBreakIntoLinesAndAdd(x0, y0, curve, xe, ye); x0 = xe; y0 = ye; } @Override - public void quadTo(double x1, double y1, double x2, double y2) { - final double xe = tosubpixx(x2); - final double ye = tosubpixy(y2); - curve.set(x0, y0, tosubpixx(x1), tosubpixy(y1), xe, ye); + public void quadTo(double pix_x1, double pix_y1, + double pix_x2, double pix_y2) + { + final double xe = tosubpixx(pix_x2); + final double ye = tosubpixy(pix_y2); + curve.set(x0, y0, tosubpixx(pix_x1), tosubpixy(pix_y1), xe, ye); quadBreakIntoLinesAndAdd(x0, y0, curve, xe, ye); x0 = xe; y0 = ye; @@ -713,9 +718,11 @@ @Override public void closePath() { - addLine(x0, y0, sx0, sy0); - x0 = sx0; - y0 = sy0; + if (x0 != sx0 || y0 != sy0) { + addLine(x0, y0, sx0, sy0); + x0 = sx0; + y0 = sy0; + } } @Override