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

Side by Side Diff: src/lazy/SkCachingPixelRef.cpp

Issue 108613005: Ensure we call onUnlock only if onLock succeeded (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « src/images/SkImageRef_ashmem.cpp ('k') | src/lazy/SkDiscardablePixelRef.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 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
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 }
OLDNEW
« no previous file with comments | « src/images/SkImageRef_ashmem.cpp ('k') | src/lazy/SkDiscardablePixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698