| OLD | NEW |
| 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 "SkTwoPointConicalGradient.h" | 8 #include "SkTwoPointConicalGradient.h" |
| 9 #include "SkTwoPointConicalGradient_gpu.h" | 9 #include "SkTwoPointConicalGradient_gpu.h" |
| 10 | 10 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 void SkTwoPointConicalGradient::init() { | 189 void SkTwoPointConicalGradient::init() { |
| 190 fRec.init(fCenter1, fRadius1, fCenter2, fRadius2, fFlippedGrad); | 190 fRec.init(fCenter1, fRadius1, fCenter2, fRadius2, fFlippedGrad); |
| 191 fPtsToUnit.reset(); | 191 fPtsToUnit.reset(); |
| 192 } | 192 } |
| 193 | 193 |
| 194 ///////////////////////////////////////////////////////////////////// | 194 ///////////////////////////////////////////////////////////////////// |
| 195 | 195 |
| 196 SkTwoPointConicalGradient::SkTwoPointConicalGradient( | 196 SkTwoPointConicalGradient::SkTwoPointConicalGradient( |
| 197 const SkPoint& start, SkScalar startRadius, | 197 const SkPoint& start, SkScalar startRadius, |
| 198 const SkPoint& end, SkScalar endRadius, | 198 const SkPoint& end, SkScalar endRadius, |
| 199 bool flippedGrad, const Descriptor& desc, | 199 bool flippedGrad, const Descriptor& desc) |
| 200 const SkMatrix* localMatrix) | 200 : SkGradientShaderBase(desc) |
| 201 : SkGradientShaderBase(desc, localMatrix), | 201 , fCenter1(start) |
| 202 fCenter1(start), | 202 , fCenter2(end) |
| 203 fCenter2(end), | 203 , fRadius1(startRadius) |
| 204 fRadius1(startRadius), | 204 , fRadius2(endRadius) |
| 205 fRadius2(endRadius), | 205 , fFlippedGrad(flippedGrad) |
| 206 fFlippedGrad(flippedGrad) { | 206 { |
| 207 // this is degenerate, and should be caught by our caller | 207 // this is degenerate, and should be caught by our caller |
| 208 SkASSERT(fCenter1 != fCenter2 || fRadius1 != fRadius2); | 208 SkASSERT(fCenter1 != fCenter2 || fRadius1 != fRadius2); |
| 209 this->init(); | 209 this->init(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 bool SkTwoPointConicalGradient::isOpaque() const { | 212 bool SkTwoPointConicalGradient::isOpaque() const { |
| 213 // Because areas outside the cone are left untouched, we cannot treat the | 213 // Because areas outside the cone are left untouched, we cannot treat the |
| 214 // shader as opaque even if the gradient itself is opaque. | 214 // shader as opaque even if the gradient itself is opaque. |
| 215 // TODO(junov): Compute whether the cone fills the plane crbug.com/222380 | 215 // TODO(junov): Compute whether the cone fills the plane crbug.com/222380 |
| 216 return false; | 216 return false; |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 str->appendScalar(fCenter2.fY); | 421 str->appendScalar(fCenter2.fY); |
| 422 str->append(") radius2: "); | 422 str->append(") radius2: "); |
| 423 str->appendScalar(fRadius2); | 423 str->appendScalar(fRadius2); |
| 424 str->append(" "); | 424 str->append(" "); |
| 425 | 425 |
| 426 this->INHERITED::toString(str); | 426 this->INHERITED::toString(str); |
| 427 | 427 |
| 428 str->append(")"); | 428 str->append(")"); |
| 429 } | 429 } |
| 430 #endif | 430 #endif |
| OLD | NEW |