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

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

Issue 195223003: Fixing SkPicture serialization (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixed nits 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 | « include/core/SkPicture.h ('k') | src/core/SkPicture.cpp » ('j') | no next file with comments »
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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 */ 170 */
171 void setBitmapDecoder(SkPicture::InstallPixelRefProc bitmapDecoder) { 171 void setBitmapDecoder(SkPicture::InstallPixelRefProc bitmapDecoder) {
172 fBitmapDecoder = bitmapDecoder; 172 fBitmapDecoder = bitmapDecoder;
173 } 173 }
174 174
175 // Default impelementations don't check anything. 175 // Default impelementations don't check anything.
176 virtual bool validate(bool isValid) { return true; } 176 virtual bool validate(bool isValid) { return true; }
177 virtual bool isValid() const { return true; } 177 virtual bool isValid() const { return true; }
178 virtual bool validateAvailable(size_t size) { return true; } 178 virtual bool validateAvailable(size_t size) { return true; }
179 179
180 protected:
181 SkReader32 fReader;
182
180 private: 183 private:
181 bool readArray(void* value, size_t size, size_t elementSize); 184 bool readArray(void* value, size_t size, size_t elementSize);
182 185
183 uint32_t fFlags; 186 uint32_t fFlags;
184 187
185 SkReader32 fReader;
186 void* fMemoryPtr; 188 void* fMemoryPtr;
187 189
188 SkBitmapHeapReader* fBitmapStorage; 190 SkBitmapHeapReader* fBitmapStorage;
189 SkTypeface** fTFArray; 191 SkTypeface** fTFArray;
190 int fTFCount; 192 int fTFCount;
191 193
192 SkTDArray<SkFlattenable::Factory>* fFactoryTDArray; 194 SkTDArray<SkFlattenable::Factory>* fFactoryTDArray;
193 SkFlattenable::Factory* fFactoryArray; 195 SkFlattenable::Factory* fFactoryArray;
194 int fFactoryCount; 196 int fFactoryCount;
195 197
196 SkPicture::InstallPixelRefProc fBitmapDecoder; 198 SkPicture::InstallPixelRefProc fBitmapDecoder;
197 199
198 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT 200 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT
199 // Debugging counter to keep track of how many bitmaps we 201 // Debugging counter to keep track of how many bitmaps we
200 // have decoded. 202 // have decoded.
201 int fDecodedBitmapIndex; 203 int fDecodedBitmapIndex;
202 #endif // DEBUG_NON_DETERMINISTIC_ASSERT 204 #endif // DEBUG_NON_DETERMINISTIC_ASSERT
203 }; 205 };
204 206
205 #endif // SkReadBuffer_DEFINED 207 #endif // SkReadBuffer_DEFINED
OLDNEW
« no previous file with comments | « include/core/SkPicture.h ('k') | src/core/SkPicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698