12-29 19:06:55.639 19716-19716/com.yourcompany.jucedemo W/View: requestLayout() improperly called by com.yourcompany.jucedemo.JuceDemo$ComponentPeerView{d558d91 VFED..... .F....ID 0,0-1082,1536} during layout: running second layout pass 12-29 19:07:09.880 19716-19716/com.yourcompany.jucedemo I/Choreographer: Skipped 43 frames! The application may be doing too much work on its main thread. 12-29 19:07:10.096 19716-665/com.yourcompany.jucedemo A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 665 (Pool)
3. Some text seems to be rendering weirdly. See screenshots (some of these are showing the problem and some show that the problem isn't happening everywhere):
I can confirm bugs 1) and 3) on my device. The first bug should be relatively straight forward to fix. The third one might be more complicated but I'll give it a go. I'll get back to you on both.
On bug 2): Can you check that the "teapot" opengl demo works as expected. Can you also check that you can set the renderer to open gl by clicking on the "Tabs & Widgets" demo and then selecting "Use OpenGL Renderer" from the Look-and-feel menu on the right?
I've looked into this a bit more and seems to have something to do with the OpenGL shader version. The OpenGL 2D demo requests shader version 2 but some newer Motorola devices nevertheless returns an OpenGL 3 context. I was able to re-produce the crash with the Motorola Nexus 6. I've filed a bug to Google but obviously JUCE still shouldn't crash. I'll see if I can come up with a workaround.
This is the shader code in the OpenGL2D demo that ultimately gets sent to the GPU:
varying mediump vec4 frontColour;varying highp vec2 pixelPos;
mediump float pixelAlpha = frontColour.a;
/* This demo shows the use of the OpenGLGraphicsContextCustomShader,
which allows a 2D area to be filled using a GL shader program.
Edit the shader program below and it will be
recompiled in real-time!
*/
void main()
{
mediump vec4 colour1 = vec4 (1.0, 0.4, 0.6, 1.0);
mediump vec4 colour2 = vec4 (0.0, 0.8, 0.6, 1.0);
mediump float alpha = pixelPos.x / 1000.0;
gl_FragColor = pixelAlpha * mix (colour1, colour2, alpha);
}
which fails to compile with the following error:
ERROR: 0.2: 'frontColour': Only consts or uniforms can be used in a global initializer
Note that this error only occurs on some newer Motorola devices (Nexus 9, Nexus 6 for example). Are there any Open GL gurus out there that could point me in the right direction?