summaryrefslogtreecommitdiffstats
path: root/tests/MinikinFontForTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/MinikinFontForTest.cpp')
-rw-r--r--tests/MinikinFontForTest.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/MinikinFontForTest.cpp b/tests/MinikinFontForTest.cpp
index 96f3326..66dd4ea 100644
--- a/tests/MinikinFontForTest.cpp
+++ b/tests/MinikinFontForTest.cpp
@@ -22,8 +22,14 @@
#include <cutils/log.h>
-MinikinFontForTest::MinikinFontForTest(const std::string& font_path) : mFontPath(font_path) {
- mTypeface = SkTypeface::CreateFromFile(font_path.c_str());
+MinikinFontForTest::MinikinFontForTest(const std::string& font_path) :
+ MinikinFontForTest(font_path, SkTypeface::CreateFromFile(font_path.c_str())) {
+}
+
+MinikinFontForTest::MinikinFontForTest(const std::string& font_path, SkTypeface* typeface) :
+ MinikinFont(typeface->uniqueID()),
+ mTypeface(typeface),
+ mFontPath(font_path) {
}
MinikinFontForTest::~MinikinFontForTest() {
@@ -55,7 +61,3 @@ const void* MinikinFontForTest::GetTable(uint32_t tag, size_t* size,
*destroy = free;
return buf;
}
-
-int32_t MinikinFontForTest::GetUniqueId() const {
- return mTypeface->uniqueID();
-}