modules/graphics/src/main/java/com/sun/prism/sw/SWGraphics.java

Print this page

        

@@ -87,10 +87,11 @@
 
     private Ellipse2D ellipse2d;
     private Line2D line2d;
     private RoundRectangle2D rect2d;
 
+    private boolean antialiasedShape = true;
     private boolean hasPreCullingBits = false;
 
     private NodePath renderRoot;
     @Override
     public void setRenderRoot(NodePath root) {

@@ -216,10 +217,18 @@
             System.out.println("SW pipe doesn't support shader with alpha testing");
         }
         return false;
     }
 
+    public void setAntialiasedShape(boolean aa) {
+        antialiasedShape = aa;
+    }
+
+    public boolean isAntialiasedShape() {
+        return (!PrismSettings.forceNonAntialiasedShape && antialiasedShape);
+    }
+
     public Rectangle getClipRect() {
         return (clip == null) ? null : new Rectangle(clip);
     }
 
     public Rectangle getClipRectNoClone() {

@@ -494,11 +503,11 @@
             System.out.println("Stroke: " + st);
             System.out.println("Tx: " + tr);
             System.out.println("Clip: " + finalClip);
             System.out.println("Composite rule: " + compositeMode);
         }
-        context.renderShape(this.pr, shape, st, tr, this.finalClip);
+        context.renderShape(this.pr, shape, st, tr, this.finalClip, isAntialiasedShape());
     }
 
     private void paintRoundRect(float x, float y, float width, float height, float arcw, float arch, BasicStroke st) {
         if (rect2d == null) {
             rect2d = new RoundRectangle2D(x, y, width, height, arcw, arch);