提交 6b44b0ea 编写于 作者: B bagiras

7121482: some sun/java2d and sun/awt tests failed with InvalidPipeException...

7121482: some sun/java2d and sun/awt tests failed with InvalidPipeException since 1.7.0_03b02, 6u31b02
Reviewed-by: art, bae
上级 e451fe25
...@@ -1815,7 +1815,12 @@ public final class SunGraphics2D ...@@ -1815,7 +1815,12 @@ public final class SunGraphics2D
width += x; width += x;
height += y; height += y;
} }
if (!getCompClip().intersectsQuickCheckXYXY(x, y, width, height)) {
try {
if (!getCompClip().intersectsQuickCheckXYXY(x, y, width, height)) {
return false;
}
} catch (InvalidPipeException e) {
return false; return false;
} }
// REMIND: We could go one step further here and examine the // REMIND: We could go one step further here and examine the
...@@ -1999,8 +2004,8 @@ public final class SunGraphics2D ...@@ -1999,8 +2004,8 @@ public final class SunGraphics2D
try { try {
doCopyArea(x, y, w, h, dx, dy); doCopyArea(x, y, w, h, dx, dy);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
doCopyArea(x, y, w, h, dx, dy); doCopyArea(x, y, w, h, dx, dy);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2131,8 +2136,8 @@ public final class SunGraphics2D ...@@ -2131,8 +2136,8 @@ public final class SunGraphics2D
try { try {
drawpipe.drawLine(this, x1, y1, x2, y2); drawpipe.drawLine(this, x1, y1, x2, y2);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
drawpipe.drawLine(this, x1, y1, x2, y2); drawpipe.drawLine(this, x1, y1, x2, y2);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2148,8 +2153,8 @@ public final class SunGraphics2D ...@@ -2148,8 +2153,8 @@ public final class SunGraphics2D
try { try {
drawpipe.drawRoundRect(this, x, y, w, h, arcW, arcH); drawpipe.drawRoundRect(this, x, y, w, h, arcW, arcH);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
drawpipe.drawRoundRect(this, x, y, w, h, arcW, arcH); drawpipe.drawRoundRect(this, x, y, w, h, arcW, arcH);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2165,8 +2170,8 @@ public final class SunGraphics2D ...@@ -2165,8 +2170,8 @@ public final class SunGraphics2D
try { try {
fillpipe.fillRoundRect(this, x, y, w, h, arcW, arcH); fillpipe.fillRoundRect(this, x, y, w, h, arcW, arcH);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
fillpipe.fillRoundRect(this, x, y, w, h, arcW, arcH); fillpipe.fillRoundRect(this, x, y, w, h, arcW, arcH);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2182,8 +2187,8 @@ public final class SunGraphics2D ...@@ -2182,8 +2187,8 @@ public final class SunGraphics2D
try { try {
drawpipe.drawOval(this, x, y, w, h); drawpipe.drawOval(this, x, y, w, h);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
drawpipe.drawOval(this, x, y, w, h); drawpipe.drawOval(this, x, y, w, h);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2199,8 +2204,8 @@ public final class SunGraphics2D ...@@ -2199,8 +2204,8 @@ public final class SunGraphics2D
try { try {
fillpipe.fillOval(this, x, y, w, h); fillpipe.fillOval(this, x, y, w, h);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
fillpipe.fillOval(this, x, y, w, h); fillpipe.fillOval(this, x, y, w, h);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2217,8 +2222,8 @@ public final class SunGraphics2D ...@@ -2217,8 +2222,8 @@ public final class SunGraphics2D
try { try {
drawpipe.drawArc(this, x, y, w, h, startAngl, arcAngl); drawpipe.drawArc(this, x, y, w, h, startAngl, arcAngl);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
drawpipe.drawArc(this, x, y, w, h, startAngl, arcAngl); drawpipe.drawArc(this, x, y, w, h, startAngl, arcAngl);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2235,8 +2240,8 @@ public final class SunGraphics2D ...@@ -2235,8 +2240,8 @@ public final class SunGraphics2D
try { try {
fillpipe.fillArc(this, x, y, w, h, startAngl, arcAngl); fillpipe.fillArc(this, x, y, w, h, startAngl, arcAngl);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
fillpipe.fillArc(this, x, y, w, h, startAngl, arcAngl); fillpipe.fillArc(this, x, y, w, h, startAngl, arcAngl);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2252,8 +2257,8 @@ public final class SunGraphics2D ...@@ -2252,8 +2257,8 @@ public final class SunGraphics2D
try { try {
drawpipe.drawPolyline(this, xPoints, yPoints, nPoints); drawpipe.drawPolyline(this, xPoints, yPoints, nPoints);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
drawpipe.drawPolyline(this, xPoints, yPoints, nPoints); drawpipe.drawPolyline(this, xPoints, yPoints, nPoints);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2269,8 +2274,8 @@ public final class SunGraphics2D ...@@ -2269,8 +2274,8 @@ public final class SunGraphics2D
try { try {
drawpipe.drawPolygon(this, xPoints, yPoints, nPoints); drawpipe.drawPolygon(this, xPoints, yPoints, nPoints);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
drawpipe.drawPolygon(this, xPoints, yPoints, nPoints); drawpipe.drawPolygon(this, xPoints, yPoints, nPoints);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2286,8 +2291,8 @@ public final class SunGraphics2D ...@@ -2286,8 +2291,8 @@ public final class SunGraphics2D
try { try {
fillpipe.fillPolygon(this, xPoints, yPoints, nPoints); fillpipe.fillPolygon(this, xPoints, yPoints, nPoints);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
fillpipe.fillPolygon(this, xPoints, yPoints, nPoints); fillpipe.fillPolygon(this, xPoints, yPoints, nPoints);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2303,8 +2308,8 @@ public final class SunGraphics2D ...@@ -2303,8 +2308,8 @@ public final class SunGraphics2D
try { try {
drawpipe.drawRect(this, x, y, w, h); drawpipe.drawRect(this, x, y, w, h);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
drawpipe.drawRect(this, x, y, w, h); drawpipe.drawRect(this, x, y, w, h);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2320,8 +2325,8 @@ public final class SunGraphics2D ...@@ -2320,8 +2325,8 @@ public final class SunGraphics2D
try { try {
fillpipe.fillRect(this, x, y, w, h); fillpipe.fillRect(this, x, y, w, h);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
fillpipe.fillRect(this, x, y, w, h); fillpipe.fillRect(this, x, y, w, h);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2369,7 +2374,6 @@ public final class SunGraphics2D ...@@ -2369,7 +2374,6 @@ public final class SunGraphics2D
Paint p = paint; Paint p = paint;
setComposite(AlphaComposite.Src); setComposite(AlphaComposite.Src);
setColor(getBackground()); setColor(getBackground());
validatePipe();
fillRect(x, y, w, h); fillRect(x, y, w, h);
setPaint(p); setPaint(p);
setComposite(c); setComposite(c);
...@@ -2393,8 +2397,8 @@ public final class SunGraphics2D ...@@ -2393,8 +2397,8 @@ public final class SunGraphics2D
try { try {
shapepipe.draw(this, s); shapepipe.draw(this, s);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
shapepipe.draw(this, s); shapepipe.draw(this, s);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2423,8 +2427,8 @@ public final class SunGraphics2D ...@@ -2423,8 +2427,8 @@ public final class SunGraphics2D
try { try {
shapepipe.fill(this, s); shapepipe.fill(this, s);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
shapepipe.fill(this, s); shapepipe.fill(this, s);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2571,10 +2575,17 @@ public final class SunGraphics2D ...@@ -2571,10 +2575,17 @@ public final class SunGraphics2D
// Include padding for interpolation/antialiasing if necessary // Include padding for interpolation/antialiasing if necessary
int pad = isIntegerTranslate ? 0 : 3; int pad = isIntegerTranslate ? 0 : 3;
Region clip;
try {
clip = getCompClip();
} catch (InvalidPipeException e) {
return;
}
// Determine the region of the image that may contribute to // Determine the region of the image that may contribute to
// the clipped drawing area // the clipped drawing area
Rectangle region = getImageRegion(img, Rectangle region = getImageRegion(img,
getCompClip(), clip,
transform, transform,
xform, xform,
pad, pad); pad, pad);
...@@ -2817,8 +2828,8 @@ public final class SunGraphics2D ...@@ -2817,8 +2828,8 @@ public final class SunGraphics2D
try { try {
textpipe.drawString(this, str, x, y); textpipe.drawString(this, str, x, y);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
textpipe.drawString(this, str, x, y); textpipe.drawString(this, str, x, y);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2846,8 +2857,8 @@ public final class SunGraphics2D ...@@ -2846,8 +2857,8 @@ public final class SunGraphics2D
try { try {
textpipe.drawString(this, str, x, y); textpipe.drawString(this, str, x, y);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
textpipe.drawString(this, str, x, y); textpipe.drawString(this, str, x, y);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2892,8 +2903,8 @@ public final class SunGraphics2D ...@@ -2892,8 +2903,8 @@ public final class SunGraphics2D
try { try {
textpipe.drawGlyphVector(this, gv, x, y); textpipe.drawGlyphVector(this, gv, x, y);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
textpipe.drawGlyphVector(this, gv, x, y); textpipe.drawGlyphVector(this, gv, x, y);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2925,8 +2936,8 @@ public final class SunGraphics2D ...@@ -2925,8 +2936,8 @@ public final class SunGraphics2D
try { try {
textpipe.drawChars(this, data, offset, length, x, y); textpipe.drawChars(this, data, offset, length, x, y);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
textpipe.drawChars(this, data, offset, length, x, y); textpipe.drawChars(this, data, offset, length, x, y);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2962,8 +2973,8 @@ public final class SunGraphics2D ...@@ -2962,8 +2973,8 @@ public final class SunGraphics2D
try { try {
textpipe.drawChars(this, chData, 0, length, x, y); textpipe.drawChars(this, chData, 0, length, x, y);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
textpipe.drawChars(this, chData, 0, length, x, y); textpipe.drawChars(this, chData, 0, length, x, y);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -2999,8 +3010,8 @@ public final class SunGraphics2D ...@@ -2999,8 +3010,8 @@ public final class SunGraphics2D
return imagepipe.copyImage(this, img, dx, dy, sx, sy, return imagepipe.copyImage(this, img, dx, dy, sx, sy,
width, height, bgcolor, observer); width, height, bgcolor, observer);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
return imagepipe.copyImage(this, img, dx, dy, sx, sy, return imagepipe.copyImage(this, img, dx, dy, sx, sy,
width, height, bgcolor, observer); width, height, bgcolor, observer);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
...@@ -3036,8 +3047,8 @@ public final class SunGraphics2D ...@@ -3036,8 +3047,8 @@ public final class SunGraphics2D
return imagepipe.scaleImage(this, img, x, y, width, height, return imagepipe.scaleImage(this, img, x, y, width, height,
bg, observer); bg, observer);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
return imagepipe.scaleImage(this, img, x, y, width, height, return imagepipe.scaleImage(this, img, x, y, width, height,
bg, observer); bg, observer);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
...@@ -3072,8 +3083,8 @@ public final class SunGraphics2D ...@@ -3072,8 +3083,8 @@ public final class SunGraphics2D
try { try {
return imagepipe.copyImage(this, img, x, y, bg, observer); return imagepipe.copyImage(this, img, x, y, bg, observer);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
return imagepipe.copyImage(this, img, x, y, bg, observer); return imagepipe.copyImage(this, img, x, y, bg, observer);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -3149,8 +3160,8 @@ public final class SunGraphics2D ...@@ -3149,8 +3160,8 @@ public final class SunGraphics2D
sx1, sy1, sx2, sy2, bgcolor, sx1, sy1, sx2, sy2, bgcolor,
observer); observer);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
return imagepipe.scaleImage(this, img, dx1, dy1, dx2, dy2, return imagepipe.scaleImage(this, img, dx1, dy1, dx2, dy2,
sx1, sy1, sx2, sy2, bgcolor, sx1, sy1, sx2, sy2, bgcolor,
observer); observer);
...@@ -3198,8 +3209,8 @@ public final class SunGraphics2D ...@@ -3198,8 +3209,8 @@ public final class SunGraphics2D
try { try {
return imagepipe.transformImage(this, img, xform, observer); return imagepipe.transformImage(this, img, xform, observer);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
return imagepipe.transformImage(this, img, xform, observer); return imagepipe.transformImage(this, img, xform, observer);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
...@@ -3224,8 +3235,8 @@ public final class SunGraphics2D ...@@ -3224,8 +3235,8 @@ public final class SunGraphics2D
try { try {
imagepipe.transformImage(this, bImg, op, x, y); imagepipe.transformImage(this, bImg, op, x, y);
} catch (InvalidPipeException e) { } catch (InvalidPipeException e) {
revalidateAll();
try { try {
revalidateAll();
imagepipe.transformImage(this, bImg, op, x, y); imagepipe.transformImage(this, bImg, op, x, y);
} catch (InvalidPipeException e2) { } catch (InvalidPipeException e2) {
// Still catching the exception; we are not yet ready to // Still catching the exception; we are not yet ready to
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册