mirror of
https://github.com/encounter/SDL.git
synced 2025-12-18 01:15:24 +00:00
Fixed bug 3250 - Wrong backbuffer pixel format on Android, keep getting RGB_565
Use the egl format to reconfigure java SurfaceView holder format. If there is a change, it triggers a surfaceDestroyed/Created/Change sequence.
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_ANDROID
|
||||
#include <android/native_window.h>
|
||||
#include "../core/android/SDL_android.h"
|
||||
#endif
|
||||
|
||||
#include "SDL_sysvideo.h"
|
||||
@@ -885,6 +886,10 @@ SDL_EGL_CreateSurface(_THIS, NativeWindowType nw)
|
||||
EGL_NATIVE_VISUAL_ID, &format);
|
||||
|
||||
ANativeWindow_setBuffersGeometry(nw, 0, 0, format);
|
||||
|
||||
/* Update SurfaceView holder format.
|
||||
* May triggers a sequence surfaceDestroyed(), surfaceCreated(), surfaceChanged(). */
|
||||
Android_JNI_SetSurfaceViewFormat(format);
|
||||
}
|
||||
#endif
|
||||
if (_this->gl_config.framebuffer_srgb_capable) {
|
||||
|
||||
Reference in New Issue
Block a user