aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/debugger/SkJsonWriteBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/debugger/SkJsonWriteBuffer.cpp')
-rw-r--r--tools/debugger/SkJsonWriteBuffer.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/debugger/SkJsonWriteBuffer.cpp b/tools/debugger/SkJsonWriteBuffer.cpp
index bdabc8aea5..9a9a032d6b 100644
--- a/tools/debugger/SkJsonWriteBuffer.cpp
+++ b/tools/debugger/SkJsonWriteBuffer.cpp
@@ -15,6 +15,16 @@ void SkJsonWriteBuffer::append(const char* type, const Json::Value& value) {
fJson[fullName.c_str()] = value;
}
+void SkJsonWriteBuffer::writePad32(const void* data, size_t size) {
+ Json::Value jsonArray(Json::arrayValue);
+ const uint8_t* bytes = reinterpret_cast<const uint8_t*>(data);
+ for (size_t i = 0; i < size; ++i) {
+ SkString hexByte = SkStringPrintf("%02x", bytes[i]);
+ jsonArray.append(hexByte.c_str());
+ }
+ this->append("rawBytes", jsonArray);
+}
+
void SkJsonWriteBuffer::writeByteArray(const void* data, size_t size) {
Json::Value jsonArray(Json::arrayValue);
const uint8_t* bytes = reinterpret_cast<const uint8_t*>(data);