Add a --color option to dumpsys SurfaceFlinger
colorize a bit the output of dumpsys SurfaceFlinger to
make it easier to read. Right now it will bold the
title of each section and use green for the name of
each layer.
Change-Id: I0d9f18d115401cb45109d244ef3a278481f68cc6
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 91113c9..9896581 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -36,6 +36,7 @@
#include <gui/Surface.h>
#include "clz.h"
+#include "Colorizer.h"
#include "DisplayDevice.h"
#include "GLExtensions.h"
#include "Layer.h"
@@ -1178,13 +1179,15 @@
// debugging
// ----------------------------------------------------------------------------
-void Layer::dump(String8& result) const
+void Layer::dump(String8& result, Colorizer& colorizer) const
{
const Layer::State& s(drawingState());
+ colorizer.colorize(result, Colorizer::GREEN);
result.appendFormat(
"+ %s %p (%s)\n",
getTypeId(), this, getName().string());
+ colorizer.reset(result);
s.activeTransparentRegion.dump(result, "transparentRegion");
visibleRegion.dump(result, "visibleRegion");
@@ -1224,11 +1227,6 @@
}
}
-
-void Layer::shortDump(String8& result) const {
- Layer::dump(result);
-}
-
void Layer::dumpStats(String8& result) const {
mFrameTracker.dump(result);
}