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

Side by Side Diff: src/effects/gradients/SkSweepGradient.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
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 "SkSweepGradient.h" 8 #include "SkSweepGradient.h"
9 9
10 static SkMatrix translate(SkScalar dx, SkScalar dy) { 10 static SkMatrix translate(SkScalar dx, SkScalar dy) {
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 SkColor colors[kMaxRandomGradientColors]; 187 SkColor colors[kMaxRandomGradientColors];
188 SkScalar stopsArray[kMaxRandomGradientColors]; 188 SkScalar stopsArray[kMaxRandomGradientColors];
189 SkScalar* stops = stopsArray; 189 SkScalar* stops = stopsArray;
190 SkShader::TileMode tmIgnored; 190 SkShader::TileMode tmIgnored;
191 int colorCount = RandomGradientParams(d->fRandom, colors, &stops, &tmIgnored ); 191 int colorCount = RandomGradientParams(d->fRandom, colors, &stops, &tmIgnored );
192 sk_sp<SkShader> shader(SkGradientShader::MakeSweep(center.fX, center.fY, co lors, stops, 192 sk_sp<SkShader> shader(SkGradientShader::MakeSweep(center.fX, center.fY, co lors, stops,
193 colorCount)); 193 colorCount));
194 SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom); 194 SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom);
195 sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPAr gs( 195 sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPAr gs(
196 d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, SkSourceGammaTrea tment::kRespect)); 196 d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, nullptr,
197 SkSourceGammaTreatment::kRespect));
197 GrAlwaysAssert(fp); 198 GrAlwaysAssert(fp);
198 return fp; 199 return fp;
199 } 200 }
200 201
201 ///////////////////////////////////////////////////////////////////// 202 /////////////////////////////////////////////////////////////////////
202 203
203 void GrGLSweepGradient::emitCode(EmitArgs& args) { 204 void GrGLSweepGradient::emitCode(EmitArgs& args) {
204 const GrSweepGradient& ge = args.fFp.cast<GrSweepGradient>(); 205 const GrSweepGradient& ge = args.fFp.cast<GrSweepGradient>();
205 this->emitUniforms(args.fUniformHandler, ge); 206 this->emitUniforms(args.fUniformHandler, ge);
206 SkString coords2D = args.fFragBuilder->ensureFSCoords2D(args.fCoords, 0); 207 SkString coords2D = args.fFragBuilder->ensureFSCoords2D(args.fCoords, 0);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 str->appendScalar(fCenter.fX); 256 str->appendScalar(fCenter.fX);
256 str->append(", "); 257 str->append(", ");
257 str->appendScalar(fCenter.fY); 258 str->appendScalar(fCenter.fY);
258 str->append(") "); 259 str->append(") ");
259 260
260 this->INHERITED::toString(str); 261 this->INHERITED::toString(str);
261 262
262 str->append(")"); 263 str->append(")");
263 } 264 }
264 #endif 265 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkRadialGradient.cpp ('k') | src/effects/gradients/SkTwoPointConicalGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698