aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar fmalita@google.com <fmalita@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-08 14:11:26 +0000
committerGravatar fmalita@google.com <fmalita@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-08 14:11:26 +0000
commit667240a2e8dbe24b805d466e5bd0307ab2898418 (patch)
tree22318b48e719b47442d5e4dd1d2f8d166734a1bb
parente6d8be080dc60e598aafab77a91ead3007d6cee3 (diff)
Relax the assert in SkReadBuffer::setPictureVersion().
I'm hitting this with SkPictureShader serialization because there can be multiple pictures deserialized from the same buffer. I think we can relax the assert to allow setting the same version multiple times. (Alternatively, we could guard all the callers - but since setting the same version is a no-op, that seems overkill) R=mtklein@google.com, reed@google.com Review URL: https://codereview.chromium.org/226743004 git-svn-id: http://skia.googlecode.com/svn/trunk@14089 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--include/core/SkReadBuffer.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/core/SkReadBuffer.h b/include/core/SkReadBuffer.h
index 3befb42512..3cb31a0e80 100644
--- a/include/core/SkReadBuffer.h
+++ b/include/core/SkReadBuffer.h
@@ -46,7 +46,7 @@ public:
/** This may be called at most once; most clients of SkReadBuffer should not mess with it. */
void setPictureVersion(int version) {
- SkASSERT(0 == fPictureVersion);
+ SkASSERT(0 == fPictureVersion || version == fPictureVersion);
fPictureVersion = version;
}