diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-12 16:27:12 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-12 16:27:12 +0000 |
commit | 772d8524cef44f973abde368a69f8d17b55c6d74 (patch) | |
tree | cb16ab90ff6f74885ec858e61d74bff749bf609b /include/core | |
parent | 728f2a62526c8643ba5d234e6f570a4ebd06271a (diff) |
ensure that we call onUnlock only when we onLock succeeded
BUG=
R=halcanary@google.com, scroggo@google.com
Review URL: https://codereview.chromium.org/112783004
git-svn-id: http://skia.googlecode.com/svn/trunk@12642 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkPixelRef.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h index ec4937bea0..d4c35323bb 100644 --- a/include/core/SkPixelRef.h +++ b/include/core/SkPixelRef.h @@ -244,10 +244,15 @@ protected: acquire a mutex for thread safety, so this method need not do that. */ virtual void* onLockPixels(SkColorTable**) = 0; - /** Called when the lock count goes from 1 to 0. The caller will have - already acquire a mutex for thread safety, so this method need not do - that. - */ + + /** + * Called when the lock count goes from 1 to 0. The caller will have + * already acquire a mutex for thread safety, so this method need not do + * that. + * + * If the previous call to onLockPixels failed (i.e. returned NULL), then + * the onUnlockPixels will NOT be called. + */ virtual void onUnlockPixels() = 0; /** Default impl returns true */ |