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

Side by Side Diff: include/effects/SkLayerDrawLooper.h

Issue 133813005: Builder class for SkLayerDrawLooper. (Closed) Base URL: https://skia.googlesource.com/skia.git@draw_looper_context
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/effects/SkLayerDrawLooper.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkLayerDrawLooper_DEFINED 8 #ifndef SkLayerDrawLooper_DEFINED
9 #define SkLayerDrawLooper_DEFINED 9 #define SkLayerDrawLooper_DEFINED
10 10
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 Rec* fCurrRec; 134 Rec* fCurrRec;
135 135
136 static void ApplyInfo(SkPaint* dst, const SkPaint& src, const LayerInfo& ); 136 static void ApplyInfo(SkPaint* dst, const SkPaint& src, const LayerInfo& );
137 }; 137 };
138 138
139 class MyRegistrar : public SkFlattenable::Registrar { 139 class MyRegistrar : public SkFlattenable::Registrar {
140 public: 140 public:
141 MyRegistrar(); 141 MyRegistrar();
142 }; 142 };
143 143
144 friend class SkLayerDrawLooperBuilder;
144 typedef SkDrawLooper INHERITED; 145 typedef SkDrawLooper INHERITED;
145 }; 146 };
146 147
148 class SK_API SkLayerDrawLooperBuilder {
149 public:
150 SkLayerDrawLooperBuilder();
151 ~SkLayerDrawLooperBuilder();
152
153 /**
154 * Call for each layer you want to add (from top to bottom).
155 * This returns a paint you can modify, but that ptr is only valid until
156 * the next call made to addLayer().
157 */
158 SkPaint* addLayer(const SkLayerDrawLooper::LayerInfo&);
159
160 /**
161 * This layer will draw with the original paint, at the specified offset
162 */
163 void addLayer(SkScalar dx, SkScalar dy);
164
165 /**
166 * This layer will with the original paint and no offset.
167 */
168 void addLayer() { this->addLayer(0, 0); }
169
170 /// Similar to addLayer, but adds a layer to the top.
171 SkPaint* addLayerOnTop(const SkLayerDrawLooper::LayerInfo&);
172
173 /**
174 * Pass list of layers onto newly built looper and return it. This will
175 * also reset the builder, so it can be used to build another looper.
176 */
177 SkDrawLooper* createLooper();
reed1 2014/02/07 18:32:22 possibly call this detachLooper(), as in other pla
Dominik Grewe 2014/02/07 18:57:02 Done.
178
179 private:
180 SkLayerDrawLooper::Rec* fRecs;
181 SkLayerDrawLooper::Rec* fTopRec;
182 int fCount;
183 };
184
147 #endif 185 #endif
OLDNEW
« no previous file with comments | « no previous file | src/effects/SkLayerDrawLooper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698