summaryrefslogtreecommitdiffstats
path: root/include/minikin/FontFamily.h
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2014-05-05 16:11:17 -0700
committerRaph Levien <raph@google.com>2014-05-12 10:28:15 -0700
commitb80c1f19c58b927820a8a24bf2218e5645724608 (patch)
treee00dec46530cfec05ea82512605ff2bf3ff32f28 /include/minikin/FontFamily.h
parentecc2d34ac23a497988f21e5f415b53c007b9d8c5 (diff)
downloadandroid_frameworks_minikin-b80c1f19c58b927820a8a24bf2218e5645724608.tar.gz
android_frameworks_minikin-b80c1f19c58b927820a8a24bf2218e5645724608.tar.bz2
android_frameworks_minikin-b80c1f19c58b927820a8a24bf2218e5645724608.zip
Better refcounting and locking
All major externally accessible objects (especially FontFamily and FontCollection) are now reference counted. In addition, there is a global lock intended to make operations thread-safe. WIP notice: in this version of the patch, not all external API entry points are protected by the lock. That should be fixed. Change-Id: I14106196e99eb101e8bf1bcb4b81359759d2086c
Diffstat (limited to 'include/minikin/FontFamily.h')
-rw-r--r--include/minikin/FontFamily.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/minikin/FontFamily.h b/include/minikin/FontFamily.h
index 290220b..3b59017 100644
--- a/include/minikin/FontFamily.h
+++ b/include/minikin/FontFamily.h
@@ -19,6 +19,8 @@
#include <vector>
+#include <minikin/MinikinRefCounted.h>
+
namespace android {
// FontStyle represents all style information needed to select an actual font
@@ -39,8 +41,10 @@ private:
uint32_t bits;
};
-class FontFamily {
+class FontFamily : public MinikinRefCounted {
public:
+ ~FontFamily();
+
// Add font to family, extracting style information from the font
bool addFont(MinikinFont* typeface);