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

Side by Side Diff: tests/DrawFilterTest.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/DrawBitmapRectTest.cpp ('k') | tests/FrontBufferedStreamTest.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 2015 Google Inc. 2 * Copyright 2015 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkDrawFilter.h" 9 #include "SkDrawFilter.h"
10 #include "SkSurface.h" 10 #include "SkSurface.h"
(...skipping 10 matching lines...) Expand all
21 21
22 /** 22 /**
23 * canvas.setDrawFilter is defined to be local to the save/restore block, such that if you 23 * canvas.setDrawFilter is defined to be local to the save/restore block, such that if you
24 * do the following: save / modify-drawfilter / restore, the current drawfilter should be what 24 * do the following: save / modify-drawfilter / restore, the current drawfilter should be what
25 * it was before the save. 25 * it was before the save.
26 */ 26 */
27 static void test_saverestore(skiatest::Reporter* reporter) { 27 static void test_saverestore(skiatest::Reporter* reporter) {
28 SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(10, 10)); 28 SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(10, 10));
29 SkCanvas* canvas = surface->getCanvas(); 29 SkCanvas* canvas = surface->getCanvas();
30 30
31 31 SkAutoTUnref<TestFilter> df(new TestFilter);
32 SkAutoTUnref<TestFilter> df(SkNEW(TestFilter));
33 32
34 REPORTER_ASSERT(reporter, NULL == canvas->getDrawFilter()); 33 REPORTER_ASSERT(reporter, NULL == canvas->getDrawFilter());
35 34
36 canvas->save(); 35 canvas->save();
37 canvas->setDrawFilter(df); 36 canvas->setDrawFilter(df);
38 REPORTER_ASSERT(reporter, NULL != canvas->getDrawFilter()); 37 REPORTER_ASSERT(reporter, NULL != canvas->getDrawFilter());
39 canvas->restore(); 38 canvas->restore();
40 39
41 REPORTER_ASSERT(reporter, NULL == canvas->getDrawFilter()); 40 REPORTER_ASSERT(reporter, NULL == canvas->getDrawFilter());
42 } 41 }
43 42
44 DEF_TEST(DrawFilter, reporter) { 43 DEF_TEST(DrawFilter, reporter) {
45 test_saverestore(reporter); 44 test_saverestore(reporter);
46 } 45 }
OLDNEW
« no previous file with comments | « tests/DrawBitmapRectTest.cpp ('k') | tests/FrontBufferedStreamTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698