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

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

Issue 15893002: Add flag to gradients to interpolate colors in premul space. Experimental API to encapsulate the sh… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/gradients/SkSweepGradient.cpp ('k') | no next file » | 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 "SkTwoPointConicalGradient.h" 9 #include "SkTwoPointConicalGradient.h"
10 10
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 168 }
169 169
170 void SkTwoPointConicalGradient::init() { 170 void SkTwoPointConicalGradient::init() {
171 fRec.init(fCenter1, fRadius1, fCenter2, fRadius2); 171 fRec.init(fCenter1, fRadius1, fCenter2, fRadius2);
172 fPtsToUnit.reset(); 172 fPtsToUnit.reset();
173 } 173 }
174 174
175 ///////////////////////////////////////////////////////////////////// 175 /////////////////////////////////////////////////////////////////////
176 176
177 SkTwoPointConicalGradient::SkTwoPointConicalGradient( 177 SkTwoPointConicalGradient::SkTwoPointConicalGradient(
178 const SkPoint& start, SkScalar startRadius, 178 const SkPoint& start, SkScalar startRadius,
179 const SkPoint& end, SkScalar endRadius, 179 const SkPoint& end, SkScalar endRadius,
180 const Descriptor& desc) 180 const Descriptor& desc)
181 : SkGradientShaderBase(desc), 181 : SkGradientShaderBase(desc),
182 fCenter1(start), 182 fCenter1(start),
183 fCenter2(end), 183 fCenter2(end),
184 fRadius1(startRadius), 184 fRadius1(startRadius),
185 fRadius2(endRadius) { 185 fRadius2(endRadius) {
186 // this is degenerate, and should be caught by our caller 186 // this is degenerate, and should be caught by our caller
187 SkASSERT(fCenter1 != fCenter2 || fRadius1 != fRadius2); 187 SkASSERT(fCenter1 != fCenter2 || fRadius1 != fRadius2);
188 this->init(); 188 this->init();
189 } 189 }
190 190
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 str->appendScalar(fCenter2.fY); 756 str->appendScalar(fCenter2.fY);
757 str->append(") radius2: "); 757 str->append(") radius2: ");
758 str->appendScalar(fRadius2); 758 str->appendScalar(fRadius2);
759 str->append(" "); 759 str->append(" ");
760 760
761 this->INHERITED::toString(str); 761 this->INHERITED::toString(str);
762 762
763 str->append(")"); 763 str->append(")");
764 } 764 }
765 #endif 765 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkSweepGradient.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698