| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkData.h" | 10 #include "SkData.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // need a cache, but don't expect to use it, so the budget is not critical | 34 // need a cache, but don't expect to use it, so the budget is not critical |
| 35 SkAutoTUnref<SkDiscardableMemoryPool> pool( | 35 SkAutoTUnref<SkDiscardableMemoryPool> pool( |
| 36 SkDiscardableMemoryPool::Create(10 * 1000, nullptr)); | 36 SkDiscardableMemoryPool::Create(10 * 1000, nullptr)); |
| 37 | 37 |
| 38 SkBitmap bm; | 38 SkBitmap bm; |
| 39 const SkImageInfo info = SkImageInfo::MakeN32Premul(100, 100); | 39 const SkImageInfo info = SkImageInfo::MakeN32Premul(100, 100); |
| 40 bm.setInfo(info); | 40 bm.setInfo(info); |
| 41 bm.setPixelRef(new FailurePixelRef(info), 0, 0)->unref(); | 41 bm.setPixelRef(new FailurePixelRef(info), 0, 0)->unref(); |
| 42 // now our bitmap has a pixelref, but we know it will fail to lock | 42 // now our bitmap has a pixelref, but we know it will fail to lock |
| 43 | 43 |
| 44 SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(200, 200)); | 44 auto surface(SkSurface::MakeRasterN32Premul(200, 200)); |
| 45 SkCanvas* canvas = surface->getCanvas(); | 45 SkCanvas* canvas = surface->getCanvas(); |
| 46 | 46 |
| 47 const SkFilterQuality levels[] = { | 47 const SkFilterQuality levels[] = { |
| 48 kNone_SkFilterQuality, | 48 kNone_SkFilterQuality, |
| 49 kLow_SkFilterQuality, | 49 kLow_SkFilterQuality, |
| 50 kMedium_SkFilterQuality, | 50 kMedium_SkFilterQuality, |
| 51 kHigh_SkFilterQuality, | 51 kHigh_SkFilterQuality, |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 SkPaint paint; | 54 SkPaint paint; |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 | 303 |
| 304 // ensure that we draw nothing if srcR does not intersect the bitmap | 304 // ensure that we draw nothing if srcR does not intersect the bitmap |
| 305 REPORTER_ASSERT(reporter, check_for_all_zeros(dst)); | 305 REPORTER_ASSERT(reporter, check_for_all_zeros(dst)); |
| 306 | 306 |
| 307 test_nan_antihair(); | 307 test_nan_antihair(); |
| 308 test_giantrepeat_crbug118018(reporter); | 308 test_giantrepeat_crbug118018(reporter); |
| 309 | 309 |
| 310 test_treatAsSprite(reporter); | 310 test_treatAsSprite(reporter); |
| 311 test_faulty_pixelref(reporter); | 311 test_faulty_pixelref(reporter); |
| 312 } | 312 } |
| OLD | NEW |