diff --git a/src/solaris/classes/sun/java2d/xr/XRDrawImage.java b/src/solaris/classes/sun/java2d/xr/XRDrawImage.java index ea8edbb391abc27462d9caacb10cbb6698f4fd79..69502f2ee2a813f554dd254b513350beb71754bc 100644 --- a/src/solaris/classes/sun/java2d/xr/XRDrawImage.java +++ b/src/solaris/classes/sun/java2d/xr/XRDrawImage.java @@ -46,24 +46,28 @@ public class XRDrawImage extends DrawImage { SurfaceData dstData = sg.surfaceData; SurfaceData srcData = dstData.getSourceSurfaceData(img, SunGraphics2D.TRANSFORM_GENERIC, sg.imageComp, bgColor); - int compRule = ((AlphaComposite) sg.composite).getRule(); - float extraAlpha = ((AlphaComposite) sg.composite).getAlpha(); - if (srcData != null && !isBgOperation(srcData, bgColor) + if (sg.composite instanceof AlphaComposite) { + int compRule = ((AlphaComposite) sg.composite).getRule(); + float extraAlpha = ((AlphaComposite) sg.composite).getAlpha(); + + if (srcData != null && !isBgOperation(srcData, bgColor) && interpType <= AffineTransformOp.TYPE_BILINEAR && (XRUtils.isMaskEvaluated(XRUtils.j2dAlphaCompToXR(compRule)) - || (XRUtils.isTransformQuadrantRotated(tx)) && extraAlpha == 1.0f)) - { - SurfaceType srcType = srcData.getSurfaceType(); - SurfaceType dstType = dstData.getSurfaceType(); + || (XRUtils.isTransformQuadrantRotated(tx)) + && extraAlpha == 1.0f)) + { + SurfaceType srcType = srcData.getSurfaceType(); + SurfaceType dstType = dstData.getSurfaceType(); - TransformBlit blit = TransformBlit.getFromCache(srcType, - sg.imageComp, dstType); - if (blit != null) { - blit.Transform(srcData, dstData, sg.composite, - sg.getCompClip(), tx, interpType, sx1, sy1, 0, 0, sx2 + TransformBlit blit = TransformBlit.getFromCache(srcType, + sg.imageComp, dstType); + if (blit != null) { + blit.Transform(srcData, dstData, sg.composite, + sg.getCompClip(), tx, interpType, sx1, sy1, 0, 0, sx2 - sx1, sy2 - sy1); return; + } } } diff --git a/test/java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java b/test/java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java index 8a9b1bd1ae79e16faaeb5a7cfe9bfd36b95b970d..c23a1cf0968581dc84b5fdfde6c9e847e235c8d7 100644 --- a/test/java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java +++ b/test/java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java @@ -40,7 +40,7 @@ import static java.awt.geom.Rectangle2D.Double; /** * @test - * @bug 8061831 + * @bug 8061831 8130400 * @summary Tests drawing volatile image to volatile image using different * clips + xor mode. Results of the blit compatibleImage to * compatibleImage is used for comparison.