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

Side by Side Diff: src/effects/gradients/SkLinearGradient.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/SkPerlinNoiseShader.cpp ('k') | src/effects/gradients/SkRadialGradient.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 "Sk4fLinearGradient.h" 8 #include "Sk4fLinearGradient.h"
9 #include "SkLinearGradient.h" 9 #include "SkLinearGradient.h"
10 #include "SkRefCnt.h" 10 #include "SkRefCnt.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()} }; 413 {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()} };
414 414
415 SkColor colors[kMaxRandomGradientColors]; 415 SkColor colors[kMaxRandomGradientColors];
416 SkScalar stopsArray[kMaxRandomGradientColors]; 416 SkScalar stopsArray[kMaxRandomGradientColors];
417 SkScalar* stops = stopsArray; 417 SkScalar* stops = stopsArray;
418 SkShader::TileMode tm; 418 SkShader::TileMode tm;
419 int colorCount = RandomGradientParams(d->fRandom, colors, &stops, &tm); 419 int colorCount = RandomGradientParams(d->fRandom, colors, &stops, &tm);
420 auto shader = SkGradientShader::MakeLinear(points, colors, stops, colorCount , tm); 420 auto shader = SkGradientShader::MakeLinear(points, colors, stops, colorCount , tm);
421 SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom); 421 SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom);
422 sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPAr gs( 422 sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPAr gs(
423 d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, SkSourceGammaTrea tment::kRespect)); 423 d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, nullptr,
424 SkSourceGammaTreatment::kRespect));
424 GrAlwaysAssert(fp); 425 GrAlwaysAssert(fp);
425 return fp; 426 return fp;
426 } 427 }
427 428
428 ///////////////////////////////////////////////////////////////////// 429 /////////////////////////////////////////////////////////////////////
429 430
430 void GrGLLinearGradient::emitCode(EmitArgs& args) { 431 void GrGLLinearGradient::emitCode(EmitArgs& args) {
431 const GrLinearGradient& ge = args.fFp.cast<GrLinearGradient>(); 432 const GrLinearGradient& ge = args.fFp.cast<GrLinearGradient>();
432 this->emitUniforms(args.fUniformHandler, ge); 433 this->emitUniforms(args.fUniformHandler, ge);
433 SkString t = args.fFragBuilder->ensureFSCoords2D(args.fCoords, 0); 434 SkString t = args.fFragBuilder->ensureFSCoords2D(args.fCoords, 0);
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 this->shade4_dx_clamp<false, true>(dstC, count, fx, dx, invDx, dithe r); 753 this->shade4_dx_clamp<false, true>(dstC, count, fx, dx, invDx, dithe r);
753 } 754 }
754 } else { 755 } else {
755 if (fApplyAlphaAfterInterp) { 756 if (fApplyAlphaAfterInterp) {
756 this->shade4_dx_clamp<true, false>(dstC, count, fx, dx, invDx, dithe r); 757 this->shade4_dx_clamp<true, false>(dstC, count, fx, dx, invDx, dithe r);
757 } else { 758 } else {
758 this->shade4_dx_clamp<false, false>(dstC, count, fx, dx, invDx, dith er); 759 this->shade4_dx_clamp<false, false>(dstC, count, fx, dx, invDx, dith er);
759 } 760 }
760 } 761 }
761 } 762 }
OLDNEW
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/gradients/SkRadialGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698