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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 fRec.init(fCenter1, fRadius1, fCenter2, fRadius2, fFlippedGrad); | 204 fRec.init(fCenter1, fRadius1, fCenter2, fRadius2, fFlippedGrad); |
205 } | 205 } |
206 | 206 |
207 bool SkTwoPointConicalGradient::isOpaque() const { | 207 bool SkTwoPointConicalGradient::isOpaque() const { |
208 // Because areas outside the cone are left untouched, we cannot treat the | 208 // Because areas outside the cone are left untouched, we cannot treat the |
209 // shader as opaque even if the gradient itself is opaque. | 209 // shader as opaque even if the gradient itself is opaque. |
210 // TODO(junov): Compute whether the cone fills the plane crbug.com/222380 | 210 // TODO(junov): Compute whether the cone fills the plane crbug.com/222380 |
211 return false; | 211 return false; |
212 } | 212 } |
213 | 213 |
214 size_t SkTwoPointConicalGradient::contextSize() const { | 214 size_t SkTwoPointConicalGradient::contextSize(const ContextRec&) const { |
215 return sizeof(TwoPointConicalGradientContext); | 215 return sizeof(TwoPointConicalGradientContext); |
216 } | 216 } |
217 | 217 |
218 SkShader::Context* SkTwoPointConicalGradient::onCreateContext(const ContextRec&
rec, | 218 SkShader::Context* SkTwoPointConicalGradient::onCreateContext(const ContextRec&
rec, |
219 void* storage) con
st { | 219 void* storage) con
st { |
220 return new (storage) TwoPointConicalGradientContext(*this, rec); | 220 return new (storage) TwoPointConicalGradientContext(*this, rec); |
221 } | 221 } |
222 | 222 |
223 SkTwoPointConicalGradient::TwoPointConicalGradientContext::TwoPointConicalGradie
ntContext( | 223 SkTwoPointConicalGradient::TwoPointConicalGradientContext::TwoPointConicalGradie
ntContext( |
224 const SkTwoPointConicalGradient& shader, const ContextRec& rec) | 224 const SkTwoPointConicalGradient& shader, const ContextRec& rec) |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 str->appendScalar(fCenter2.fY); | 388 str->appendScalar(fCenter2.fY); |
389 str->append(") radius2: "); | 389 str->append(") radius2: "); |
390 str->appendScalar(fRadius2); | 390 str->appendScalar(fRadius2); |
391 str->append(" "); | 391 str->append(" "); |
392 | 392 |
393 this->INHERITED::toString(str); | 393 this->INHERITED::toString(str); |
394 | 394 |
395 str->append(")"); | 395 str->append(")"); |
396 } | 396 } |
397 #endif | 397 #endif |
OLD | NEW |