| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |