diff options
author | Mike Reed <reed@google.com> | 2017-04-12 15:11:02 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-12 19:45:00 +0000 |
commit | 9fa740365215931c8208fe57a55c7ebac1303d95 (patch) | |
tree | faf1880ea26a8062821a07a45779eac83b056143 /include | |
parent | 0f47a25cac5ceaa172f4db1cc50c36868527ff84 (diff) |
locking methods should only be virtual in legacy mode
However, they should not be pure-virtual, otherwise the client can't migrate to the new
api independent of undef-ing the flag.
Bug: skia:6481
Change-Id: I3c9107b145c4c53297891224946b080ce729f9b0
Reviewed-on: https://skia-review.googlesource.com/13272
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkPixelRef.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h index feaef8d1b8..1fd32dde3e 100644 --- a/include/core/SkPixelRef.h +++ b/include/core/SkPixelRef.h @@ -214,6 +214,8 @@ public: protected: #ifdef SK_SUPPORT_LEGACY_NO_ADDR_PIXELREF + virtual +#endif /** * On success, returns true and fills out the LockRec for the pixels. On * failure returns false and ignores the LockRec parameter. @@ -221,8 +223,14 @@ protected: * The caller will have already acquired a mutex for thread safety, so this * method need not do that. */ - virtual bool onNewLockPixels(LockRec*) = 0; + bool onNewLockPixels(LockRec*) { + SkASSERT(false); // should never be called + return true; + } +#ifdef SK_SUPPORT_LEGACY_NO_ADDR_PIXELREF + virtual +#endif /** * Balancing the previous successful call to onNewLockPixels. The locked * pixel address will no longer be referenced, so the subclass is free to @@ -231,16 +239,9 @@ protected: * The caller will have already acquired a mutex for thread safety, so this * method need not do that. */ - virtual void onUnlockPixels() = 0; -#else - bool onNewLockPixels(LockRec*) { - SkASSERT(false); // should never be called - return true; - } void onUnlockPixels() { SkASSERT(false); // should never be called } -#endif // default impl does nothing. virtual void onNotifyPixelsChanged(); |