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

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

Issue 2337313002: (Some) gradients are gamma and gamut correct on GPU (Closed)
Patch Set: Rebase Created 4 years, 3 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 "SkRadialGradient.h" 8 #include "SkRadialGradient.h"
9 #include "SkNx.h" 9 #include "SkNx.h"
10 10
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 return nullptr; 348 return nullptr;
349 } 349 }
350 if (args.fLocalMatrix) { 350 if (args.fLocalMatrix) {
351 SkMatrix inv; 351 SkMatrix inv;
352 if (!args.fLocalMatrix->invert(&inv)) { 352 if (!args.fLocalMatrix->invert(&inv)) {
353 return nullptr; 353 return nullptr;
354 } 354 }
355 matrix.postConcat(inv); 355 matrix.postConcat(inv);
356 } 356 }
357 matrix.postConcat(fPtsToUnit); 357 matrix.postConcat(fPtsToUnit);
358 sk_sp<GrColorSpaceXform> colorSpaceXform = GrColorSpaceXform::Make(fColorSpa ce.get(),
359 args.fDst ColorSpace);
358 sk_sp<GrFragmentProcessor> inner(GrRadialGradient::Make( 360 sk_sp<GrFragmentProcessor> inner(GrRadialGradient::Make(
359 GrGradientEffect::CreateArgs(args.fContext, this, &matrix, fTileMode))); 361 GrGradientEffect::CreateArgs(args.fContext, this, &matrix, fTileMode,
362 std::move(colorSpaceXform), SkToBool(args.f DstColorSpace))));
360 return GrFragmentProcessor::MulOutputByInputAlpha(std::move(inner)); 363 return GrFragmentProcessor::MulOutputByInputAlpha(std::move(inner));
361 } 364 }
362 365
363 #endif 366 #endif
364 367
365 #ifndef SK_IGNORE_TO_STRING 368 #ifndef SK_IGNORE_TO_STRING
366 void SkRadialGradient::toString(SkString* str) const { 369 void SkRadialGradient::toString(SkString* str) const {
367 str->append("SkRadialGradient: ("); 370 str->append("SkRadialGradient: (");
368 371
369 str->append("center: ("); 372 str->append("center: (");
370 str->appendScalar(fCenter.fX); 373 str->appendScalar(fCenter.fX);
371 str->append(", "); 374 str->append(", ");
372 str->appendScalar(fCenter.fY); 375 str->appendScalar(fCenter.fY);
373 str->append(") radius: "); 376 str->append(") radius: ");
374 str->appendScalar(fRadius); 377 str->appendScalar(fRadius);
375 str->append(" "); 378 str->append(" ");
376 379
377 this->INHERITED::toString(str); 380 this->INHERITED::toString(str);
378 381
379 str->append(")"); 382 str->append(")");
380 } 383 }
381 #endif 384 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698