aboutsummaryrefslogtreecommitdiffstats
path: root/include/core/SkScalerContext.h
diff options
context:
space:
mode:
authorBilly Hewlett <billyh@google.com>2012-07-03 17:03:55 -0700
committerVictoria Lease <violets@google.com>2012-08-20 08:43:58 -0700
commit725b3e03acb91dc69296554932624b36612bd189 (patch)
tree56edf31f828b49d7b202522b91ac389a29e55714 /include/core/SkScalerContext.h
parent8ab6679ce80dafa0d97c426c9fe70c6b6ceb20e6 (diff)
downloadexternal_skia-725b3e03acb91dc69296554932624b36612bd189.zip
external_skia-725b3e03acb91dc69296554932624b36612bd189.tar.gz
external_skia-725b3e03acb91dc69296554932624b36612bd189.tar.bz2
DO NOT MERGE Han Preference
Cherry-pick Id8c91ae0be6cad8a7ef77a0cd5803676290986c1 from master. During font initialization, create a seperate fallback list for each locale. At runtime, use the fallbacklist associated with the locale set in the paint object. Fallback files are associated with locales in fallback_fonts.xml. Multiple files can be associated with the same locale, ordering within that langauge and apart from that language in the fallback order is preserved. This changelist also includes some refactoring, notably of the functions that call getNextContext(). Change-Id: I121f0e491a522c4a8558a0066b2d8969fb8a3667
Diffstat (limited to 'include/core/SkScalerContext.h')
-rw-r--r--include/core/SkScalerContext.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/include/core/SkScalerContext.h b/include/core/SkScalerContext.h
index 33c3c3d..4a0c70d 100644
--- a/include/core/SkScalerContext.h
+++ b/include/core/SkScalerContext.h
@@ -17,6 +17,10 @@
#include "SkPoint.h"
#include "SkTypeface.h"
+#ifdef SK_BUILD_FOR_ANDROID
+#include "SkLanguage.h"
+#endif
+
//#define SK_USE_COLOR_LUMINANCE
class SkDescriptor;
@@ -211,6 +215,7 @@ public:
uint32_t fLumBits;
#endif
#ifdef SK_BUILD_FOR_ANDROID
+ SkLanguage fLanguage;
SkPaint::FontVariant fFontVariant;
#endif
uint8_t fMaskFormat;
@@ -304,16 +309,7 @@ public:
#ifdef SK_BUILD_FOR_ANDROID
// This function must be public for SkTypeface_android.h, but should not be
// called by other callers
- SkFontID findTypefaceIdForChar(SkUnichar uni) {
- SkScalerContext* ctx = this;
- while (NULL != ctx) {
- if (ctx->generateCharToGlyph(uni)) {
- return ctx->fRec.fFontID;
- }
- ctx = ctx->getNextContext();
- }
- return 0;
- }
+ SkFontID findTypefaceIdForChar(SkUnichar uni);
unsigned getBaseGlyphCount(SkUnichar charCode);
#endif
@@ -341,6 +337,8 @@ protected:
void forceGenerateImageFromPath() { fGenerateImageFromPath = true; }
private:
+ SkScalerContext* getContextFromChar(SkUnichar uni, unsigned& glyphID);
+
SkPathEffect* fPathEffect;
SkMaskFilter* fMaskFilter;
SkRasterizer* fRasterizer;