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

Unified Diff: include/effects/SkLayerDrawLooper.h

Issue 155513012: [WIP] Add Context to SkDrawLooper. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make methods const. Created 6 years, 10 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
Index: include/effects/SkLayerDrawLooper.h
diff --git a/include/effects/SkLayerDrawLooper.h b/include/effects/SkLayerDrawLooper.h
index 6955192b53f2e6f9edeb94f49efd0858a8a73b2b..7821e1a8f595bf851db0eff943fa8a17125f9c71 100644
--- a/include/effects/SkLayerDrawLooper.h
+++ b/include/effects/SkLayerDrawLooper.h
@@ -103,8 +103,7 @@ public:
SkPaint* addLayerOnTop(const LayerInfo&);
// overrides from SkDrawLooper
- virtual void init(SkCanvas*);
- virtual bool next(SkCanvas*, SkPaint* paint);
+ virtual SkDrawLooper::DrawContext* init(SkCanvas*) const;
SK_DEVELOPER_TO_STRING()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLayerDrawLooper)
@@ -113,6 +112,9 @@ protected:
SkLayerDrawLooper(SkReadBuffer&);
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
+ virtual bool next_internal(SkCanvas*, SkPaint* paint,
+ SkDrawLooper::DrawContext* context) const;
+
private:
struct Rec {
Rec* fNext;
@@ -124,7 +126,10 @@ private:
int fCount;
// state-machine during the init/next cycle
- Rec* fCurrRec;
+ struct SkLayerDrawLooperContext : public SkDrawLooper::DrawContext {
+ explicit SkLayerDrawLooperContext(const SkLayerDrawLooper* looper);
+ Rec* fCurrRec;
+ };
static void ApplyInfo(SkPaint* dst, const SkPaint& src, const LayerInfo&);

Powered by Google App Engine
This is Rietveld 408576698