Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f263a32 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Change Typeface redesign flag to readonly" into main

parents ec4878cc 9e680206
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -163,10 +163,12 @@ flag {
}

flag {
  name: "typeface_redesign"
  name: "typeface_redesign_readonly"
  namespace: "text"
  description: "Decouple variation settings, weight and style information from Typeface class"
  bug: "361260253"
  # This feature does not support runtime flag switch which leads crash in System UI.
  is_fixed_read_only: true
}

flag {
+1 −1
Original line number Diff line number Diff line
@@ -2119,7 +2119,7 @@ public class Paint {
     * @see FontVariationAxis
     */
    public boolean setFontVariationSettings(String fontVariationSettings) {
        final boolean useFontVariationStore = Flags.typefaceRedesign()
        final boolean useFontVariationStore = Flags.typefaceRedesignReadonly()
                && CompatChanges.isChangeEnabled(NEW_FONT_VARIATION_MANAGEMENT);
        if (useFontVariationStore) {
            FontVariationAxis[] axes =
+2 −2
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ public final class PositionedGlyphs {
    @NonNull
    public Font getFont(@IntRange(from = 0) int index) {
        Preconditions.checkArgumentInRange(index, 0, glyphCount() - 1, "index");
        if (Flags.typefaceRedesign()) {
        if (Flags.typefaceRedesignReadonly()) {
            return mFonts.get(nGetFontId(mLayoutPtr, index));
        }
        return mFonts.get(index);
@@ -252,7 +252,7 @@ public final class PositionedGlyphs {
        mXOffset = xOffset;
        mYOffset = yOffset;

        if (Flags.typefaceRedesign()) {
        if (Flags.typefaceRedesignReadonly()) {
            int fontCount = nGetFontCount(layoutPtr);
            mFonts = new ArrayList<>(fontCount);
            for (int i = 0; i < fontCount; ++i) {
+2 −2
Original line number Diff line number Diff line
@@ -33,9 +33,9 @@ inline bool letter_spacing_justification() {
#endif  // __ANDROID__
}

inline bool typeface_redesign() {
inline bool typeface_redesign_readonly() {
#ifdef __ANDROID__
    static bool flag = com_android_text_flags_typeface_redesign();
    static bool flag = com_android_text_flags_typeface_redesign_readonly();
    return flag;
#else
    return true;
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ public:
    static void forFontRun(const minikin::Layout& layout, Paint* paint, F& f) {
        float saveSkewX = paint->getSkFont().getSkewX();
        bool savefakeBold = paint->getSkFont().isEmbolden();
        if (text_feature::typeface_redesign()) {
        if (text_feature::typeface_redesign_readonly()) {
            for (uint32_t runIdx = 0; runIdx < layout.getFontRunCount(); ++runIdx) {
                uint32_t start = layout.getFontRunStart(runIdx);
                uint32_t end = layout.getFontRunEnd(runIdx);
Loading