diff options
author | Mike Reed <reed@google.com> | 2017-04-20 10:32:02 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-20 15:15:58 +0000 |
commit | ad8b5dc69cd613cc8974999f9e7c94a19eb01fec (patch) | |
tree | f5050988f450990974e41cab7a8a7b0190ca022c /src/core | |
parent | ad5a81b06446a7415cf82e1ef3bce1795cf27830 (diff) |
remove vestigle code for lockpixels
Bug: skia:6481
Change-Id: Icfd53981b8588fbea74fca2e3be58bc6f13ef923
Reviewed-on: https://skia-review.googlesource.com/13968
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkBitmap.cpp | 31 | ||||
-rw-r--r-- | src/core/SkPixelRef.cpp | 31 | ||||
-rw-r--r-- | src/core/SkPixmap.cpp | 12 |
3 files changed, 0 insertions, 74 deletions
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp index 7e3b2c97b3..8f131d15f5 100644 --- a/src/core/SkBitmap.cpp +++ b/src/core/SkBitmap.cpp @@ -994,37 +994,6 @@ void SkBitmap::toString(SkString* str) const { /////////////////////////////////////////////////////////////////////////////// -#ifdef SK_SUPPORT_OBSOLETE_LOCKPIXELS -bool SkBitmap::requestLock(SkAutoPixmapUnlock* result) const { - SkASSERT(result); - - SkPixelRef* pr = fPixelRef.get(); - if (nullptr == pr) { - return false; - } - - // We have to lock the whole thing (using the pixelref's dimensions) until the api supports - // a partial lock (with offset/origin). Hence we can't use our fInfo. - SkPixelRef::LockRequest req = { pr->info().dimensions(), kNone_SkFilterQuality }; - SkPixelRef::LockResult res; - if (pr->requestLock(req, &res)) { - SkASSERT(res.fPixels); - // The bitmap may be a subset of the pixelref's dimensions - SkASSERT(fPixelRefOrigin.x() + fInfo.width() <= res.fSize.width()); - SkASSERT(fPixelRefOrigin.y() + fInfo.height() <= res.fSize.height()); - const void* addr = (const char*)res.fPixels + SkColorTypeComputeOffset(fInfo.colorType(), - fPixelRefOrigin.x(), - fPixelRefOrigin.y(), - res.fRowBytes); - - result->reset(SkPixmap(this->info(), addr, res.fRowBytes, res.fCTable), - res.fUnlockProc, res.fUnlockContext); - return true; - } - return false; -} -#endif - bool SkBitmap::peekPixels(SkPixmap* pmap) const { if (fPixels) { if (pmap) { diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp index 5b562b1ea6..5834b66936 100644 --- a/src/core/SkPixelRef.cpp +++ b/src/core/SkPixelRef.cpp @@ -110,37 +110,6 @@ void SkPixelRef::cloneGenID(const SkPixelRef& that) { SkASSERT(!that. genIDIsUnique()); } -#ifdef SK_SUPPORT_OBSOLETE_LOCKPIXELS -bool SkPixelRef::lockPixels(LockRec* rec) { - if (fPixels) { - rec->fPixels = fPixels; - rec->fRowBytes = fRowBytes; - rec->fColorTable = fCTable.get(); - return true; - } - return false; -} - -bool SkPixelRef::requestLock(const LockRequest& request, LockResult* result) { - SkASSERT(result); - if (request.fSize.isEmpty()) { - return false; - } - // until we support subsets, we have to check this... - if (request.fSize.width() != fInfo.width() || request.fSize.height() != fInfo.height()) { - return false; - } - - result->fUnlockProc = nullptr; - result->fUnlockContext = nullptr; - result->fCTable = fCTable.get(); - result->fPixels = fPixels; - result->fRowBytes = fRowBytes; - result->fSize.set(fInfo.width(), fInfo.height()); - return true; -} -#endif - uint32_t SkPixelRef::getGenerationID() const { uint32_t id = fTaggedGenID.load(); if (0 == id) { diff --git a/src/core/SkPixmap.cpp b/src/core/SkPixmap.cpp index 4d482181a5..02090b77c6 100644 --- a/src/core/SkPixmap.cpp +++ b/src/core/SkPixmap.cpp @@ -20,18 +20,6 @@ #include "SkSurface.h" #include "SkUtils.h" -#ifdef SK_SUPPORT_OBSOLETE_LOCKPIXELS -void SkAutoPixmapUnlock::reset(const SkPixmap& pm, void (*unlock)(void*), void* ctx) { - SkASSERT(pm.addr() != nullptr); - - this->unlock(); - fPixmap = pm; - fUnlockProc = unlock; - fUnlockContext = ctx; - fIsLocked = true; -} -#endif - ///////////////////////////////////////////////////////////////////////////////////////////////// void SkPixmap::reset() { |