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
diff --git a/include/core/SkReadBuffer.h b/include/core/SkReadBuffer.h
index 3befb42..3cb31a0 100644
--- a/include/core/SkReadBuffer.h
+++ b/include/core/SkReadBuffer.h
@@ -46,7 +46,7 @@
/** 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;
}