From: benjaminwagner Date: Fri, 22 Jan 2016 17:45:14 +0000 (-0800) Subject: Add SK_SUPPORT_LEGACY_DRAWFILTER guard around calls to SkCanvas::(get|set)DrawFilter. X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~129^2~2443 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c2729c8bbb19ec60a0148e143ae6516faf452d6;p=platform%2Fupstream%2FlibSkiaSharp.git 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 --- diff --git a/gm/drawfilter.cpp b/gm/drawfilter.cpp index cd1bbb0..d17eb4f 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 bd7c325..cd7a418 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 774e85d..2390c74 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 6381a3c..f3e0a77 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