OLD | NEW |
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 Loading... |
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 |
OLD | NEW |