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

Unified Diff: include/core/SkReadBuffer.h

Issue 291913004: formalize named picture versions (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 7 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 | src/core/SkPaint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkReadBuffer.h
diff --git a/include/core/SkReadBuffer.h b/include/core/SkReadBuffer.h
index dfd92eedc0c26d986585d85019af1b27191e2568..4da27d4fe0c6902de0a908a3637ebcfe120d2d48 100644
--- a/include/core/SkReadBuffer.h
+++ b/include/core/SkReadBuffer.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2011 Google Inc.
*
@@ -41,13 +40,25 @@ public:
SkReadBuffer(SkStream* stream);
virtual ~SkReadBuffer();
- /** Return the version of the serialized picture this buffer holds, or 0 if unset. */
- int pictureVersion() const { return fPictureVersion; }
+ enum Version {
+ kFilterLevelIsEnum_Version = 23,
+ kGradientFlippedFlag_Version = 24,
+ kDashWritesPhaseIntervals_Version = 25,
+ kColorShaderNoBool_Version = 26,
+ };
+
+ /**
+ * Returns true IFF the version is older than the specified version.
+ */
+ bool isVersionLT(Version targetVersion) const {
+ SkASSERT(targetVersion > 0);
+ return fVersion > 0 && fVersion < targetVersion;
+ }
/** This may be called at most once; most clients of SkReadBuffer should not mess with it. */
- void setPictureVersion(int version) {
- SkASSERT(0 == fPictureVersion || version == fPictureVersion);
- fPictureVersion = version;
+ void setVersion(int version) {
+ SkASSERT(0 == fVersion || version == fVersion);
+ fVersion = version;
}
enum Flags {
@@ -188,7 +199,7 @@ private:
bool readArray(void* value, size_t size, size_t elementSize);
uint32_t fFlags;
- int fPictureVersion;
+ int fVersion;
void* fMemoryPtr;
« no previous file with comments | « no previous file | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698