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
This commit is contained in:
Kohsuke Yatoh
2022-08-04 07:16:00 +00:00
parent 9d5621caf5
commit c75aa4cd53

View File

@@ -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<minikin::AxisTag>& tagSet = face->fFontCollection->getSupportedTags();
const size_t length = tagSet.size();
const size_t length = face->fFontCollection->getSupportedAxesCount();
if (length == 0) {
return nullptr;
}
std::vector<jint> 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);