| 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 "SkTwoPointRadialGradient.h" | 9 #include "SkTwoPointRadialGradient.h" |
| 10 | 10 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 if (info) { | 213 if (info) { |
| 214 commonAsAGradient(info); | 214 commonAsAGradient(info); |
| 215 info->fPoint[0] = fCenter1; | 215 info->fPoint[0] = fCenter1; |
| 216 info->fPoint[1] = fCenter2; | 216 info->fPoint[1] = fCenter2; |
| 217 info->fRadius[0] = fRadius1; | 217 info->fRadius[0] = fRadius1; |
| 218 info->fRadius[1] = fRadius2; | 218 info->fRadius[1] = fRadius2; |
| 219 } | 219 } |
| 220 return kRadial2_GradientType; | 220 return kRadial2_GradientType; |
| 221 } | 221 } |
| 222 | 222 |
| 223 #if 0 |
| 223 void SkTwoPointRadialGradient::shadeSpan(int x, int y, SkPMColor* dstCParam, | 224 void SkTwoPointRadialGradient::shadeSpan(int x, int y, SkPMColor* dstCParam, |
| 224 int count) { | 225 int count) { |
| 225 SkASSERT(count > 0); | 226 SkASSERT(count > 0); |
| 226 | 227 |
| 227 SkPMColor* SK_RESTRICT dstC = dstCParam; | 228 SkPMColor* SK_RESTRICT dstC = dstCParam; |
| 228 | 229 |
| 229 // Zero difference between radii: fill with transparent black. | 230 // Zero difference between radii: fill with transparent black. |
| 230 if (fDiffRadius == 0) { | 231 if (fDiffRadius == 0) { |
| 231 sk_bzero(dstC, count * sizeof(*dstC)); | 232 sk_bzero(dstC, count * sizeof(*dstC)); |
| 232 return; | 233 return; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 } | 300 } |
| 300 | 301 |
| 301 if (!this->INHERITED::setContext(device, paint, matrix)) { | 302 if (!this->INHERITED::setContext(device, paint, matrix)) { |
| 302 return false; | 303 return false; |
| 303 } | 304 } |
| 304 | 305 |
| 305 // we don't have a span16 proc | 306 // we don't have a span16 proc |
| 306 fFlags &= ~kHasSpan16_Flag; | 307 fFlags &= ~kHasSpan16_Flag; |
| 307 return true; | 308 return true; |
| 308 } | 309 } |
| 310 #endif |
| 309 | 311 |
| 310 #ifdef SK_DEVELOPER | 312 #ifdef SK_DEVELOPER |
| 311 void SkTwoPointRadialGradient::toString(SkString* str) const { | 313 void SkTwoPointRadialGradient::toString(SkString* str) const { |
| 312 str->append("SkTwoPointRadialGradient: ("); | 314 str->append("SkTwoPointRadialGradient: ("); |
| 313 | 315 |
| 314 str->append("center1: ("); | 316 str->append("center1: ("); |
| 315 str->appendScalar(fCenter1.fX); | 317 str->appendScalar(fCenter1.fX); |
| 316 str->append(", "); | 318 str->append(", "); |
| 317 str->appendScalar(fCenter1.fY); | 319 str->appendScalar(fCenter1.fY); |
| 318 str->append(") radius1: "); | 320 str->append(") radius1: "); |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 } | 684 } |
| 683 | 685 |
| 684 #else | 686 #else |
| 685 | 687 |
| 686 GrEffectRef* SkTwoPointRadialGradient::asNewEffect(GrContext*, const SkPaint&) c
onst { | 688 GrEffectRef* SkTwoPointRadialGradient::asNewEffect(GrContext*, const SkPaint&) c
onst { |
| 687 SkDEBUGFAIL("Should not call in GPU-less build"); | 689 SkDEBUGFAIL("Should not call in GPU-less build"); |
| 688 return NULL; | 690 return NULL; |
| 689 } | 691 } |
| 690 | 692 |
| 691 #endif | 693 #endif |
| OLD | NEW |