From c75aa4cd533cccb7962b6e74237ae7a0d3934bb8 Mon Sep 17 00:00:00 2001 From: Kohsuke Yatoh Date: Thu, 4 Aug 2022 07:16:00 +0000 Subject: [PATCH] Update usage of FontCollection::getSupportedTags(). Replace getSupportedTags() with getSupportedAxesCount() / getSupportedAxisAt(), following minikin change. Bug: 174672300 Test: atest CtsGraphicsTestCases:android.graphics.cts.TypefaceTest Change-Id: I7959ea903cc73e89589d5f8bb5b5e5900ba6d5db --- libs/hwui/jni/Typeface.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libs/hwui/jni/Typeface.cpp b/libs/hwui/jni/Typeface.cpp index 6325226068dd8..6a7119b821a20 100644 --- a/libs/hwui/jni/Typeface.cpp +++ b/libs/hwui/jni/Typeface.cpp @@ -140,15 +140,13 @@ static void Typeface_setDefault(CRITICAL_JNI_PARAMS_COMMA jlong faceHandle) { static jobject Typeface_getSupportedAxes(JNIEnv *env, jobject, jlong faceHandle) { Typeface* face = toTypeface(faceHandle); - const std::unordered_set& tagSet = face->fFontCollection->getSupportedTags(); - const size_t length = tagSet.size(); + const size_t length = face->fFontCollection->getSupportedAxesCount(); if (length == 0) { return nullptr; } std::vector tagVec(length); - int index = 0; - for (const auto& tag : tagSet) { - tagVec[index++] = tag; + for (size_t i = 0; i < length; i++) { + tagVec[i] = face->fFontCollection->getSupportedAxisAt(i); } std::sort(tagVec.begin(), tagVec.end()); const jintArray result = env->NewIntArray(length);