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

Unified Diff: src/core/SkScalerContext.h

Issue 434623002: Remove ALL font fallback logic from Skia. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix win font host 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 | « src/core/SkPaintOptionsAndroid.cpp ('k') | src/core/SkScalerContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkScalerContext.h
diff --git a/src/core/SkScalerContext.h b/src/core/SkScalerContext.h
index be5d3b555eb51ebae1681e69e126db22c8ad910c..43b5ebfaf6a71f8ad7f18f42f60493674ea15a3f 100644
--- a/src/core/SkScalerContext.h
+++ b/src/core/SkScalerContext.h
@@ -164,22 +164,21 @@ public:
return SkToBool(fRec.fFlags & kVertical_Flag);
}
- // remember our glyph offset/base
- void setBaseGlyphCount(unsigned baseGlyphCount) {
- fBaseGlyphCount = baseGlyphCount;
- }
-
/** Return the corresponding glyph for the specified unichar. Since contexts
may be chained (under the hood), the glyphID that is returned may in
fact correspond to a different font/context. In that case, we use the
base-glyph-count to know how to translate back into local glyph space.
*/
- uint16_t charToGlyphID(SkUnichar uni);
+ uint16_t charToGlyphID(SkUnichar uni) {
+ return generateCharToGlyph(uni);
+ }
/** Map the glyphID to its glyph index, and then to its char code. Unmapped
glyphs return zero.
*/
- SkUnichar glyphIDToChar(uint16_t glyphID);
+ SkUnichar glyphIDToChar(uint16_t glyphID) {
+ return (glyphID < getGlyphCount()) ? generateGlyphToChar(glyphID) : 0;
+ }
unsigned getGlyphCount() { return this->generateGlyphCount(); }
void getAdvance(SkGlyph*);
@@ -199,14 +198,6 @@ public:
static void GetGammaLUTData(SkScalar contrast, SkScalar paintGamma, SkScalar deviceGamma,
void* data);
-#ifdef SK_BUILD_FOR_ANDROID
- unsigned getBaseGlyphCount(SkUnichar charCode);
-
- // This function must be public for SkTypeface_android.h, but should not be
- // called by other callers
- SkFontID findTypefaceIdForChar(SkUnichar uni);
-#endif
-
static void MakeRec(const SkPaint&, const SkDeviceProperties* deviceProperties,
const SkMatrix*, Rec* rec);
static inline void PostMakeRec(const SkPaint&, Rec*);
@@ -215,7 +206,6 @@ public:
protected:
Rec fRec;
- unsigned fBaseGlyphCount;
/** Generates the contents of glyph.fAdvanceX and glyph.fAdvanceY.
* May call getMetrics if that would be just as fast.
@@ -288,25 +278,11 @@ private:
void internalGetPath(const SkGlyph& glyph, SkPath* fillPath,
SkPath* devPath, SkMatrix* fillToDevMatrix);
- // Return the context associated with the next logical typeface, or NULL if
- // there are no more entries in the fallback chain.
- SkScalerContext* allocNextContext() const;
-
- // return the next context, treating fNextContext as a cache of the answer
- SkScalerContext* getNextContext();
-
- // returns the right context from our link-list for this glyph. If no match
- // is found, just returns the original context (this)
- SkScalerContext* getGlyphContext(const SkGlyph& glyph);
-
// returns the right context from our link-list for this char. If no match
// is found it returns NULL. If a match is found then the glyphID param is
// set to the glyphID that maps to the provided char.
SkScalerContext* getContextFromChar(SkUnichar uni, uint16_t* glyphID);
- // link-list of context, to handle missing chars. null-terminated.
- SkScalerContext* fNextContext;
-
// SkMaskGamma::PreBlend converts linear masks to gamma correcting masks.
protected:
// Visible to subclasses so that generateImage can apply the pre-blend directly.
« no previous file with comments | « src/core/SkPaintOptionsAndroid.cpp ('k') | src/core/SkScalerContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698