changeset 8052:06b496f5c779

Fix RT-36221: INNER/OUTER stroketype drawn incorrectly on Ubuntu Reviewed by: kcr
author flar <James.Graham@oracle.com>
date Fri, 12 Sep 2014 17:10:09 -0700
parents 6cabbc998483
children f4e58490d406
files modules/graphics/src/main/java/com/sun/prism/sw/SWContext.java
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/prism/sw/SWContext.java	Fri Sep 12 12:51:08 2014 +0200
+++ b/modules/graphics/src/main/java/com/sun/prism/sw/SWContext.java	Fri Sep 12 17:10:09 2014 -0700
@@ -103,6 +103,16 @@
         private final DirectRTPiscesAlphaConsumer alphaConsumer = new DirectRTPiscesAlphaConsumer();
 
         public void renderShape(PiscesRenderer pr, Shape shape, BasicStroke stroke, BaseTransform tr, Rectangle clip) {
+            if (stroke != null && stroke.getType() != BasicStroke.TYPE_CENTERED) {
+                // RT-27427
+                // TODO: Optimize the combinatorial strokes for simple
+                // shapes and/or teach the rasterizer to be able to
+                // do a "differential fill" between two shapes.
+                // Note that most simple shapes will use a more optimized path
+                // than this method for the INNER/OUTER strokes anyway.
+                shape = stroke.createStrokedShape(shape);
+                stroke = null;
+            }
             final Renderer r = OpenPiscesPrismUtils.setupRenderer(shape, stroke, tr, clip);
             alphaConsumer.initConsumer(r, pr);
             r.produceAlphas(alphaConsumer);