diff options
author | Sven Gothel <[email protected]> | 2019-05-13 11:20:34 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2019-05-13 11:20:34 +0200 |
commit | 154e91978498d8b6db9ce34a1f06b298bcf4c361 (patch) | |
tree | ec5b9104c81bcbc60def54e621397559298fc992 /src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java | |
parent | ea3edf9cfc6b6fda9780c540e1de099c97207bc1 (diff) |
Bug 1381: Keep host PixelFormat functional using requested immutable alphaRequested + add appropriate API doc
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java index aad94aae6..3eb5fd076 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java @@ -32,8 +32,9 @@ import java.awt.image.BufferedImage; import com.jogamp.opengl.GL; import com.jogamp.opengl.GLDrawable; import com.jogamp.opengl.GLProfile; - +import com.jogamp.opengl.util.GLPixelBuffer; import com.jogamp.opengl.util.GLReadBufferUtil; +import com.jogamp.opengl.util.GLPixelBuffer.GLPixelBufferProvider; /** * {@link GLReadBufferUtil} specialization allowing to @@ -44,10 +45,15 @@ public class AWTGLReadBufferUtil extends GLReadBufferUtil { /** * {@inheritDoc} * - * @param alpha + * Using the AWT {@link GLPixelBuffer}: {@link AWTGLPixelBuffer.AWTGLPixelBufferProvider}, always using alpha on OpenGL operations. + * <p> + * The host {@link PixelFormat} will be a 32bit INT compatible to AWT, capable to store the GL RGBA read data, regardless whether AWT utilizes the alpha component. + * </p> + * + * @param requestAlpha true for RGBA readPixels, otherwise RGB readPixels. Disclaimer: {@link #hasAlpha()}==true is forced due to the used {@link AWTGLPixelBuffer.AWTGLPixelBufferProvider} when calling {@link #readPixels(GL, int, int, int, int, boolean) readPixels}. */ - public AWTGLReadBufferUtil(final GLProfile glp, final boolean alpha) { - super(new AWTGLPixelBuffer.AWTGLPixelBufferProvider( glp.isGL2ES3() /* allowRowStride */ ), alpha, false); + public AWTGLReadBufferUtil(final GLProfile glp, final boolean requestAlpha) { + super(new AWTGLPixelBuffer.AWTGLPixelBufferProvider( glp.isGL2ES3() /* allowRowStride */ ), requestAlpha /* See Bug 1381 */, false); } /** |