aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2018-05-01 16:13:20 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-01 20:52:05 +0000
commit0f91bb874dc3201dbc3cce3b946f66e3e484c6fc (patch)
tree13483fb7d8371c8b14127137c964b0de765e06ac /src/gpu/text
parent7e7369f7131d0b00f87cfb94e0fcbf91b02b4ee6 (diff)
Correct precondition for SDF mask format.
When creating an SDF glyph the mask format of the underlying glyph must be A1 or A8. Currently the code just checks for ~ARGB, but LCD16, 3D, and any other possible mask formats are also unsupported. Change-Id: I092a18828742dddfc93687eabd9858186605fc96 Reviewed-on: https://skia-review.googlesource.com/125083 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'src/gpu/text')
-rw-r--r--src/gpu/text/GrAtlasTextContext.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp
index 6be6b5b8c3..27c8dea670 100644
--- a/src/gpu/text/GrAtlasTextContext.cpp
+++ b/src/gpu/text/GrAtlasTextContext.cpp
@@ -795,7 +795,9 @@ void GrAtlasTextContext::drawDFPosText(GrAtlasTextBlob* blob, int runIndex,
glyphPos.fY += (2 == scalarsPerPosition ? pos[1] : 0) -
SkFloatToScalar(glyph.fAdvanceY) * alignMul * textRatio;
- if (glyph.fMaskFormat != SkMask::kARGB32_Format) {
+ if (glyph.fMaskFormat == SkMask::kA8_Format ||
+ glyph.fMaskFormat == SkMask::kBW_Format)
+ {
DfAppendGlyph(blob, runIndex, glyphCache, &currStrike, glyph, glyphPos.fX,
glyphPos.fY, paint.filteredPremulColor(), cache.get(), textRatio);
} else {