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 "SkRadialGradient.h" | 9 #include "SkRadialGradient.h" |
10 #include "SkNx.h" | 10 #include "SkNx.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 } // namespace | 33 } // namespace |
34 | 34 |
35 ///////////////////////////////////////////////////////////////////// | 35 ///////////////////////////////////////////////////////////////////// |
36 | 36 |
37 SkRadialGradient::SkRadialGradient(const SkPoint& center, SkScalar radius, const
Descriptor& desc) | 37 SkRadialGradient::SkRadialGradient(const SkPoint& center, SkScalar radius, const
Descriptor& desc) |
38 : SkGradientShaderBase(desc, rad_to_unit_matrix(center, radius)) | 38 : SkGradientShaderBase(desc, rad_to_unit_matrix(center, radius)) |
39 , fCenter(center) | 39 , fCenter(center) |
40 , fRadius(radius) { | 40 , fRadius(radius) { |
41 } | 41 } |
42 | 42 |
43 size_t SkRadialGradient::contextSize() const { | 43 size_t SkRadialGradient::contextSize(const ContextRec&) const { |
44 return sizeof(RadialGradientContext); | 44 return sizeof(RadialGradientContext); |
45 } | 45 } |
46 | 46 |
47 SkShader::Context* SkRadialGradient::onCreateContext(const ContextRec& rec, void
* storage) const { | 47 SkShader::Context* SkRadialGradient::onCreateContext(const ContextRec& rec, void
* storage) const { |
48 return new (storage) RadialGradientContext(*this, rec); | 48 return new (storage) RadialGradientContext(*this, rec); |
49 } | 49 } |
50 | 50 |
51 SkRadialGradient::RadialGradientContext::RadialGradientContext( | 51 SkRadialGradient::RadialGradientContext::RadialGradientContext( |
52 const SkRadialGradient& shader, const ContextRec& rec) | 52 const SkRadialGradient& shader, const ContextRec& rec) |
53 : INHERITED(shader, rec) {} | 53 : INHERITED(shader, rec) {} |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 str->appendScalar(fCenter.fY); | 376 str->appendScalar(fCenter.fY); |
377 str->append(") radius: "); | 377 str->append(") radius: "); |
378 str->appendScalar(fRadius); | 378 str->appendScalar(fRadius); |
379 str->append(" "); | 379 str->append(" "); |
380 | 380 |
381 this->INHERITED::toString(str); | 381 this->INHERITED::toString(str); |
382 | 382 |
383 str->append(")"); | 383 str->append(")"); |
384 } | 384 } |
385 #endif | 385 #endif |
OLD | NEW |