Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 | |
| 2 /* | 1 /* |
| 3 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 4 * | 3 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 7 */ | 6 */ |
| 8 | 7 |
| 9 #ifndef SkReadBuffer_DEFINED | 8 #ifndef SkReadBuffer_DEFINED |
| 10 #define SkReadBuffer_DEFINED | 9 #define SkReadBuffer_DEFINED |
| 11 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 33 #if defined(SK_DEBUG) && defined(SK_BUILD_FOR_MAC) | 32 #if defined(SK_DEBUG) && defined(SK_BUILD_FOR_MAC) |
| 34 #define DEBUG_NON_DETERMINISTIC_ASSERT | 33 #define DEBUG_NON_DETERMINISTIC_ASSERT |
| 35 #endif | 34 #endif |
| 36 | 35 |
| 37 class SkReadBuffer { | 36 class SkReadBuffer { |
| 38 public: | 37 public: |
| 39 SkReadBuffer(); | 38 SkReadBuffer(); |
| 40 SkReadBuffer(const void* data, size_t size); | 39 SkReadBuffer(const void* data, size_t size); |
| 41 SkReadBuffer(SkStream* stream); | 40 SkReadBuffer(SkStream* stream); |
| 42 virtual ~SkReadBuffer(); | 41 virtual ~SkReadBuffer(); |
| 43 | 42 |
|
robertphillips
2014/05/20 12:34:06
Remove these two lines?
reed1
2014/05/20 17:21:57
Done.
| |
| 44 /** Return the version of the serialized picture this buffer holds, or 0 if unset. */ | 43 /** Return the version of the serialized picture this buffer holds, or 0 if unset. */ |
| 45 int pictureVersion() const { return fPictureVersion; } | 44 // int pictureVersion() const { return fPictureVersion; } |
| 45 | |
|
robertphillips
2014/05/20 12:34:06
intended ?
users ?
reed1
2014/05/20 17:21:57
Done.
| |
| 46 // Just indended for internal uses who query pictureVersionLT() | |
| 47 enum PictureVersion { | |
| 48 kFilterLevelIsEnum_PictureVersion = 23, | |
| 49 kGradientFlippedFlag_PictureVersion = 24, | |
| 50 kDashWritesPhaseIntervals_PictureVersion = 25, | |
| 51 kColorShaderNoBool_PictureVersion = 26, | |
| 52 }; | |
| 53 | |
| 54 /** | |
|
robertphillips
2014/05/20 12:34:06
Returns ?
reed1
2014/05/20 17:21:57
Done.
| |
| 55 * Retruns true IFF the picture version is older than the specified version . | |
| 56 */ | |
| 57 bool pictureVersionLT(PictureVersion targetVersion) const { | |
| 58 SkASSERT(targetVersion > 0); | |
| 59 return fPictureVersion > 0 && fPictureVersion < targetVersion; | |
| 60 } | |
| 46 | 61 |
| 47 /** This may be called at most once; most clients of SkReadBuffer should not mess with it. */ | 62 /** This may be called at most once; most clients of SkReadBuffer should not mess with it. */ |
| 48 void setPictureVersion(int version) { | 63 void setPictureVersion(int version) { |
| 49 SkASSERT(0 == fPictureVersion || version == fPictureVersion); | 64 SkASSERT(0 == fPictureVersion || version == fPictureVersion); |
| 50 fPictureVersion = version; | 65 fPictureVersion = version; |
| 51 } | 66 } |
| 52 | 67 |
| 53 enum Flags { | 68 enum Flags { |
| 54 kCrossProcess_Flag = 1 << 0, | 69 kCrossProcess_Flag = 1 << 0, |
| 55 kScalarIsFloat_Flag = 1 << 1, | 70 kScalarIsFloat_Flag = 1 << 1, |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 203 SkPicture::InstallPixelRefProc fBitmapDecoder; | 218 SkPicture::InstallPixelRefProc fBitmapDecoder; |
| 204 | 219 |
| 205 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT | 220 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT |
| 206 // Debugging counter to keep track of how many bitmaps we | 221 // Debugging counter to keep track of how many bitmaps we |
| 207 // have decoded. | 222 // have decoded. |
| 208 int fDecodedBitmapIndex; | 223 int fDecodedBitmapIndex; |
| 209 #endif // DEBUG_NON_DETERMINISTIC_ASSERT | 224 #endif // DEBUG_NON_DETERMINISTIC_ASSERT |
| 210 }; | 225 }; |
| 211 | 226 |
| 212 #endif // SkReadBuffer_DEFINED | 227 #endif // SkReadBuffer_DEFINED |
| OLD | NEW |