mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-26 17:19:24 +00:00
fix surface update being called outside gl thread
This commit is contained in:
1 file changed
+6
-3
@@ -340,7 +340,6 @@ public class ExplicitGLSurfaceView extends SurfaceView implements SurfaceHolder.
|
|||||||
* not normally called or subclassed by clients of GLSurfaceView.
|
* not normally called or subclassed by clients of GLSurfaceView.
|
||||||
*/
|
*/
|
||||||
public void surfaceCreated(SurfaceHolder holder) {
|
public void surfaceCreated(SurfaceHolder holder) {
|
||||||
LauncherFix.INSTANCE.setSurface(holder.getSurface());
|
|
||||||
mGLThread.surfaceCreated();
|
mGLThread.surfaceCreated();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -348,7 +347,6 @@ public class ExplicitGLSurfaceView extends SurfaceView implements SurfaceHolder.
|
|||||||
* not normally called or subclassed by clients of GLSurfaceView.
|
* not normally called or subclassed by clients of GLSurfaceView.
|
||||||
*/
|
*/
|
||||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||||
LauncherFix.INSTANCE.setSurface(null);
|
|
||||||
// Surface will be destroyed when we return
|
// Surface will be destroyed when we return
|
||||||
mGLThread.surfaceDestroyed();
|
mGLThread.surfaceDestroyed();
|
||||||
}
|
}
|
||||||
@@ -357,7 +355,6 @@ public class ExplicitGLSurfaceView extends SurfaceView implements SurfaceHolder.
|
|||||||
* not normally called or subclassed by clients of GLSurfaceView.
|
* not normally called or subclassed by clients of GLSurfaceView.
|
||||||
*/
|
*/
|
||||||
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
|
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
|
||||||
LauncherFix.INSTANCE.setSurface(holder.getSurface());
|
|
||||||
mGLThread.onWindowResize(w, h);
|
mGLThread.onWindowResize(w, h);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -817,8 +814,12 @@ public class ExplicitGLSurfaceView extends SurfaceView implements SurfaceHolder.
|
|||||||
if (view != null) {
|
if (view != null) {
|
||||||
mEglSurface = view.mEGLWindowSurfaceFactory.createWindowSurface(
|
mEglSurface = view.mEGLWindowSurfaceFactory.createWindowSurface(
|
||||||
mEglDisplay, mEglConfig, view.getHolder());
|
mEglDisplay, mEglConfig, view.getHolder());
|
||||||
|
// NOTE: this diverges from GLSurfaceView
|
||||||
|
LauncherFix.INSTANCE.setSurface(view.getHolder().getSurface());
|
||||||
} else {
|
} else {
|
||||||
mEglSurface = null;
|
mEglSurface = null;
|
||||||
|
// NOTE: this diverges from GLSurfaceView
|
||||||
|
LauncherFix.INSTANCE.setSurface(null);
|
||||||
}
|
}
|
||||||
if (mEglSurface == null || mEglSurface == EGL14.EGL_NO_SURFACE) {
|
if (mEglSurface == null || mEglSurface == EGL14.EGL_NO_SURFACE) {
|
||||||
int error = EGL14.eglGetError();
|
int error = EGL14.eglGetError();
|
||||||
@@ -847,6 +848,7 @@ public class ExplicitGLSurfaceView extends SurfaceView implements SurfaceHolder.
|
|||||||
* @return the EGL error code from eglSwapBuffers.
|
* @return the EGL error code from eglSwapBuffers.
|
||||||
*/
|
*/
|
||||||
public int swap() {
|
public int swap() {
|
||||||
|
// NOTE: this diverges from GLSurfaceView
|
||||||
// if (! EGL14.eglSwapBuffers(mEglDisplay, mEglSurface)) {
|
// if (! EGL14.eglSwapBuffers(mEglDisplay, mEglSurface)) {
|
||||||
if (!LauncherFix.INSTANCE.swapFrame(mEglDisplay.getNativeHandle(), mEglSurface.getNativeHandle())) {
|
if (!LauncherFix.INSTANCE.swapFrame(mEglDisplay.getNativeHandle(), mEglSurface.getNativeHandle())) {
|
||||||
return EGL14.eglGetError();
|
return EGL14.eglGetError();
|
||||||
@@ -1216,6 +1218,7 @@ public class ExplicitGLSurfaceView extends SurfaceView implements SurfaceHolder.
|
|||||||
finishDrawingRunnable.run();
|
finishDrawingRunnable.run();
|
||||||
finishDrawingRunnable = null;
|
finishDrawingRunnable = null;
|
||||||
}
|
}
|
||||||
|
// NOTE: this diverges from GLSurfaceView
|
||||||
requestRender();
|
requestRender();
|
||||||
} finally {
|
} finally {
|
||||||
// Trace.traceEnd(Trace.TRACE_TAG_VIEW);
|
// Trace.traceEnd(Trace.TRACE_TAG_VIEW);
|
||||||
|
|||||||
Reference in new issue
Block a user