Search in sources :

Example 16 with EGLSurface

use of android.opengl.EGLSurface in project grafika by google.

the class EglCore method createOffscreenSurface.

/**
 * Creates an EGL surface associated with an offscreen buffer.
 */
public EGLSurface createOffscreenSurface(int width, int height) {
    int[] surfaceAttribs = { EGL14.EGL_WIDTH, width, EGL14.EGL_HEIGHT, height, EGL14.EGL_NONE };
    EGLSurface eglSurface = EGL14.eglCreatePbufferSurface(mEGLDisplay, mEGLConfig, surfaceAttribs, 0);
    checkEglError("eglCreatePbufferSurface");
    if (eglSurface == null) {
        throw new RuntimeException("surface was null");
    }
    return eglSurface;
}
Also used : EGLSurface(android.opengl.EGLSurface)

Example 17 with EGLSurface

use of android.opengl.EGLSurface in project MagicCamera by wuhaoyu1990.

the class EglCore method logCurrent.

/**
 * Writes the current display, context, and surface to the log.
 */
public static void logCurrent(String msg) {
    EGLDisplay display;
    EGLContext context;
    EGLSurface surface;
    display = EGL14.eglGetCurrentDisplay();
    context = EGL14.eglGetCurrentContext();
    surface = EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW);
    Log.i(TAG, "Current EGL (" + msg + "): display=" + display + ", context=" + context + ", surface=" + surface);
}
Also used : EGLSurface(android.opengl.EGLSurface) EGLDisplay(android.opengl.EGLDisplay) EGLContext(android.opengl.EGLContext)

Aggregations

EGLSurface (android.opengl.EGLSurface)17 SurfaceTexture (android.graphics.SurfaceTexture)7 EGLContext (android.opengl.EGLContext)7 EGLDisplay (android.opengl.EGLDisplay)7 Surface (android.view.Surface)7 Size (android.util.Size)5 EGLConfig (android.opengl.EGLConfig)4 TargetApi (android.annotation.TargetApi)2 SurfaceView (android.view.SurfaceView)1 Nullable (androidx.annotation.Nullable)1 GlUtil (com.google.android.exoplayer2.util.GlUtil)1 IOException (java.io.IOException)1