Delete SkMakeImageFromPixelRef
authorMatt Sarett <msarett@google.com>
Thu, 5 Jan 2017 14:32:11 +0000 (09:32 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Thu, 5 Jan 2017 16:33:21 +0000 (16:33 +0000)
There are no callers.

BUG=skia:

Change-Id: Ie743fc61cc0a0ca755d4e3fdab8a5985fa35fbd3
Reviewed-on: https://skia-review.googlesource.com/6598
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

src/core/SkImagePriv.h
src/image/SkImage_Raster.cpp

index 5b470e20924d7522c68c0e5e097e7e2ffd97db6e..1d197147171c63f6da36f4b6e0e4944c132d5c5a 100644 (file)
@@ -33,11 +33,6 @@ sk_sp<SkShader> 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<SkImage> 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.
index afd5f903908709fa71ade4c319a3f07cae1779ea..cce1ed20c504d17d65726e7dcf7002bc8da2d3e1 100644 (file)
@@ -92,9 +92,6 @@ public:
                             sk_sp<SkColorSpace>*) const override;
     sk_sp<SkImage> 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<SkData> 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> SkImage::MakeFromRaster(const SkPixmap& pmap, RasterReleaseProc p
     return sk_make_sp<SkImage_Raster>(pmap.info(), std::move(data), pmap.rowBytes(), pmap.ctable());
 }
 
-sk_sp<SkImage> 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<SkImage_Raster>(info, pr, pixelRefOrigin, rowBytes);
-}
-
 sk_sp<SkImage> SkMakeImageFromRasterBitmap(const SkBitmap& bm, SkCopyPixelsMode cpm,
                                            SkTBlitterAllocator* allocator) {
     bool hasColorTable = false;