diff options
author | Mike Reed <reed@google.com> | 2017-04-11 15:50:02 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-12 00:12:00 +0000 |
commit | a00f34774712598cdee89b6a6fbdedb68cb9c193 (patch) | |
tree | 508121d63ad1a36a566084b117a7abdb4f29e70e /tests/DrawBitmapRectTest.cpp | |
parent | 921ebe5b736b068182ce5de1ab0e36add06d5e2c (diff) |
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 <fmalita@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'tests/DrawBitmapRectTest.cpp')
-rw-r--r-- | tests/DrawBitmapRectTest.cpp | 41 |
1 files changed, 0 insertions, 41 deletions
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<SkDiscardableMemoryPool> pool( - SkDiscardableMemoryPool::Create(10 * 1000, nullptr)); - - SkBitmap bm; - const SkImageInfo info = SkImageInfo::MakeN32Premul(100, 100); - bm.setInfo(info); - bm.setPixelRef(sk_make_sp<FailurePixelRef>(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); } |