20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package com.sun.marlin; 27 28 import static com.sun.marlin.OffHeapArray.SIZE_INT; 29 import jdk.internal.misc.Unsafe; 30 31 public final class DRendererNoAA implements DMarlinRenderer, MarlinConst { 32 33 static final boolean DISABLE_RENDER = false; 34 35 private static final int ALL_BUT_LSB = 0xFFFFFFFE; 36 private static final int ERR_STEP_MAX = 0x7FFFFFFF; // = 2^31 - 1 37 38 private static final double POWER_2_TO_32 = 0x1.0p32d; 39 40 // common to all types of input path segments. 41 // OFFSET as bytes 42 // only integer values: 43 public static final long OFF_CURX_OR = 0; 44 public static final long OFF_ERROR = OFF_CURX_OR + SIZE_INT; 45 public static final long OFF_BUMP_X = OFF_ERROR + SIZE_INT; 46 public static final long OFF_BUMP_ERR = OFF_BUMP_X + SIZE_INT; 47 public static final long OFF_NEXT = OFF_BUMP_ERR + SIZE_INT; 48 public static final long OFF_YMAX = OFF_NEXT + SIZE_INT; 49 50 // size of one edge in bytes 51 public static final int SIZEOF_EDGE_BYTES = (int)(OFF_YMAX + SIZE_INT); 52 53 // curve break into lines 54 // cubic error in subpixels to decrement step 55 private static final double CUB_DEC_ERR_SUBPIX 56 = MarlinProperties.getCubicDecD2() * (1.0d / 8.0d); // 1 pixel 57 // cubic error in subpixels to increment step 58 private static final double CUB_INC_ERR_SUBPIX 59 = MarlinProperties.getCubicIncD1() * (1.0d / 8.0d); // 0.4 pixel 1462 int bboxX0, bboxX1, bboxY0, bboxY1; 1463 1464 @Override 1465 public int getOutpixMinX() { 1466 return bboxX0; 1467 } 1468 1469 @Override 1470 public int getOutpixMaxX() { 1471 return bboxX1; 1472 } 1473 1474 @Override 1475 public int getOutpixMinY() { 1476 return bboxY0; 1477 } 1478 1479 @Override 1480 public int getOutpixMaxY() { 1481 return bboxY1; 1482 } 1483 } | 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package com.sun.marlin; 27 28 import static com.sun.marlin.OffHeapArray.SIZE_INT; 29 import jdk.internal.misc.Unsafe; 30 31 public final class DRendererNoAA implements DMarlinRenderer, MarlinConst { 32 33 static final boolean DISABLE_RENDER = false; 34 35 private static final int ALL_BUT_LSB = 0xFFFFFFFE; 36 private static final int ERR_STEP_MAX = 0x7FFFFFFF; // = 2^31 - 1 37 38 private static final double POWER_2_TO_32 = 0x1.0p32d; 39 40 private static final double RDR_OFFSET_X = 0.501d; 41 private static final double RDR_OFFSET_Y = 0.501d; 42 43 // common to all types of input path segments. 44 // OFFSET as bytes 45 // only integer values: 46 public static final long OFF_CURX_OR = 0; 47 public static final long OFF_ERROR = OFF_CURX_OR + SIZE_INT; 48 public static final long OFF_BUMP_X = OFF_ERROR + SIZE_INT; 49 public static final long OFF_BUMP_ERR = OFF_BUMP_X + SIZE_INT; 50 public static final long OFF_NEXT = OFF_BUMP_ERR + SIZE_INT; 51 public static final long OFF_YMAX = OFF_NEXT + SIZE_INT; 52 53 // size of one edge in bytes 54 public static final int SIZEOF_EDGE_BYTES = (int)(OFF_YMAX + SIZE_INT); 55 56 // curve break into lines 57 // cubic error in subpixels to decrement step 58 private static final double CUB_DEC_ERR_SUBPIX 59 = MarlinProperties.getCubicDecD2() * (1.0d / 8.0d); // 1 pixel 60 // cubic error in subpixels to increment step 61 private static final double CUB_INC_ERR_SUBPIX 62 = MarlinProperties.getCubicIncD1() * (1.0d / 8.0d); // 0.4 pixel 1465 int bboxX0, bboxX1, bboxY0, bboxY1; 1466 1467 @Override 1468 public int getOutpixMinX() { 1469 return bboxX0; 1470 } 1471 1472 @Override 1473 public int getOutpixMaxX() { 1474 return bboxX1; 1475 } 1476 1477 @Override 1478 public int getOutpixMinY() { 1479 return bboxY0; 1480 } 1481 1482 @Override 1483 public int getOutpixMaxY() { 1484 return bboxY1; 1485 } 1486 1487 @Override 1488 public double getOffsetX() { 1489 return RDR_OFFSET_X; 1490 } 1491 1492 @Override 1493 public double getOffsetY() { 1494 return RDR_OFFSET_Y; 1495 } 1496 } |