File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -733,13 +733,17 @@ boolean hasDirtyRegions() {
733733 */
734734 void checkEglErrors () {
735735 if (isEnabled ()) {
736- int error = sEgl .eglGetError ();
737- if (error != EGL_SUCCESS ) {
738- // something bad has happened revert to
739- // normal rendering.
740- Log .w (LOG_TAG , "EGL error: " + GLUtils .getEGLErrorString (error ));
741- fallback (error != EGL11 .EGL_CONTEXT_LOST );
742- }
736+ checkEglErrorsForced ();
737+ }
738+ }
739+
740+ private void checkEglErrorsForced () {
741+ int error = sEgl .eglGetError ();
742+ if (error != EGL_SUCCESS ) {
743+ // something bad has happened revert to
744+ // normal rendering.
745+ Log .w (LOG_TAG , "EGL error: " + GLUtils .getEGLErrorString (error ));
746+ fallback (error != EGL11 .EGL_CONTEXT_LOST );
743747 }
744748 }
745749
@@ -812,7 +816,9 @@ void initializeEgl() {
812816 throw new RuntimeException ("eglInitialize failed " +
813817 GLUtils .getEGLErrorString (sEgl .eglGetError ()));
814818 }
815-
819+
820+ checkEglErrorsForced ();
821+
816822 sEglConfig = chooseEglConfig ();
817823 if (sEglConfig == null ) {
818824 // We tried to use EGL_SWAP_BEHAVIOR_PRESERVED_BIT, try again without
You can’t perform that action at this time.
0 commit comments