summaryrefslogtreecommitdiff
path: root/libs/gui/LayerDebugInfo.cpp
diff options
context:
space:
mode:
author Yiwei Zhang <zzyiwei@google.com> 2018-12-05 18:06:32 -0800
committer Yiwei Zhang <zzyiwei@google.com> 2018-12-05 23:50:03 -0800
commit5434a781d70df56cef2ecf6cbc9d6c7b8faf1ae8 (patch)
tree8c75c8ddecb1f95d385b39666c4bca7d76021edf /libs/gui/LayerDebugInfo.cpp
parent161410bcb27ac5203b802d34a1c836e490aeb2f7 (diff)
SurfaceFlinger: Get rid of String8 in dumpsys
Test: build and gui/ui/renderengine/surfaceflinger tests and compare dumpsys SurfaceFlinger results Change-Id: Iafdaf73a0acbbbb8fbafc930ad86285106a07e13
Diffstat (limited to 'libs/gui/LayerDebugInfo.cpp')
-rw-r--r--libs/gui/LayerDebugInfo.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/libs/gui/LayerDebugInfo.cpp b/libs/gui/LayerDebugInfo.cpp
index ccde9e08e1..cdde9a2308 100644
--- a/libs/gui/LayerDebugInfo.cpp
+++ b/libs/gui/LayerDebugInfo.cpp
@@ -16,13 +16,14 @@
#include <gui/LayerDebugInfo.h>
+#include <android-base/stringprintf.h>
+
#include <ui/DebugUtils.h>
#include <binder/Parcel.h>
-#include <utils/String8.h>
-
using namespace android;
+using android::base::StringAppendF;
#define RETURN_ON_ERROR(X) do {status_t res = (X); if (res != NO_ERROR) return res;} while(false)
@@ -108,38 +109,37 @@ status_t LayerDebugInfo::readFromParcel(const Parcel* parcel) {
}
std::string to_string(const LayerDebugInfo& info) {
- String8 result;
+ std::string result;
- result.appendFormat("+ %s (%s)\n", info.mType.c_str(), info.mName.c_str());
+ StringAppendF(&result, "+ %s (%s)\n", info.mType.c_str(), info.mName.c_str());
info.mTransparentRegion.dump(result, "TransparentRegion");
info.mVisibleRegion.dump(result, "VisibleRegion");
info.mSurfaceDamageRegion.dump(result, "SurfaceDamageRegion");
- result.appendFormat(" layerStack=%4d, z=%9d, pos=(%g,%g), size=(%4d,%4d), ",
- info.mLayerStack, info.mZ, static_cast<double>(info.mX), static_cast<double>(info.mY),
- info.mWidth, info.mHeight);
+ StringAppendF(&result, " layerStack=%4d, z=%9d, pos=(%g,%g), size=(%4d,%4d), ",
+ info.mLayerStack, info.mZ, static_cast<double>(info.mX),
+ static_cast<double>(info.mY), info.mWidth, info.mHeight);
- result.appendFormat("crop=%s, ", to_string(info.mCrop).c_str());
- result.appendFormat("isOpaque=%1d, invalidate=%1d, ", info.mIsOpaque, info.mContentDirty);
- result.appendFormat("dataspace=%s, ", dataspaceDetails(info.mDataSpace).c_str());
- result.appendFormat("pixelformat=%s, ", decodePixelFormat(info.mPixelFormat).c_str());
- result.appendFormat("color=(%.3f,%.3f,%.3f,%.3f), flags=0x%08x, ",
- static_cast<double>(info.mColor.r), static_cast<double>(info.mColor.g),
- static_cast<double>(info.mColor.b), static_cast<double>(info.mColor.a),
- info.mFlags);
- result.appendFormat("tr=[%.2f, %.2f][%.2f, %.2f]",
- static_cast<double>(info.mMatrix[0][0]), static_cast<double>(info.mMatrix[0][1]),
- static_cast<double>(info.mMatrix[1][0]), static_cast<double>(info.mMatrix[1][1]));
+ StringAppendF(&result, "crop=%s, ", to_string(info.mCrop).c_str());
+ StringAppendF(&result, "isOpaque=%1d, invalidate=%1d, ", info.mIsOpaque, info.mContentDirty);
+ StringAppendF(&result, "dataspace=%s, ", dataspaceDetails(info.mDataSpace).c_str());
+ StringAppendF(&result, "pixelformat=%s, ", decodePixelFormat(info.mPixelFormat).c_str());
+ StringAppendF(&result, "color=(%.3f,%.3f,%.3f,%.3f), flags=0x%08x, ",
+ static_cast<double>(info.mColor.r), static_cast<double>(info.mColor.g),
+ static_cast<double>(info.mColor.b), static_cast<double>(info.mColor.a),
+ info.mFlags);
+ StringAppendF(&result, "tr=[%.2f, %.2f][%.2f, %.2f]", static_cast<double>(info.mMatrix[0][0]),
+ static_cast<double>(info.mMatrix[0][1]), static_cast<double>(info.mMatrix[1][0]),
+ static_cast<double>(info.mMatrix[1][1]));
result.append("\n");
- result.appendFormat(" parent=%s\n", info.mParentName.c_str());
- result.appendFormat(" activeBuffer=[%4ux%4u:%4u,%s],",
- info.mActiveBufferWidth, info.mActiveBufferHeight,
- info.mActiveBufferStride,
- decodePixelFormat(info.mActiveBufferFormat).c_str());
- result.appendFormat(" queued-frames=%d, mRefreshPending=%d",
- info.mNumQueuedFrames, info.mRefreshPending);
+ StringAppendF(&result, " parent=%s\n", info.mParentName.c_str());
+ StringAppendF(&result, " activeBuffer=[%4ux%4u:%4u,%s],", info.mActiveBufferWidth,
+ info.mActiveBufferHeight, info.mActiveBufferStride,
+ decodePixelFormat(info.mActiveBufferFormat).c_str());
+ StringAppendF(&result, " queued-frames=%d, mRefreshPending=%d", info.mNumQueuedFrames,
+ info.mRefreshPending);
result.append("\n");
- return std::string(result.c_str());
+ return result;
}
} // android