提交 6597619e 编写于 作者: A aivanov

8147077: IllegalArgumentException thrown by...

8147077: IllegalArgumentException thrown by api/java_awt/Component/FlipBufferStrategy/indexTGF_General
8148127: IllegalArgumentException thrown by JCK test api/java_awt/Component/FlipBufferStrategy/indexTGF_General in opengl pipeline
Reviewed-by: flar, arapte
上级 48350458
...@@ -435,8 +435,12 @@ public class X11GraphicsConfig extends GraphicsConfiguration ...@@ -435,8 +435,12 @@ public class X11GraphicsConfig extends GraphicsConfiguration
public VolatileImage createBackBufferImage(Component target, public VolatileImage createBackBufferImage(Component target,
long backBuffer) long backBuffer)
{ {
// 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, return new SunVolatileImage(target,
target.getWidth(), target.getHeight(), w, h,
Long.valueOf(backBuffer)); Long.valueOf(backBuffer));
} }
......
...@@ -323,8 +323,12 @@ public class WGLGraphicsConfig ...@@ -323,8 +323,12 @@ public class WGLGraphicsConfig
@Override @Override
public VolatileImage createBackBuffer(WComponentPeer peer) { public VolatileImage createBackBuffer(WComponentPeer peer) {
Component target = (Component)peer.getTarget(); 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, return new SunVolatileImage(target,
target.getWidth(), target.getHeight(), w, h,
Boolean.TRUE); Boolean.TRUE);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册