use of javax.microedition.khronos.egl.EGLConfig in project android_frameworks_base by ResurrectionRemix.
the class RenderTarget method createSurface.
private static EGLSurface createSurface(EGL10 egl, EGLDisplay display, int width, int height) {
EGLConfig eglConfig = chooseEglConfig(egl, display);
int[] attribs = { EGL10.EGL_WIDTH, width, EGL10.EGL_HEIGHT, height, EGL10.EGL_NONE };
return egl.eglCreatePbufferSurface(display, eglConfig, attribs);
}
use of javax.microedition.khronos.egl.EGLConfig in project android_frameworks_base by ResurrectionRemix.
the class RenderTarget method forSurfaceTexture.
@TargetApi(11)
public RenderTarget forSurfaceTexture(SurfaceTexture surfaceTexture) {
EGLConfig eglConfig = chooseEglConfig(mEgl, mDisplay);
EGLSurface eglSurf = null;
synchronized (mSurfaceSources) {
eglSurf = mSurfaceSources.get(surfaceTexture);
if (eglSurf == null) {
eglSurf = mEgl.eglCreateWindowSurface(mDisplay, eglConfig, surfaceTexture, null);
mSurfaceSources.put(surfaceTexture, eglSurf);
}
}
checkEglError(mEgl, "eglCreateWindowSurface");
checkSurface(mEgl, eglSurf);
RenderTarget result = new RenderTarget(mDisplay, mContext, eglSurf, 0, false, true);
result.setSurfaceSource(surfaceTexture);
result.addReferenceTo(eglSurf);
return result;
}
use of javax.microedition.khronos.egl.EGLConfig in project android_frameworks_base by ResurrectionRemix.
the class RenderTarget method forSurface.
@TargetApi(11)
public RenderTarget forSurface(Surface surface) {
EGLConfig eglConfig = chooseEglConfig(mEgl, mDisplay);
EGLSurface eglSurf = null;
synchronized (mSurfaceSources) {
eglSurf = mSurfaceSources.get(surface);
if (eglSurf == null) {
eglSurf = mEgl.eglCreateWindowSurface(mDisplay, eglConfig, surface, null);
mSurfaceSources.put(surface, eglSurf);
}
}
checkEglError(mEgl, "eglCreateWindowSurface");
checkSurface(mEgl, eglSurf);
RenderTarget result = new RenderTarget(mDisplay, mContext, eglSurf, 0, false, true);
result.setSurfaceSource(surface);
result.addReferenceTo(eglSurf);
return result;
}
use of javax.microedition.khronos.egl.EGLConfig in project android_frameworks_base by ResurrectionRemix.
the class RenderTarget method forSurfaceHolder.
public RenderTarget forSurfaceHolder(SurfaceHolder surfaceHolder) {
EGLConfig eglConfig = chooseEglConfig(mEgl, mDisplay);
EGLSurface eglSurf = null;
synchronized (mSurfaceSources) {
eglSurf = mSurfaceSources.get(surfaceHolder);
if (eglSurf == null) {
eglSurf = mEgl.eglCreateWindowSurface(mDisplay, eglConfig, surfaceHolder, null);
mSurfaceSources.put(surfaceHolder, eglSurf);
}
}
checkEglError(mEgl, "eglCreateWindowSurface");
checkSurface(mEgl, eglSurf);
RenderTarget result = new RenderTarget(mDisplay, mContext, eglSurf, 0, false, true);
result.addReferenceTo(eglSurf);
result.setSurfaceSource(surfaceHolder);
return result;
}
use of javax.microedition.khronos.egl.EGLConfig in project react-native-android-video-editor by RZulfikri.
the class TextureSurfaceRenderer method initGL.
private void initGL() {
egl = (EGL10) EGLContext.getEGL();
eglDisplay = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
int[] version = new int[2];
egl.eglInitialize(eglDisplay, version);
EGLConfig eglConfig = chooseEglConfig();
eglContext = createContext(egl, eglDisplay, eglConfig);
eglSurface = egl.eglCreateWindowSurface(eglDisplay, eglConfig, texture, null);
if (eglSurface == null || eglSurface == EGL10.EGL_NO_SURFACE) {
throw new RuntimeException("GL Error: " + GLUtils.getEGLErrorString(egl.eglGetError()));
}
if (!egl.eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext)) {
throw new RuntimeException("GL Make current error: " + GLUtils.getEGLErrorString(egl.eglGetError()));
}
}
Aggregations