diff -r 472aae61bf84 javafx-sg-prism/src/com/sun/javafx/sg/prism/NGCanvas.java --- a/javafx-sg-prism/src/com/sun/javafx/sg/prism/NGCanvas.java Mon Jun 17 16:36:29 2013 +0100 +++ b/javafx-sg-prism/src/com/sun/javafx/sg/prism/NGCanvas.java Mon Jun 17 21:35:58 2013 -0700 @@ -93,7 +93,7 @@ g = null; input = null; } - + public boolean validate(Graphics resg, int tw, int th) { int cw, ch; boolean create; @@ -162,7 +162,7 @@ } return false; } - + private void save(Graphics g, int tw, int th) { if (tex.isVolatile()) { if (savedPixelData == null) { @@ -198,7 +198,7 @@ tex.readPixels(pixels); validPixels = true; } - + private void restore(Graphics g, int tw, int th) { if (validPixels) { Image img = Image.fromIntArgbPreData(pixels, tw, th); @@ -408,17 +408,17 @@ } private static void shapebounds(Shape shape, RectBounds bounds, - BaseTransform transform) + BaseTransform transform) { TEMP_COORDS[0] = TEMP_COORDS[1] = Float.POSITIVE_INFINITY; TEMP_COORDS[2] = TEMP_COORDS[3] = Float.NEGATIVE_INFINITY; Shape.accumulate(TEMP_COORDS, shape, transform); - bounds.setBounds(TEMP_COORDS[0], TEMP_COORDS[1], + bounds.setBounds(TEMP_COORDS[0], TEMP_COORDS[1], TEMP_COORDS[2], TEMP_COORDS[3]); } - private static void strokebounds(BasicStroke stroke, Shape shape, - RectBounds bounds, BaseTransform transform) + private static void strokebounds(BasicStroke stroke, Shape shape, + RectBounds bounds, BaseTransform transform) { TEMP_COORDS[0] = TEMP_COORDS[1] = Float.POSITIVE_INFINITY; TEMP_COORDS[2] = TEMP_COORDS[3] = Float.NEGATIVE_INFINITY; @@ -429,7 +429,7 @@ @Override protected void renderContent(Graphics g) { - initCanvas(g); + initCanvas(g); if (cv.tex != null) { if (thebuf != null) { thebuf.switchToRead(); @@ -854,7 +854,7 @@ * Calculate bounds and/or render one single rendering operation. * All of the data for the rendering operation should be consumed * so that the buffer is left at the next token in the stream. - * + * * @param token the stream token for the rendering op * @param buf the GrowableDataBuffer to get rendering info from * @param gr the Graphics to render to, if not null @@ -985,7 +985,7 @@ TEMP_ARC.setArc(x, y, w, h, as, ae, arctype); if (token == FILL_ARC) { if (bounds != null) { - shapebounds(TEMP_ARC, bounds, transform); + shapebounds(TEMP_ARC, bounds, transform); } if (gr != null) { setupFill(gr); @@ -1075,13 +1075,14 @@ } else { TEMP_TX.translate(x - xAlign, y - yAlign); } - if (token == FILL_TEXT) { - textLayout.getBounds(null, bounds); - TEMP_TX.transform(bounds, bounds); - } else { + textLayout.getBounds(null, bounds); + TEMP_TX.transform(bounds, bounds); + if (token == STROKE_TEXT) { int flag = PrismTextLayout.TYPE_TEXT; Shape textShape = textLayout.getShape(flag, null); - strokebounds(getStroke(), textShape, bounds, TEMP_TX); + RectBounds shapeBounds = new RectBounds(); + strokebounds(getStroke(), textShape, shapeBounds, TEMP_TX); + bounds.unionWith(shapeBounds); } } if (gr != null) { @@ -1317,7 +1318,7 @@ public boolean reducesOpaquePixels() { return false; } - + @Override public DirtyRegionContainer getDirtyRegions(Effect defaultInput, DirtyRegionPool regionPool) { return null; // Never called