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

Unified Diff: src/core/SkStream.cpp

Issue 182733008: Switch the factory chunk in the skps to storing its size in bytes (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Added comment Created 6 years, 10 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/SkPicturePlayback.cpp ('k') | src/utils/SkMD5.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkStream.cpp
===================================================================
--- src/core/SkStream.cpp (revision 13672)
+++ src/core/SkStream.cpp (working copy)
@@ -140,6 +140,15 @@
return this->write(&value, sizeof(value));
}
+int SkWStream::SizeOfPackedUInt(size_t value) {
+ if (value <= SK_MAX_BYTE_FOR_U8) {
+ return 1;
+ } else if (value <= 0xFFFF) {
+ return 3;
+ }
+ return 5;
+}
+
bool SkWStream::writePackedUInt(size_t value) {
uint8_t data[5];
size_t len = 1;
« no previous file with comments | « src/core/SkPicturePlayback.cpp ('k') | src/utils/SkMD5.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698