diff options
author | brianosman <brianosman@google.com> | 2016-04-13 13:10:14 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-13 13:10:14 -0700 |
commit | b461d3457567cf79a3efac3123c00f7afc37fecb (patch) | |
tree | 6b1600d0da18cefc3e29568419354bd68c9e5b41 /src/effects | |
parent | 54ef1a7c95bcc8e507f7d6ccd9a49bd9a110ba90 (diff) |
Rename lots of things from 'sRGB' to 'GammaCorrect', where appropriate
Trying to be much more explicit about where we really mean sRGB as a format,
and where we mean gamma-correct, as in: "not legacy behavior". Most of the
changes to rendering behavior are dependent on the latter, so let's be precise.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1884873006
Review URL: https://codereview.chromium.org/1884873006
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkBlurImageFilter.cpp | 2 | ||||
-rw-r--r-- | src/effects/SkGpuBlurUtils.cpp | 12 | ||||
-rw-r--r-- | src/effects/SkGpuBlurUtils.h | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp index b8ec28f051..d387c2fda4 100644 --- a/src/effects/SkBlurImageFilter.cpp +++ b/src/effects/SkBlurImageFilter.cpp @@ -115,7 +115,7 @@ sk_sp<SkSpecialImage> SkBlurImageFilter::onFilterImage(SkSpecialImage* source, SkAutoTUnref<GrTexture> tex(SkGpuBlurUtils::GaussianBlur(context, inputTexture, false, - source->props().allowSRGBInputs(), + source->props().isGammaCorrect(), SkRect::Make(dstBounds), &inputBoundsF, sigma.x(), diff --git a/src/effects/SkGpuBlurUtils.cpp b/src/effects/SkGpuBlurUtils.cpp index 90619f9dc8..0ecc5010c3 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); diff --git a/src/effects/SkGpuBlurUtils.h b/src/effects/SkGpuBlurUtils.h index e81e5daddb..7dbfa138ea 100644 --- a/src/effects/SkGpuBlurUtils.h +++ b/src/effects/SkGpuBlurUtils.h @@ -26,7 +26,7 @@ namespace SkGpuBlurUtils { * @param srcTexture The source texture to be blurred. * @param canClobberSrc If true, srcTexture may be overwritten, and * may be returned as the result. - * @param allowSRGBInputs Should sRGB inputs be allowed to perform sRGB to linear conversion. + * @param gammaCorrect Should blur be gamma-correct (sRGB to linear, etc...) * @param dstBounds The destination bounds, relative to the source texture. * @param srcBounds The source bounds, relative to the source texture. If non-null, * no pixels will be sampled outside of this rectangle. @@ -38,7 +38,7 @@ namespace SkGpuBlurUtils { GrTexture* GaussianBlur(GrContext* context, GrTexture* srcTexture, bool canClobberSrc, - bool allowSRGBInputs, + bool gammaCorrect, const SkRect& dstBounds, const SkRect* srcBounds, float sigmaX, |