From ac1f09d53bfe8b99ae7ac82b54e3911258b07b6a Mon Sep 17 00:00:00 2001 From: Matt Sarett Date: Thu, 5 Jan 2017 09:32:11 -0500 Subject: [PATCH] Delete SkMakeImageFromPixelRef There are no callers. BUG=skia: Change-Id: Ie743fc61cc0a0ca755d4e3fdab8a5985fa35fbd3 Reviewed-on: https://skia-review.googlesource.com/6598 Reviewed-by: Mike Reed Commit-Queue: Matt Sarett --- src/core/SkImagePriv.h | 5 ----- src/image/SkImage_Raster.cpp | 21 --------------------- 2 files changed, 26 deletions(-) diff --git a/src/core/SkImagePriv.h b/src/core/SkImagePriv.h index 5b470e2..1d19714 100644 --- a/src/core/SkImagePriv.h +++ b/src/core/SkImagePriv.h @@ -33,11 +33,6 @@ sk_sp SkMakeBitmapShader(const SkBitmap& src, SkShader::TileMode, SkSh const SkMatrix* localMatrix, SkCopyPixelsMode, SkTBlitterAllocator* alloc); -// Call this if you explicitly want to use/share this pixelRef in the image -extern sk_sp SkMakeImageFromPixelRef(const SkImageInfo&, SkPixelRef*, - const SkIPoint& pixelRefOrigin, - size_t rowBytes); - /** * Examines the bitmap to decide if it can share the existing pixelRef, or * if it needs to make a deep-copy of the pixels. diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp index afd5f90..cce1ed2 100644 --- a/src/image/SkImage_Raster.cpp +++ b/src/image/SkImage_Raster.cpp @@ -92,9 +92,6 @@ public: sk_sp*) const override; sk_sp onMakeSubset(const SkIRect&) const override; - // exposed for SkSurface_Raster via SkNewImageFromPixelRef - SkImage_Raster(const SkImageInfo&, SkPixelRef*, const SkIPoint& origin, size_t rowBytes); - SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const override; @@ -153,16 +150,6 @@ SkImage_Raster::SkImage_Raster(const Info& info, sk_sp data, size_t rowB fBitmap.lockPixels(); } -SkImage_Raster::SkImage_Raster(const Info& info, SkPixelRef* pr, const SkIPoint& pixelRefOrigin, - size_t rowBytes) - : INHERITED(info.width(), info.height(), pr->getGenerationID()) -{ - fBitmap.setInfo(info, rowBytes); - fBitmap.setPixelRef(sk_ref_sp(pr), pixelRefOrigin.x(), pixelRefOrigin.y()); - fBitmap.lockPixels(); - SkASSERT(fBitmap.isImmutable()); -} - SkImage_Raster::~SkImage_Raster() { #if SK_SUPPORT_GPU SkASSERT(nullptr == fPinnedTexture.get()); // want the caller to have manually unpinned @@ -313,14 +300,6 @@ sk_sp SkImage::MakeFromRaster(const SkPixmap& pmap, RasterReleaseProc p return sk_make_sp(pmap.info(), std::move(data), pmap.rowBytes(), pmap.ctable()); } -sk_sp SkMakeImageFromPixelRef(const SkImageInfo& info, SkPixelRef* pr, - const SkIPoint& pixelRefOrigin, size_t rowBytes) { - if (!SkImage_Raster::ValidArgs(info, rowBytes, false, nullptr)) { - return nullptr; - } - return sk_make_sp(info, pr, pixelRefOrigin, rowBytes); -} - sk_sp SkMakeImageFromRasterBitmap(const SkBitmap& bm, SkCopyPixelsMode cpm, SkTBlitterAllocator* allocator) { bool hasColorTable = false; -- 2.7.4