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

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

Issue 371103003: Remove GrEffect::CreateEffectRef and GrEffect::AutoEffectRef. (Closed) Base URL: https://skia.googlesource.com/skia.git@no_ref2
Patch Set: Address comments and update for new YUV effect Created 6 years, 5 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/SkTableColorFilter.cpp ('k') | src/effects/gradients/SkRadialGradient.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 2012 Google Inc. 2 * Copyright 2012 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 #include "SkLinearGradient.h" 8 #include "SkLinearGradient.h"
9 9
10 static inline int repeat_bits(int x, const int bits) { 10 static inline int repeat_bits(int x, const int bits) {
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 477
478 ///////////////////////////////////////////////////////////////////// 478 /////////////////////////////////////////////////////////////////////
479 479
480 class GrLinearGradient : public GrGradientEffect { 480 class GrLinearGradient : public GrGradientEffect {
481 public: 481 public:
482 482
483 static GrEffectRef* Create(GrContext* ctx, 483 static GrEffectRef* Create(GrContext* ctx,
484 const SkLinearGradient& shader, 484 const SkLinearGradient& shader,
485 const SkMatrix& matrix, 485 const SkMatrix& matrix,
486 SkShader::TileMode tm) { 486 SkShader::TileMode tm) {
487 AutoEffectUnref effect(SkNEW_ARGS(GrLinearGradient, (ctx, shader, matrix , tm))); 487 return SkNEW_ARGS(GrLinearGradient, (ctx, shader, matrix, tm));
488 return CreateEffectRef(effect);
489 } 488 }
490 489
491 virtual ~GrLinearGradient() { } 490 virtual ~GrLinearGradient() { }
492 491
493 static const char* Name() { return "Linear Gradient"; } 492 static const char* Name() { return "Linear Gradient"; }
494 const GrBackendEffectFactory& getFactory() const SK_OVERRIDE { 493 const GrBackendEffectFactory& getFactory() const SK_OVERRIDE {
495 return GrTBackendEffectFactory<GrLinearGradient>::getInstance(); 494 return GrTBackendEffectFactory<GrLinearGradient>::getInstance();
496 } 495 }
497 496
498 typedef GrGLLinearGradient GLEffect; 497 typedef GrGLLinearGradient GLEffect;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 str->append("SkLinearGradient ("); 590 str->append("SkLinearGradient (");
592 591
593 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY); 592 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY);
594 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY); 593 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY);
595 594
596 this->INHERITED::toString(str); 595 this->INHERITED::toString(str);
597 596
598 str->append(")"); 597 str->append(")");
599 } 598 }
600 #endif 599 #endif
OLDNEW
« no previous file with comments | « src/effects/SkTableColorFilter.cpp ('k') | src/effects/gradients/SkRadialGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698