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

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

Issue 2180503002: Add destination color space to AsFPArgs. Eliminates last XFORMTODO. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « src/effects/gradients/SkLinearGradient.cpp ('k') | src/effects/gradients/SkSweepGradient.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "SkRadialGradient.h" 8 #include "SkRadialGradient.h"
9 #include "SkNx.h" 9 #include "SkNx.h"
10 10
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 SkScalar radius = d->fRandom->nextUScalar1(); 307 SkScalar radius = d->fRandom->nextUScalar1();
308 308
309 SkColor colors[kMaxRandomGradientColors]; 309 SkColor colors[kMaxRandomGradientColors];
310 SkScalar stopsArray[kMaxRandomGradientColors]; 310 SkScalar stopsArray[kMaxRandomGradientColors];
311 SkScalar* stops = stopsArray; 311 SkScalar* stops = stopsArray;
312 SkShader::TileMode tm; 312 SkShader::TileMode tm;
313 int colorCount = RandomGradientParams(d->fRandom, colors, &stops, &tm); 313 int colorCount = RandomGradientParams(d->fRandom, colors, &stops, &tm);
314 auto shader = SkGradientShader::MakeRadial(center, radius, colors, stops, co lorCount, tm); 314 auto shader = SkGradientShader::MakeRadial(center, radius, colors, stops, co lorCount, tm);
315 SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom); 315 SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom);
316 sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPAr gs( 316 sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPAr gs(
317 d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, SkSourceGammaTrea tment::kRespect)); 317 d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, nullptr,
318 SkSourceGammaTreatment::kRespect));
318 GrAlwaysAssert(fp); 319 GrAlwaysAssert(fp);
319 return fp; 320 return fp;
320 } 321 }
321 322
322 ///////////////////////////////////////////////////////////////////// 323 /////////////////////////////////////////////////////////////////////
323 324
324 void GrGLRadialGradient::emitCode(EmitArgs& args) { 325 void GrGLRadialGradient::emitCode(EmitArgs& args) {
325 const GrRadialGradient& ge = args.fFp.cast<GrRadialGradient>(); 326 const GrRadialGradient& ge = args.fFp.cast<GrRadialGradient>();
326 this->emitUniforms(args.fUniformHandler, ge); 327 this->emitUniforms(args.fUniformHandler, ge);
327 SkString t("length("); 328 SkString t("length(");
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 str->appendScalar(fCenter.fY); 371 str->appendScalar(fCenter.fY);
371 str->append(") radius: "); 372 str->append(") radius: ");
372 str->appendScalar(fRadius); 373 str->appendScalar(fRadius);
373 str->append(" "); 374 str->append(" ");
374 375
375 this->INHERITED::toString(str); 376 this->INHERITED::toString(str);
376 377
377 str->append(")"); 378 str->append(")");
378 } 379 }
379 #endif 380 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkLinearGradient.cpp ('k') | src/effects/gradients/SkSweepGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698