< prev index next >
src/java.desktop/share/classes/sun/java2d/marlin/DRenderer.java
Print this page
*** 44,53 ****
--- 44,56 ----
static final double SUBPIXEL_SCALE_X = SUBPIXEL_POSITIONS_X;
static final double SUBPIXEL_SCALE_Y = SUBPIXEL_POSITIONS_Y;
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.5d / SUBPIXEL_SCALE_X;
+ static final double RDR_OFFSET_Y = 0.5d / SUBPIXEL_SCALE_Y;
+
// number of subpixels corresponding to a tile line
private static final int SUBPIXEL_TILE
= TILE_H << SUBPIXEL_LG_POSITIONS_Y;
// 2048 (pixelSize) pixels (height) x 8 subpixels = 64K
*** 55,67 ****
= INITIAL_PIXEL_DIM * SUBPIXEL_POSITIONS_Y;
// crossing capacity = edges count / 4 ~ 1024
static final int INITIAL_CROSSING_COUNT = INITIAL_EDGES_COUNT >> 2;
- public static final int WIND_EVEN_ODD = 0;
- public static final int WIND_NON_ZERO = 1;
-
// common to all types of input path segments.
// OFFSET as bytes
// only integer values:
public static final long OFF_CURX_OR = 0;
public static final long OFF_ERROR = OFF_CURX_OR + SIZE_INT;
--- 58,67 ----
*** 666,723 ****
// shift y by -0.5 for fast ceil(y - 0.5):
return SUBPIXEL_SCALE_Y * pix_y - 0.5d;
}
@Override
! public void moveTo(double pix_x0, double pix_y0) {
closePath();
final double sx = tosubpixx(pix_x0);
final double sy = tosubpixy(pix_y0);
this.sx0 = sx;
this.sy0 = sy;
this.x0 = sx;
this.y0 = sy;
}
@Override
! public void lineTo(double pix_x1, double pix_y1) {
final double x1 = tosubpixx(pix_x1);
final double y1 = tosubpixy(pix_y1);
addLine(x0, y0, x1, y1);
x0 = x1;
y0 = y1;
}
@Override
! public void curveTo(double x1, double y1,
! double x2, double y2,
! double x3, double 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);
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);
quadBreakIntoLinesAndAdd(x0, y0, curve, xe, ye);
x0 = xe;
y0 = ye;
}
@Override
public void closePath() {
! addLine(x0, y0, sx0, sy0);
! x0 = sx0;
! y0 = sy0;
}
@Override
public void pathDone() {
closePath();
--- 666,727 ----
// shift y by -0.5 for fast ceil(y - 0.5):
return SUBPIXEL_SCALE_Y * pix_y - 0.5d;
}
@Override
! public void moveTo(final double pix_x0, final double pix_y0) {
closePath();
final double sx = tosubpixx(pix_x0);
final double sy = tosubpixy(pix_y0);
this.sx0 = sx;
this.sy0 = sy;
this.x0 = sx;
this.y0 = sy;
}
@Override
! public void lineTo(final double pix_x1, final double pix_y1) {
final double x1 = tosubpixx(pix_x1);
final double y1 = tosubpixy(pix_y1);
addLine(x0, y0, x1, y1);
x0 = x1;
y0 = y1;
}
@Override
! public void curveTo(final double pix_x1, final double pix_y1,
! final double pix_x2, final double pix_y2,
! final double pix_x3, final double pix_y3)
{
! 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(final double pix_x1, final double pix_y1,
! final double pix_x2, final 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;
}
@Override
public void closePath() {
! if (x0 != sx0 || y0 != sy0) {
! addLine(x0, y0, sx0, sy0);
! x0 = sx0;
! y0 = sy0;
! }
}
@Override
public void pathDone() {
closePath();
< prev index next >