36 private static final ShapeRasterizer shapeRasterizer; 37 private static final ShapeRasterizer textRasterizer; 38 static { 39 if (PrismSettings.doNativePisces) { 40 shapeRasterizer = new NativePiscesRasterizer(); 41 } else { 42 shapeRasterizer = new OpenPiscesRasterizer(); 43 } 44 45 if (PrismSettings.doPiscesText || PrismSettings.doOpenPiscesText) { 46 textRasterizer = shapeRasterizer; 47 } else { 48 textRasterizer = null; 49 } 50 } 51 52 public static MaskData rasterizeShape(Shape shape, 53 BasicStroke stroke, 54 RectBounds xformBounds, 55 BaseTransform xform, 56 boolean close) 57 { 58 return shapeRasterizer.getMaskData(shape, stroke, xformBounds, xform, close); 59 } 60 61 public static MaskData rasterizeGlyphOutline(Shape shape) { 62 return textRasterizer. 63 getMaskData(shape, null, null, BaseTransform.IDENTITY_TRANSFORM, true); 64 } 65 66 /** 67 * Private constructor to prevent instantiation. 68 */ 69 private ShapeUtil() { 70 } 71 } | 36 private static final ShapeRasterizer shapeRasterizer; 37 private static final ShapeRasterizer textRasterizer; 38 static { 39 if (PrismSettings.doNativePisces) { 40 shapeRasterizer = new NativePiscesRasterizer(); 41 } else { 42 shapeRasterizer = new OpenPiscesRasterizer(); 43 } 44 45 if (PrismSettings.doPiscesText || PrismSettings.doOpenPiscesText) { 46 textRasterizer = shapeRasterizer; 47 } else { 48 textRasterizer = null; 49 } 50 } 51 52 public static MaskData rasterizeShape(Shape shape, 53 BasicStroke stroke, 54 RectBounds xformBounds, 55 BaseTransform xform, 56 boolean close, boolean antialiasedShape) 57 { 58 return shapeRasterizer.getMaskData(shape, stroke, xformBounds, xform, close, antialiasedShape); 59 } 60 61 public static MaskData rasterizeGlyphOutline(Shape shape, boolean antialiasedShape) { 62 return textRasterizer. 63 getMaskData(shape, null, null, BaseTransform.IDENTITY_TRANSFORM, true, antialiasedShape); 64 } 65 66 /** 67 * Private constructor to prevent instantiation. 68 */ 69 private ShapeUtil() { 70 } 71 } |