OpenGL renderer glitch in retina


We have an issue with OpenGL juce::Component rendering. There is a thin line that appears on the bottom and right of each component. 

The problem comes from the fact that  all the components are drawn on power of two wide textures, with some transparent pixels beyond the real image. The GL_CLAMP_TO_EDGE clamps the texture coordinates at the power of two texture boundaries, and not at the actual image boundaries. At the object bottom/right border, the image pixels are rendered blended with the following transparent pixels. On the other borders, GL_CLAMP_TO_EDGE does its job correctly.

One solution would be to allow non power of two textures, removing the nextPowerOfTwo() calls in OpenGLTexture.cpp (and the isPowerOfTwo() test). It fixes the issue for me. It could be activated by a #define, or according to the appropriate extension on the GPU.


Image edge artifacts in Ableton Live when using OpenGL renderer

Good idea - I've added a flag JUCE_OPENGL_ALLOW_NON_POWER_OF_TWO_TEXTURES, thanks!


Great, thanks.