Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: tests/DrawBitmapRectTest.cpp

Issue 1817383002: switch surface to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/BlurTest.cpp ('k') | tests/DrawFilterTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « tests/BlurTest.cpp ('k') | tests/DrawFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698