OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |