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

Side by Side Diff: tests/DrawBitmapRectTest.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 3 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/DataRefTest.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 16 matching lines...) Expand all
27 }; 27 };
28 28
29 // crbug.com/295895 29 // crbug.com/295895
30 // Crashing in skia when a pixelref fails in lockPixels 30 // Crashing in skia when a pixelref fails in lockPixels
31 // 31 //
32 static void test_faulty_pixelref(skiatest::Reporter* reporter) { 32 static void test_faulty_pixelref(skiatest::Reporter* reporter) {
33 // need a cache, but don't expect to use it, so the budget is not critical 33 // need a cache, but don't expect to use it, so the budget is not critical
34 SkAutoTUnref<SkDiscardableMemoryPool> pool( 34 SkAutoTUnref<SkDiscardableMemoryPool> pool(
35 SkDiscardableMemoryPool::Create(10 * 1000, NULL)); 35 SkDiscardableMemoryPool::Create(10 * 1000, NULL));
36 SkBitmap bm; 36 SkBitmap bm;
37 bool success = SkInstallDiscardablePixelRef(SkNEW(FailureImageGenerator), NU LL, &bm, pool); 37 bool success = SkInstallDiscardablePixelRef(new FailureImageGenerator, NULL, &bm, pool);
38 REPORTER_ASSERT(reporter, success); 38 REPORTER_ASSERT(reporter, success);
39 // now our bitmap has a pixelref, but we know it will fail to lock 39 // now our bitmap has a pixelref, but we know it will fail to lock
40 40
41 SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(200, 200)); 41 SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(200, 200));
42 SkCanvas* canvas = surface->getCanvas(); 42 SkCanvas* canvas = surface->getCanvas();
43 43
44 const SkFilterQuality levels[] = { 44 const SkFilterQuality levels[] = {
45 kNone_SkFilterQuality, 45 kNone_SkFilterQuality,
46 kLow_SkFilterQuality, 46 kLow_SkFilterQuality,
47 kMedium_SkFilterQuality, 47 kMedium_SkFilterQuality,
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 304
305 // ensure that we draw nothing if srcR does not intersect the bitmap 305 // ensure that we draw nothing if srcR does not intersect the bitmap
306 REPORTER_ASSERT(reporter, check_for_all_zeros(dst)); 306 REPORTER_ASSERT(reporter, check_for_all_zeros(dst));
307 307
308 test_nan_antihair(); 308 test_nan_antihair();
309 test_giantrepeat_crbug118018(reporter); 309 test_giantrepeat_crbug118018(reporter);
310 310
311 test_treatAsSprite(reporter); 311 test_treatAsSprite(reporter);
312 test_faulty_pixelref(reporter); 312 test_faulty_pixelref(reporter);
313 } 313 }
OLDNEW
« no previous file with comments | « tests/DataRefTest.cpp ('k') | tests/DrawFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698