src/java.desktop/unix/classes/sun/java2d/xr/XRPMBlitLoops.java
Print this page
*** 125,135 ****
} else {
vImg = argbTmpPM.get();
vImgSurfaceType = SurfaceType.IntArgbPre;
}
! if (vImg == null || vImg.getWidth() < w || vImg.getHeight() < h) {
if (vImg != null) {
vImg.flush();
}
vImg = (SunVolatileImage) dst.getGraphicsConfig().createCompatibleVolatileImage(w, h, src.getTransparency());
vImg.setAccelerationPriority(1.0f);
--- 125,139 ----
} else {
vImg = argbTmpPM.get();
vImgSurfaceType = SurfaceType.IntArgbPre;
}
! 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();
}
vImg = (SunVolatileImage) dst.getGraphicsConfig().createCompatibleVolatileImage(w, h, src.getTransparency());
vImg.setAccelerationPriority(1.0f);
*** 140,149 ****
--- 144,158 ----
argbTmpPM = new WeakReference<SunVolatileImage>(vImg);
}
}
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);
return vImgSurface;