diff options
author | 2014-05-20 17:31:08 +0000 | |
---|---|---|
committer | 2014-05-20 17:31:08 +0000 | |
commit | 7ed173b1ebac84671fb0dc1b9bd323a5e6e63771 (patch) | |
tree | e461dd6d0414900c14138d70ce607fdb2733079d /include/core/SkReadBuffer.h | |
parent | 731b28daaadbea13b071b0de0d95c06058b940fc (diff) |
formalize named picture versions
BUG=skia:
R=mtklein@google.com, robertphillips@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/291913004
git-svn-id: http://skia.googlecode.com/svn/trunk@14807 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkReadBuffer.h')
-rw-r--r-- | include/core/SkReadBuffer.h | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/include/core/SkReadBuffer.h b/include/core/SkReadBuffer.h index dfd92eedc0..4da27d4fe0 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; |