aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-06-04 11:09:38 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-04 15:29:20 +0000
commitad445ce8416474056fded4fa912dae7f53e462ce (patch)
treea34447c088411f8f20117ddf03ba8ff4e7fbf23a /src
parentfeb9fa9e9ba47ec4a4e6480d90a88ad5cdb46020 (diff)
Remove GrPaint::setGammaCorrect
Driving this from the presence of a color space makes no sense in the new world, we should always be treating sRGB as such (end-to-end). Change-Id: If3d8e740793321a2b1294ff72b04558d3b96cb53 Reviewed-on: https://skia-review.googlesource.com/131784 Commit-Queue: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com> Auto-Submit: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/SkGpuBlurUtils.cpp8
-rw-r--r--src/core/SkImageFilter.cpp1
-rw-r--r--src/effects/SkArithmeticImageFilter.cpp1
-rw-r--r--src/effects/SkDisplacementMapEffect.cpp1
-rw-r--r--src/effects/SkLightingImageFilter.cpp1
-rw-r--r--src/effects/SkMorphologyImageFilter.cpp4
-rw-r--r--src/effects/SkXfermodeImageFilter.cpp1
-rw-r--r--src/gpu/GrPaint.h8
-rw-r--r--src/gpu/GrTextureProducer.cpp2
9 files changed, 0 insertions, 27 deletions
diff --git a/src/core/SkGpuBlurUtils.cpp b/src/core/SkGpuBlurUtils.cpp
index a2f95adcf8..9ebed06884 100644
--- a/src/core/SkGpuBlurUtils.cpp
+++ b/src/core/SkGpuBlurUtils.cpp
@@ -81,8 +81,6 @@ static void convolve_gaussian_1d(GrRenderTargetContext* renderTargetContext,
GrTextureDomain::Mode mode,
int bounds[2]) {
GrPaint paint;
- paint.setGammaCorrect(renderTargetContext->colorSpaceInfo().isGammaCorrect());
-
std::unique_ptr<GrFragmentProcessor> conv(GrGaussianConvolutionFragmentProcessor::Make(
std::move(proxy), direction, radius, sigma, mode, bounds));
paint.addColorFragmentProcessor(std::move(conv));
@@ -140,8 +138,6 @@ static sk_sp<GrRenderTargetContext> convolve_gaussian_2d(GrContext* context,
SkISize size = SkISize::Make(2 * radiusX + 1, 2 * radiusY + 1);
SkIPoint kernelOffset = SkIPoint::Make(radiusX, radiusY);
GrPaint paint;
- paint.setGammaCorrect(renderTargetContext->colorSpaceInfo().isGammaCorrect());
-
auto conv = GrMatrixConvolutionEffect::MakeGaussian(std::move(proxy), srcBounds, size, 1.0, 0.0,
kernelOffset, mode, true, sigmaX, sigmaY);
paint.addColorFragmentProcessor(std::move(conv));
@@ -297,8 +293,6 @@ static sk_sp<GrTextureProxy> decimate(GrContext* context,
}
GrPaint paint;
- paint.setGammaCorrect(dstRenderTargetContext->colorSpaceInfo().isGammaCorrect());
-
if (GrTextureDomain::kIgnore_Mode != mode && i == 1) {
// GrTextureDomainEffect does not support kRepeat_Mode with GrSamplerState::Filter.
GrTextureDomain::Mode modeForScaling = GrTextureDomain::kRepeat_Mode == mode
@@ -397,8 +391,6 @@ static sk_sp<GrRenderTargetContext> reexpand(GrContext* context,
}
GrPaint paint;
- paint.setGammaCorrect(dstRenderTargetContext->colorSpaceInfo().isGammaCorrect());
-
if (GrTextureDomain::kIgnore_Mode != mode) {
// GrTextureDomainEffect does not support kRepeat_Mode with GrSamplerState::Filter.
GrTextureDomain::Mode modeForScaling = GrTextureDomain::kRepeat_Mode == mode
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index aabfef09bb..fe97d241b1 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -284,7 +284,6 @@ sk_sp<SkSpecialImage> SkImageFilter::DrawWithFP(GrContext* context,
if (!renderTargetContext) {
return nullptr;
}
- paint.setGammaCorrect(renderTargetContext->colorSpaceInfo().isGammaCorrect());
SkIRect dstIRect = SkIRect::MakeWH(bounds.width(), bounds.height());
SkRect srcRect = SkRect::Make(bounds);
diff --git a/src/effects/SkArithmeticImageFilter.cpp b/src/effects/SkArithmeticImageFilter.cpp
index c022ec955e..9674575db2 100644
--- a/src/effects/SkArithmeticImageFilter.cpp
+++ b/src/effects/SkArithmeticImageFilter.cpp
@@ -358,7 +358,6 @@ sk_sp<SkSpecialImage> ArithmeticImageFilterImpl::filterImageGPU(
if (!renderTargetContext) {
return nullptr;
}
- paint.setGammaCorrect(renderTargetContext->colorSpaceInfo().isGammaCorrect());
SkMatrix matrix;
matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top()));
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index f1b704e1c8..1d9284482c 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -319,7 +319,6 @@ sk_sp<SkSpecialImage> SkDisplacementMapEffect::onFilterImage(SkSpecialImage* sou
if (!renderTargetContext) {
return nullptr;
}
- paint.setGammaCorrect(renderTargetContext->colorSpaceInfo().isGammaCorrect());
renderTargetContext->drawRect(GrNoClip(), std::move(paint), GrAA::kNo, matrix,
SkRect::Make(colorBounds));
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 7c4f9b790d..5b7b94a7dc 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -446,7 +446,6 @@ void SkLightingImageFilterInternal::drawRect(GrRenderTargetContext* renderTarget
const SkIRect& bounds) const {
SkRect srcRect = dstRect.makeOffset(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y()));
GrPaint paint;
- paint.setGammaCorrect(renderTargetContext->colorSpaceInfo().isGammaCorrect());
auto fp = this->makeFragmentProcessor(std::move(srcProxy), matrix, srcBounds, boundaryMode);
paint.addColorFragmentProcessor(std::move(fp));
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 9d87aa033b..dbdea3d5ff 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -399,8 +399,6 @@ static void apply_morphology_rect(GrRenderTargetContext* renderTargetContext,
const float bounds[2],
GrMorphologyEffect::Direction direction) {
GrPaint paint;
- paint.setGammaCorrect(renderTargetContext->colorSpaceInfo().isGammaCorrect());
-
paint.addColorFragmentProcessor(GrMorphologyEffect::Make(std::move(proxy),
direction, radius, morphType,
bounds));
@@ -418,8 +416,6 @@ static void apply_morphology_rect_no_bounds(GrRenderTargetContext* renderTargetC
GrMorphologyEffect::Type morphType,
GrMorphologyEffect::Direction direction) {
GrPaint paint;
- paint.setGammaCorrect(renderTargetContext->colorSpaceInfo().isGammaCorrect());
-
paint.addColorFragmentProcessor(GrMorphologyEffect::Make(std::move(proxy),
direction, radius, morphType));
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp
index 0aa33d9cc0..19c072f5da 100644
--- a/src/effects/SkXfermodeImageFilter.cpp
+++ b/src/effects/SkXfermodeImageFilter.cpp
@@ -343,7 +343,6 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter_Base::filterImageGPU(
if (!renderTargetContext) {
return nullptr;
}
- paint.setGammaCorrect(renderTargetContext->colorSpaceInfo().isGammaCorrect());
SkMatrix matrix;
matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top()));
diff --git a/src/gpu/GrPaint.h b/src/gpu/GrPaint.h
index 3a5fa11d03..c7e52fab07 100644
--- a/src/gpu/GrPaint.h
+++ b/src/gpu/GrPaint.h
@@ -62,14 +62,6 @@ public:
void setDisableOutputConversionToSRGB(bool srgb) { fDisableOutputConversionToSRGB = srgb; }
bool getDisableOutputConversionToSRGB() const { return fDisableOutputConversionToSRGB; }
- /**
- * Should rendering be gamma-correct, end-to-end. Causes sRGB render targets to behave
- * as such (with linear blending).
- */
- void setGammaCorrect(bool gammaCorrect) {
- this->setDisableOutputConversionToSRGB(!gammaCorrect);
- }
-
void setXPFactory(const GrXPFactory* xpFactory) {
fXPFactory = xpFactory;
fTrivial &= !SkToBool(xpFactory);
diff --git a/src/gpu/GrTextureProducer.cpp b/src/gpu/GrTextureProducer.cpp
index c30d155d03..d9fffbc410 100644
--- a/src/gpu/GrTextureProducer.cpp
+++ b/src/gpu/GrTextureProducer.cpp
@@ -33,8 +33,6 @@ sk_sp<GrTextureProxy> GrTextureProducer::CopyOnGpu(GrContext* context,
}
GrPaint paint;
- paint.setGammaCorrect(true);
-
SkRect localRect = SkRect::MakeWH(inputProxy->width(), inputProxy->height());
bool needsDomain = false;