aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-04-08 06:47:54 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-08 06:47:54 -0700
commita1e8f8d8f1a0b7141136d7d49df1cc2fec0528df (patch)
tree9249c051645ac31322729f11d3caa4c619aa7b73 /src/gpu/text
parentb63c5766c3dece300167b41c5c4e30b7b330dfaa (diff)
Decouple contrast boost from fake gamma.
Replace FakeGamma with FontWeightFlags. Largely mechanical, except for the changes in ignorePreBlend. With this change, text GMs generally look the same (or at least more similar) in 8888/srgb/gpu/gpusrgb configs. No public API changes. TBR=reed@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1866293003 Review URL: https://codereview.chromium.org/1866293003
Diffstat (limited to 'src/gpu/text')
-rw-r--r--src/gpu/text/GrAtlasTextBlob.cpp4
-rw-r--r--src/gpu/text/GrAtlasTextBlob.h2
-rw-r--r--src/gpu/text/GrAtlasTextContext.cpp74
-rw-r--r--src/gpu/text/GrAtlasTextContext.h16
-rw-r--r--src/gpu/text/GrStencilAndCoverTextContext.cpp3
-rw-r--r--src/gpu/text/GrTextUtils.cpp28
-rw-r--r--src/gpu/text/GrTextUtils.h9
7 files changed, 71 insertions, 65 deletions
diff --git a/src/gpu/text/GrAtlasTextBlob.cpp b/src/gpu/text/GrAtlasTextBlob.cpp
index 62591f87b0..4b339d4adb 100644
--- a/src/gpu/text/GrAtlasTextBlob.cpp
+++ b/src/gpu/text/GrAtlasTextBlob.cpp
@@ -51,7 +51,7 @@ GrAtlasTextBlob* GrAtlasTextBlob::Create(GrMemoryPool* pool, int glyphCount, int
SkGlyphCache* GrAtlasTextBlob::setupCache(int runIndex,
const SkSurfaceProps& props,
- SkPaint::FakeGamma fakeGamma,
+ uint32_t scalerContextFlags,
const SkPaint& skPaint,
const SkMatrix* viewMatrix) {
GrAtlasTextBlob::Run* run = &fRuns[runIndex];
@@ -59,7 +59,7 @@ SkGlyphCache* GrAtlasTextBlob::setupCache(int 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, fakeGamma, viewMatrix);
+ skPaint.getScalerContextDescriptor(desc, props, scalerContextFlags, 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 a6531f167b..36e45abcff 100644
--- a/src/gpu/text/GrAtlasTextBlob.h
+++ b/src/gpu/text/GrAtlasTextBlob.h
@@ -148,7 +148,7 @@ public:
SkGlyphCache* setupCache(int runIndex,
const SkSurfaceProps& props,
- SkPaint::FakeGamma fakeGamma,
+ uint32_t scalerContextFlags,
const SkPaint& skPaint,
const SkMatrix* viewMatrix);
diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp
index 574993a3ca..6a1f7af4b3 100644
--- a/src/gpu/text/GrAtlasTextContext.cpp
+++ b/src/gpu/text/GrAtlasTextContext.cpp
@@ -53,14 +53,15 @@ GrColor GrAtlasTextContext::ComputeCanonicalColor(const SkPaint& paint, bool lcd
return canonicalColor;
}
-SkPaint::FakeGamma GrAtlasTextContext::ComputeFakeGamma(GrDrawContext* dc, const GrPaint& grPaint) {
+uint32_t GrAtlasTextContext::ComputeScalerContextFlags(GrDrawContext* dc, const GrPaint& grPaint) {
// If we're rendering to an sRGB render target, and we aren't forcing sRGB blending off,
- // then we can disable the gamma hacks. Otherwise, leave them on:
+ // then we can disable the gamma hacks. Otherwise, leave them on. In either case, we still
+ // want the contrast boost:
if (GrPixelConfigIsSRGB(dc->accessRenderTarget()->config()) &&
!grPaint.getDisableOutputConversionToSRGB()) {
- return SkPaint::FakeGamma::Off;
+ return SkPaint::kBoostContrast_ScalerContextFlag;
} else {
- return SkPaint::FakeGamma::On;
+ return SkPaint::kFakeGammaAndBoostContrast_ScalerContextFlags;
}
}
@@ -127,7 +128,7 @@ void GrAtlasTextContext::drawTextBlob(GrContext* context, GrDrawContext* dc,
return;
}
- SkPaint::FakeGamma fakeGamma = ComputeFakeGamma(dc, grPaint);
+ uint32_t scalerContextFlags = ComputeScalerContextFlags(dc, grPaint);
if (cacheBlob) {
if (cacheBlob->mustRegenerate(skPaint, grPaint.getColor(), blurRec, viewMatrix, x, y)) {
@@ -138,7 +139,7 @@ void GrAtlasTextContext::drawTextBlob(GrContext* context, GrDrawContext* dc,
cacheBlob.reset(SkRef(cache->createCachedBlob(blob, key, blurRec, skPaint)));
RegenerateTextBlob(cacheBlob, context->getBatchFontCache(),
*context->caps()->shaderCaps(), skPaint, grPaint.getColor(),
- fakeGamma, viewMatrix, props,
+ scalerContextFlags, viewMatrix, props,
blob, x, y, drawFilter);
} else {
cache->makeMRU(cacheBlob);
@@ -151,7 +152,7 @@ void GrAtlasTextContext::drawTextBlob(GrContext* context, GrDrawContext* dc,
sanityBlob->setupKey(key, blurRec, skPaint);
RegenerateTextBlob(sanityBlob, context->getBatchFontCache(),
*context->caps()->shaderCaps(), skPaint,
- grPaint.getColor(), fakeGamma, viewMatrix, props,
+ grPaint.getColor(), scalerContextFlags, viewMatrix, props,
blob, x, y, drawFilter);
GrAtlasTextBlob::AssertEqual(*sanityBlob, *cacheBlob);
}
@@ -164,7 +165,7 @@ void GrAtlasTextContext::drawTextBlob(GrContext* context, GrDrawContext* dc,
}
RegenerateTextBlob(cacheBlob, context->getBatchFontCache(),
*context->caps()->shaderCaps(), skPaint, grPaint.getColor(),
- fakeGamma, viewMatrix, props,
+ scalerContextFlags, viewMatrix, props,
blob, x, y, drawFilter);
}
@@ -176,7 +177,7 @@ void GrAtlasTextContext::RegenerateTextBlob(GrAtlasTextBlob* cacheBlob,
GrBatchFontCache* fontCache,
const GrShaderCaps& shaderCaps,
const SkPaint& skPaint, GrColor color,
- SkPaint::FakeGamma fakeGamma,
+ uint32_t scalerContextFlags,
const SkMatrix& viewMatrix,
const SkSurfaceProps& props,
const SkTextBlob* blob, SkScalar x, SkScalar y,
@@ -208,25 +209,25 @@ void GrAtlasTextContext::RegenerateTextBlob(GrAtlasTextBlob* cacheBlob,
switch (it.positioning()) {
case SkTextBlob::kDefault_Positioning: {
GrTextUtils::DrawDFText(cacheBlob, run, fontCache,
- props, runPaint, color, fakeGamma, viewMatrix,
- (const char *)it.glyphs(), textLen,
+ props, runPaint, color, scalerContextFlags,
+ viewMatrix, (const char *)it.glyphs(), textLen,
x + offset.x(), y + offset.y());
break;
}
case SkTextBlob::kHorizontal_Positioning: {
SkPoint dfOffset = SkPoint::Make(x, y + offset.y());
GrTextUtils::DrawDFPosText(cacheBlob, run, fontCache,
- props, runPaint, color, fakeGamma, viewMatrix,
- (const char*)it.glyphs(), textLen, it.pos(),
- 1, dfOffset);
+ props, runPaint, color, scalerContextFlags,
+ viewMatrix, (const char*)it.glyphs(), textLen,
+ it.pos(), 1, dfOffset);
break;
}
case SkTextBlob::kFull_Positioning: {
SkPoint dfOffset = SkPoint::Make(x, y);
GrTextUtils::DrawDFPosText(cacheBlob, run, fontCache,
- props, runPaint, color, fakeGamma, viewMatrix,
- (const char*)it.glyphs(), textLen, it.pos(),
- 2, dfOffset);
+ props, runPaint, color, scalerContextFlags,
+ viewMatrix, (const char*)it.glyphs(), textLen,
+ it.pos(), 2, dfOffset);
break;
}
}
@@ -236,21 +237,21 @@ void GrAtlasTextContext::RegenerateTextBlob(GrAtlasTextBlob* cacheBlob,
switch (it.positioning()) {
case SkTextBlob::kDefault_Positioning:
GrTextUtils::DrawBmpText(cacheBlob, run, fontCache,
- props, runPaint, color, fakeGamma, viewMatrix,
- (const char *)it.glyphs(), textLen,
+ props, runPaint, color, scalerContextFlags,
+ viewMatrix, (const char *)it.glyphs(), textLen,
x + offset.x(), y + offset.y());
break;
case SkTextBlob::kHorizontal_Positioning:
GrTextUtils::DrawBmpPosText(cacheBlob, run, fontCache,
- props, runPaint, color, fakeGamma, viewMatrix,
- (const char*)it.glyphs(), textLen, it.pos(), 1,
- SkPoint::Make(x, y + offset.y()));
+ props, runPaint, color, scalerContextFlags,
+ viewMatrix, (const char*)it.glyphs(), textLen,
+ it.pos(), 1, SkPoint::Make(x, y + offset.y()));
break;
case SkTextBlob::kFull_Positioning:
GrTextUtils::DrawBmpPosText(cacheBlob, run, fontCache,
- props, runPaint, color, fakeGamma, viewMatrix,
- (const char*)it.glyphs(), textLen, it.pos(), 2,
- SkPoint::Make(x, y));
+ props, runPaint, color, scalerContextFlags,
+ viewMatrix, (const char*)it.glyphs(), textLen,
+ it.pos(), 2, SkPoint::Make(x, y));
break;
}
}
@@ -268,7 +269,7 @@ GrAtlasTextContext::CreateDrawTextBlob(GrTextBlobCache* blobCache,
const GrShaderCaps& shaderCaps,
const GrPaint& paint,
const SkPaint& skPaint,
- SkPaint::FakeGamma fakeGamma,
+ uint32_t scalerContextFlags,
const SkMatrix& viewMatrix,
const SkSurfaceProps& props,
const char text[], size_t byteLength,
@@ -279,12 +280,11 @@ GrAtlasTextContext::CreateDrawTextBlob(GrTextBlobCache* blobCache,
blob->initThrowawayBlob(viewMatrix, x, y);
if (GrTextUtils::CanDrawAsDistanceFields(skPaint, viewMatrix, props, shaderCaps)) {
- GrTextUtils::DrawDFText(blob, 0, fontCache, props,
- skPaint, paint.getColor(), fakeGamma, viewMatrix, text,
- byteLength, x, y);
+ GrTextUtils::DrawDFText(blob, 0, fontCache, props, skPaint, paint.getColor(),
+ scalerContextFlags, viewMatrix, text, byteLength, x, y);
} else {
- GrTextUtils::DrawBmpText(blob, 0, fontCache, props, skPaint,
- paint.getColor(), fakeGamma, viewMatrix, text, byteLength, x, y);
+ GrTextUtils::DrawBmpText(blob, 0, fontCache, props, skPaint, paint.getColor(),
+ scalerContextFlags, viewMatrix, text, byteLength, x, y);
}
return blob;
}
@@ -292,7 +292,7 @@ GrAtlasTextContext::CreateDrawTextBlob(GrTextBlobCache* blobCache,
inline GrAtlasTextBlob*
GrAtlasTextContext::CreateDrawPosTextBlob(GrTextBlobCache* blobCache, GrBatchFontCache* fontCache,
const GrShaderCaps& shaderCaps, const GrPaint& paint,
- const SkPaint& skPaint, SkPaint::FakeGamma fakeGamma,
+ const SkPaint& skPaint, uint32_t scalerContextFlags,
const SkMatrix& viewMatrix, const SkSurfaceProps& props,
const char text[], size_t byteLength,
const SkScalar pos[], int scalarsPerPosition,
@@ -304,11 +304,11 @@ GrAtlasTextContext::CreateDrawPosTextBlob(GrTextBlobCache* blobCache, GrBatchFon
if (GrTextUtils::CanDrawAsDistanceFields(skPaint, viewMatrix, props, shaderCaps)) {
GrTextUtils::DrawDFPosText(blob, 0, fontCache, props,
- skPaint, paint.getColor(), fakeGamma, viewMatrix, text,
+ skPaint, paint.getColor(), scalerContextFlags, viewMatrix, text,
byteLength, pos, scalarsPerPosition, offset);
} else {
GrTextUtils::DrawBmpPosText(blob, 0, fontCache, props, skPaint,
- paint.getColor(), fakeGamma, viewMatrix, text,
+ paint.getColor(), scalerContextFlags, viewMatrix, text,
byteLength, pos, scalarsPerPosition, offset);
}
return blob;
@@ -329,7 +329,7 @@ void GrAtlasTextContext::drawText(GrContext* context,
CreateDrawTextBlob(context->getTextBlobCache(), context->getBatchFontCache(),
*context->caps()->shaderCaps(),
paint, skPaint,
- ComputeFakeGamma(dc, paint),
+ ComputeScalerContextFlags(dc, paint),
viewMatrix, props,
text, byteLength, x, y));
blob->flushThrowaway(context, dc, props, fDistanceAdjustTable, skPaint, paint,
@@ -359,7 +359,7 @@ void GrAtlasTextContext::drawPosText(GrContext* context,
context->getBatchFontCache(),
*context->caps()->shaderCaps(),
paint, skPaint,
- ComputeFakeGamma(dc, paint),
+ ComputeScalerContextFlags(dc, paint),
viewMatrix, props,
text, byteLength,
pos, scalarsPerPosition,
@@ -423,7 +423,7 @@ DRAW_BATCH_TEST_DEFINE(TextBlobBatch) {
GrAtlasTextContext::CreateDrawTextBlob(context->getTextBlobCache(),
context->getBatchFontCache(),
*context->caps()->shaderCaps(), grPaint, skPaint,
- GrAtlasTextContext::kTextBlobBatchFakeGamma,
+ GrAtlasTextContext::kTextBlobBatchScalerContextFlags,
viewMatrix,
gSurfaceProps, text,
static_cast<size_t>(textLen), x, y));
diff --git a/src/gpu/text/GrAtlasTextContext.h b/src/gpu/text/GrAtlasTextContext.h
index a784acb72c..6d93783044 100644
--- a/src/gpu/text/GrAtlasTextContext.h
+++ b/src/gpu/text/GrAtlasTextContext.h
@@ -52,12 +52,13 @@ private:
// sets up the descriptor on the blob and returns a detached cache. Client must attach
inline static GrColor ComputeCanonicalColor(const SkPaint&, bool lcd);
- // Determines if we need to use FakeGamma:
- inline static SkPaint::FakeGamma ComputeFakeGamma(GrDrawContext*, const GrPaint&);
+ // Determines if we need to use fake gamma (and contrast boost):
+ inline static uint32_t ComputeScalerContextFlags(GrDrawContext*, const GrPaint&);
static void RegenerateTextBlob(GrAtlasTextBlob* bmp,
GrBatchFontCache*,
const GrShaderCaps&,
- const SkPaint& skPaint, GrColor, SkPaint::FakeGamma,
+ const SkPaint& skPaint, GrColor,
+ uint32_t scalerContextFlags,
const SkMatrix& viewMatrix,
const SkSurfaceProps&,
const SkTextBlob* blob, SkScalar x, SkScalar y,
@@ -67,7 +68,8 @@ private:
static inline GrAtlasTextBlob* CreateDrawTextBlob(GrTextBlobCache*,
GrBatchFontCache*, const GrShaderCaps&,
const GrPaint&,
- const SkPaint&, SkPaint::FakeGamma,
+ const SkPaint&,
+ uint32_t scalerContextFlags,
const SkMatrix& viewMatrix,
const SkSurfaceProps&,
const char text[], size_t byteLength,
@@ -75,7 +77,8 @@ private:
static inline GrAtlasTextBlob* CreateDrawPosTextBlob(GrTextBlobCache*, GrBatchFontCache*,
const GrShaderCaps&,
const GrPaint&,
- const SkPaint&, SkPaint::FakeGamma,
+ const SkPaint&,
+ uint32_t scalerContextFlags,
const SkMatrix& viewMatrix,
const SkSurfaceProps&,
const char text[], size_t byteLength,
@@ -87,7 +90,8 @@ private:
SkAutoTUnref<const GrDistanceFieldAdjustTable> fDistanceAdjustTable;
#ifdef GR_TEST_UTILS
- static const SkPaint::FakeGamma kTextBlobBatchFakeGamma = SkPaint::FakeGamma::On;
+ static const uint32_t kTextBlobBatchScalerContextFlags =
+ SkPaint::kFakeGammaAndBoostContrast_ScalerContextFlags;
DRAW_BATCH_TEST_FRIEND(TextBlobBatch);
#endif
};
diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp
index 151858b8b9..f0c66979d5 100644
--- a/src/gpu/text/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp
@@ -631,7 +631,8 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx,
SkGlyphCache* GrStencilAndCoverTextContext::TextRun::getGlyphCache() const {
if (!fDetachedGlyphCache) {
- fDetachedGlyphCache = fFont.detachCache(nullptr, SkPaint::FakeGamma::Off, nullptr);
+ fDetachedGlyphCache = fFont.detachCache(nullptr, SkPaint::kNone_ScalerContextFlags,
+ nullptr);
}
return fDetachedGlyphCache;
}
diff --git a/src/gpu/text/GrTextUtils.cpp b/src/gpu/text/GrTextUtils.cpp
index ad5c040977..3616bcada1 100644
--- a/src/gpu/text/GrTextUtils.cpp
+++ b/src/gpu/text/GrTextUtils.cpp
@@ -40,7 +40,7 @@ static const int kLargeDFFontLimit = 2 * kLargeDFFontSize;
void GrTextUtils::DrawBmpText(GrAtlasTextBlob* blob, int runIndex,
GrBatchFontCache* fontCache,
const SkSurfaceProps& props, const SkPaint& skPaint,
- GrColor color, SkPaint::FakeGamma fakeGamma,
+ GrColor color, uint32_t scalerContextFlags,
const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
SkScalar x, SkScalar y) {
@@ -57,8 +57,8 @@ void GrTextUtils::DrawBmpText(GrAtlasTextBlob* blob, int runIndex,
GrBatchTextStrike* currStrike = nullptr;
// Get GrFontScaler from cache
- SkGlyphCache* cache = blob->setupCache(runIndex, props, fakeGamma,
- skPaint, &viewMatrix);
+ SkGlyphCache* cache = blob->setupCache(runIndex, props, scalerContextFlags, skPaint,
+ &viewMatrix);
GrFontScaler* fontScaler = GrTextUtils::GetGrFontScaler(cache);
SkFindAndPlaceGlyph::ProcessText(
@@ -80,7 +80,7 @@ void GrTextUtils::DrawBmpText(GrAtlasTextBlob* blob, int runIndex,
void GrTextUtils::DrawBmpPosText(GrAtlasTextBlob* blob, int runIndex,
GrBatchFontCache* fontCache,
const SkSurfaceProps& props, const SkPaint& skPaint,
- GrColor color, SkPaint::FakeGamma fakeGamma,
+ GrColor color, uint32_t scalerContextFlags,
const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
const SkScalar pos[], int scalarsPerPosition,
@@ -99,8 +99,8 @@ void GrTextUtils::DrawBmpPosText(GrAtlasTextBlob* blob, int runIndex,
GrBatchTextStrike* currStrike = nullptr;
// Get GrFontScaler from cache
- SkGlyphCache* cache = blob->setupCache(runIndex, props, fakeGamma,
- skPaint, &viewMatrix);
+ SkGlyphCache* cache = blob->setupCache(runIndex, props, scalerContextFlags, skPaint,
+ &viewMatrix);
GrFontScaler* fontScaler = GrTextUtils::GetGrFontScaler(cache);
SkFindAndPlaceGlyph::ProcessPosText(
@@ -247,7 +247,7 @@ void GrTextUtils::InitDistanceFieldPaint(GrAtlasTextBlob* blob,
void GrTextUtils::DrawDFText(GrAtlasTextBlob* blob, int runIndex,
GrBatchFontCache* fontCache, const SkSurfaceProps& props,
- const SkPaint& skPaint, GrColor color, SkPaint::FakeGamma fakeGamma,
+ const SkPaint& skPaint, GrColor color, uint32_t scalerContextFlags,
const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
SkScalar x, SkScalar y) {
@@ -261,8 +261,8 @@ void GrTextUtils::DrawDFText(GrAtlasTextBlob* blob, int runIndex,
SkPaint::GlyphCacheProc glyphCacheProc = skPaint.getGlyphCacheProc(true);
SkAutoDescriptor desc;
// We apply the fake-gamma by altering the distance in the shader, so we ignore the
- // fakeGamma parameter. (It's only used when we fall-back to bitmap text).
- skPaint.getScalerContextDescriptor(&desc, props, SkPaint::FakeGamma::Off, nullptr);
+ // passed-in scaler context flags. (It's only used when we fall-back to bitmap text).
+ skPaint.getScalerContextDescriptor(&desc, props, SkPaint::kNone_ScalerContextFlags, nullptr);
SkGlyphCache* origPaintCache = SkGlyphCache::DetachCache(skPaint.getTypeface(),
desc.getDesc());
@@ -312,14 +312,14 @@ void GrTextUtils::DrawDFText(GrAtlasTextBlob* blob, int runIndex,
y -= alignY;
SkPoint offset = SkPoint::Make(x, y);
- DrawDFPosText(blob, runIndex, fontCache, props, skPaint, color, fakeGamma, viewMatrix,
+ DrawDFPosText(blob, runIndex, fontCache, props, skPaint, color, scalerContextFlags, viewMatrix,
text, byteLength, positions.begin(), 2, offset);
}
void GrTextUtils::DrawDFPosText(GrAtlasTextBlob* blob, int runIndex,
GrBatchFontCache* fontCache, const SkSurfaceProps& props,
const SkPaint& origPaint,
- GrColor color, SkPaint::FakeGamma fakeGamma,
+ GrColor color, uint32_t scalerContextFlags,
const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
const SkScalar pos[], int scalarsPerPosition,
@@ -345,8 +345,8 @@ void GrTextUtils::DrawDFPosText(GrAtlasTextBlob* blob, int runIndex,
GrBatchTextStrike* currStrike = nullptr;
// We apply the fake-gamma by altering the distance in the shader, so we ignore the
- // fakeGamma parameter. (It's only used when we fall-back to bitmap text).
- SkGlyphCache* cache = blob->setupCache(runIndex, props, SkPaint::FakeGamma::Off,
+ // passed-in scaler context flags. (It's only used when we fall-back to bitmap text).
+ SkGlyphCache* cache = blob->setupCache(runIndex, props, SkPaint::kNone_ScalerContextFlags,
dfPaint, nullptr);
SkPaint::GlyphCacheProc glyphCacheProc = dfPaint.getGlyphCacheProc(true);
GrFontScaler* fontScaler = GrTextUtils::GetGrFontScaler(cache);
@@ -420,7 +420,7 @@ void GrTextUtils::DrawDFPosText(GrAtlasTextBlob* blob, int runIndex,
if (fallbackTxt.count()) {
blob->initOverride(runIndex);
GrTextUtils::DrawBmpPosText(blob, runIndex, fontCache, props,
- origPaint, origPaint.getColor(), fakeGamma, viewMatrix,
+ origPaint, origPaint.getColor(), scalerContextFlags, viewMatrix,
fallbackTxt.begin(), fallbackTxt.count(),
fallbackPos.begin(), scalarsPerPosition, offset);
}
diff --git a/src/gpu/text/GrTextUtils.h b/src/gpu/text/GrTextUtils.h
index 52b3ab4c54..7823473f77 100644
--- a/src/gpu/text/GrTextUtils.h
+++ b/src/gpu/text/GrTextUtils.h
@@ -38,13 +38,13 @@ public:
static void DrawBmpText(GrAtlasTextBlob*, int runIndex,
GrBatchFontCache*, const SkSurfaceProps&,
const SkPaint&,
- GrColor, SkPaint::FakeGamma, const SkMatrix& viewMatrix,
+ GrColor, uint32_t scalerContextFlags, const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
SkScalar x, SkScalar y);
static void DrawBmpPosText(GrAtlasTextBlob*, int runIndex,
GrBatchFontCache*, const SkSurfaceProps&, const SkPaint&,
- GrColor, SkPaint::FakeGamma, const SkMatrix& viewMatrix,
+ GrColor, uint32_t scalerContextFlags, const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
const SkScalar pos[], int scalarsPerPosition,
const SkPoint& offset);
@@ -55,14 +55,15 @@ public:
static void DrawDFText(GrAtlasTextBlob* blob, int runIndex,
GrBatchFontCache*, const SkSurfaceProps&,
- const SkPaint& skPaint, GrColor color, SkPaint::FakeGamma,
+ const SkPaint& skPaint, GrColor color, uint32_t scalerContextFlags,
const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
SkScalar x, SkScalar y);
static void DrawDFPosText(GrAtlasTextBlob* blob, int runIndex,
GrBatchFontCache*, const SkSurfaceProps&, const SkPaint&,
- GrColor color, SkPaint::FakeGamma, const SkMatrix& viewMatrix,
+ GrColor color, uint32_t scalerContextFlags,
+ const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
const SkScalar pos[], int scalarsPerPosition,
const SkPoint& offset);