Add SK_SUPPORT_LEGACY_DRAWFILTER guard around calls to SkCanvas::(get|set)DrawFilter.
authorbenjaminwagner <benjaminwagner@google.com>
Fri, 22 Jan 2016 17:45:14 +0000 (09:45 -0800)
committerCommit bot <commit-bot@chromium.org>
Fri, 22 Jan 2016 17:45:14 +0000 (09:45 -0800)
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

gm/drawfilter.cpp
tests/CanvasStateTest.cpp
tests/CanvasTest.cpp
tests/DrawFilterTest.cpp

index cd1bbb0..d17eb4f 100644 (file)
@@ -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
index bd7c325..cd7a418 100644 (file)
@@ -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
index 774e85d..2390c74 100644 (file)
@@ -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) ==
index 6381a3c..f3e0a77 100644 (file)
@@ -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