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 - Android black screen on resume [2.0.4]
Summary: Android black screen on resume [2.0.4]
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: 2.0.4
Hardware: All Android (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-02 10:23 UTC by Richard Russell
Modified: 2017-01-08 18:42 UTC (History)
0 users

See Also:


Attachments
Test Case to demonstrate black screen on resume. (5.02 KB, text/x-csrc)
2016-04-02 10:23 UTC, Richard Russell
Details

Note You need to log in before you can comment on or make changes to this bug.
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