Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Side by Side Diff: src/effects/gradients/SkTwoPointRadialGradient.cpp

Issue 207683004: Extract most of the mutable state of SkShader into a separate Context object. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: scroggo's comments Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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
OLDNEW
« src/effects/SkTransparentShader.cpp ('K') | « src/effects/gradients/SkTwoPointRadialGradient.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698