diff --git a/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java b/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java index 6a2f7140550a811722b9ad2f0d77e6912c672b14..a06a312bd0bd072a6bda1f50de9a380317a5b3c4 100644 --- a/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java +++ b/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java @@ -127,7 +127,11 @@ public class XRPMBlitLoops { vImgSurfaceType = SurfaceType.IntArgbPre; } - if (vImg == null || vImg.getWidth() < w || vImg.getHeight() < h) { + if (vImg == null || vImg.getWidth() < w || vImg.getHeight() < h || + // Sometimes we get volatile image of wrong dest surface type, + // so recreating it + !(vImg.getDestSurface() instanceof XRSurfaceData)) + { if (vImg != null) { vImg.flush(); } @@ -145,6 +149,11 @@ public class XRPMBlitLoops { } Blit swToSurfaceBlit = Blit.getFromCache(src.getSurfaceType(), CompositeType.SrcNoEa, vImgSurfaceType); + + if (!(vImg.getDestSurface() instanceof XRSurfaceData)) { + throw new InvalidPipeException("wrong surface data type: " + vImg.getDestSurface()); + } + XRSurfaceData vImgSurface = (XRSurfaceData) vImg.getDestSurface(); swToSurfaceBlit.Blit(src, vImgSurface, AlphaComposite.Src, null, sx, sy, 0, 0, w, h);