Bug 962

Summary: AWTGLReadBufferUtil should use aligned BufferedImage [for resized images]; Fix GLReadBufferUtil GL_PACK_ROW_LENGTH
Product: [JogAmp] Jogl Reporter: Sven Gothel <sgothel>
Component: awtAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: ---    
Version: 2   
Hardware: All   
OS: all   
Type: --- SCM Refs:
1d2515da352a79c239efecdfa3e0fade47779781 8631e403aa0c02c53b06819ef9b112af1885d4f7
Workaround: ---

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