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 "SkRadialGradient_Table.h" | 10 #include "SkRadialGradient_Table.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // make sure our table is insync with our current #define for kSQRT_TABLE_SI
ZE | 154 // make sure our table is insync with our current #define for kSQRT_TABLE_SI
ZE |
155 SkASSERT(sizeof(gSqrt8Table) == kSQRT_TABLE_SIZE); | 155 SkASSERT(sizeof(gSqrt8Table) == kSQRT_TABLE_SIZE); |
156 | 156 |
157 rad_to_unit_matrix(center, radius, &fPtsToUnit); | 157 rad_to_unit_matrix(center, radius, &fPtsToUnit); |
158 } | 158 } |
159 | 159 |
160 size_t SkRadialGradient::contextSize() const { | 160 size_t SkRadialGradient::contextSize() const { |
161 return sizeof(RadialGradientContext); | 161 return sizeof(RadialGradientContext); |
162 } | 162 } |
163 | 163 |
164 SkShader::Context* SkRadialGradient::createContext(const ContextRec& rec, void*
storage) const { | 164 SkShader::Context* SkRadialGradient::onCreateContext(const ContextRec& rec, void
* storage) const { |
165 if (!this->validContext(rec)) { | |
166 return NULL; | |
167 } | |
168 | |
169 return SkNEW_PLACEMENT_ARGS(storage, RadialGradientContext, (*this, rec)); | 165 return SkNEW_PLACEMENT_ARGS(storage, RadialGradientContext, (*this, rec)); |
170 } | 166 } |
171 | 167 |
172 SkRadialGradient::RadialGradientContext::RadialGradientContext( | 168 SkRadialGradient::RadialGradientContext::RadialGradientContext( |
173 const SkRadialGradient& shader, const ContextRec& rec) | 169 const SkRadialGradient& shader, const ContextRec& rec) |
174 : INHERITED(shader, rec) {} | 170 : INHERITED(shader, rec) {} |
175 | 171 |
176 void SkRadialGradient::RadialGradientContext::shadeSpan16(int x, int y, uint16_t
* dstCParam, | 172 void SkRadialGradient::RadialGradientContext::shadeSpan16(int x, int y, uint16_t
* dstCParam, |
177 int count) { | 173 int count) { |
178 SkASSERT(count > 0); | 174 SkASSERT(count > 0); |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 str->appendScalar(fCenter.fY); | 589 str->appendScalar(fCenter.fY); |
594 str->append(") radius: "); | 590 str->append(") radius: "); |
595 str->appendScalar(fRadius); | 591 str->appendScalar(fRadius); |
596 str->append(" "); | 592 str->append(" "); |
597 | 593 |
598 this->INHERITED::toString(str); | 594 this->INHERITED::toString(str); |
599 | 595 |
600 str->append(")"); | 596 str->append(")"); |
601 } | 597 } |
602 #endif | 598 #endif |
OLD | NEW |