diff options
Diffstat (limited to 'src/gpu/text')
-rw-r--r-- | src/gpu/text/GrAtlasTextContext.cpp | 4 | ||||
-rw-r--r-- | src/gpu/text/GrAtlasTextContext.h | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp index 3faa0f7b87..73a27100d3 100644 --- a/src/gpu/text/GrAtlasTextContext.cpp +++ b/src/gpu/text/GrAtlasTextContext.cpp @@ -39,6 +39,7 @@ GrAtlasTextContext::GrAtlasTextContext(const Options& options) fMinDistanceFieldFontSize = options.fMinDistanceFieldFontSize < 0.f ? kDefaultMinDistanceFieldFontSize : options.fMinDistanceFieldFontSize; + fDistanceFieldVerticesAlwaysHaveW = options.fDistanceFieldVerticesAlwaysHaveW; } std::unique_ptr<GrAtlasTextContext> GrAtlasTextContext::Make(const Options& options) { @@ -646,7 +647,8 @@ void GrAtlasTextContext::drawDFPosText(GrAtlasTextBlob* blob, int runIndex, SkTDArray<char> fallbackTxt; SkTDArray<SkScalar> fallbackPos; - bool hasWCoord = viewMatrix.hasPerspective(); + bool hasWCoord = viewMatrix.hasPerspective() || fDistanceFieldVerticesAlwaysHaveW; + // Setup distance field paint and text ratio SkScalar textRatio; SkPaint dfPaint(paint); diff --git a/src/gpu/text/GrAtlasTextContext.h b/src/gpu/text/GrAtlasTextContext.h index 8db0d7e050..52c8dfcb87 100644 --- a/src/gpu/text/GrAtlasTextContext.h +++ b/src/gpu/text/GrAtlasTextContext.h @@ -38,6 +38,8 @@ public: * be rendered from outline as individual paths. Negative means use a default value. */ SkScalar fMaxDistanceFieldFontSize = -1.f; + /** Forces all distance field vertices to use 3 components, not just when in perspective. */ + bool fDistanceFieldVerticesAlwaysHaveW = false; }; static std::unique_ptr<GrAtlasTextContext> Make(const Options& options); @@ -142,6 +144,7 @@ private: SkScalar fMinDistanceFieldFontSize; SkScalar fMaxDistanceFieldFontSize; + bool fDistanceFieldVerticesAlwaysHaveW; #if GR_TEST_UTILS static const uint32_t kTextBlobOpScalerContextFlags = |