There's no reason for this to be signed, and the callers are using an unsigned index already.
(Won't make any difference, especially once the optimizer has had a look at it; this is just
a bit of cleanup noticed in passing.)
Differential Revision: https://phabricator.services.mozilla.com/D184313
Take care to restore only the parts of the gfxContext that we need to because saving and restoring the complete gfxContext is expensive.
Differential Revision: https://phabricator.services.mozilla.com/D178304
This slightly simplifies gfxTextRun::BreakAndMeasureText, and should make it less confusing
to reason about trailing whitespace in nsTextFrame/nsLineLayout.
Differential Revision: https://phabricator.services.mozilla.com/D174377
In the patches for bug 1823215, we eliminated the use of a local copy of the glyph runs array
during SortGlyphRuns; but we call RemoveElementAt individually for each run to be coalesced,
which means potentially moving all the rest of the array multiple times. Instrumentation shows
that we sometimes end up with dozens of glyphruns to be coalesced (or even hundreds/thousands,
in pathological cases), which becomes quite inefficient.
Using RemoveElementsBy(predicate) instead will minimize the copying/moving of the remaining
array elements.
Differential Revision: https://phabricator.services.mozilla.com/D172945
This reverts the per-glyph-run optimization landed in bug 1816299, and replaces it with a per-glyph version
that will work within a long run of glyphs in a single font, as well as across the glyph runs in a mixed-font textrun.
To minimize the cost of the check, rather than retrieving individual glyph bounds, we use the overall font extents.
(Note that this uses the bounding box min/max coordinates from the 'head' table, which may exceed the typographic
ascent/descent of the font, and the advances of the glyphs; we care about the ink extents, not typographic size.)
Differential Revision: https://phabricator.services.mozilla.com/D170058
[Int]CoordTyped no longer inherits Units because otherwise
instances of [Int]IntPointTyped may get one Base subobject because
it inherits Units, and others because of BasePoint's Coord members,
which end up increasing the [Int]CoordTyped's objects size (since
according to the ISO C++ standard, different Base subobject are
required to have different addresses).
Differential Revision: https://phabricator.services.mozilla.com/D160713
This creates the gfx support needed to use alternate palettes, though not yet connected
to the CSS rules/properties to define and access them.
Differential Revision: https://phabricator.services.mozilla.com/D157958
This creates the gfx support needed to use alternate palettes, though not yet connected
to the CSS rules/properties to define and access them.
Differential Revision: https://phabricator.services.mozilla.com/D157958
This creates the gfx support needed to use alternate palettes, though not yet connected
to the CSS rules/properties to define and access them.
Differential Revision: https://phabricator.services.mozilla.com/D157958
This creates the gfx support needed to use alternate palettes, though not yet connected
to the CSS rules/properties to define and access them.
Differential Revision: https://phabricator.services.mozilla.com/D157958
We do some initialization of gfxFontSrcURI and gfxFontFaceSrc that is
main thread only on the DOM worker threads. These portions of the
initialization can easily be deferred to on demand access since they are
only ever used on the main thread itself.
Differential Revision: https://phabricator.services.mozilla.com/D153461
We do some initialization of gfxFontSrcURI and gfxFontFaceSrc that is
main thread only on the DOM worker threads. These portions of the
initialization can easily be deferred to on demand access since they are
only ever used on the main thread itself.
Differential Revision: https://phabricator.services.mozilla.com/D153461
gfxFontCache acquires and releases its mutex during various operations.
In order to keep the state internally consistent, we should only release
the lock after the full operation is complete. This involves moving the
deletion of gfxFont to outside the lock via a temporary discard array.
The expiration state should not be protected by the gfxFont's mutex
since we don't hold it during most operations. Instead we should hold
gfxFontCache's mutex because then we can guarantee the operation is
atomic, particularly when a worker wants a font, and the main thread is
aging the generations.
When a font is returned from gfxFontCache, we now return it already
removed from the tracker, and with its refcount updated. This avoids any
potential races between the expiration timer and a worker accessing the
font, as well as simplying the callers so they don't need to be aware of
addref-ing manually in case the result is to be discarded (so that it
gets readded to the tracker).
Differential Revision: https://phabricator.services.mozilla.com/D151821