From a00f34774712598cdee89b6a6fbdedb68cb9c193 Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Tue, 11 Apr 2017 15:50:02 -0400 Subject: switch over to no lockPixels in pixelref Bug: skia:6481 Change-Id: I7c32d2e6dcd4c9cd8aa761ac5c4794c916eb650a Reviewed-on: https://skia-review.googlesource.com/13193 Reviewed-by: Florin Malita Reviewed-by: Leon Scroggins Reviewed-by: Matt Sarett Commit-Queue: Mike Reed --- tests/DrawBitmapRectTest.cpp | 41 ----------------------------------------- 1 file changed, 41 deletions(-) (limited to 'tests/DrawBitmapRectTest.cpp') diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp index 62da1c2af8..df410b2b00 100644 --- a/tests/DrawBitmapRectTest.cpp +++ b/tests/DrawBitmapRectTest.cpp @@ -19,46 +19,6 @@ #include "SkSurface.h" #include "Test.h" -class FailurePixelRef : public SkPixelRef { -public: - FailurePixelRef(const SkImageInfo& info) : SkPixelRef(info) {} -protected: - bool onNewLockPixels(LockRec*) override { return false; } - void onUnlockPixels() override {} -}; - -// crbug.com/295895 -// Crashing in skia when a pixelref fails in lockPixels -// -static void test_faulty_pixelref(skiatest::Reporter* reporter) { - // need a cache, but don't expect to use it, so the budget is not critical - sk_sp pool( - SkDiscardableMemoryPool::Create(10 * 1000, nullptr)); - - SkBitmap bm; - const SkImageInfo info = SkImageInfo::MakeN32Premul(100, 100); - bm.setInfo(info); - bm.setPixelRef(sk_make_sp(info), 0, 0); - // now our bitmap has a pixelref, but we know it will fail to lock - - auto surface(SkSurface::MakeRasterN32Premul(200, 200)); - SkCanvas* canvas = surface->getCanvas(); - - const SkFilterQuality levels[] = { - kNone_SkFilterQuality, - kLow_SkFilterQuality, - kMedium_SkFilterQuality, - kHigh_SkFilterQuality, - }; - - SkPaint paint; - canvas->scale(2, 2); // need a scale, otherwise we may ignore filtering - for (size_t i = 0; i < SK_ARRAY_COUNT(levels); ++i) { - paint.setFilterQuality(levels[i]); - canvas->drawBitmap(bm, 0, 0, &paint); - } -} - /////////////////////////////////////////////////////////////////////////////// static void rand_matrix(SkMatrix* mat, SkRandom& rand, unsigned mask) { @@ -308,5 +268,4 @@ DEF_TEST(DrawBitmapRect, reporter) { test_giantrepeat_crbug118018(reporter); test_treatAsSprite(reporter); - test_faulty_pixelref(reporter); } -- cgit v1.2.3