I updated the underlying Juce library to an app of mine and I've noticed that all my red and blue colors are swapped on my target Intel Android devices when I use OpenGL when drawing any juce::Image. The source image has the the correct ARGB info (I stepped into it).
This does not happen on the Windows or OSX build of my app. This only happens on Android. It happens on multiple Intel Android tablets (Dell Venue, Dell venue 2, multiple Intel prototypes).
So I decided to look around the OpenGL juce code and I ran across juce_OpenGLTexture.cpp and the Flipper struct. Inside the Flipper::flipper() function you have an #if JUCE_ANDROID that basically swaps the Red and Blue pixels.
// straight from the current code base
#if JUCE_ANDROID
dst[x].setARGB (s.getAlpha(), s.getBlue(), s.getGreen(), s.getRed()); // orginal code red and blue are swapped
It is coverting a pixel from the ARBG format to AGBR. That pretty much describes by issue. Ok, I changed this code to just assign the ARGB pixel to ARGB and my problem is fixed.
dst[x].setARGB (s.getAlpha(), s.getRed(), s.getGreen(), s.getBlue()); // my edit, copy pixel over as ARGB, straight up lofi gangsta style
Any thoughts? I would hate anyone else to run across this and have to debug it (it took me a minute when I could have been eating cheesy nachos). I made this edit to my local copy of the juce library and have been using it for a couple weeks with no issues.
Even better yet, the #if JUCE_ANDROID isn't really needed at all, it can be handled just like Windows and OSX handle it. At least on the devices I've tried.
I have yet to personally try it out on an Arm or Tegra based Android tablet.
Thanks again Jules for making a great framework!