aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2018-06-27 14:46:46 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-12 02:36:44 +0000
commit2c312c4f58f9c151acab8ca2dd0d39fb77c5e74a (patch)
tree527d8ef60903f99e54cc83615a051c8b65e046bb /tests
parent0859252397e0a771669d21d173a8a20f814b7ca0 (diff)
Remove SkDrawFilter.
Change-Id: I0204a9522e828c87bb7c6c20ae34ce51161442af Reviewed-on: https://skia-review.googlesource.com/137895 Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/CanvasStateTest.cpp31
-rw-r--r--tests/DrawFilterTest.cpp51
2 files changed, 0 insertions, 82 deletions
diff --git a/tests/CanvasStateTest.cpp b/tests/CanvasStateTest.cpp
index a1c9df4682..5b3b3f34db 100644
--- a/tests/CanvasStateTest.cpp
+++ b/tests/CanvasStateTest.cpp
@@ -12,7 +12,6 @@
#include "SkClipOpPriv.h"
#include "SkColor.h"
#include "SkCommandLineFlags.h"
-#include "SkDrawFilter.h"
#include "SkImageInfo.h"
#include "SkPaint.h"
#include "SkRRect.h"
@@ -274,36 +273,6 @@ DEF_TEST(CanvasState_test_complex_clips, reporter) {
////////////////////////////////////////////////////////////////////////////////
-#ifdef SK_SUPPORT_LEGACY_DRAWFILTER
-
-class TestDrawFilter : public SkDrawFilter {
-public:
- bool filter(SkPaint*, Type) override { return true; }
-};
-
-DEF_TEST(CanvasState_test_draw_filters, reporter) {
- TestDrawFilter drawFilter;
- SkBitmap bitmap;
- bitmap.allocN32Pixels(10, 10);
- SkCanvas canvas(bitmap);
-
- canvas.setDrawFilter(&drawFilter);
-
- SkCanvasState* state = SkCanvasStateUtils::CaptureCanvasState(&canvas);
- REPORTER_ASSERT(reporter, state);
- std::unique_ptr<SkCanvas> tmpCanvas = SkCanvasStateUtils::MakeFromCanvasState(state);
- REPORTER_ASSERT(reporter, tmpCanvas);
-
- REPORTER_ASSERT(reporter, canvas.getDrawFilter());
- REPORTER_ASSERT(reporter, nullptr == tmpCanvas->getDrawFilter());
-
- SkCanvasStateUtils::ReleaseCanvasState(state);
-}
-
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-
DEF_TEST(CanvasState_test_soft_clips, reporter) {
SkBitmap bitmap;
bitmap.allocN32Pixels(10, 10);
diff --git a/tests/DrawFilterTest.cpp b/tests/DrawFilterTest.cpp
deleted file mode 100644
index ff8fae0316..0000000000
--- a/tests/DrawFilterTest.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkCanvas.h"
-#include "SkDrawFilter.h"
-#include "SkRefCnt.h"
-#include "SkSurface.h"
-#include "Test.h"
-class SkPaint;
-
-#ifdef SK_SUPPORT_LEGACY_DRAWFILTER
-
-namespace {
-class TestFilter : public SkDrawFilter {
-public:
- bool filter(SkPaint* p, Type) override {
- return true;
- }
-};
-}
-
-/**
- * canvas.setDrawFilter is defined to be local to the save/restore block, such that if you
- * do the following: save / modify-drawfilter / restore, the current drawfilter should be what
- * it was before the save.
- */
-static void test_saverestore(skiatest::Reporter* reporter) {
- auto surface(SkSurface::MakeRasterN32Premul(10, 10));
- SkCanvas* canvas = surface->getCanvas();
-
- sk_sp<TestFilter> df(new TestFilter);
-
- REPORTER_ASSERT(reporter, nullptr == canvas->getDrawFilter());
-
- canvas->save();
- canvas->setDrawFilter(df.get());
- REPORTER_ASSERT(reporter, nullptr != canvas->getDrawFilter());
- canvas->restore();
-
- REPORTER_ASSERT(reporter, nullptr == canvas->getDrawFilter());
-}
-
-DEF_TEST(DrawFilter, reporter) {
- test_saverestore(reporter);
-}
-
-#endif