Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: include/core/SkReadBuffer.h

Issue 214413008: Thread picture version through to SkReadBuffer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/core/SkPicture.cpp » ('j') | src/core/SkPicture.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #ifndef SkReadBuffer_DEFINED 9 #ifndef SkReadBuffer_DEFINED
10 #define SkReadBuffer_DEFINED 10 #define SkReadBuffer_DEFINED
(...skipping 22 matching lines...) Expand all
33 #if defined(SK_DEBUG) && defined(SK_BUILD_FOR_MAC) 33 #if defined(SK_DEBUG) && defined(SK_BUILD_FOR_MAC)
34 #define DEBUG_NON_DETERMINISTIC_ASSERT 34 #define DEBUG_NON_DETERMINISTIC_ASSERT
35 #endif 35 #endif
36 36
37 class SkReadBuffer { 37 class SkReadBuffer {
38 public: 38 public:
39 SkReadBuffer(); 39 SkReadBuffer();
40 SkReadBuffer(const void* data, size_t size); 40 SkReadBuffer(const void* data, size_t size);
41 SkReadBuffer(SkStream* stream); 41 SkReadBuffer(SkStream* stream);
42 virtual ~SkReadBuffer(); 42 virtual ~SkReadBuffer();
43 43
reed1 2014/03/27 20:58:14 /** Return the current picture version, or 0 if th
mtklein 2014/03/27 21:02:48 Done.
44 int pictureVersion() const { return fPictureVersion; }
45 void setPictureVersion(int version) { fPictureVersion = version; }
46
44 enum Flags { 47 enum Flags {
45 kCrossProcess_Flag = 1 << 0, 48 kCrossProcess_Flag = 1 << 0,
46 kScalarIsFloat_Flag = 1 << 1, 49 kScalarIsFloat_Flag = 1 << 1,
47 kPtrIs64Bit_Flag = 1 << 2, 50 kPtrIs64Bit_Flag = 1 << 2,
48 kValidation_Flag = 1 << 3, 51 kValidation_Flag = 1 << 3,
49 }; 52 };
50 53
51 void setFlags(uint32_t flags) { fFlags = flags; } 54 void setFlags(uint32_t flags) { fFlags = flags; }
52 uint32_t getFlags() const { return fFlags; } 55 uint32_t getFlags() const { return fFlags; }
53 56
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 virtual bool isValid() const { return true; } 180 virtual bool isValid() const { return true; }
178 virtual bool validateAvailable(size_t size) { return true; } 181 virtual bool validateAvailable(size_t size) { return true; }
179 182
180 protected: 183 protected:
181 SkReader32 fReader; 184 SkReader32 fReader;
182 185
183 private: 186 private:
184 bool readArray(void* value, size_t size, size_t elementSize); 187 bool readArray(void* value, size_t size, size_t elementSize);
185 188
186 uint32_t fFlags; 189 uint32_t fFlags;
190 int fPictureVersion;
187 191
188 void* fMemoryPtr; 192 void* fMemoryPtr;
189 193
190 SkBitmapHeapReader* fBitmapStorage; 194 SkBitmapHeapReader* fBitmapStorage;
191 SkTypeface** fTFArray; 195 SkTypeface** fTFArray;
192 int fTFCount; 196 int fTFCount;
193 197
194 SkTDArray<SkFlattenable::Factory>* fFactoryTDArray; 198 SkTDArray<SkFlattenable::Factory>* fFactoryTDArray;
195 SkFlattenable::Factory* fFactoryArray; 199 SkFlattenable::Factory* fFactoryArray;
196 int fFactoryCount; 200 int fFactoryCount;
197 201
198 SkPicture::InstallPixelRefProc fBitmapDecoder; 202 SkPicture::InstallPixelRefProc fBitmapDecoder;
199 203
200 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT 204 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT
201 // Debugging counter to keep track of how many bitmaps we 205 // Debugging counter to keep track of how many bitmaps we
202 // have decoded. 206 // have decoded.
203 int fDecodedBitmapIndex; 207 int fDecodedBitmapIndex;
204 #endif // DEBUG_NON_DETERMINISTIC_ASSERT 208 #endif // DEBUG_NON_DETERMINISTIC_ASSERT
205 }; 209 };
206 210
207 #endif // SkReadBuffer_DEFINED 211 #endif // SkReadBuffer_DEFINED
OLDNEW
« no previous file with comments | « no previous file | src/core/SkPicture.cpp » ('j') | src/core/SkPicture.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698