Only use fake gamma with linear devices.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1711223003

Review URL: https://codereview.chromium.org/1711223003
diff --git a/src/gpu/text/GrAtlasTextBlob.cpp b/src/gpu/text/GrAtlasTextBlob.cpp
index 26f6a7c..62591f8 100644
--- a/src/gpu/text/GrAtlasTextBlob.cpp
+++ b/src/gpu/text/GrAtlasTextBlob.cpp
@@ -51,15 +51,15 @@
 
 SkGlyphCache* GrAtlasTextBlob::setupCache(int runIndex,
                                           const SkSurfaceProps& props,
+                                          SkPaint::FakeGamma fakeGamma,
                                           const SkPaint& skPaint,
-                                          const SkMatrix* viewMatrix,
-                                          bool noGamma) {
+                                          const SkMatrix* viewMatrix) {
     GrAtlasTextBlob::Run* run = &fRuns[runIndex];
 
     // if we have an override descriptor for the run, then we should use that
     SkAutoDescriptor* desc = run->fOverrideDescriptor.get() ? run->fOverrideDescriptor.get() :
                                                               &run->fDescriptor;
-    skPaint.getScalerContextDescriptor(desc, props, viewMatrix, noGamma);
+    skPaint.getScalerContextDescriptor(desc, props, fakeGamma, viewMatrix);
     run->fTypeface.reset(SkSafeRef(skPaint.getTypeface()));
     return SkGlyphCache::DetachCache(run->fTypeface, desc->getDesc());
 }
diff --git a/src/gpu/text/GrAtlasTextBlob.h b/src/gpu/text/GrAtlasTextBlob.h
index a026693..a6531f1 100644
--- a/src/gpu/text/GrAtlasTextBlob.h
+++ b/src/gpu/text/GrAtlasTextBlob.h
@@ -148,9 +148,9 @@
 
     SkGlyphCache* setupCache(int runIndex,
                              const SkSurfaceProps& props,
+                             SkPaint::FakeGamma fakeGamma,
                              const SkPaint& skPaint,
-                             const SkMatrix* viewMatrix,
-                             bool noGamma);
+                             const SkMatrix* viewMatrix);
 
     // Appends a glyph to the blob.  If the glyph is too large, the glyph will be appended
     // as a path.
diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp
index 205c6d9..a87e5d2 100644
--- a/src/gpu/text/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp
@@ -629,7 +629,7 @@
 
 SkGlyphCache* GrStencilAndCoverTextContext::TextRun::getGlyphCache() const {
     if (!fDetachedGlyphCache) {
-        fDetachedGlyphCache = fFont.detachCache(nullptr, nullptr, true /*ignoreGamma*/);
+        fDetachedGlyphCache = fFont.detachCache(nullptr, SkPaint::FakeGamma::Off, nullptr);
     }
     return fDetachedGlyphCache;
 }
diff --git a/src/gpu/text/GrTextUtils.cpp b/src/gpu/text/GrTextUtils.cpp
index 59ecbc0..112f5bd 100644
--- a/src/gpu/text/GrTextUtils.cpp
+++ b/src/gpu/text/GrTextUtils.cpp
@@ -57,7 +57,8 @@
     GrBatchTextStrike* currStrike = nullptr;
 
     // Get GrFontScaler from cache
-    SkGlyphCache* cache = blob->setupCache(runIndex, props, skPaint, &viewMatrix, false);
+    SkGlyphCache* cache = blob->setupCache(runIndex, props, SkPaint::FakeGamma::On,
+                                           skPaint, &viewMatrix);
     GrFontScaler* fontScaler = GrTextUtils::GetGrFontScaler(cache);
 
     SkFindAndPlaceGlyph::ProcessText(
@@ -98,7 +99,8 @@
     GrBatchTextStrike* currStrike = nullptr;
 
     // Get GrFontScaler from cache
-    SkGlyphCache* cache = blob->setupCache(runIndex, props, skPaint, &viewMatrix, false);
+    SkGlyphCache* cache = blob->setupCache(runIndex, props, SkPaint::FakeGamma::On,
+                                           skPaint, &viewMatrix);
     GrFontScaler* fontScaler = GrTextUtils::GetGrFontScaler(cache);
 
     SkFindAndPlaceGlyph::ProcessPosText(
@@ -258,7 +260,7 @@
 
     SkDrawCacheProc glyphCacheProc = skPaint.getDrawCacheProc();
     SkAutoDescriptor desc;
-    skPaint.getScalerContextDescriptor(&desc, props, nullptr, true);
+    skPaint.getScalerContextDescriptor(&desc, props, SkPaint::FakeGamma::Off, nullptr);
     SkGlyphCache* origPaintCache = SkGlyphCache::DetachCache(skPaint.getTypeface(),
                                                              desc.getDesc());
 
@@ -339,7 +341,8 @@
 
     GrBatchTextStrike* currStrike = nullptr;
 
-    SkGlyphCache* cache = blob->setupCache(runIndex, props, dfPaint, nullptr, true);
+    SkGlyphCache* cache = blob->setupCache(runIndex, props, SkPaint::FakeGamma::Off,
+                                           dfPaint, nullptr);
     SkDrawCacheProc glyphCacheProc = dfPaint.getDrawCacheProc();
     GrFontScaler* fontScaler = GrTextUtils::GetGrFontScaler(cache);