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

Side by Side Diff: src/effects/gradients/SkRadialGradient.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
« no previous file with comments | « src/effects/gradients/SkLinearGradient.cpp ('k') | src/effects/gradients/SkSweepGradient.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 /* 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 "SkRadialGradient.h" 9 #include "SkRadialGradient.h"
10 #include "SkRadialGradient_Table.h" 10 #include "SkRadialGradient_Table.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 const SkRadialGradient& shader, 461 const SkRadialGradient& shader,
462 const SkMatrix& matrix, 462 const SkMatrix& matrix,
463 SkShader::TileMode tm) { 463 SkShader::TileMode tm) {
464 return SkNEW_ARGS(GrRadialGradient, (ctx, procDataManager, shader, matri x, tm)); 464 return SkNEW_ARGS(GrRadialGradient, (ctx, procDataManager, shader, matri x, tm));
465 } 465 }
466 466
467 virtual ~GrRadialGradient() { } 467 virtual ~GrRadialGradient() { }
468 468
469 const char* name() const override { return "Radial Gradient"; } 469 const char* name() const override { return "Radial Gradient"; }
470 470
471 GrGLFragmentProcessor* createGLInstance() const override {
472 return SkNEW_ARGS(GrGLRadialGradient, (*this));
473 }
474
475 private: 471 private:
476 GrRadialGradient(GrContext* ctx, 472 GrRadialGradient(GrContext* ctx,
477 GrProcessorDataManager* procDataManager, 473 GrProcessorDataManager* procDataManager,
478 const SkRadialGradient& shader, 474 const SkRadialGradient& shader,
479 const SkMatrix& matrix, 475 const SkMatrix& matrix,
480 SkShader::TileMode tm) 476 SkShader::TileMode tm)
481 : INHERITED(ctx, procDataManager, shader, matrix, tm) { 477 : INHERITED(ctx, procDataManager, shader, matrix, tm) {
482 this->initClassID<GrRadialGradient>(); 478 this->initClassID<GrRadialGradient>();
483 } 479 }
484 480
481 GrGLFragmentProcessor* onCreateGLInstance() const override {
482 return SkNEW_ARGS(GrGLRadialGradient, (*this));
483 }
484
485 virtual void onGetGLProcessorKey(const GrGLSLCaps& caps, 485 virtual void onGetGLProcessorKey(const GrGLSLCaps& caps,
486 GrProcessorKeyBuilder* b) const override { 486 GrProcessorKeyBuilder* b) const override {
487 GrGLRadialGradient::GenKey(*this, caps, b); 487 GrGLRadialGradient::GenKey(*this, caps, b);
488 } 488 }
489 489
490 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 490 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
491 491
492 typedef GrGradientEffect INHERITED; 492 typedef GrGradientEffect INHERITED;
493 }; 493 };
494 494
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 str->appendScalar(fCenter.fY); 578 str->appendScalar(fCenter.fY);
579 str->append(") radius: "); 579 str->append(") radius: ");
580 str->appendScalar(fRadius); 580 str->appendScalar(fRadius);
581 str->append(" "); 581 str->append(" ");
582 582
583 this->INHERITED::toString(str); 583 this->INHERITED::toString(str);
584 584
585 str->append(")"); 585 str->append(")");
586 } 586 }
587 #endif 587 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkLinearGradient.cpp ('k') | src/effects/gradients/SkSweepGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698