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

Unified Diff: src/effects/SkGpuBlurUtils.cpp

Issue 1884873006: Rename lots of things from 'sRGB' to 'GammaCorrect', where appropriate (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: src/effects/SkGpuBlurUtils.cpp
diff --git a/src/effects/SkGpuBlurUtils.cpp b/src/effects/SkGpuBlurUtils.cpp
index 90619f9dc80899ddd3d62719481ff53c75de963d..0ecc5010c33c38654f4fbea2917bfb962d99a789 100644
--- a/src/effects/SkGpuBlurUtils.cpp
+++ b/src/effects/SkGpuBlurUtils.cpp
@@ -56,7 +56,7 @@ static void convolve_gaussian_1d(GrDrawContext* drawContext,
bool useBounds,
float bounds[2]) {
GrPaint paint;
- paint.setAllowSRGBInputs(drawContext->allowSRGBInputs());
+ paint.setGammaCorrect(drawContext->isGammaCorrect());
SkAutoTUnref<GrFragmentProcessor> conv(GrConvolutionEffect::CreateGaussian(
texture, direction, radius, sigma, useBounds, bounds));
paint.addColorFragmentProcessor(conv);
@@ -79,7 +79,7 @@ static void convolve_gaussian_2d(GrDrawContext* drawContext,
SkISize size = SkISize::Make(2 * radiusX + 1, 2 * radiusY + 1);
SkIPoint kernelOffset = SkIPoint::Make(radiusX, radiusY);
GrPaint paint;
- paint.setAllowSRGBInputs(drawContext->allowSRGBInputs());
+ paint.setGammaCorrect(drawContext->isGammaCorrect());
SkIRect bounds;
if (srcBounds) {
srcBounds->roundOut(&bounds);
@@ -166,7 +166,7 @@ static void convolve_gaussian(GrDrawContext* drawContext,
GrTexture* GaussianBlur(GrContext* context,
GrTexture* srcTexture,
bool canClobberSrc,
- bool allowSRGBInputs,
+ bool gammaCorrect,
const SkRect& dstBounds,
const SkRect* srcBounds,
float sigmaX,
@@ -232,7 +232,7 @@ GrTexture* GaussianBlur(GrContext* context,
for (int i = 1; i < scaleFactorX || i < scaleFactorY; i *= 2) {
GrPaint paint;
- paint.setAllowSRGBInputs(allowSRGBInputs);
+ paint.setGammaCorrect(gammaCorrect);
SkMatrix matrix;
matrix.setIDiv(srcTexture->width(), srcTexture->height());
SkRect dstRect(srcRect);
@@ -272,7 +272,7 @@ GrTexture* GaussianBlur(GrContext* context,
localSrcBounds = srcRect;
}
- SkSurfaceProps props(allowSRGBInputs ? SkSurfaceProps::kAllowSRGBInputs_Flag : 0,
+ SkSurfaceProps props(gammaCorrect ? SkSurfaceProps::kGammaCorrect_Flag : 0,
SkSurfaceProps::kLegacyFontHost_InitType);
// For really small blurs (certainly no wider than 5x5 on desktop gpus) it is faster to just
@@ -382,7 +382,7 @@ GrTexture* GaussianBlur(GrContext* context,
matrix.setIDiv(srcTexture->width(), srcTexture->height());
GrPaint paint;
- paint.setAllowSRGBInputs(allowSRGBInputs);
+ paint.setGammaCorrect(gammaCorrect);
// FIXME: this should be mitchell, not bilinear.
GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kBilerp_FilterMode);
paint.addColorTextureProcessor(srcTexture, matrix, params);

Powered by Google App Engine
This is Rietveld 408576698