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

Side by Side Diff: src/gpu/effects/GrDashingEffect.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
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 "GrDashingEffect.h" 8 #include "GrDashingEffect.h"
9 9
10 #include "../GrAARectRenderer.h" 10 #include "../GrAARectRenderer.h"
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 } 556 }
557 557
558 ////////////////////////////////////////////////////////////////////////////// 558 //////////////////////////////////////////////////////////////////////////////
559 559
560 GrEffectRef* DashingCircleEffect::Create(GrEffectEdgeType edgeType, const DashIn fo& info, 560 GrEffectRef* DashingCircleEffect::Create(GrEffectEdgeType edgeType, const DashIn fo& info,
561 SkScalar radius) { 561 SkScalar radius) {
562 if (info.fCount != 2 || info.fIntervals[0] != 0) { 562 if (info.fCount != 2 || info.fIntervals[0] != 0) {
563 return NULL; 563 return NULL;
564 } 564 }
565 565
566 return CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(DashingCircleEffect, 566 return SkNEW_ARGS(DashingCircleEffect, (edgeType, info, radius));
567 (edgeType, info, radius))) );
568 } 567 }
569 568
570 DashingCircleEffect::~DashingCircleEffect() {} 569 DashingCircleEffect::~DashingCircleEffect() {}
571 570
572 void DashingCircleEffect::getConstantColorComponents(GrColor* color, uint32_t* v alidFlags) const { 571 void DashingCircleEffect::getConstantColorComponents(GrColor* color, uint32_t* v alidFlags) const {
573 *validFlags = 0; 572 *validFlags = 0;
574 } 573 }
575 574
576 const GrBackendEffectFactory& DashingCircleEffect::getFactory() const { 575 const GrBackendEffectFactory& DashingCircleEffect::getFactory() const {
577 return GrTBackendEffectFactory<DashingCircleEffect>::getInstance(); 576 return GrTBackendEffectFactory<DashingCircleEffect>::getInstance();
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 } 774 }
776 775
777 ////////////////////////////////////////////////////////////////////////////// 776 //////////////////////////////////////////////////////////////////////////////
778 777
779 GrEffectRef* DashingLineEffect::Create(GrEffectEdgeType edgeType, const DashInfo & info, 778 GrEffectRef* DashingLineEffect::Create(GrEffectEdgeType edgeType, const DashInfo & info,
780 SkScalar strokeWidth) { 779 SkScalar strokeWidth) {
781 if (info.fCount != 2) { 780 if (info.fCount != 2) {
782 return NULL; 781 return NULL;
783 } 782 }
784 783
785 return CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(DashingLineEffect, 784 return SkNEW_ARGS(DashingLineEffect, (edgeType, info, strokeWidth));
786 (edgeType, info, strokeWid th))));
787 } 785 }
788 786
789 DashingLineEffect::~DashingLineEffect() {} 787 DashingLineEffect::~DashingLineEffect() {}
790 788
791 void DashingLineEffect::getConstantColorComponents(GrColor* color, uint32_t* val idFlags) const { 789 void DashingLineEffect::getConstantColorComponents(GrColor* color, uint32_t* val idFlags) const {
792 *validFlags = 0; 790 *validFlags = 0;
793 } 791 }
794 792
795 const GrBackendEffectFactory& DashingLineEffect::getFactory() const { 793 const GrBackendEffectFactory& DashingLineEffect::getFactory() const {
796 return GrTBackendEffectFactory<DashingLineEffect>::getInstance(); 794 return GrTBackendEffectFactory<DashingLineEffect>::getInstance();
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 switch (cap) { 843 switch (cap) {
846 case GrDashingEffect::kRound_DashCap: 844 case GrDashingEffect::kRound_DashCap:
847 return DashingCircleEffect::Create(edgeType, info, SkScalarHalf(stro keWidth)); 845 return DashingCircleEffect::Create(edgeType, info, SkScalarHalf(stro keWidth));
848 case GrDashingEffect::kNonRound_DashCap: 846 case GrDashingEffect::kNonRound_DashCap:
849 return DashingLineEffect::Create(edgeType, info, strokeWidth); 847 return DashingLineEffect::Create(edgeType, info, strokeWidth);
850 default: 848 default:
851 SkFAIL("Unexpected dashed cap."); 849 SkFAIL("Unexpected dashed cap.");
852 } 850 }
853 return NULL; 851 return NULL;
854 } 852 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrCustomCoordsTextureEffect.h ('k') | src/gpu/effects/GrDistanceFieldTextureEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698