FileDocCategorySizeDatePackage
EGLLogWrapper.javaAPI DocAndroid 5.1 API16407Thu Mar 12 22:22:40 GMT 2015android.opengl

EGLLogWrapper

public class EGLLogWrapper extends Object implements javax.microedition.khronos.egl.EGL11

Fields Summary
private javax.microedition.khronos.egl.EGL10
mEgl10
Writer
mLog
boolean
mLogArgumentNames
boolean
mCheckError
private int
mArgCount
Constructors Summary
public EGLLogWrapper(javax.microedition.khronos.egl.EGL egl, int configFlags, Writer log)

        mEgl10 = (EGL10) egl;
        mLog = log;
        mLogArgumentNames =
            (GLDebugHelper.CONFIG_LOG_ARGUMENT_NAMES & configFlags) != 0;
        mCheckError =
            (GLDebugHelper.CONFIG_CHECK_GL_ERROR & configFlags) != 0;
    
Methods Summary
private voidarg(java.lang.String name, java.lang.String value)

        if (mArgCount++ > 0) {
            log(", ");
        }
        if (mLogArgumentNames) {
            log(name + "=");
        }
        log(value);
    
private voidarg(java.lang.String name, int value)

        arg(name, Integer.toString(value));
    
private voidarg(java.lang.String name, java.lang.Object object)

        arg(name, toString(object));
    
private voidarg(java.lang.String name, javax.microedition.khronos.egl.EGLDisplay object)

        if (object == EGL10.EGL_DEFAULT_DISPLAY) {
            arg(name, "EGL10.EGL_DEFAULT_DISPLAY");
        } else if (object == EGL_NO_DISPLAY) {
            arg(name, "EGL10.EGL_NO_DISPLAY");
        } else {
            arg(name, toString(object));
        }
    
private voidarg(java.lang.String name, javax.microedition.khronos.egl.EGLContext object)

        if (object == EGL10.EGL_NO_CONTEXT) {
            arg(name, "EGL10.EGL_NO_CONTEXT");
        } else {
            arg(name, toString(object));
        }
    
private voidarg(java.lang.String name, javax.microedition.khronos.egl.EGLSurface object)

        if (object == EGL10.EGL_NO_SURFACE) {
            arg(name, "EGL10.EGL_NO_SURFACE");
        } else {
            arg(name, toString(object));
        }
    
private voidarg(java.lang.String name, int[] arr)

        if (arr == null) {
            arg(name, "null");
        } else {
            arg(name, toString(arr.length, arr, 0));
        }
    
private voidarg(java.lang.String name, java.lang.Object[] arr)

        if (arr == null) {
            arg(name, "null");
        } else {
            arg(name, toString(arr.length, arr, 0));
        }
    
private voidbegin(java.lang.String name)

        log(name + '(");
        mArgCount = 0;
    
private voidcheckError()

        int eglError;
        if ((eglError = mEgl10.eglGetError()) != EGL_SUCCESS) {
            String errorMessage = "eglError: " + getErrorString(eglError);
            logLine(errorMessage);
            if (mCheckError) {
                throw new GLException(eglError, errorMessage);
            }
        }
    
public booleaneglChooseConfig(javax.microedition.khronos.egl.EGLDisplay display, int[] attrib_list, javax.microedition.khronos.egl.EGLConfig[] configs, int config_size, int[] num_config)

        begin("eglChooseConfig");
        arg("display", display);
        arg("attrib_list", attrib_list);
        arg("config_size", config_size);
        end();

        boolean result = mEgl10.eglChooseConfig(display, attrib_list, configs,
                config_size, num_config);
        arg("configs", configs);
        arg("num_config", num_config);
        returns(result);
        checkError();
        return result;
    
public booleaneglCopyBuffers(javax.microedition.khronos.egl.EGLDisplay display, javax.microedition.khronos.egl.EGLSurface surface, java.lang.Object native_pixmap)

        begin("eglCopyBuffers");
        arg("display", display);
        arg("surface", surface);
        arg("native_pixmap", native_pixmap);
        end();

        boolean result = mEgl10.eglCopyBuffers(display, surface, native_pixmap);
        returns(result);
        checkError();
        return result;
    
public javax.microedition.khronos.egl.EGLContexteglCreateContext(javax.microedition.khronos.egl.EGLDisplay display, javax.microedition.khronos.egl.EGLConfig config, javax.microedition.khronos.egl.EGLContext share_context, int[] attrib_list)

        begin("eglCreateContext");
        arg("display", display);
        arg("config", config);
        arg("share_context", share_context);
        arg("attrib_list", attrib_list);
        end();

        EGLContext result = mEgl10.eglCreateContext(display, config,
                share_context, attrib_list);
        returns(result);
        checkError();
        return result;
    
public javax.microedition.khronos.egl.EGLSurfaceeglCreatePbufferSurface(javax.microedition.khronos.egl.EGLDisplay display, javax.microedition.khronos.egl.EGLConfig config, int[] attrib_list)

        begin("eglCreatePbufferSurface");
        arg("display", display);
        arg("config", config);
        arg("attrib_list", attrib_list);
        end();

        EGLSurface result = mEgl10.eglCreatePbufferSurface(display, config,
                attrib_list);
        returns(result);
        checkError();
        return result;
    
public javax.microedition.khronos.egl.EGLSurfaceeglCreatePixmapSurface(javax.microedition.khronos.egl.EGLDisplay display, javax.microedition.khronos.egl.EGLConfig config, java.lang.Object native_pixmap, int[] attrib_list)

        begin("eglCreatePixmapSurface");
        arg("display", display);
        arg("config", config);
        arg("native_pixmap", native_pixmap);
        arg("attrib_list", attrib_list);
        end();

        EGLSurface result = mEgl10.eglCreatePixmapSurface(display, config,
                native_pixmap, attrib_list);
        returns(result);
        checkError();
        return result;
        
public javax.microedition.khronos.egl.EGLSurfaceeglCreateWindowSurface(javax.microedition.khronos.egl.EGLDisplay display, javax.microedition.khronos.egl.EGLConfig config, java.lang.Object native_window, int[] attrib_list)

        begin("eglCreateWindowSurface");
        arg("display", display);
        arg("config", config);
        arg("native_window", native_window);
        arg("attrib_list", attrib_list);
        end();

        EGLSurface result = mEgl10.eglCreateWindowSurface(display, config,
                native_window, attrib_list);
        returns(result);
        checkError();
        return result;
    
public booleaneglDestroyContext(javax.microedition.khronos.egl.EGLDisplay display, javax.microedition.khronos.egl.EGLContext context)

        begin("eglDestroyContext");
        arg("display", display);
        arg("context", context);
        end();

        boolean result = mEgl10.eglDestroyContext(display, context);
        returns(result);
        checkError();
        return result;
    
public booleaneglDestroySurface(javax.microedition.khronos.egl.EGLDisplay display, javax.microedition.khronos.egl.EGLSurface surface)

        begin("eglDestroySurface");
        arg("display", display);
        arg("surface", surface);
        end();

        boolean result = mEgl10.eglDestroySurface(display, surface);
        returns(result);
        checkError();
        return result;
    
public booleaneglGetConfigAttrib(javax.microedition.khronos.egl.EGLDisplay display, javax.microedition.khronos.egl.EGLConfig config, int attribute, int[] value)

        begin("eglGetConfigAttrib");
        arg("display", display);
        arg("config", config);
        arg("attribute", attribute);
        end();
        boolean result = mEgl10.eglGetConfigAttrib(display, config, attribute,
                value);
        arg("value", value);
        returns(result);
        checkError();
        return false;
    
public booleaneglGetConfigs(javax.microedition.khronos.egl.EGLDisplay display, javax.microedition.khronos.egl.EGLConfig[] configs, int config_size, int[] num_config)

        begin("eglGetConfigs");
        arg("display", display);
        arg("config_size", config_size);
        end();

        boolean result = mEgl10.eglGetConfigs(display, configs, config_size,
                num_config);
        arg("configs", configs);
        arg("num_config", num_config);
        returns(result);
        checkError();
        return result;
    
public javax.microedition.khronos.egl.EGLContexteglGetCurrentContext()

        begin("eglGetCurrentContext");
        end();

        EGLContext result = mEgl10.eglGetCurrentContext();
        returns(result);

        checkError();
        return result;
    
public javax.microedition.khronos.egl.EGLDisplayeglGetCurrentDisplay()

        begin("eglGetCurrentDisplay");
        end();

        EGLDisplay result = mEgl10.eglGetCurrentDisplay();
        returns(result);

        checkError();
        return result;
    
public javax.microedition.khronos.egl.EGLSurfaceeglGetCurrentSurface(int readdraw)

        begin("eglGetCurrentSurface");
        arg("readdraw", readdraw);
        end();

        EGLSurface result = mEgl10.eglGetCurrentSurface(readdraw);
        returns(result);

        checkError();
        return result;
    
public javax.microedition.khronos.egl.EGLDisplayeglGetDisplay(java.lang.Object native_display)

        begin("eglGetDisplay");
        arg("native_display", native_display);
        end();

        EGLDisplay result = mEgl10.eglGetDisplay(native_display);
        returns(result);

        checkError();
        return result;
    
public integlGetError()

        begin("eglGetError");
        end();

        int result = mEgl10.eglGetError();
        returns(getErrorString(result));

        return result;
    
public booleaneglInitialize(javax.microedition.khronos.egl.EGLDisplay display, int[] major_minor)

        begin("eglInitialize");
        arg("display", display);
        end();
        boolean result = mEgl10.eglInitialize(display, major_minor);
        returns(result);
        arg("major_minor", major_minor);
        checkError();
        return result;
    
public booleaneglMakeCurrent(javax.microedition.khronos.egl.EGLDisplay display, javax.microedition.khronos.egl.EGLSurface draw, javax.microedition.khronos.egl.EGLSurface read, javax.microedition.khronos.egl.EGLContext context)

        begin("eglMakeCurrent");
        arg("display", display);
        arg("draw", draw);
        arg("read", read);
        arg("context", context);
        end();
        boolean result = mEgl10.eglMakeCurrent(display, draw, read, context);
        returns(result);
        checkError();
        return result;
    
public booleaneglQueryContext(javax.microedition.khronos.egl.EGLDisplay display, javax.microedition.khronos.egl.EGLContext context, int attribute, int[] value)

        begin("eglQueryContext");
        arg("display", display);
        arg("context", context);
        arg("attribute", attribute);
        end();
        boolean result = mEgl10.eglQueryContext(display, context, attribute,
                value);
        returns(value[0]);
        returns(result);
        checkError();
        return result;
    
public java.lang.StringeglQueryString(javax.microedition.khronos.egl.EGLDisplay display, int name)

        begin("eglQueryString");
        arg("display", display);
        arg("name", name);
        end();
        String result = mEgl10.eglQueryString(display, name);
        returns(result);
        checkError();
        return result;
    
public booleaneglQuerySurface(javax.microedition.khronos.egl.EGLDisplay display, javax.microedition.khronos.egl.EGLSurface surface, int attribute, int[] value)

        begin("eglQuerySurface");
        arg("display", display);
        arg("surface", surface);
        arg("attribute", attribute);
        end();
        boolean result = mEgl10.eglQuerySurface(display, surface, attribute,
                value);
        returns(value[0]);
        returns(result);
        checkError();
        return result;
    
public booleaneglReleaseThread()

hide

        begin("eglReleaseThread");
        end();
        boolean result = mEgl10.eglReleaseThread();
        returns(result);
        checkError();
        return result;
    
public booleaneglSwapBuffers(javax.microedition.khronos.egl.EGLDisplay display, javax.microedition.khronos.egl.EGLSurface surface)

        begin("eglSwapBuffers");
        arg("display", display);
        arg("surface", surface);
        end();
        boolean result = mEgl10.eglSwapBuffers(display, surface);
        returns(result);
        checkError();
        return result;
    
public booleaneglTerminate(javax.microedition.khronos.egl.EGLDisplay display)

        begin("eglTerminate");
        arg("display", display);
        end();
        boolean result = mEgl10.eglTerminate(display);
        returns(result);
        checkError();
        return result;
    
public booleaneglWaitGL()

        begin("eglWaitGL");
        end();
        boolean result = mEgl10.eglWaitGL();
        returns(result);
        checkError();
        return result;
    
public booleaneglWaitNative(int engine, java.lang.Object bindTarget)

        begin("eglWaitNative");
        arg("engine", engine);
        arg("bindTarget", bindTarget);
        end();
        boolean result = mEgl10.eglWaitNative(engine, bindTarget);
        returns(result);
        checkError();
        return result;
    
private voidend()

        log(");\n");
        flush();
    
private voidflush()

        try {
            mLog.flush();
        } catch (IOException e) {
            mLog = null;
        }
    
public static java.lang.StringgetErrorString(int error)

        switch (error) {
        case EGL_SUCCESS:
            return "EGL_SUCCESS";
        case EGL_NOT_INITIALIZED:
            return "EGL_NOT_INITIALIZED";
        case EGL_BAD_ACCESS:
            return "EGL_BAD_ACCESS";
        case EGL_BAD_ALLOC:
            return "EGL_BAD_ALLOC";
        case EGL_BAD_ATTRIBUTE:
            return "EGL_BAD_ATTRIBUTE";
        case EGL_BAD_CONFIG:
            return "EGL_BAD_CONFIG";
        case EGL_BAD_CONTEXT:
            return "EGL_BAD_CONTEXT";
        case EGL_BAD_CURRENT_SURFACE:
            return "EGL_BAD_CURRENT_SURFACE";
        case EGL_BAD_DISPLAY:
            return "EGL_BAD_DISPLAY";
        case EGL_BAD_MATCH:
            return "EGL_BAD_MATCH";
        case EGL_BAD_NATIVE_PIXMAP:
            return "EGL_BAD_NATIVE_PIXMAP";
        case EGL_BAD_NATIVE_WINDOW:
            return "EGL_BAD_NATIVE_WINDOW";
        case EGL_BAD_PARAMETER:
            return "EGL_BAD_PARAMETER";
        case EGL_BAD_SURFACE:
            return "EGL_BAD_SURFACE";
        case EGL11.EGL_CONTEXT_LOST:
            return "EGL_CONTEXT_LOST";
        default:
            return getHex(error);
        }
    
private static java.lang.StringgetHex(int value)

        return "0x" + Integer.toHexString(value);
    
private voidlog(java.lang.String message)

        try {
            mLog.write(message);
        } catch (IOException e) {
            // Ignore exception, keep on trying
        }
    
private voidlogLine(java.lang.String message)

        log(message + '\n");
    
private voidreturns(java.lang.String result)

        log(" returns " + result + ";\n");
        flush();
    
private voidreturns(int result)

        returns(Integer.toString(result));
    
private voidreturns(boolean result)

        returns(Boolean.toString(result));
    
private voidreturns(java.lang.Object result)

        returns(toString(result));
    
private java.lang.StringtoString(java.lang.Object obj)

        if (obj == null) {
            return "null";
        } else {
            return obj.toString();
        }
    
private java.lang.StringtoString(int n, int[] arr, int offset)

        StringBuilder buf = new StringBuilder();
        buf.append("{\n");
        int arrLen = arr.length;
        for (int i = 0; i < n; i++) {
            int index = offset + i;
            buf.append(" [" + index + "] = ");
            if (index < 0 || index >= arrLen) {
                buf.append("out of bounds");
            } else {
                buf.append(arr[index]);
            }
            buf.append('\n");
        }
        buf.append("}");
        return buf.toString();
    
private java.lang.StringtoString(int n, java.lang.Object[] arr, int offset)

        StringBuilder buf = new StringBuilder();
        buf.append("{\n");
        int arrLen = arr.length;
        for (int i = 0; i < n; i++) {
            int index = offset + i;
            buf.append(" [" + index + "] = ");
            if (index < 0 || index >= arrLen) {
                buf.append("out of bounds");
            } else {
                buf.append(arr[index]);
            }
            buf.append('\n");
        }
        buf.append("}");
        return buf.toString();