Merge "Implement getAxes() method."
diff --git a/core/jni/android/graphics/FontFamily.cpp b/core/jni/android/graphics/FontFamily.cpp
index ce359dc..c090a75 100644
--- a/core/jni/android/graphics/FontFamily.cpp
+++ b/core/jni/android/graphics/FontFamily.cpp
@@ -83,7 +83,8 @@
 static void addSkTypeface(jlong builderPtr, sk_sp<SkTypeface> face, const void* fontData,
         size_t fontSize, int ttcIndex, jint givenWeight, jboolean givenItalic) {
     minikin::MinikinFont* minikinFont =
-            new MinikinFontSkia(std::move(face), fontData, fontSize, ttcIndex);
+            new MinikinFontSkia(std::move(face), fontData, fontSize, ttcIndex,
+                    std::vector<minikin::FontVariation>());
     NativeFamilyBuilder* builder = reinterpret_cast<NativeFamilyBuilder*>(builderPtr);
     int weight = givenWeight / 100;
     bool italic = givenItalic;
@@ -208,7 +209,8 @@
         return false;
     }
     minikin::MinikinFont* minikinFont =
-            new MinikinFontSkia(std::move(face), fontPtr, fontSize, ttcIndex);
+            new MinikinFontSkia(std::move(face), fontPtr, fontSize, ttcIndex,
+                    std::vector<minikin::FontVariation>());
     NativeFamilyBuilder* builder = reinterpret_cast<NativeFamilyBuilder*>(builderPtr);
     builder->fonts.push_back(minikin::Font(minikinFont,
             minikin::FontStyle(weight / 100, isItalic)));
diff --git a/libs/hwui/hwui/MinikinSkia.cpp b/libs/hwui/hwui/MinikinSkia.cpp
index 6a00379..cbae0a0 100644
--- a/libs/hwui/hwui/MinikinSkia.cpp
+++ b/libs/hwui/hwui/MinikinSkia.cpp
@@ -25,9 +25,9 @@
 namespace android {
 
 MinikinFontSkia::MinikinFontSkia(sk_sp<SkTypeface> typeface, const void* fontData, size_t fontSize,
-        int ttcIndex) :
+        int ttcIndex, const std::vector<minikin::FontVariation>& axes) :
     minikin::MinikinFont(typeface->uniqueID()), mTypeface(std::move(typeface)), mFontData(fontData),
-    mFontSize(fontSize), mTtcIndex(ttcIndex) {
+    mFontSize(fontSize), mTtcIndex(ttcIndex), mAxes(axes) {
 }
 
 static void MinikinFontSkia_SetSkiaPaint(const minikin::MinikinFont* font, SkPaint* skPaint,
@@ -87,6 +87,10 @@
     return mTtcIndex;
 }
 
+const std::vector<minikin::FontVariation>& MinikinFontSkia::GetAxes() const {
+    return mAxes;
+}
+
 minikin::MinikinFont* MinikinFontSkia::createFontWithVariation(
         const std::vector<minikin::FontVariation>& variations) const {
     SkFontMgr::FontParameters params;
@@ -106,7 +110,7 @@
     sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault());
     sk_sp<SkTypeface> face(fm->createFromStream(stream, params));
 
-    return new MinikinFontSkia(std::move(face), mFontData, mFontSize, ttcIndex);
+    return new MinikinFontSkia(std::move(face), mFontData, mFontSize, ttcIndex, variations);
 }
 
 uint32_t MinikinFontSkia::packPaintFlags(const SkPaint* paint) {
diff --git a/libs/hwui/hwui/MinikinSkia.h b/libs/hwui/hwui/MinikinSkia.h
index 249b0cb..db59fe5 100644
--- a/libs/hwui/hwui/MinikinSkia.h
+++ b/libs/hwui/hwui/MinikinSkia.h
@@ -29,7 +29,7 @@
 class ANDROID_API MinikinFontSkia : public minikin::MinikinFont {
 public:
     explicit MinikinFontSkia(sk_sp<SkTypeface> typeface, const void* fontData, size_t fontSize,
-        int ttcIndex);
+        int ttcIndex, const std::vector<minikin::FontVariation>& axes);
 
     float GetHorizontalAdvance(uint32_t glyph_id,
         const minikin::MinikinPaint &paint) const;
@@ -44,6 +44,7 @@
     const void* GetFontData() const;
     size_t GetFontSize() const;
     int GetFontIndex() const;
+    const std::vector<minikin::FontVariation>& GetAxes() const;
     minikin::MinikinFont* createFontWithVariation(
             const std::vector<minikin::FontVariation>&) const;
 
@@ -61,6 +62,7 @@
     const void* mFontData;
     size_t mFontSize;
     int mTtcIndex;
+    std::vector<minikin::FontVariation> mAxes;
 };
 
 }  // namespace android
diff --git a/libs/hwui/hwui/Typeface.cpp b/libs/hwui/hwui/Typeface.cpp
index b69b0cb..9f9fac6 100644
--- a/libs/hwui/hwui/Typeface.cpp
+++ b/libs/hwui/hwui/Typeface.cpp
@@ -150,7 +150,8 @@
     sk_sp<SkTypeface> typeface = SkTypeface::MakeFromStream(fontData.release());
     LOG_ALWAYS_FATAL_IF(typeface == nullptr, "Failed to make typeface from %s", kRobotoFont);
 
-    minikin::MinikinFont* font = new MinikinFontSkia(std::move(typeface), data, st.st_size, 0);
+    minikin::MinikinFont* font = new MinikinFontSkia(std::move(typeface), data, st.st_size, 0,
+            std::vector<minikin::FontVariation>());
     minikin::FontFamily* family = new minikin::FontFamily(
                  std::vector<minikin::Font>({ minikin::Font(font, minikin::FontStyle()) }));
     font->Unref();