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

Unified Diff: src/core/SkBitmap.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/SkBitmap.cpp
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index 3bb763b4f43cf65f7117dbcdb79cbe8f444b79bb..fa2ddc670bcd09064c536c303de4c6d8b788bb99 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -1100,7 +1100,7 @@ static void write_raw_pixels(SkWriteBuffer* buffer, const SkPixmap& pmap) {
const char* src = (const char*)pmap.addr();
const size_t ramRB = pmap.rowBytes();
- buffer->write32(SkToU32(snugRB));
+ buffer->write32("snugRB", SkToU32(snugRB));
info.flatten(*buffer);
const size_t size = snugRB * info.height();
@@ -1111,27 +1111,27 @@ static void write_raw_pixels(SkWriteBuffer* buffer, const SkPixmap& pmap) {
dst += snugRB;
src += ramRB;
}
- buffer->writeByteArray(storage.get(), size);
+ buffer->writeByteArray("storage", storage.get(), size);
const SkColorTable* ct = pmap.ctable();
if (kIndex_8_SkColorType == info.colorType() && ct) {
- buffer->writeBool(true);
+ buffer->writeBool("hasColorTable", true);
ct->writeToBuffer(*buffer);
} else {
- buffer->writeBool(false);
+ buffer->writeBool("hasColorTable", false);
}
}
void SkBitmap::WriteRawPixels(SkWriteBuffer* buffer, const SkBitmap& bitmap) {
const SkImageInfo info = bitmap.info();
if (0 == info.width() || 0 == info.height() || nullptr == bitmap.pixelRef()) {
- buffer->writeUInt(0); // instead of snugRB, signaling no pixels
+ buffer->writeUInt("snugRB", 0); // instead of snugRB, signaling no pixels
return;
}
SkAutoPixmapUnlock result;
if (!bitmap.requestLock(&result)) {
- buffer->writeUInt(0); // instead of snugRB, signaling no pixels
+ buffer->writeUInt("snugRB", 0); // instead of snugRB, signaling no pixels
return;
}

Powered by Google App Engine
This is Rietveld 408576698