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

Side by Side Diff: src/effects/gradients/SkSweepGradient.cpp

Issue 1287023009: Added tree structure to GrGLFragmentProcessor, i.e. GL instances (Closed) Base URL: https://skia.googlesource.com/skia@cs3_isequal_nonrecursive
Patch Set: moved onSetData from public to protected, onCreateGLInstance from public to private in subclasses Created 5 years, 4 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkSweepGradient.h" 9 #include "SkSweepGradient.h"
10 10
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 class GrSweepGradient : public GrGradientEffect { 207 class GrSweepGradient : public GrGradientEffect {
208 public: 208 public:
209 static GrFragmentProcessor* Create(GrContext* ctx, GrProcessorDataManager* p rocDataManager, 209 static GrFragmentProcessor* Create(GrContext* ctx, GrProcessorDataManager* p rocDataManager,
210 const SkSweepGradient& shader, const SkMa trix& m) { 210 const SkSweepGradient& shader, const SkMa trix& m) {
211 return SkNEW_ARGS(GrSweepGradient, (ctx, procDataManager, shader, m)); 211 return SkNEW_ARGS(GrSweepGradient, (ctx, procDataManager, shader, m));
212 } 212 }
213 virtual ~GrSweepGradient() { } 213 virtual ~GrSweepGradient() { }
214 214
215 const char* name() const override { return "Sweep Gradient"; } 215 const char* name() const override { return "Sweep Gradient"; }
216 216
217 GrGLFragmentProcessor* createGLInstance() const override {
218 return SkNEW_ARGS(GrGLSweepGradient, (*this));
219 }
220
221 private: 217 private:
222 GrSweepGradient(GrContext* ctx, 218 GrSweepGradient(GrContext* ctx,
223 GrProcessorDataManager* procDataManager, 219 GrProcessorDataManager* procDataManager,
224 const SkSweepGradient& shader, 220 const SkSweepGradient& shader,
225 const SkMatrix& matrix) 221 const SkMatrix& matrix)
226 : INHERITED(ctx, procDataManager, shader, matrix, SkShader::kClamp_TileMode) { 222 : INHERITED(ctx, procDataManager, shader, matrix, SkShader::kClamp_TileMode) {
227 this->initClassID<GrSweepGradient>(); 223 this->initClassID<GrSweepGradient>();
228 } 224 }
229 225
226 GrGLFragmentProcessor* onCreateGLInstance() const override {
227 return SkNEW_ARGS(GrGLSweepGradient, (*this));
228 }
229
230 virtual void onGetGLProcessorKey(const GrGLSLCaps& caps, 230 virtual void onGetGLProcessorKey(const GrGLSLCaps& caps,
231 GrProcessorKeyBuilder* b) const override { 231 GrProcessorKeyBuilder* b) const override {
232 GrGLSweepGradient::GenKey(*this, caps, b); 232 GrGLSweepGradient::GenKey(*this, caps, b);
233 } 233 }
234 234
235 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 235 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
236 236
237 typedef GrGradientEffect INHERITED; 237 typedef GrGradientEffect INHERITED;
238 }; 238 };
239 239
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 str->appendScalar(fCenter.fX); 329 str->appendScalar(fCenter.fX);
330 str->append(", "); 330 str->append(", ");
331 str->appendScalar(fCenter.fY); 331 str->appendScalar(fCenter.fY);
332 str->append(") "); 332 str->append(") ");
333 333
334 this->INHERITED::toString(str); 334 this->INHERITED::toString(str);
335 335
336 str->append(")"); 336 str->append(")");
337 } 337 }
338 #endif 338 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkRadialGradient.cpp ('k') | src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698