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

Unified Diff: src/gpu/GrContext.cpp

Issue 2002253002: Remove sRGB overrides on GrTextureParams. Use GrPaint flags instead. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 04fabaa6b3e0b41b1f246167f3b4a48bedde555b..51ab64d2198a4f0b78b40eb23d1cef9adc57198d 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -367,11 +367,10 @@ bool GrContext::writeSurfacePixels(GrSurface* surface,
if (!drawContext) {
return false;
}
- // SRGBTODO: AllowSRGBInputs? (We could force it on here, so we don't need the
- // per-texture override in config conversion effect?)
GrPaint paint;
paint.addColorFragmentProcessor(fp);
paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
+ paint.setAllowSRGBInputs(true);
SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
drawContext->drawRect(GrNoClip(), paint, matrix, rect, nullptr);
@@ -479,11 +478,10 @@ bool GrContext::readSurfacePixels(GrSurface* src,
GrConfigConversionEffect::kNone_PMConversion, textureMatrix));
}
if (fp) {
- // SRGBTODO: AllowSRGBInputs? (We could force it on here, so we don't need the
- // per-texture override in config conversion effect?)
GrPaint paint;
paint.addColorFragmentProcessor(fp);
paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
+ paint.setAllowSRGBInputs(true);
SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
sk_sp<GrDrawContext> drawContext(
this->drawContext(sk_ref_sp(temp->asRenderTarget())));

Powered by Google App Engine
This is Rietveld 408576698