| 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 #include "SkCachingPixelRef.h" | 8 #include "SkCachingPixelRef.h" |
| 9 #include "SkScaledImageCache.h" | 9 #include "SkScaledImageCache.h" |
| 10 | 10 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // destroy bitmap. The *only* guarantee that this pointer | 83 // destroy bitmap. The *only* guarantee that this pointer |
| 84 // remains valid is the guarantee made by | 84 // remains valid is the guarantee made by |
| 85 // SkScaledImageCache that it will not destroy the *other* | 85 // SkScaledImageCache that it will not destroy the *other* |
| 86 // bitmap (SkScaledImageCache::Rec.fBitmap) that holds a | 86 // bitmap (SkScaledImageCache::Rec.fBitmap) that holds a |
| 87 // reference to the concrete PixelRef while this record is | 87 // reference to the concrete PixelRef while this record is |
| 88 // locked. | 88 // locked. |
| 89 return pixels; | 89 return pixels; |
| 90 } | 90 } |
| 91 | 91 |
| 92 void SkCachingPixelRef::onUnlockPixels() { | 92 void SkCachingPixelRef::onUnlockPixels() { |
| 93 if (fScaledCacheId != NULL) { | 93 SkASSERT(fScaledCacheId != NULL); |
| 94 SkScaledImageCache::Unlock( | 94 SkScaledImageCache::Unlock( static_cast<SkScaledImageCache::ID*>(fScaledCach
eId)); |
| 95 static_cast<SkScaledImageCache::ID*>(fScaledCacheId)); | 95 fScaledCacheId = NULL; |
| 96 fScaledCacheId = NULL; | |
| 97 } | |
| 98 } | 96 } |
| OLD | NEW |