aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkGlyphCache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkGlyphCache.cpp')
-rw-r--r--src/core/SkGlyphCache.cpp30
1 files changed, 9 insertions, 21 deletions
diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp
index 3475b6037d..6930b37e6a 100644
--- a/src/core/SkGlyphCache.cpp
+++ b/src/core/SkGlyphCache.cpp
@@ -6,6 +6,7 @@
*/
#include "SkGlyphCache.h"
+
#include "SkGraphics.h"
#include "SkMutex.h"
#include "SkOnce.h"
@@ -15,10 +16,10 @@
#include <cctype>
SkGlyphCache::SkGlyphCache(
- const SkDescriptor& desc,
- std::unique_ptr<SkScalerContext> scaler,
- const SkPaint::FontMetrics& fontMetrics)
- : Node{desc}
+ const SkDescriptor& desc,
+ std::unique_ptr<SkScalerContext> scaler,
+ const SkPaint::FontMetrics& fontMetrics)
+ : fDesc{desc}
, fScalerContext{std::move(scaler)}
, fFontMetrics(fontMetrics)
{
@@ -34,6 +35,10 @@ SkGlyphCache::~SkGlyphCache() {
});
}
+const SkDescriptor& SkGlyphCache::getDescriptor() const {
+ return *fDesc.getDesc();
+}
+
SkGlyphCache::CharGlyphRec* SkGlyphCache::getCharGlyphRec(SkPackedUnicharID packedUnicharID) {
if (!fPackedUnicharIDToPackedGlyphID) {
fPackedUnicharIDToPackedGlyphID.reset(new CharGlyphRec[kHashCount]);
@@ -401,23 +406,6 @@ void SkGlyphCache::validate() const {
#endif
}
-void SkStrikeCache::validate() const {
- size_t computedBytes = 0;
- int computedCount = 0;
-
- const SkGlyphCache* head = fHead;
- while (head != nullptr) {
- computedBytes += head->fMemoryUsed;
- computedCount += 1;
- head = head->fNext;
- }
-
- SkASSERTF(fCacheCount == computedCount, "fCacheCount: %d, computedCount: %d", fCacheCount,
- computedCount);
- SkASSERTF(fTotalMemoryUsed == computedBytes, "fTotalMemoryUsed: %d, computedBytes: %d",
- fTotalMemoryUsed, computedBytes);
-}
-
#endif