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
diff --git a/src/gpu/batches/GrAtlasTextBatch.cpp b/src/gpu/batches/GrAtlasTextBatch.cpp
index b23a4cc..bdf6986 100644
--- a/src/gpu/batches/GrAtlasTextBatch.cpp
+++ b/src/gpu/batches/GrAtlasTextBatch.cpp
@@ -264,7 +264,7 @@
// set up any flags
uint32_t flags = viewMatrix.isSimilarity() ? kSimilarity_DistanceFieldEffectFlag : 0;
flags |= viewMatrix.isScaleTranslate() ? kScaleOnly_DistanceFieldEffectFlag : 0;
- flags |= fUseSRGBDistanceTable ? kSRGB_DistanceFieldEffectFlag : 0;
+ flags |= fUseGammaCorrectDistanceTable ? kGammaCorrect_DistanceFieldEffectFlag : 0;
// see if we need to create a new effect
if (isLCD) {
@@ -274,11 +274,14 @@
GrColor colorNoPreMul = skcolor_to_grcolor_nopremultiply(filteredColor);
float redCorrection = fDistanceAdjustTable->getAdjustment(
- GrColorUnpackR(colorNoPreMul) >> kDistanceAdjustLumShift, fUseSRGBDistanceTable);
+ GrColorUnpackR(colorNoPreMul) >> kDistanceAdjustLumShift,
+ fUseGammaCorrectDistanceTable);
float greenCorrection = fDistanceAdjustTable->getAdjustment(
- GrColorUnpackG(colorNoPreMul) >> kDistanceAdjustLumShift, fUseSRGBDistanceTable);
+ GrColorUnpackG(colorNoPreMul) >> kDistanceAdjustLumShift,
+ fUseGammaCorrectDistanceTable);
float blueCorrection = fDistanceAdjustTable->getAdjustment(
- GrColorUnpackB(colorNoPreMul) >> kDistanceAdjustLumShift, fUseSRGBDistanceTable);
+ GrColorUnpackB(colorNoPreMul) >> kDistanceAdjustLumShift,
+ fUseGammaCorrectDistanceTable);
GrDistanceFieldLCDTextGeoProc::DistanceAdjust widthAdjust =
GrDistanceFieldLCDTextGeoProc::DistanceAdjust::Make(redCorrection,
greenCorrection,
@@ -295,7 +298,7 @@
#ifdef SK_GAMMA_APPLY_TO_A8
U8CPU lum = SkColorSpaceLuminance::computeLuminance(SK_GAMMA_EXPONENT, filteredColor);
float correction = fDistanceAdjustTable->getAdjustment(
- lum >> kDistanceAdjustLumShift, fUseSRGBDistanceTable);
+ lum >> kDistanceAdjustLumShift, fUseGammaCorrectDistanceTable);
return GrDistanceFieldA8TextGeoProc::Create(color,
viewMatrix,
texture,