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

Unified Diff: src/core/SkRecorder.cpp

Issue 501533003: Support comment groups in SkRecord. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add unit test Created 6 years, 4 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 | « src/core/SkRecorder.h ('k') | src/core/SkRecords.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRecorder.cpp
diff --git a/src/core/SkRecorder.cpp b/src/core/SkRecorder.cpp
index 2e14c3e25d6c9b6b5a321b92e1d765801d701089..df3e1d8fa51636c1f22a9f39718508cdb076f94b 100644
--- a/src/core/SkRecorder.cpp
+++ b/src/core/SkRecorder.cpp
@@ -82,6 +82,13 @@ char* SkRecorder::copy(const char src[], size_t count) {
return dst;
}
+// As above, assuming and copying a terminating \0.
+template <>
+char* SkRecorder::copy(const char* src) {
+ return this->copy(src, strlen(src)+1);
+}
+
+
void SkRecorder::clear(SkColor color) {
APPEND(Clear, color);
}
@@ -276,3 +283,15 @@ void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
INHERITED(onClipRegion, deviceRgn, op);
APPEND(ClipRegion, this->devBounds(), delay_copy(deviceRgn), op);
}
+
+void SkRecorder::beginCommentGroup(const char* description) {
+ APPEND(BeginCommentGroup, this->copy(description));
+}
+
+void SkRecorder::addComment(const char* key, const char* value) {
+ APPEND(AddComment, this->copy(key), this->copy(value));
+}
+
+void SkRecorder::endCommentGroup() {
+ APPEND(EndCommentGroup);
+}
« no previous file with comments | « src/core/SkRecorder.h ('k') | src/core/SkRecords.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698