/** * Returns true if our context and the specified surface are current. */ public boolean isCurrent(EGLSurface eglSurface) { return mEGLContext.equals(EGL14.eglGetCurrentContext()) && eglSurface.equals(EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW)); }
@Override @SuppressLint("NewApi") public long getNativeHandle() { return eglContext != null ? (BuildCheck.isLollipop() ? eglContext.getNativeHandle() : eglContext.getHandle()) : 0L; }
/** * Returns true if our context and the specified surface are current. */ public boolean isCurrent(EGLSurface eglSurface) { return mEGLContext.equals(EGL14.eglGetCurrentContext()) && eglSurface.equals(EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW)); }
/** * Returns true if our context and the specified surface are current. */ public boolean isCurrent(EGLSurface eglSurface) { return mEGLContext.equals(EGL14.eglGetCurrentContext()) && eglSurface.equals(EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW)); }
/** * Returns true if our context and the specified surface are current. */ public boolean isCurrent(EGLSurface eglSurface) { return mEGLContext.equals(EGL14.eglGetCurrentContext()) && eglSurface.equals(EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW)); }
public void release() { if (EGL14.eglGetCurrentContext().equals(mEGLContext)) { EGL14.eglMakeCurrent(mEGLDisplay, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_CONTEXT); } EGL14.eglDestroySurface(mEGLDisplay, mEGLSurface); EGL14.eglDestroyContext(mEGLDisplay, mEGLContext); mSurface.release(); mEGLDisplay = null; mEGLContext = null; mEGLSurface = null; mSurface = null; }
public void release() { if (EGL14.eglGetCurrentContext().equals(mEGLContext)) { EGL14.eglMakeCurrent(mEGLDisplay, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_CONTEXT); } EGL14.eglDestroySurface(mEGLDisplay, mEGLSurface); EGL14.eglDestroyContext(mEGLDisplay, mEGLContext); mSurface.release(); mEGLDisplay = null; mEGLContext = null; mEGLSurface = null; mSurface = null; }
public void release() { if (EGL14.eglGetCurrentContext().equals(mEGLContext)) { EGL14.eglMakeCurrent(mEGLDisplay, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_CONTEXT); } EGL14.eglDestroySurface(mEGLDisplay, mEGLSurface); EGL14.eglDestroyContext(mEGLDisplay, mEGLContext); mSurface.release(); mEGLDisplay = null; mEGLContext = null; mEGLSurface = null; mSurface = null; }
/** * Discard all resources held by this class, notably the EGL context. Also releases the * Surface that was passed to our constructor. */ public void release() { if (EGL14.eglGetCurrentContext().equals(mEGLContext)) { // Clear the current context and surface to ensure they are discarded immediately. EGL14.eglMakeCurrent(mEGLDisplay, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_CONTEXT); } EGL14.eglDestroySurface(mEGLDisplay, mEGLSurface); EGL14.eglDestroyContext(mEGLDisplay, mEGLContext); //EGL14.eglTerminate(mEGLDisplay); mSurface.release(); // null everything out so future attempts to use this object will cause an NPE mEGLDisplay = null; mEGLContext = null; mEGLSurface = null; mSurface = null; }