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

Unified Diff: src/core/SkTextBlob.cpp

Issue 1911963008: DNC - JSON of flattenables, with field names. Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add names to call sites Created 4 years, 8 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
Index: src/core/SkTextBlob.cpp
diff --git a/src/core/SkTextBlob.cpp b/src/core/SkTextBlob.cpp
index 463312aa6de00b364d64c1b16712760cea38f08d..89bb0d750f3b0609e4048c44a8e8131e6734b3a5 100644
--- a/src/core/SkTextBlob.cpp
+++ b/src/core/SkTextBlob.cpp
@@ -221,23 +221,23 @@ SkTextBlob::~SkTextBlob() {
void SkTextBlob::flatten(SkWriteBuffer& buffer) const {
int runCount = fRunCount;
- buffer.write32(runCount);
- buffer.writeRect(fBounds);
+ buffer.write32("runCount", runCount);
+ buffer.writeRect("fBounds", fBounds);
SkPaint runPaint;
SkTextBlobRunIterator it(this);
while (!it.done()) {
SkASSERT(it.glyphCount() > 0);
- buffer.write32(it.glyphCount());
- buffer.write32(it.positioning());
- buffer.writePoint(it.offset());
+ buffer.write32("glyphCount", it.glyphCount());
+ buffer.write32("positioning", it.positioning());
+ buffer.writePoint("offset", it.offset());
// This should go away when switching to SkFont
it.applyFontToPaint(&runPaint);
- buffer.writePaint(runPaint);
+ buffer.writePaint("runPaint", runPaint);
- buffer.writeByteArray(it.glyphs(), it.glyphCount() * sizeof(uint16_t));
- buffer.writeByteArray(it.pos(),
+ buffer.writeByteArray("glyphs", it.glyphs(), it.glyphCount() * sizeof(uint16_t));
+ buffer.writeByteArray("positions", it.pos(),
it.glyphCount() * sizeof(SkScalar) * ScalarsPerGlyph(it.positioning()));
it.next();

Powered by Google App Engine
This is Rietveld 408576698