提交 9c2a11a5 编写于 作者: A azvegint

8130400: Test...

8130400: Test java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java fails with ClassCastException
Reviewed-by: prr, serb
上级 a73c6a39
...@@ -46,24 +46,28 @@ public class XRDrawImage extends DrawImage { ...@@ -46,24 +46,28 @@ public class XRDrawImage extends DrawImage {
SurfaceData dstData = sg.surfaceData; SurfaceData dstData = sg.surfaceData;
SurfaceData srcData = dstData.getSourceSurfaceData(img, SurfaceData srcData = dstData.getSourceSurfaceData(img,
SunGraphics2D.TRANSFORM_GENERIC, sg.imageComp, bgColor); 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 && interpType <= AffineTransformOp.TYPE_BILINEAR
&& (XRUtils.isMaskEvaluated(XRUtils.j2dAlphaCompToXR(compRule)) && (XRUtils.isMaskEvaluated(XRUtils.j2dAlphaCompToXR(compRule))
|| (XRUtils.isTransformQuadrantRotated(tx)) && extraAlpha == 1.0f)) || (XRUtils.isTransformQuadrantRotated(tx))
{ && extraAlpha == 1.0f))
SurfaceType srcType = srcData.getSurfaceType(); {
SurfaceType dstType = dstData.getSurfaceType(); SurfaceType srcType = srcData.getSurfaceType();
SurfaceType dstType = dstData.getSurfaceType();
TransformBlit blit = TransformBlit.getFromCache(srcType, TransformBlit blit = TransformBlit.getFromCache(srcType,
sg.imageComp, dstType); sg.imageComp, dstType);
if (blit != null) { if (blit != null) {
blit.Transform(srcData, dstData, sg.composite, blit.Transform(srcData, dstData, sg.composite,
sg.getCompClip(), tx, interpType, sx1, sy1, 0, 0, sx2 sg.getCompClip(), tx, interpType, sx1, sy1, 0, 0, sx2
- sx1, sy2 - sy1); - sx1, sy2 - sy1);
return; return;
}
} }
} }
......
...@@ -40,7 +40,7 @@ import static java.awt.geom.Rectangle2D.Double; ...@@ -40,7 +40,7 @@ import static java.awt.geom.Rectangle2D.Double;
/** /**
* @test * @test
* @bug 8061831 * @bug 8061831 8130400
* @summary Tests drawing volatile image to volatile image using different * @summary Tests drawing volatile image to volatile image using different
* clips + xor mode. Results of the blit compatibleImage to * clips + xor mode. Results of the blit compatibleImage to
* compatibleImage is used for comparison. * compatibleImage is used for comparison.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册