8148127: IllegalArgumentException thrown by JCK test api/java_awt/Component/FlipBufferStrategy/indexTGF_General in opengl pipeline
Reviewed-by: flar, arapte
--- a/jdk/src/java.desktop/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java Wed Jan 27 14:12:05 2016 +0530
+++ b/jdk/src/java.desktop/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java Wed Jan 27 14:13:48 2016 +0530
@@ -323,8 +323,12 @@
@Override
public VolatileImage createBackBuffer(WComponentPeer peer) {
Component target = (Component)peer.getTarget();
+ // it is possible for the component to have size 0x0, adjust it to
+ // be at least 1x1 to avoid IAE
+ int w = Math.max(1, target.getWidth());
+ int h = Math.max(1, target.getHeight());
return new SunVolatileImage(target,
- target.getWidth(), target.getHeight(),
+ w, h,
Boolean.TRUE);
}