We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3304

Summary: Android black screen on resume [2.0.4]
Product: SDL Reporter: Richard Russell <rtrussell>
Component: renderAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.4   
Hardware: All   
OS: Android (All)   
Attachments: Test Case to demonstrate black screen on resume.

Description Richard Russell 2016-04-02 10:23:36 UTC
Created attachment 2404 [details]
Test Case to demonstrate black screen on resume.

Resuming from a suspended state results in a black screen.  This only happens when using GLES 1.1 (GLES 2 resumes correctly) and when the render target has been changed using SDL_SetRenderTarget.  This problem is new in 2.0.4.

The attached test case demonstrates the issue.

Sylvain Becker has apparently found a fix as follows:

"In the opengles leaf function (in 'src/render/opengles/SDL_render_gles.c'), it appears there is a call to 'GLES_ActivateRenderer' in 'GLES_SetRenderTarget', which is not present in opengles2. When commenting out this 'GLES_ActivateRenderer', it seems to resume fine".

This appears to fix the testcase perfectly, but I don't know whether it could have any undesirable side-effects.
Comment 1 Richard Russell 2016-04-02 10:26:18 UTC
More details can be found at this forum thread:

https://forums.libsdl.org/viewtopic.php?t=11770
Comment 2 Richard Russell 2017-01-08 10:37:28 UTC
This bug is still present in 2.0.5, but the fix described above (commenting out or deleting the call to GLES_ActivateRenderer) again seems to be a complete cure.  Can somebody who understands the code form an opinion on whether this modification has any undesirable side-effects, and if not incorporate it in the next release?  Thanks.
Comment 3 Sam Lantinga 2017-01-08 18:42:35 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/602fec42fe09