summaryrefslogtreecommitdiff
path: root/libs/hwui/utils/StringUtils.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/utils/StringUtils.h')
-rw-r--r--libs/hwui/utils/StringUtils.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/libs/hwui/utils/StringUtils.h b/libs/hwui/utils/StringUtils.h
index 5add95711f2d..af5d10f8522b 100644
--- a/libs/hwui/utils/StringUtils.h
+++ b/libs/hwui/utils/StringUtils.h
@@ -16,10 +16,14 @@
#ifndef STRING_UTILS_H
#define STRING_UTILS_H
+#include <iomanip>
+#include <iostream>
+#include <ostream>
+#include <sstream>
#include <string>
#include <unordered_set>
-#include <ostream>
-#include <iomanip>
+
+#include <utils/Log.h>
namespace android {
namespace uirenderer {
@@ -51,6 +55,22 @@ struct SizePrinter {
}
};
+class LogcatStream: public std::ostream {
+ class LogcatStreamBuf: public std::stringbuf {
+ virtual int sync() {
+ ALOGD("%s", str().c_str());
+ str("");
+ return 0;
+ }
+ };
+
+ LogcatStreamBuf buffer;
+public:
+ LogcatStream()
+ :std::ostream(&buffer) {
+ }
+};
+
} /* namespace uirenderer */
} /* namespace android */