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

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

Issue 1343703005: SkImageSource (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: review comments Created 5 years, 3 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 | « src/core/SkPictureData.cpp ('k') | src/core/SkReadBuffer.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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * 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
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkReadBuffer_DEFINED 8 #ifndef SkReadBuffer_DEFINED
9 #define SkReadBuffer_DEFINED 9 #define SkReadBuffer_DEFINED
10 10
11 #include "SkBitmapHeap.h" 11 #include "SkBitmapHeap.h"
12 #include "SkColorFilter.h" 12 #include "SkColorFilter.h"
13 #include "SkData.h" 13 #include "SkData.h"
14 #include "SkDrawLooper.h" 14 #include "SkDrawLooper.h"
15 #include "SkImageFilter.h" 15 #include "SkImageFilter.h"
16 #include "SkMaskFilter.h" 16 #include "SkMaskFilter.h"
17 #include "SkPath.h" 17 #include "SkPath.h"
18 #include "SkPathEffect.h" 18 #include "SkPathEffect.h"
19 #include "SkPicture.h" 19 #include "SkPicture.h"
20 #include "SkRasterizer.h" 20 #include "SkRasterizer.h"
21 #include "SkReadBuffer.h" 21 #include "SkReadBuffer.h"
22 #include "SkReader32.h" 22 #include "SkReader32.h"
23 #include "SkRefCnt.h" 23 #include "SkRefCnt.h"
24 #include "SkShader.h" 24 #include "SkShader.h"
25 #include "SkWriteBuffer.h" 25 #include "SkWriteBuffer.h"
26 #include "SkXfermode.h" 26 #include "SkXfermode.h"
27 27
28 class SkBitmap; 28 class SkBitmap;
29 class SkImage;
29 30
30 #if defined(SK_DEBUG) && defined(SK_BUILD_FOR_MAC) 31 #if defined(SK_DEBUG) && defined(SK_BUILD_FOR_MAC)
31 #define DEBUG_NON_DETERMINISTIC_ASSERT 32 #define DEBUG_NON_DETERMINISTIC_ASSERT
32 #endif 33 #endif
33 34
34 class SkReadBuffer { 35 class SkReadBuffer {
35 public: 36 public:
36 SkReadBuffer(); 37 SkReadBuffer();
37 SkReadBuffer(const void* data, size_t size); 38 SkReadBuffer(const void* data, size_t size);
38 SkReadBuffer(SkStream* stream); 39 SkReadBuffer(SkStream* stream);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 163
163 // helpers to get info about arrays and binary data 164 // helpers to get info about arrays and binary data
164 virtual uint32_t getArrayCount(); 165 virtual uint32_t getArrayCount();
165 166
166 /** 167 /**
167 * Returns false if the bitmap could not be completely read. In that case, it will be set 168 * Returns false if the bitmap could not be completely read. In that case, it will be set
168 * to have width/height, but no pixels. 169 * to have width/height, but no pixels.
169 */ 170 */
170 bool readBitmap(SkBitmap* bitmap); 171 bool readBitmap(SkBitmap* bitmap);
171 172
173 SkImage* readImage();
174
172 virtual SkTypeface* readTypeface(); 175 virtual SkTypeface* readTypeface();
173 176
174 void setBitmapStorage(SkBitmapHeapReader* bitmapStorage) { 177 void setBitmapStorage(SkBitmapHeapReader* bitmapStorage) {
175 SkRefCnt_SafeAssign(fBitmapStorage, bitmapStorage); 178 SkRefCnt_SafeAssign(fBitmapStorage, bitmapStorage);
176 } 179 }
177 180
178 void setTypefaceArray(SkTypeface* array[], int count) { 181 void setTypefaceArray(SkTypeface* array[], int count) {
179 fTFArray = array; 182 fTFArray = array;
180 fTFCount = count; 183 fTFCount = count;
181 } 184 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 SkPicture::InstallPixelRefProc fBitmapDecoder; 240 SkPicture::InstallPixelRefProc fBitmapDecoder;
238 241
239 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT 242 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT
240 // Debugging counter to keep track of how many bitmaps we 243 // Debugging counter to keep track of how many bitmaps we
241 // have decoded. 244 // have decoded.
242 int fDecodedBitmapIndex; 245 int fDecodedBitmapIndex;
243 #endif // DEBUG_NON_DETERMINISTIC_ASSERT 246 #endif // DEBUG_NON_DETERMINISTIC_ASSERT
244 }; 247 };
245 248
246 #endif // SkReadBuffer_DEFINED 249 #endif // SkReadBuffer_DEFINED
OLDNEW
« no previous file with comments | « src/core/SkPictureData.cpp ('k') | src/core/SkReadBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698