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

Unified Diff: src/core/SkTypefaceCache.cpp

Issue 23067003: expose instance methods on SkTypefaceCache (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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/SkTypefaceCache.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTypefaceCache.cpp
diff --git a/src/core/SkTypefaceCache.cpp b/src/core/SkTypefaceCache.cpp
index b75b2a9af95db764af35102b0b36c2a9a2f0a1e2..f864e1c9dc5105b4961eacd0253c48c7a18a67d8 100644
--- a/src/core/SkTypefaceCache.cpp
+++ b/src/core/SkTypefaceCache.cpp
@@ -13,6 +13,21 @@
#define TYPEFACE_CACHE_LIMIT 1024
+SkTypefaceCache::SkTypefaceCache() {}
+
+SkTypefaceCache::~SkTypefaceCache() {
+ const Rec* curr = fArray.begin();
+ const Rec* stop = fArray.end();
+ while (curr < stop) {
+ if (curr->fStrong) {
+ curr->fFace->unref();
+ } else {
+ curr->fFace->weak_unref();
+ }
+ curr += 1;
+ }
+}
+
void SkTypefaceCache::add(SkTypeface* face,
SkTypeface::Style requestedStyle,
bool strong) {
« no previous file with comments | « src/core/SkTypefaceCache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698