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

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: static allocation of DrawContext; update rest of code. 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..edffee648660d6d89aa1224d0cfb87c44c445751 100644
--- a/include/effects/SkLayerDrawLooper.h
+++ b/include/effects/SkLayerDrawLooper.h
@@ -102,9 +102,8 @@ public:
/// Similar to addLayer, but adds a layer to the top.
SkPaint* addLayerOnTop(const LayerInfo&);
- // overrides from SkDrawLooper
- virtual void init(SkCanvas*);
- virtual bool next(SkCanvas*, SkPaint* paint);
+ virtual SkDrawLooper::DrawContext* init(
+ SkCanvas*, void* storage, size_t storageSize) const SK_OVERRIDE;
SK_DEVELOPER_TO_STRING()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLayerDrawLooper)
@@ -124,9 +123,18 @@ private:
int fCount;
// state-machine during the init/next cycle
- Rec* fCurrRec;
+ class LayerDrawLooperContext : public SkDrawLooper::DrawContext {
reed1 2014/02/07 14:46:02 Just for public brevity, can this definition be mo
Dominik Grewe 2014/02/07 16:59:17 If we move this definition out of the class scope
+ public:
+ explicit LayerDrawLooperContext(const SkLayerDrawLooper* looper);
+
+ protected:
+ virtual bool next(SkCanvas*, SkPaint* paint) SK_OVERRIDE;
- static void ApplyInfo(SkPaint* dst, const SkPaint& src, const LayerInfo&);
+ private:
+ Rec* fCurrRec;
+
+ static void ApplyInfo(SkPaint* dst, const SkPaint& src, const LayerInfo&);
+ };
class MyRegistrar : public SkFlattenable::Registrar {
public:

Powered by Google App Engine
This is Rietveld 408576698