From 7435f34b4720241f20d101879dffdcbf678a53a0 Mon Sep 17 00:00:00 2001 From: "bungeman@google.com" Date: Tue, 26 Nov 2013 20:43:27 +0000 Subject: [PATCH] Minimal changes to not crash GPU with color fonts. Review URL: https://codereview.chromium.org/88993003 git-svn-id: http://skia.googlecode.com/svn/trunk@12400 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/fonts/SkGScalerContext.cpp | 2 ++ src/gpu/SkGrFontScaler.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/fonts/SkGScalerContext.cpp b/src/fonts/SkGScalerContext.cpp index f0543c571..551b01c96 100644 --- a/src/fonts/SkGScalerContext.cpp +++ b/src/fonts/SkGScalerContext.cpp @@ -176,6 +176,8 @@ SkScalerContext* SkGTypeface::onCreateScalerContext( void SkGTypeface::onFilterRec(SkScalerContextRec* rec) const { fProxy->filterRec(rec); + rec->setHinting(SkPaint::kNo_Hinting); + rec->fMaskFormat = SkMask::kARGB32_Format; } SkAdvancedTypefaceMetrics* SkGTypeface::onGetAdvancedTypefaceMetrics( diff --git a/src/gpu/SkGrFontScaler.cpp b/src/gpu/SkGrFontScaler.cpp index 651486665..1ca9357c6 100644 --- a/src/gpu/SkGrFontScaler.cpp +++ b/src/gpu/SkGrFontScaler.cpp @@ -85,6 +85,8 @@ GrMaskFormat SkGrFontScaler::getMaskFormat() { return kA8_GrMaskFormat; case SkMask::kLCD16_Format: return kA565_GrMaskFormat; + // TODO: properly support kARGB32_Format. + case SkMask::kARGB32_Format: case SkMask::kLCD32_Format: return kA888_GrMaskFormat; default: