Bug 962 - AWTGLReadBufferUtil should use aligned BufferedImage [for resized images]; Fix GLReadBufferUtil GL_PACK_ROW_LENGTH
Summary: AWTGLReadBufferUtil should use aligned BufferedImage [for resized images]; Fi...
Status: RESOLVED FIXED
Alias: None
Product: Jogl
Classification: JogAmp
Component: awt (show other bugs)
Version: 2
Hardware: All all
: --- enhancement
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2014-02-06 15:28 CET by Sven Gothel
Modified: 2014-02-13 01:06 CET (History)
0 users

See Also:
Type: ---
SCM Refs:
1d2515da352a79c239efecdfa3e0fade47779781 8631e403aa0c02c53b06819ef9b112af1885d4f7
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2014-02-06 15:28:51 CET
AWTGLPixelBuffer is being reused when used via AWTGLPixelBufferProvider
even when resized. 

AWTGLPixelBufferProvider uses  GLPixelBufferProvider's requiresNewBuffer(..) 
which returns true if 
  - allowRowStride==true and pixel-buffer size < required-size, or
  - allowRowStride==false and pixel-buffer size < required _or_ width doesn't match

otherwise it returns true, i.e. the AWTGLPixelBuffer is reused.

Hence the used BufferedImage might need to be aligned,
i.e. using AWTGLPixelBuffer's getAlignedImage(..).
Comment 1 Sven Gothel 2014-02-13 01:03:06 CET
GLReadBufferUtil shall use current texture-data width for GL_PACK_ROW_LENGTH,
not the static GLPixelBuffer's width, which may not reflect image dimension (resize)
Comment 2 Sven Gothel 2014-02-13 01:06:56 CET
1d2515da352a79c239efecdfa3e0fade47779781
  As described ..

8631e403aa0c02c53b06819ef9b112af1885d4f7
  TextureIO: Fix PNGTextureWriter Vertical-Flip, i.e. pass TextureData's getMustFlipVertically() to PNGPixelRect