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

Unified Diff: src/core/SkPicturePlayback.cpp

Issue 182153003: Add debug check of chunk size written to skp (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPicturePlayback.cpp
===================================================================
--- src/core/SkPicturePlayback.cpp (revision 13686)
+++ src/core/SkPicturePlayback.cpp (working copy)
@@ -345,6 +345,7 @@
// TODO: write_tag_size should really take a size_t
write_tag_size(stream, SK_PICT_FACTORY_TAG, (uint32_t) size);
+ SkDEBUGCODE(size_t start = stream->bytesWritten());
stream->write32(count);
for (int i = 0; i < count; i++) {
@@ -359,10 +360,10 @@
}
}
-
+ SkASSERT(size == (stream->bytesWritten() - start));
}
-static void writeTypefaces(SkWStream* stream, const SkRefCntSet& rec) {
+static void write_typefaces(SkWStream* stream, const SkRefCntSet& rec) {
int count = rec.count();
write_tag_size(stream, SK_PICT_TYPEFACE_TAG, count);
@@ -428,7 +429,7 @@
// the buffer, since parsing that buffer will require that we already
// have these sets available to use.
write_factories(stream, factSet);
- writeTypefaces(stream, typefaceSet);
+ write_typefaces(stream, typefaceSet);
write_tag_size(stream, SK_PICT_BUFFER_SIZE_TAG, buffer.bytesWritten());
buffer.writeToStream(stream);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698