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
This commit is contained in:
fmalita@google.com 2014-04-08 14:11:26 +00:00
parent e6d8be080d
commit 667240a2e8

View File

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