aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar benjaminwagner <benjaminwagner@google.com>2016-01-22 09:45:14 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-22 09:45:14 -0800
commit1c2729c8bbb19ec60a0148e143ae6516faf452d6 (patch)
tree947082d4d1970065119b2ac58d657e034a83a001
parentf5b87908cd98aac189070866dc662d69edbb0f71 (diff)
Add SK_SUPPORT_LEGACY_DRAWFILTER guard around calls to SkCanvas::(get|set)DrawFilter.
Fixes Google3 dm build. (Can't enable SK_INTERNAL for Google3 dm without enabling it for all dependents.) GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1626543002 Review URL: https://codereview.chromium.org/1626543002
-rw-r--r--gm/drawfilter.cpp3
-rw-r--r--tests/CanvasStateTest.cpp4
-rw-r--r--tests/CanvasTest.cpp3
-rw-r--r--tests/DrawFilterTest.cpp4
4 files changed, 14 insertions, 0 deletions
diff --git a/gm/drawfilter.cpp b/gm/drawfilter.cpp
index cd1bbb0c16..d17eb4f52f 100644
--- a/gm/drawfilter.cpp
+++ b/gm/drawfilter.cpp
@@ -12,6 +12,8 @@
#include "SkDrawFilter.h"
#include "SkPaint.h"
+#ifdef SK_SUPPORT_LEGACY_DRAWFILTER
+
/**
* Initial test coverage for SkDrawFilter.
* Draws two rectangles; if draw filters are broken, they will match.
@@ -70,3 +72,4 @@ private:
DEF_GM( return new DrawFilterGM; )
+#endif
diff --git a/tests/CanvasStateTest.cpp b/tests/CanvasStateTest.cpp
index bd7c325ca2..cd7a4184eb 100644
--- a/tests/CanvasStateTest.cpp
+++ b/tests/CanvasStateTest.cpp
@@ -262,6 +262,8 @@ DEF_TEST(CanvasState_test_complex_clips, reporter) {
////////////////////////////////////////////////////////////////////////////////
+#ifdef SK_SUPPORT_LEGACY_DRAWFILTER
+
class TestDrawFilter : public SkDrawFilter {
public:
bool filter(SkPaint*, Type) override { return true; }
@@ -287,6 +289,8 @@ DEF_TEST(CanvasState_test_draw_filters, reporter) {
SkCanvasStateUtils::ReleaseCanvasState(state);
}
+#endif
+
////////////////////////////////////////////////////////////////////////////////
// we need this function to prevent SkError from printing to stdout
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index 774e85d242..2390c7455f 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -515,8 +515,11 @@ static void AssertCanvasStatesEqual(skiatest::Reporter* reporter, const TestData
REPORTER_ASSERT_MESSAGE(reporter, bounds1 == bounds2,
testStep->assertMessage());
+#ifdef SK_SUPPORT_LEGACY_DRAWFILTER
REPORTER_ASSERT_MESSAGE(reporter, canvas1->getDrawFilter() ==
canvas2->getDrawFilter(), testStep->assertMessage());
+#endif
+
SkIRect deviceBounds1, deviceBounds2;
REPORTER_ASSERT_MESSAGE(reporter,
canvas1->getClipDeviceBounds(&deviceBounds1) ==
diff --git a/tests/DrawFilterTest.cpp b/tests/DrawFilterTest.cpp
index 6381a3c8fa..f3e0a77306 100644
--- a/tests/DrawFilterTest.cpp
+++ b/tests/DrawFilterTest.cpp
@@ -10,6 +10,8 @@
#include "SkSurface.h"
#include "Test.h"
+#ifdef SK_SUPPORT_LEGACY_DRAWFILTER
+
namespace {
class TestFilter : public SkDrawFilter {
public:
@@ -43,3 +45,5 @@ static void test_saverestore(skiatest::Reporter* reporter) {
DEF_TEST(DrawFilter, reporter) {
test_saverestore(reporter);
}
+
+#endif