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>
This commit is contained in:
parent
45a00cee88
commit
1987366b3c
@ -192,9 +192,6 @@ public:
|
||||
|
||||
bool requestLock(const LockRequest&, LockResult*);
|
||||
|
||||
/** Populates dst with the pixels of this pixelRef, converting them to colorType. */
|
||||
bool readPixels(SkBitmap* dst, SkColorType colorType, const SkIRect* subset = NULL);
|
||||
|
||||
// Register a listener that may be called the next time our generation ID changes.
|
||||
//
|
||||
// We'll only call the listener if we're confident that we are the only SkPixelRef with this
|
||||
@ -247,14 +244,6 @@ protected:
|
||||
/** Default impl returns true */
|
||||
virtual bool onLockPixelsAreWritable() const;
|
||||
|
||||
/**
|
||||
* For pixelrefs that don't have access to their raw pixels, they may be
|
||||
* able to make a copy of them (e.g. if the pixels are on the GPU).
|
||||
*
|
||||
* The base class implementation returns false;
|
||||
*/
|
||||
virtual bool onReadPixels(SkBitmap* dst, SkColorType colorType, const SkIRect* subsetOrNull);
|
||||
|
||||
// default impl does nothing.
|
||||
virtual void onNotifyPixelsChanged();
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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() { }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user