提交 03643bb6 编写于 作者: P prr

8147542: ClassCastException when repainting after display resolution change

Reviewed-by: prr, flar
Contributed-by: alexey.ushakov@jetbrains.com
上级 09fb7798
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册