Closed Bug 1403302 Opened 7 years ago Closed 7 years ago

Eliminate dependency on cairo fonts for getting glyph metrics

Categories

(Core :: Graphics: Text, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [gfx-noted])

Attachments

(3 files)

We currently rely on cairo font APIs to get glyph extents, even when we aren't actually rendering via cairo any more. This seems inefficient (as it requires us to set up cairo fonts just for this purpose), and will make the implementation of Variation Fonts harder than it should be (because we'll need to plumb variations through the cairo font code in addition to moz2d/skia/webrender/whatever).

We should just get rid of this dependency and figure out how to get glyph metrics/extents via the same font backend as we're using to render.
Priority: -- → P3
Whiteboard: [gfx-noted]
OS: Unspecified → All
Hardware: Unspecified → All
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Attachment #8930246 - Flags: review?(bas) → review+
Attachment #8930247 - Flags: review?(bas) → review+
Comment on attachment 8930248 [details] [diff] [review]
patch 3 - Remove direct cairo dependency from gfxTextRun and gfxGlyphExtents

Review of attachment 8930248 [details] [diff] [review]:
-----------------------------------------------------------------

Stealing review as Jeff is on PTO.
Attachment #8930248 - Flags: review?(jmuizelaar) → review+
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/cdc8898f59b3
patch 1 - Add missing return statement to ScaledFontBase::GetGlyphDesignMetrics, so that its cairo-based code path actually works. r=bas
https://hg.mozilla.org/integration/mozilla-inbound/rev/ade4ee8e1bfc
patch 2 - Fix mixed-up glyph bounding box coordinates in ScaledFontDWrite::GetGlyphDesignMetrics. r=bas
https://hg.mozilla.org/integration/mozilla-inbound/rev/d4f80c4ba719
patch 3 - Remove direct cairo dependency from gfxTextRun and gfxGlyphExtents. r=bas
Depends on: 1420553
Looks like this brought some AWSY improvements:

== Change summary for alert #10719 (as of Thu, 23 Nov 2017 17:40:52 GMT) ==

Improvements:

  4%  Heap Unclassified summary windows7-32 opt      42,427,149.35 -> 40,924,380.53
  3%  Heap Unclassified summary windows10-64 pgo     49,933,293.77 -> 48,426,975.48
  3%  Heap Unclassified summary windows10-64 opt     49,945,868.79 -> 48,541,249.41
  3%  Heap Unclassified summary windows7-32 pgo      42,149,408.59 -> 41,023,741.65

For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=10719
Depends on: 1435472
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: