Merge "Add frame counter to dumpGfxInfo"
This commit is contained in:
committed by
Android (Google) Code Review
commit
e6c966caa3
@@ -259,7 +259,14 @@ public abstract class HardwareRenderer {
|
||||
* @param pw
|
||||
*/
|
||||
abstract void dumpGfxInfo(PrintWriter pw);
|
||||
|
||||
|
||||
/**
|
||||
* Outputs the total number of frames rendered (used for fps calculations)
|
||||
*
|
||||
* @return the number of frames rendered
|
||||
*/
|
||||
abstract long getFrameCount();
|
||||
|
||||
/**
|
||||
* Sets the directory to use as a persistent storage for hardware rendering
|
||||
* resources.
|
||||
@@ -513,7 +520,7 @@ public abstract class HardwareRenderer {
|
||||
GL mGl;
|
||||
HardwareCanvas mCanvas;
|
||||
|
||||
int mFrameCount;
|
||||
long mFrameCount;
|
||||
Paint mDebugPaint;
|
||||
|
||||
static boolean sDirtyRegions;
|
||||
@@ -591,6 +598,11 @@ public abstract class HardwareRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
long getFrameCount() {
|
||||
return mFrameCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether this renderer instance can track and update dirty regions.
|
||||
*/
|
||||
@@ -1056,13 +1068,13 @@ public abstract class HardwareRenderer {
|
||||
callbacks.onHardwarePostDraw(canvas);
|
||||
canvas.restoreToCount(saveCount);
|
||||
view.mRecreateDisplayList = false;
|
||||
|
||||
mFrameCount++;
|
||||
if (mDebugDirtyRegions) {
|
||||
if (mDebugPaint == null) {
|
||||
mDebugPaint = new Paint();
|
||||
mDebugPaint.setColor(0x7fff0000);
|
||||
}
|
||||
if (dirty != null && (mFrameCount++ & 1) == 0) {
|
||||
if (dirty != null && (mFrameCount & 1) == 0) {
|
||||
canvas.drawRect(dirty, mDebugPaint);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -510,8 +510,13 @@ public class WindowManagerImpl implements WindowManager {
|
||||
|
||||
String name = root.getClass().getName() + '@' +
|
||||
Integer.toHexString(hashCode());
|
||||
pw.printf(" %s: %d views, %.2f kB (display lists)\n",
|
||||
pw.printf(" %s: %d views, %.2f kB (display lists)",
|
||||
name, info[0], info[1] / 1024.0f);
|
||||
HardwareRenderer renderer = root.getView().mAttachInfo.mHardwareRenderer;
|
||||
if (renderer != null) {
|
||||
pw.printf(", %d frames rendered", renderer.getFrameCount());
|
||||
}
|
||||
pw.printf("\n");
|
||||
|
||||
viewsCount += info[0];
|
||||
displayListsSize += info[1];
|
||||
|
||||
@@ -149,7 +149,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
implements Watchdog.Monitor, WindowManagerPolicy.WindowManagerFuncs {
|
||||
static final String TAG = "WindowManager";
|
||||
static final boolean DEBUG = false;
|
||||
static final boolean DEBUG_ADD_REMOVE = false;
|
||||
static final boolean DEBUG_ADD_REMOVE = true;
|
||||
static final boolean DEBUG_FOCUS = false;
|
||||
static final boolean DEBUG_ANIM = false;
|
||||
static final boolean DEBUG_LAYOUT = false;
|
||||
@@ -158,7 +158,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
static final boolean DEBUG_INPUT = false;
|
||||
static final boolean DEBUG_INPUT_METHOD = false;
|
||||
static final boolean DEBUG_VISIBILITY = false;
|
||||
static final boolean DEBUG_WINDOW_MOVEMENT = false;
|
||||
static final boolean DEBUG_WINDOW_MOVEMENT = true;
|
||||
static final boolean DEBUG_TOKEN_MOVEMENT = false;
|
||||
static final boolean DEBUG_ORIENTATION = false;
|
||||
static final boolean DEBUG_APP_ORIENTATION = false;
|
||||
|
||||
Reference in New Issue
Block a user