diff options
author | 2017-04-05 13:36:08 -0400 | |
---|---|---|
committer | 2017-04-05 18:13:05 +0000 | |
commit | 1987366b3c0a9dd9280620e62e0edb7d5087a828 (patch) | |
tree | f44e82f97f6eb3111f0220006a4ce334317e8eb1 /src | |
parent | 45a00cee88c0ea8ea175694cb94b26748713fe36 (diff) |
Delete SkPixelRef::readPixels()
Nobody calls this or overrides this.
Bug: skia:
Change-Id: I6235e4c7bcdc45523ce7f63842635c79e00d2dc4
Reviewed-on: https://skia-review.googlesource.com/11357
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkBitmap.cpp | 35 | ||||
-rw-r--r-- | src/core/SkPixelRef.cpp | 7 |
2 files changed, 1 insertions, 41 deletions
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp index df3b24ed11..151650540b 100644 --- a/src/core/SkBitmap.cpp +++ b/src/core/SkBitmap.cpp @@ -730,41 +730,8 @@ bool SkBitmap::copyTo(SkBitmap* dst, SkColorType dstColorType, Allocator* alloc) return false; } - // if we have a texture, first get those pixels - SkBitmap tmpSrc; - const SkBitmap* src = this; - - if (fPixelRef) { - SkIRect subset; - subset.setXYWH(fPixelRefOrigin.fX, fPixelRefOrigin.fY, - fInfo.width(), fInfo.height()); - if (fPixelRef->readPixels(&tmpSrc, dstColorType, &subset)) { - if (fPixelRef->info().alphaType() == kUnpremul_SkAlphaType) { - // FIXME: The only meaningful implementation of readPixels - // (GrPixelRef) assumes premultiplied pixels. - return false; - } - SkASSERT(tmpSrc.width() == this->width()); - SkASSERT(tmpSrc.height() == this->height()); - - // did we get lucky and we can just return tmpSrc? - if (tmpSrc.colorType() == dstColorType && nullptr == alloc) { - dst->swap(tmpSrc); - // If the result is an exact copy, clone the gen ID. - SkPixelRef* dstPixelRef = dst->pixelRef(); - if (!dstPixelRef && dstPixelRef->info() == fPixelRef->info()) { - dstPixelRef->cloneGenID(*fPixelRef); - } - return true; - } - - // fall through to the raster case - src = &tmpSrc; - } - } - SkAutoPixmapUnlock srcUnlocker; - if (!src->requestLock(&srcUnlocker)) { + if (!this->requestLock(&srcUnlocker)) { return false; } SkPixmap srcPM = srcUnlocker.pixmap(); diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp index 18cb4d2cb6..5e459d3db3 100644 --- a/src/core/SkPixelRef.cpp +++ b/src/core/SkPixelRef.cpp @@ -307,15 +307,8 @@ void SkPixelRef::restoreMutability() { fMutability = kMutable; } -bool SkPixelRef::readPixels(SkBitmap* dst, SkColorType ct, const SkIRect* subset) { - return this->onReadPixels(dst, ct, subset); -} - /////////////////////////////////////////////////////////////////////////////////////////////////// -bool SkPixelRef::onReadPixels(SkBitmap* dst, SkColorType, const SkIRect* subset) { - return false; -} void SkPixelRef::onNotifyPixelsChanged() { } |