diff options
author | Chris Craik <ccraik@google.com> | 2015-06-08 17:34:21 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2015-06-08 17:40:00 -0700 |
commit | 59b429d10678542756c1a9ba7acf900de3d41871 (patch) | |
tree | 7eeba12f466697c905310a2b3b5f3585f6309a7d /opengl/java | |
parent | 72285e5600fad17c42730d6f84164d8425d4d43c (diff) | |
download | frameworks_base-59b429d10678542756c1a9ba7acf900de3d41871.zip frameworks_base-59b429d10678542756c1a9ba7acf900de3d41871.tar.gz frameworks_base-59b429d10678542756c1a9ba7acf900de3d41871.tar.bz2 |
Add tracing to GLSurfaceView
bug:21195272
Change-Id: I96bce6d6021fc720c73993202ba90997b0fc0e09
Diffstat (limited to 'opengl/java')
-rw-r--r-- | opengl/java/android/opengl/GLSurfaceView.java | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/opengl/java/android/opengl/GLSurfaceView.java b/opengl/java/android/opengl/GLSurfaceView.java index 3c76115..359a7a9 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(); |