Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64d10a1d authored by Siva Velusamy's avatar Siva Velusamy
Browse files

Expose a function to set OpenGL Trace level.

This patch adds a function setGlDebugLevel() to libEGL, and
exposes it to the Java layer at android.opengl.GLUtils.enableTracing().

Change-Id: Ia5abb130bc32fcfe3ab25b0a0a5283a54c54f357
parent df0d3ab4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -556,6 +556,12 @@ void nativeUtilsClassInit(JNIEnv *env, jclass clazz)
    nativeBitmapID = env->GetFieldID(bitmapClass, "mNativeBitmap", "I");
}

extern void setGLDebugLevel(int level);
void nativeEnableTracing(JNIEnv *env, jclass clazz)
{
    setGLDebugLevel(1);
}

static int checkFormat(SkBitmap::Config config, int format, int type)
{
    switch(config) {
@@ -1026,6 +1032,7 @@ static JNINativeMethod gUtilsMethods[] = {
    { "native_getType", "(Landroid/graphics/Bitmap;)I", (void*) util_getType },
    { "native_texImage2D", "(IIILandroid/graphics/Bitmap;II)I", (void*)util_texImage2D },
    { "native_texSubImage2D", "(IIIILandroid/graphics/Bitmap;II)I", (void*)util_texSubImage2D },
    { "native_enableTracing", "()V",                    (void*)nativeEnableTracing },
};

static JNINativeMethod gEtc1Methods[] = {
+11 −2
Original line number Diff line number Diff line
@@ -269,6 +269,14 @@ public final class GLUtils {
        }
    }

    /**
     * Enable tracing of OpenGL functions for this application.
     * @hide
     */
    public static void enableTracing() {
        native_enableTracing();
    }

    native private static void nativeClassInit();

    native private static int native_getInternalFormat(Bitmap bitmap);
@@ -277,4 +285,5 @@ public final class GLUtils {
            Bitmap bitmap, int type, int border);
    native private static int native_texSubImage2D(int target, int level, int xoffset, int yoffset,
            Bitmap bitmap, int format, int type);
    native private static void native_enableTracing();
}