Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: src/ports/SkScalerContext_win_dw.cpp

Issue 510563003: win dw: Fallback to aliased if ClearType 'succeeds' but returns empty (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkScalerContext_win_dw.cpp
diff --git a/src/ports/SkScalerContext_win_dw.cpp b/src/ports/SkScalerContext_win_dw.cpp
index f27497be62ef7e40fdc88fede12c183624cbb227..a5771260bc0bafdece519288fc0571aef7d60b91 100644
--- a/src/ports/SkScalerContext_win_dw.cpp
+++ b/src/ports/SkScalerContext_win_dw.cpp
@@ -399,6 +399,7 @@ void SkScalerContext_DW::generateAdvance(SkGlyph* glyph) {
}
void SkScalerContext_DW::generateMetrics(SkGlyph* glyph) {
Shrikant Kelkar 2014/08/27 21:09:13 nit: optional generateMetricsInternal(SKGlyph* gl
+try_again:
glyph->fWidth = 0;
this->generateAdvance(glyph);
@@ -440,6 +441,12 @@ void SkScalerContext_DW::generateMetrics(SkGlyph* glyph) {
RECT bbox;
HRVM(glyphRunAnalysis->GetAlphaTextureBounds(fTextureType, &bbox),
"Could not get texture bounds.");
+ if (bbox.right == 0 && bbox.left == 0 && bbox.top == 0 && bbox.bottom == 0 &&
+ fTextureType == DWRITE_TEXTURE_CLEARTYPE_3x1) {
+ fTextureType = DWRITE_TEXTURE_ALIASED_1x1;
+ fRenderingMode = DWRITE_RENDERING_MODE_ALIASED;
+ goto try_again;
+ }
glyph->fWidth = SkToU16(bbox.right - bbox.left);
glyph->fHeight = SkToU16(bbox.bottom - bbox.top);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698