--- old/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGNode.java 2014-01-03 16:07:25.440892881 +0100 +++ new/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGNode.java 2014-01-03 16:07:25.296892877 +0100 @@ -1281,10 +1281,19 @@ // the group exceeds the bounds of the clip on the group. Just trust me. region = region.deriveWithNewBounds(transformedBounds); } - + // We shouldn't do anything with empty region, as we may accidentally make // it non empty or turn it into some nonsense (like (-1,-1,0,0) ) if (!region.isEmpty()) { + // In case we have a valid cache, there might be sub-pixel differences between the computed + // transformedBounds (and consequently also dirtyBounds) and the bounds of the cache. + // At this point, we still don't know for sure if the cache fill be used (or if it will be recomputed). + // For finding that out and then for computing the new cache bounds, we'd need to analyze the current tx + // (using "unmatrix" of CacheFilter). Since the gain of tight bounds would be probably very low and so not + // worth an extra computation, we just round out the region right here. + if (cacheFilter != null && !tx.isTranslateOrIdentity()) { + region.roundOut(); + } // Now that we have the dirty region, we will simply apply the tx // to it (after slightly padding it for good luck) to get the scene // coordinates for this.