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; |