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

Unified Diff: src/core/SkGlyphCache.h

Issue 897463004: Revert of Make the glyph array entries inline. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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/SkGlyph.h ('k') | src/core/SkGlyphCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkGlyphCache.h
diff --git a/src/core/SkGlyphCache.h b/src/core/SkGlyphCache.h
index 880508546834b8df937adb406e5bd8c0ab5e0f23..b335d29d2d8a8acf2005213bd11bf7f27a82a4ca 100644
--- a/src/core/SkGlyphCache.h
+++ b/src/core/SkGlyphCache.h
@@ -187,48 +187,32 @@
kFull_MetricsType
};
- // Return the SkGlyph* associated with MakeID. The id parameter is the combined glyph/x/y
- // id generated by MakeID. If it is just a glyph id then x and y are assuemd to be zero.
- SkGlyph* lookupByCombinedID(uint32_t id, MetricsType type);
-
- // Return a SkGlyph* associated with unicode id and position x and y.
- SkGlyph* lookupByChar(SkUnichar id, MetricsType type, SkFixed x = 0, SkFixed y = 0);
-
- // Return the index of id in the fGlyphArray. If it does
- // not exist, create a new one using MaetricsType.
- uint16_t lookupMetrics(uint32_t id, MetricsType type);
+ SkGlyph* lookupMetrics(uint32_t id, MetricsType);
static bool DetachProc(const SkGlyphCache*, void*) { return true; }
- SkGlyphCache* fNext, *fPrev;
- SkDescriptor* fDesc;
- SkScalerContext* fScalerContext;
+ SkGlyphCache* fNext, *fPrev;
+ SkDescriptor* fDesc;
+ SkScalerContext* fScalerContext;
SkPaint::FontMetrics fFontMetrics;
enum {
- kHashBits = 8,
- kHashCount = 1 << kHashBits,
- kHashMask = kHashCount - 1,
- kSentinelGlyphIndex = 0,
- kSentinelGlyphID = 0
- };
-
- // A quick lookup to avoid the binary search looking for glyphs in fGlyphArray.
- uint16_t fGlyphHash[kHashCount];
- SkTDArray<SkGlyph> fGlyphArray;
- SkChunkAlloc fGlyphAlloc;
+ kHashBits = 8,
+ kHashCount = 1 << kHashBits,
+ kHashMask = kHashCount - 1
+ };
+ SkGlyph* fGlyphHash[kHashCount];
+ SkTDArray<SkGlyph*> fGlyphArray;
+ SkChunkAlloc fGlyphAlloc;
struct CharGlyphRec {
uint32_t fID; // unichar + subpixel
- uint16_t fGlyphIndex;
- };
-
+ SkGlyph* fGlyph;
+ };
// no reason to use the same kHashCount as fGlyphHash, but we do for now
// Dynamically allocated when chars are encountered.
SkAutoTArray<CharGlyphRec> fCharToGlyphHash;
-
- // The id arg is a combined id generated by MakeID.
+
CharGlyphRec* getCharGlyphRec(uint32_t id);
- void adjustCaches(int insertion_index);
static inline unsigned ID2HashIndex(uint32_t h) {
return SkChecksum::CheapMix(h) & kHashMask;
« no previous file with comments | « src/core/SkGlyph.h ('k') | src/core/SkGlyphCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698