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

Side by Side Diff: tests/DrawFilterTest.cpp

Issue 1626543002: Add SK_SUPPORT_LEGACY_DRAWFILTER guard around calls to SkCanvas::(get|set)DrawFilter. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 11 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/CanvasTest.cpp ('k') | no next file » | 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"
11 #include "Test.h" 11 #include "Test.h"
12 12
13 #ifdef SK_SUPPORT_LEGACY_DRAWFILTER
14
13 namespace { 15 namespace {
14 class TestFilter : public SkDrawFilter { 16 class TestFilter : public SkDrawFilter {
15 public: 17 public:
16 bool filter(SkPaint* p, Type) override { 18 bool filter(SkPaint* p, Type) override {
17 return true; 19 return true;
18 } 20 }
19 }; 21 };
20 } 22 }
21 23
22 /** 24 /**
(...skipping 13 matching lines...) Expand all
36 canvas->setDrawFilter(df); 38 canvas->setDrawFilter(df);
37 REPORTER_ASSERT(reporter, nullptr != canvas->getDrawFilter()); 39 REPORTER_ASSERT(reporter, nullptr != canvas->getDrawFilter());
38 canvas->restore(); 40 canvas->restore();
39 41
40 REPORTER_ASSERT(reporter, nullptr == canvas->getDrawFilter()); 42 REPORTER_ASSERT(reporter, nullptr == canvas->getDrawFilter());
41 } 43 }
42 44
43 DEF_TEST(DrawFilter, reporter) { 45 DEF_TEST(DrawFilter, reporter) {
44 test_saverestore(reporter); 46 test_saverestore(reporter);
45 } 47 }
48
49 #endif
OLDNEW
« no previous file with comments | « tests/CanvasTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698