| 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 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 * | 35 * |
| 36 * If Install fails or when the SkCachingPixelRef that is | 36 * If Install fails or when the SkCachingPixelRef that is |
| 37 * installed into destination is destroyed, it will call | 37 * installed into destination is destroyed, it will call |
| 38 * SkDELETE() on the generator. Therefore, generator should be | 38 * SkDELETE() on the generator. Therefore, generator should be |
| 39 * allocated with SkNEW() or SkNEW_ARGS(). | 39 * allocated with SkNEW() or SkNEW_ARGS(). |
| 40 */ | 40 */ |
| 41 static bool Install(SkImageGenerator* gen, SkBitmap* dst); | 41 static bool Install(SkImageGenerator* gen, SkBitmap* dst); |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 virtual ~SkCachingPixelRef(); | 44 virtual ~SkCachingPixelRef(); |
| 45 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE; | 45 bool onNewLockPixels(LockRec*) SK_OVERRIDE; |
| 46 virtual void onUnlockPixels() SK_OVERRIDE; | 46 void onUnlockPixels() SK_OVERRIDE; |
| 47 virtual bool onLockPixelsAreWritable() const SK_OVERRIDE { return false; } | 47 bool onLockPixelsAreWritable() const SK_OVERRIDE { return false; } |
| 48 | 48 |
| 49 virtual SkData* onRefEncodedData() SK_OVERRIDE { | 49 SkData* onRefEncodedData() SK_OVERRIDE { |
| 50 return fImageGenerator->refEncodedData(); | 50 return fImageGenerator->refEncodedData(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 SkImageGenerator* const fImageGenerator; | 54 SkImageGenerator* const fImageGenerator; |
| 55 bool fErrorInDecoding; | 55 bool fErrorInDecoding; |
| 56 const size_t fRowBytes; | 56 const size_t fRowBytes; |
| 57 | 57 |
| 58 SkBitmap fLockedBitmap; | 58 SkBitmap fLockedBitmap; |
| 59 | 59 |
| 60 SkCachingPixelRef(const SkImageInfo&, SkImageGenerator*, size_t rowBytes); | 60 SkCachingPixelRef(const SkImageInfo&, SkImageGenerator*, size_t rowBytes); |
| 61 | 61 |
| 62 typedef SkPixelRef INHERITED; | 62 typedef SkPixelRef INHERITED; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 #endif // SkCachingPixelRef_DEFINED | 65 #endif // SkCachingPixelRef_DEFINED |
| OLD | NEW |