diff --git a/src/core/SkAutoPixmapStorage.cpp b/src/core/SkAutoPixmapStorage.cpp index 3be28a94c4..c0e9c3c8c4 100644 --- a/src/core/SkAutoPixmapStorage.cpp +++ b/src/core/SkAutoPixmapStorage.cpp @@ -58,7 +58,3 @@ const SkData* SkAutoPixmapStorage::detachPixelsAsData() { return data.release(); } -void SkAutoPixmapStorage::release() { - fStorage = nullptr; - this->INHERITED::reset(); -} diff --git a/src/core/SkAutoPixmapStorage.h b/src/core/SkAutoPixmapStorage.h index 4379b13d24..1a07a9773a 100644 --- a/src/core/SkAutoPixmapStorage.h +++ b/src/core/SkAutoPixmapStorage.h @@ -46,14 +46,6 @@ public: */ const SkData* SK_WARN_UNUSED_RESULT detachPixelsAsData(); - /** - * Whereas 'reset' frees the backing memory and then clears the SkPixmap, - * this entry point disowns the backing memory before clearing so the memory - * isn't freed. It can be used when the Pixmap has been installed into - * an SkBitmap and the SkBitmap should manage the memory's lifetime. - */ - void release(); - // We wrap these so we can clear our internal storage void reset() { diff --git a/tests/SpecialImageTest.cpp b/tests/SpecialImageTest.cpp index 432adc8327..bd07115dbf 100644 --- a/tests/SpecialImageTest.cpp +++ b/tests/SpecialImageTest.cpp @@ -183,23 +183,10 @@ DEF_TEST(SpecialImage_Pixmap, reporter) { pixmap.erase(SK_ColorRED, subset); { - // The SkAutoPixmapStorage keeps hold of the memory sk_sp img(SkSpecialImage::MakeFromPixmap(nullptr, subset, pixmap, nullptr, nullptr)); test_image(img, reporter, true, false, kPad, kFullSize); } - - { - // The image takes ownership of the memory - sk_sp img(SkSpecialImage::MakeFromPixmap( - nullptr, subset, pixmap, - [] (void* addr, void*) -> void { - sk_free(addr); - }, - nullptr)); - pixmap.release(); - test_image(img, reporter, true, false, kPad, kFullSize); - } }