aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkFontHost_win.cpp
diff options
context:
space:
mode:
authorGravatar kkinnunen <kkinnunen@nvidia.com>2014-06-24 00:12:27 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-06-24 00:12:27 -0700
commitc6cb56f36c4aad8ed45486a3bb4de614bb822f1b (patch)
treed231e40d459dfd1f5545e489fcf004318e82c2e4 /src/ports/SkFontHost_win.cpp
parent6fc763e3c2b1e539510cb18ece8b97e183099ab1 (diff)
Implement text rendering with NVPR
Use path rendering to render the text from outlines if supported by the GPU. Implement this in GrStencilAndCoverTextContext by copying chunks of code from GrBitmapTextContext. The drawing is implemented with "instanced" path drawing functions. Moves the creation of the "main" text context from SkGpuDevice to the GrContext::createTextContext. This is done because the decision of which text renderer is optimal can be made only with the internal implementation-specific information of the context. Remove a windows assertion from SkScalerContext_GDI::getGDIGlyphPath. The GetGlyphOutlineW fails in fontmgr_match for the initial space char in the string " [700] ...". According to MSDN, this is a known problem. Just return that the glyph has no path data in these cases. R=jvanverth@google.com, bsalomon@google.com, mtklein@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/196133014
Diffstat (limited to 'src/ports/SkFontHost_win.cpp')
-rwxr-xr-xsrc/ports/SkFontHost_win.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index 5a902148bd..a6ccf4d2ee 100755
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -1706,7 +1706,8 @@ DWORD SkScalerContext_GDI::getGDIGlyphPath(const SkGlyph& glyph, UINT flags,
LogFontTypeface::EnsureAccessible(this->getTypeface());
total_size = GetGlyphOutlineW(fDDC, glyph.fID, flags, &gm, 0, NULL, &fMat22);
if (GDI_ERROR == total_size) {
- SkASSERT(false);
+ // GetGlyphOutlineW is known to fail for some characters, such as spaces.
+ // In these cases, just return that the glyph does not have a shape.
return 0;
}
}