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

Unified Diff: include/effects/SkBlurDrawLooper.h

Issue 155513012: [WIP] Add Context to SkDrawLooper. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comments Created 6 years, 9 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 | « include/core/SkDrawLooper.h ('k') | include/effects/SkLayerDrawLooper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/SkBlurDrawLooper.h
diff --git a/include/effects/SkBlurDrawLooper.h b/include/effects/SkBlurDrawLooper.h
index 46b154debcae1737acec841a576008b316725999..9a230e59ff9b4cf249194de302cb21ff6583eef7 100644
--- a/include/effects/SkBlurDrawLooper.h
+++ b/include/effects/SkBlurDrawLooper.h
@@ -43,9 +43,9 @@ public:
uint32_t flags = kNone_BlurFlag);
virtual ~SkBlurDrawLooper();
- // overrides from SkDrawLooper
- virtual void init(SkCanvas*);
- virtual bool next(SkCanvas*, SkPaint* paint);
+ virtual SkDrawLooper::Context* createContext(SkCanvas*, void* storage) const SK_OVERRIDE;
+
+ virtual size_t contextSize() const SK_OVERRIDE { return sizeof(BlurDrawLooperContext); }
SK_DEVELOPER_TO_STRING()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurDrawLooper)
@@ -66,7 +66,17 @@ private:
kAfterEdge,
kDone
};
- State fState;
+
+ class BlurDrawLooperContext : public SkDrawLooper::Context {
+ public:
+ explicit BlurDrawLooperContext(const SkBlurDrawLooper* looper);
+
+ virtual bool next(SkCanvas* canvas, SkPaint* paint) SK_OVERRIDE;
+
+ private:
+ const SkBlurDrawLooper* fLooper;
+ State fState;
+ };
void init(SkScalar sigma, SkScalar dx, SkScalar dy, SkColor color, uint32_t flags);
« no previous file with comments | « include/core/SkDrawLooper.h ('k') | include/effects/SkLayerDrawLooper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698