Closed Bug 1365185 Opened 3 years ago Closed 3 years ago

Clear cached extents when pref "gfx.font_rendering.opentype_svg.enabled"

Categories

(Core :: Layout: Text and Fonts, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: mtseng, Assigned: mtseng)

References

Details

Attachments

(1 file)

When I debugging bug 1354463, I found this bug. In our opentype_svg reftest, we first turn off the pref and run the test then we turn the pref on and run the test again (see [1]).

When running the test with pref off, we cached some extents. While we start next test with pref on, we'll use the cached extents which the data is wrong and the rendering result is wrong. (In my case, the bound of nsDisplaySVGText was wrong, and the result text was clipped)

So I cleared the extents cached when pref opentype_svg is changed to make sure we can get correct extents.

[1] https://searchfox.org/mozilla-central/source/layout/reftests/text-svgglyphs/reftest.list#4-5
Assignee: nobody → mtseng
Comment on attachment 8868032 [details]
Bug 1365185 - Clear extents cache after pref "gfx.font_rendering.opentype_svg.enabled" is changed.

https://reviewboard.mozilla.org/r/139618/#review142970

::: gfx/thebes/gfxPlatform.cpp:2093
(Diff revision 1)
>      } else if (!strcmp(BIDI_NUMERAL_PREF, aPref)) {
>          mBidiNumeralOption = UNINITIALIZED_VALUE;
>      } else if (!strcmp(GFX_PREF_OPENTYPE_SVG, aPref)) {
>          mOpenTypeSVGEnabled = UNINITIALIZED_VALUE;
>          gfxFontCache::GetCache()->AgeAllGenerations();
> +        NotifyGlyphsChanged();

I think we could just call

    gfxFontCache::GetCache()->NotifyGlyphsChanged();

directly here, there's really no need for the extra gfxPlatform::NotifyGlyphsChanged function just to wrap this for a single call site.
Attachment #8868032 - Flags: review?(jfkthame) → review+
Pushed by mtseng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3885392de7d9
Clear extents cache after pref "gfx.font_rendering.opentype_svg.enabled" is changed. r=jfkthame
https://hg.mozilla.org/mozilla-central/rev/3885392de7d9
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.