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

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

Issue 2175563003: Bundle SkShader::asFragmentProcessor arguments in a struct (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix indentation to be less arbitrary 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 "SkTwoPointConicalGradient.h" 8 #include "SkTwoPointConicalGradient.h"
9 #include "SkTwoPointConicalGradient_gpu.h" 9 #include "SkTwoPointConicalGradient_gpu.h"
10 10
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 buffer.writeScalar(fRadius1); 350 buffer.writeScalar(fRadius1);
351 buffer.writeScalar(fRadius2); 351 buffer.writeScalar(fRadius2);
352 buffer.writeBool(fFlippedGrad); 352 buffer.writeBool(fFlippedGrad);
353 } 353 }
354 354
355 #if SK_SUPPORT_GPU 355 #if SK_SUPPORT_GPU
356 356
357 #include "SkGr.h" 357 #include "SkGr.h"
358 358
359 sk_sp<GrFragmentProcessor> SkTwoPointConicalGradient::asFragmentProcessor( 359 sk_sp<GrFragmentProcessor> SkTwoPointConicalGradient::asFragmentProcessor(
360 GrContext* context, 360 const AsFPArgs & args) const {
361 const SkMatrix& viewM, 361 SkASSERT(args.fContext);
362 const SkMatrix* localMatrix,
363 SkFilterQuality,
364 SkSourceGammaTreatment) const {
365 SkASSERT(context);
366 SkASSERT(fPtsToUnit.isIdentity()); 362 SkASSERT(fPtsToUnit.isIdentity());
367 sk_sp<GrFragmentProcessor> inner( 363 sk_sp<GrFragmentProcessor> inner(
368 Gr2PtConicalGradientEffect::Make(context, *this, fTileMode, localMatrix) ); 364 Gr2PtConicalGradientEffect::Make(args.fContext, *this, fTileMode, args.f LocalMatrix));
369 return GrFragmentProcessor::MulOutputByInputAlpha(std::move(inner)); 365 return GrFragmentProcessor::MulOutputByInputAlpha(std::move(inner));
370 } 366 }
371 367
372 #endif 368 #endif
373 369
374 #ifndef SK_IGNORE_TO_STRING 370 #ifndef SK_IGNORE_TO_STRING
375 void SkTwoPointConicalGradient::toString(SkString* str) const { 371 void SkTwoPointConicalGradient::toString(SkString* str) const {
376 str->append("SkTwoPointConicalGradient: ("); 372 str->append("SkTwoPointConicalGradient: (");
377 373
378 str->append("center1: ("); 374 str->append("center1: (");
(...skipping 10 matching lines...) Expand all
389 str->appendScalar(fCenter2.fY); 385 str->appendScalar(fCenter2.fY);
390 str->append(") radius2: "); 386 str->append(") radius2: ");
391 str->appendScalar(fRadius2); 387 str->appendScalar(fRadius2);
392 str->append(" "); 388 str->append(" ");
393 389
394 this->INHERITED::toString(str); 390 this->INHERITED::toString(str);
395 391
396 str->append(")"); 392 str->append(")");
397 } 393 }
398 #endif 394 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkTwoPointConicalGradient.h ('k') | src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698