diff options
author | Ben Wagner <bungeman@google.com> | 2018-06-27 14:46:46 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-12 02:36:44 +0000 |
commit | 2c312c4f58f9c151acab8ca2dd0d39fb77c5e74a (patch) | |
tree | 527d8ef60903f99e54cc83615a051c8b65e046bb /gm | |
parent | 0859252397e0a771669d21d173a8a20f814b7ca0 (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 'gm')
-rw-r--r-- | gm/drawfilter.cpp | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/gm/drawfilter.cpp b/gm/drawfilter.cpp deleted file mode 100644 index f054cc5226..0000000000 --- a/gm/drawfilter.cpp +++ /dev/null @@ -1,71 +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 "gm.h" -#include "SkBlurMask.h" -#include "SkCanvas.h" -#include "SkDrawFilter.h" -#include "SkMaskFilter.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. - * If draw filters are working correctly, the first will be blue and blurred, - * the second red and sharp. - */ - -namespace { -class TestFilter : public SkDrawFilter { -public: - bool filter(SkPaint* p, Type) override { - p->setColor(SK_ColorRED); - p->setMaskFilter(nullptr); - return true; - } -}; -} - -class DrawFilterGM : public skiagm::GM { - sk_sp<SkMaskFilter> fBlur; - -protected: - SkISize onISize() override { - return SkISize::Make(320, 240); - } - - SkString onShortName() override { - return SkString("drawfilter"); - } - - void onOnceBeforeDraw() override { - fBlur = SkMaskFilter::MakeBlur(kNormal_SkBlurStyle, - SkBlurMask::ConvertRadiusToSigma(10.0f)); - } - - void onDraw(SkCanvas* canvas) override { - SkPaint p; - p.setColor(SK_ColorBLUE); - p.setMaskFilter(fBlur); - SkRect r = { 20, 20, 100, 100 }; - canvas->setDrawFilter(nullptr); - canvas->drawRect(r, p); - canvas->setDrawFilter(new TestFilter)->unref(); - canvas->translate(120.0f, 40.0f); - canvas->drawRect(r, p); - canvas->setDrawFilter(nullptr); - } - -private: - typedef GM INHERITED; -}; - -DEF_GM( return new DrawFilterGM; ) - -#endif |