| Index: src/core/SkLiteDL.cpp
|
| diff --git a/src/core/SkLiteDL.cpp b/src/core/SkLiteDL.cpp
|
| index b88f7bc62c41a45ed26b64867f8dbc1dd2c092c2..3b94d8d67638932e5a0d53140abce1c81996bccb 100644
|
| --- a/src/core/SkLiteDL.cpp
|
| +++ b/src/core/SkLiteDL.cpp
|
| @@ -7,6 +7,7 @@
|
|
|
| #include "SkCanvas.h"
|
| #include "SkData.h"
|
| +#include "SkDrawFilter.h"
|
| #include "SkImageFilter.h"
|
| #include "SkLiteDL.h"
|
| #include "SkMath.h"
|
| @@ -52,7 +53,7 @@ static void make_threadsafe(SkPath* path, SkMatrix* matrix) {
|
|
|
| namespace {
|
| #define TYPES(M) \
|
| - M(Save) M(Restore) M(SaveLayer) \
|
| + M(SetDrawFilter) M(Save) M(Restore) M(SaveLayer) \
|
| M(Concat) M(SetMatrix) M(Translate) M(TranslateZ) \
|
| M(ClipPath) M(ClipRect) M(ClipRRect) M(ClipRegion) \
|
| M(DrawPaint) M(DrawPath) M(DrawRect) M(DrawRegion) M(DrawOval) M(DrawArc) \
|
| @@ -75,6 +76,19 @@ namespace {
|
| };
|
| static_assert(sizeof(Op) == 4, "");
|
|
|
| + struct SetDrawFilter final : Op {
|
| +#ifdef SK_SUPPORT_LEGACY_DRAWFILTER
|
| + static const auto kType = Type::SetDrawFilter;
|
| + SetDrawFilter(SkDrawFilter* df) : drawFilter(sk_ref_sp(df)) {}
|
| + sk_sp<SkDrawFilter> drawFilter;
|
| +#endif
|
| + void draw(SkCanvas* c, const SkMatrix&) {
|
| +#ifdef SK_SUPPORT_LEGACY_DRAWFILTER
|
| + c->setDrawFilter(drawFilter.get());
|
| +#endif
|
| + }
|
| + };
|
| +
|
| struct Save final : Op {
|
| static const auto kType = Type::Save;
|
| void draw(SkCanvas* c, const SkMatrix&) { c->save(); }
|
| @@ -566,6 +580,12 @@ inline void SkLiteDL::map(const Fn fns[], Args... args) {
|
| }
|
| }
|
|
|
| +#ifdef SK_SUPPORT_LEGACY_DRAWFILTER
|
| +void SkLiteDL::setDrawFilter(SkDrawFilter* df) {
|
| + this->push<SetDrawFilter>(0, df);
|
| +}
|
| +#endif
|
| +
|
| void SkLiteDL:: save() { this->push <Save>(0); }
|
| void SkLiteDL::restore() { this->push<Restore>(0); }
|
| void SkLiteDL::saveLayer(const SkRect* bounds, const SkPaint* paint,
|
|
|