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 | 9 |
10 #include "SkTwoPointConicalGradient_gpu.h" | 10 #include "SkTwoPointConicalGradient_gpu.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // Because areas outside the cone are left untouched, we cannot treat the | 214 // Because areas outside the cone are left untouched, we cannot treat the |
215 // shader as opaque even if the gradient itself is opaque. | 215 // shader as opaque even if the gradient itself is opaque. |
216 // TODO(junov): Compute whether the cone fills the plane crbug.com/222380 | 216 // TODO(junov): Compute whether the cone fills the plane crbug.com/222380 |
217 return false; | 217 return false; |
218 } | 218 } |
219 | 219 |
220 size_t SkTwoPointConicalGradient::contextSize() const { | 220 size_t SkTwoPointConicalGradient::contextSize() const { |
221 return sizeof(TwoPointConicalGradientContext); | 221 return sizeof(TwoPointConicalGradientContext); |
222 } | 222 } |
223 | 223 |
224 SkShader::Context* SkTwoPointConicalGradient::createContext(const ContextRec& re
c, | 224 SkShader::Context* SkTwoPointConicalGradient::onCreateContext(const ContextRec&
rec, |
225 void* storage) const
{ | 225 void* storage) con
st { |
226 if (!this->validContext(rec)) { | |
227 return NULL; | |
228 } | |
229 | |
230 return SkNEW_PLACEMENT_ARGS(storage, TwoPointConicalGradientContext, (*this,
rec)); | 226 return SkNEW_PLACEMENT_ARGS(storage, TwoPointConicalGradientContext, (*this,
rec)); |
231 } | 227 } |
232 | 228 |
233 SkTwoPointConicalGradient::TwoPointConicalGradientContext::TwoPointConicalGradie
ntContext( | 229 SkTwoPointConicalGradient::TwoPointConicalGradientContext::TwoPointConicalGradie
ntContext( |
234 const SkTwoPointConicalGradient& shader, const ContextRec& rec) | 230 const SkTwoPointConicalGradient& shader, const ContextRec& rec) |
235 : INHERITED(shader, rec) | 231 : INHERITED(shader, rec) |
236 { | 232 { |
237 // we don't have a span16 proc | 233 // we don't have a span16 proc |
238 fFlags &= ~kHasSpan16_Flag; | 234 fFlags &= ~kHasSpan16_Flag; |
239 | 235 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 str->appendScalar(fCenter2.fY); | 414 str->appendScalar(fCenter2.fY); |
419 str->append(") radius2: "); | 415 str->append(") radius2: "); |
420 str->appendScalar(fRadius2); | 416 str->appendScalar(fRadius2); |
421 str->append(" "); | 417 str->append(" "); |
422 | 418 |
423 this->INHERITED::toString(str); | 419 this->INHERITED::toString(str); |
424 | 420 |
425 str->append(")"); | 421 str->append(")"); |
426 } | 422 } |
427 #endif | 423 #endif |
OLD | NEW |