diff options
Diffstat (limited to 'opengl')
| -rw-r--r-- | opengl/java/android/opengl/GLSurfaceView.java | 22 | ||||
| -rw-r--r-- | opengl/java/android/opengl/GLUtils.java | 10 |
2 files changed, 19 insertions, 13 deletions
diff --git a/opengl/java/android/opengl/GLSurfaceView.java b/opengl/java/android/opengl/GLSurfaceView.java index 3c76115cb537..359a7a97aa81 100644 --- a/opengl/java/android/opengl/GLSurfaceView.java +++ b/opengl/java/android/opengl/GLSurfaceView.java @@ -32,6 +32,7 @@ import javax.microedition.khronos.opengles.GL10; import android.content.Context; import android.content.pm.ConfigurationInfo; import android.os.SystemProperties; +import android.os.Trace; import android.util.AttributeSet; import android.util.Log; import android.view.SurfaceHolder; @@ -1497,7 +1498,12 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback } GLSurfaceView view = mGLSurfaceViewWeakRef.get(); if (view != null) { - view.mRenderer.onSurfaceCreated(gl, mEglHelper.mEglConfig); + try { + Trace.traceBegin(Trace.TRACE_TAG_VIEW, "onSurfaceCreated"); + view.mRenderer.onSurfaceCreated(gl, mEglHelper.mEglConfig); + } finally { + Trace.traceEnd(Trace.TRACE_TAG_VIEW); + } } createEglContext = false; } @@ -1508,7 +1514,12 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback } GLSurfaceView view = mGLSurfaceViewWeakRef.get(); if (view != null) { - view.mRenderer.onSurfaceChanged(gl, w, h); + try { + Trace.traceBegin(Trace.TRACE_TAG_VIEW, "onSurfaceChanged"); + view.mRenderer.onSurfaceChanged(gl, w, h); + } finally { + Trace.traceEnd(Trace.TRACE_TAG_VIEW); + } } sizeChanged = false; } @@ -1519,7 +1530,12 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback { GLSurfaceView view = mGLSurfaceViewWeakRef.get(); if (view != null) { - view.mRenderer.onDrawFrame(gl); + try { + Trace.traceBegin(Trace.TRACE_TAG_VIEW, "onDrawFrame"); + view.mRenderer.onDrawFrame(gl); + } finally { + Trace.traceEnd(Trace.TRACE_TAG_VIEW); + } } } int swapError = mEglHelper.swap(); diff --git a/opengl/java/android/opengl/GLUtils.java b/opengl/java/android/opengl/GLUtils.java index a9d33dd23827..4d890c9438a3 100644 --- a/opengl/java/android/opengl/GLUtils.java +++ b/opengl/java/android/opengl/GLUtils.java @@ -29,14 +29,6 @@ import javax.microedition.khronos.egl.EGL11; public final class GLUtils { - /* - * We use a class initializer to allow the native code to cache some - * field offsets. - */ - static { - nativeClassInit(); - } - private GLUtils() { } @@ -275,8 +267,6 @@ public final class GLUtils { */ native public static void setTracingLevel(int level); - native private static void nativeClassInit(); - native private static int native_getInternalFormat(Bitmap bitmap); native private static int native_getType(Bitmap bitmap); native private static int native_texImage2D(int target, int level, int internalformat, |