Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: src/core/SkLiteDL.cpp

Issue 2303033002: record drawfilters (Closed)
Patch Set: remove obsolete comment Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkLiteDL.h ('k') | src/core/SkLiteRecorder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/core/SkLiteDL.h ('k') | src/core/SkLiteRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698