OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 SkCachingPixelRef_DEFINED | 8 #ifndef SkCachingPixelRef_DEFINED |
9 #define SkCachingPixelRef_DEFINED | 9 #define SkCachingPixelRef_DEFINED |
10 | 10 |
| 11 #include "SkBitmapCache.h" |
11 #include "SkImageInfo.h" | 12 #include "SkImageInfo.h" |
12 #include "SkImageGenerator.h" | 13 #include "SkImageGenerator.h" |
13 #include "SkPixelRef.h" | 14 #include "SkPixelRef.h" |
14 | 15 |
15 class SkColorTable; | 16 class SkColorTable; |
16 | 17 |
17 /** | 18 /** |
18 * PixelRef which defers decoding until SkBitmap::lockPixels() is | 19 * PixelRef which defers decoding until SkBitmap::lockPixels() is |
19 * called. Caches the decoded images in the global | 20 * called. Caches the decoded images in the global |
20 * SkScaledImageCache. When the pixels are unlocked, this cache may | 21 * SkScaledImageCache. When the pixels are unlocked, this cache may |
(...skipping 24 matching lines...) Expand all Loading... |
45 virtual void onUnlockPixels() SK_OVERRIDE; | 46 virtual void onUnlockPixels() SK_OVERRIDE; |
46 virtual bool onLockPixelsAreWritable() const SK_OVERRIDE { return false; } | 47 virtual bool onLockPixelsAreWritable() const SK_OVERRIDE { return false; } |
47 | 48 |
48 virtual SkData* onRefEncodedData() SK_OVERRIDE { | 49 virtual SkData* onRefEncodedData() SK_OVERRIDE { |
49 return fImageGenerator->refEncodedData(); | 50 return fImageGenerator->refEncodedData(); |
50 } | 51 } |
51 | 52 |
52 private: | 53 private: |
53 SkImageGenerator* const fImageGenerator; | 54 SkImageGenerator* const fImageGenerator; |
54 bool fErrorInDecoding; | 55 bool fErrorInDecoding; |
55 void* fScaledCacheId; | |
56 const size_t fRowBytes; | 56 const size_t fRowBytes; |
57 | 57 |
| 58 SkBitmap fLockedBitmap; |
| 59 |
58 SkCachingPixelRef(const SkImageInfo&, SkImageGenerator*, size_t rowBytes); | 60 SkCachingPixelRef(const SkImageInfo&, SkImageGenerator*, size_t rowBytes); |
59 | 61 |
60 typedef SkPixelRef INHERITED; | 62 typedef SkPixelRef INHERITED; |
61 }; | 63 }; |
62 | 64 |
63 #endif // SkCachingPixelRef_DEFINED | 65 #endif // SkCachingPixelRef_DEFINED |
OLD | NEW |