OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 SkLazyPixelRef_DEFINED | 8 #ifndef SkLazyPixelRef_DEFINED |
9 #define SkLazyPixelRef_DEFINED | 9 #define SkLazyPixelRef_DEFINED |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 | 58 |
59 protected: | 59 protected: |
60 virtual void* onLockPixels(SkColorTable**) SK_OVERRIDE; | 60 virtual void* onLockPixels(SkColorTable**) SK_OVERRIDE; |
61 virtual void onUnlockPixels() SK_OVERRIDE; | 61 virtual void onUnlockPixels() SK_OVERRIDE; |
62 virtual bool onLockPixelsAreWritable() const SK_OVERRIDE { return false; } | 62 virtual bool onLockPixelsAreWritable() const SK_OVERRIDE { return false; } |
63 virtual SkData* onRefEncodedData() SK_OVERRIDE; | 63 virtual SkData* onRefEncodedData() SK_OVERRIDE; |
64 virtual bool onImplementsDecodeInto() SK_OVERRIDE; | 64 virtual bool onImplementsDecodeInto() SK_OVERRIDE; |
65 virtual bool onDecodeInto(int pow2, SkBitmap*) SK_OVERRIDE; | 65 virtual bool onDecodeInto(int pow2, SkBitmap*) SK_OVERRIDE; |
66 | 66 |
67 private: | 67 private: |
68 // lazily initialized our cached info. Returns NULL on failure. | |
69 const SkImage::Info* getCachedInfo(); | |
scroggo
2013/10/21 18:49:24
style nit: other fields before methods.
| |
70 | |
68 bool fErrorInDecoding; | 71 bool fErrorInDecoding; |
69 SkData* fData; | 72 SkData* fData; |
70 SkBitmapFactory::DecodeProc fDecodeProc; | 73 SkBitmapFactory::DecodeProc fDecodeProc; |
71 SkImageCache* fImageCache; | 74 SkImageCache* fImageCache; |
72 intptr_t fCacheId; | 75 intptr_t fCacheId; |
73 size_t fRowBytes; | 76 size_t fRowBytes; |
77 SkImage::Info fLazilyCachedInfo; | |
74 | 78 |
75 #if LAZY_CACHE_STATS | 79 #if LAZY_CACHE_STATS |
76 static int32_t gCacheHits; | 80 static int32_t gCacheHits; |
77 static int32_t gCacheMisses; | 81 static int32_t gCacheMisses; |
78 #endif | 82 #endif |
79 | 83 |
80 typedef SkPixelRef INHERITED; | 84 typedef SkPixelRef INHERITED; |
81 }; | 85 }; |
82 | 86 |
83 #endif // SkLazyPixelRef_DEFINED | 87 #endif // SkLazyPixelRef_DEFINED |
OLD | NEW |