use of javax.microedition.khronos.egl.EGLDisplay in project android_frameworks_base by ParanoidAndroid.
the class ManagedEGLContext method doTerminate.
/** @hide */
public static boolean doTerminate() {
ArrayList<ManagedEGLContext> active;
if (Looper.getMainLooper() != Looper.myLooper()) {
throw new IllegalStateException("Called on wrong thread");
}
synchronized (sActive) {
// try to terminate.
if (sActive.size() <= 0) {
return false;
}
// Need to check how many EGL contexts are actually running,
// to compare with how many we are managing.
EGL10 egl = (EGL10) EGLContext.getEGL();
EGLDisplay display = egl.eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (display == EGL_NO_DISPLAY) {
Log.w(TAG, "doTerminate failed: no display");
return false;
}
if (EGLImpl.getInitCount(display) != sActive.size()) {
Log.w(TAG, "doTerminate failed: EGL count is " + EGLImpl.getInitCount(display) + " but managed count is " + sActive.size());
return false;
}
active = new ArrayList<ManagedEGLContext>(sActive);
sActive.clear();
}
for (int i = 0; i < active.size(); i++) {
active.get(i).execTerminate();
}
return true;
}
use of javax.microedition.khronos.egl.EGLDisplay in project platform_frameworks_base by android.
the class EGLLogWrapper method eglGetCurrentDisplay.
public EGLDisplay eglGetCurrentDisplay() {
begin("eglGetCurrentDisplay");
end();
EGLDisplay result = mEgl10.eglGetCurrentDisplay();
returns(result);
checkError();
return result;
}
use of javax.microedition.khronos.egl.EGLDisplay in project platform_frameworks_base by android.
the class RenderTarget method createDefaultDisplay.
private static EGLDisplay createDefaultDisplay(EGL10 egl) {
EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
checkDisplay(egl, display);
initEgl(egl, display);
return display;
}
use of javax.microedition.khronos.egl.EGLDisplay in project android_frameworks_base by DirtyUnicorns.
the class RenderTarget method newTarget.
public static RenderTarget newTarget(int width, int height) {
EGL10 egl = (EGL10) EGLContext.getEGL();
EGLDisplay eglDisplay = createDefaultDisplay(egl);
EGLConfig eglConfig = chooseEglConfig(egl, eglDisplay);
EGLContext eglContext = createContext(egl, eglDisplay, eglConfig);
EGLSurface eglSurface = createSurface(egl, eglDisplay, width, height);
RenderTarget result = new RenderTarget(eglDisplay, eglContext, eglSurface, 0, true, true);
result.addReferenceTo(eglSurface);
return result;
}
use of javax.microedition.khronos.egl.EGLDisplay in project android_frameworks_base by DirtyUnicorns.
the class RenderTarget method createDefaultDisplay.
private static EGLDisplay createDefaultDisplay(EGL10 egl) {
EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
checkDisplay(egl, display);
initEgl(egl, display);
return display;
}
Aggregations