Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: tools/debugger/SkJsonWriteBuffer.cpp

Issue 2334123003: Add SkColor4f serialization (Closed)
Patch Set: Switched to memcpy, rebased Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/debugger/SkJsonWriteBuffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/debugger/SkJsonWriteBuffer.cpp
diff --git a/tools/debugger/SkJsonWriteBuffer.cpp b/tools/debugger/SkJsonWriteBuffer.cpp
index 1b5a962e670c72a9f7c6286ac8ce79070f2f713d..4b075dd2f2404bed70de464c639ed401970b47f2 100644
--- a/tools/debugger/SkJsonWriteBuffer.cpp
+++ b/tools/debugger/SkJsonWriteBuffer.cpp
@@ -83,6 +83,18 @@ void SkJsonWriteBuffer::writeColorArray(const SkColor* color, uint32_t count) {
this->append("colorArray", jsonArray);
}
+void SkJsonWriteBuffer::writeColor4f(const SkColor4f& color) {
+ this->append("color", SkDrawCommand::MakeJsonColor4f(color));
+}
+
+void SkJsonWriteBuffer::writeColor4fArray(const SkColor4f* color, uint32_t count) {
+ Json::Value jsonArray(Json::arrayValue);
+ for (uint32_t i = 0; i < count; ++i) {
+ jsonArray.append(SkDrawCommand::MakeJsonColor4f(color[i]));
+ }
+ this->append("colorArray", jsonArray);
+}
+
void SkJsonWriteBuffer::writePoint(const SkPoint& point) {
this->append("point", SkDrawCommand::MakeJsonPoint(point));
}
« no previous file with comments | « tools/debugger/SkJsonWriteBuffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698