changeset 5872:1957002886ae

RT-34523: Printing: When turning on button "style", the printed page is blank Reviewed-by: fheidric
author prr
date Mon, 02 Dec 2013 15:16:53 -0800
parents 5e17e3810011
children 8cea1f4c5315
files modules/graphics/src/main/java/com/sun/prism/impl/ps/CachingShapeRep.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/prism/impl/ps/CachingShapeRep.java	Mon Dec 02 14:54:15 2013 -0800
+++ b/modules/graphics/src/main/java/com/sun/prism/impl/ps/CachingShapeRep.java	Mon Dec 02 15:16:53 2013 -0800
@@ -465,12 +465,11 @@
             tryCache = !xformBounds.isEmpty() && maskCache.hasRoom(xformBounds);
         }
 
-        BaseShaderGraphics bsg = (BaseShaderGraphics)g;
-        BaseShaderContext context = bsg.getContext();
         renderCount++;
         if (tryCache == Boolean.FALSE ||
             renderCount <= 1 ||
-            bsg.isComplexPaint())
+            (!(g instanceof BaseShaderGraphics)) ||
+            ((BaseShaderGraphics)g).isComplexPaint())
         {
             // render the slow way if:
             //   - the shape size exceeds the threshold, or
@@ -488,6 +487,8 @@
             return;
         }
 
+        BaseShaderGraphics bsg = (BaseShaderGraphics)g;
+        BaseShaderContext context = bsg.getContext();
         if (lastXform == null || !lastXform.equals(xform)) {
             // need to create a new mask texture, or reuse an existing one
             if (xformBounds == null) {