Search in sources :

Example 41 with EGLConfig

use of javax.microedition.khronos.egl.EGLConfig in project android_frameworks_base by crdroidandroid.

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);
}
Also used : EGLConfig(javax.microedition.khronos.egl.EGLConfig)

Example 42 with EGLConfig

use of javax.microedition.khronos.egl.EGLConfig in project android_frameworks_base by crdroidandroid.

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;
}
Also used : EGLSurface(javax.microedition.khronos.egl.EGLSurface) EGL10(javax.microedition.khronos.egl.EGL10) EGLDisplay(javax.microedition.khronos.egl.EGLDisplay) EGLContext(javax.microedition.khronos.egl.EGLContext) EGLConfig(javax.microedition.khronos.egl.EGLConfig)

Aggregations

EGLConfig (javax.microedition.khronos.egl.EGLConfig)42 EGLSurface (javax.microedition.khronos.egl.EGLSurface)20 EGL10 (javax.microedition.khronos.egl.EGL10)12 EGLDisplay (javax.microedition.khronos.egl.EGLDisplay)12 TargetApi (android.annotation.TargetApi)9 EGLContext (javax.microedition.khronos.egl.EGLContext)8 SuppressLint (android.annotation.SuppressLint)1 Paint (android.graphics.Paint)1 TextPaint (android.text.TextPaint)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1