Граф коммитов

54 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Kew be14974fec Bug 1617596 - Move mSpaceGlyph to gfxFont instead of defining it separately in each subclass, and de-virtualize gfxFont::GetSpaceGlyph(). r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D63855

--HG--
extra : moz-landing-system : lando
2020-02-24 14:36:52 +00:00
Lee Salzman fd28aa44da Bug 1583707 - enable text subpixel positioning on Android and Linux. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D47035

--HG--
extra : moz-landing-system : lando
2019-10-02 14:04:45 +00:00
Lee Salzman 2b03a82ba0 Bug 1584268 - only instantiate Cairo fonts when drawing to Cairo target. r=jfkthame
This removes a lot of old cruft in thebes to instantiate Cairo scaled fonts.
Instead, we only instantiate the Cairo scaled font inside Moz2D when we actually
need it for DrawTargetCairo. This thus gets rid of the duplicated code we had
inside both Moz2D and thebes to deal with Cairo scaled fonts.

Differential Revision: https://phabricator.services.mozilla.com/D47297

--HG--
extra : moz-landing-system : lando
2019-10-01 21:56:30 +00:00
Lee Salzman 60a7bb036d Bug 1582749 - query FreeType glyph advance and bounds at the same time. r=jfkthame
Cairo would normally query both the advance and other metrics at the same time,
then store them in a glyph cache sitting on each cairo_scaled_font_t any time
any of the extents were queried. Each cached scaled glyph metrics would require
about 150 bytes of space and could thus use a horribly large amount of memory
when a lot of glyphs were being used within a scaled font.

This tries to duplicate the behavior of querying and storing both advance and
bounds at the same time to effectively cut the number of glyph loads in half
for most cases. This should only add another 8 bytes per hash entry to store
the cached bounds, thus putting us way ahead on memory usage compared to what
Cairo did under the hood.

Further, Cairo would keep around cairo_scaled_font_t's in a holdover cache
even after there are no existing references to them and the owning gfxFonts
have long since died. This gives an artificial boost in successive runs of the
benchmark, while not aiding in the performance of the first run. I don't
believe the extra memory use would be justified to reproduce that particular
behavior, especially since our expectations are that the glyph cache for
a gfxFont dies when the gfxFont itself dies from the gfxFontCache.

In any case, this should at least significantly boost our glyph metrics
performance on a cold start, with the caveat about the warm start case.

Differential Revision: https://phabricator.services.mozilla.com/D46726

--HG--
extra : moz-landing-system : lando
2019-09-22 19:56:00 +00:00
Daniel Varga c8913746b5 Backed out 1 changesets (bug 1582749) for build bustage at /builds/worker/workspace/build/src/gfx/thebes/gfxFT2FontBase
Backed out changeset db3d77b313a0 (bug 1582749)
2019-09-22 21:01:58 +03:00
Lee Salzman 95c42fceb9 Bug 1582749 - query FreeType glyph advance and bounds at the same time. r=jfkthame
Cairo would normally query both the advance and other metrics at the same time,
then store them in a glyph cache sitting on each cairo_scaled_font_t any time
any of the extents were queried. Each cached scaled glyph metrics would require
about 150 bytes of space and could thus use a horribly large amount of memory
when a lot of glyphs were being used within a scaled font.

This tries to duplicate the behavior of querying and storing both advance and
bounds at the same time to effectively cut the number of glyph loads in half
for most cases. This should only add another 8 bytes per hash entry to store
the cached bounds, thus putting us way ahead on memory usage compared to what
Cairo did under the hood.

Further, Cairo would keep around cairo_scaled_font_t's in a holdover cache
even after there are no existing references to them and the owning gfxFonts
have long since died. This gives an artificial boost in successive runs of the
benchmark, while not aiding in the performance of the first run. I don't
believe the extra memory use would be justified to reproduce that particular
behavior, especially since our expectations are that the glyph cache for
a gfxFont dies when the gfxFont itself dies from the gfxFontCache.

In any case, this should at least significantly boost our glyph metrics
performance on a cold start, with the caveat about the warm start case.

Differential Revision: https://phabricator.services.mozilla.com/D46726

--HG--
extra : moz-landing-system : lando
2019-09-22 16:52:52 +00:00
Lee Salzman 2770b6301a Bug 1582231 - remove Moz2D dependency on Cairo glyph extents. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D46332

--HG--
extra : moz-landing-system : lando
2019-09-20 16:30:21 +00:00
Lee Salzman 18ac180309 Bug 1547063 - fix advance scaling for emoji. r=karlt
This fixes the regression in reftests/text/color-opacity-rtl-[12].html.

Differential Revision: https://phabricator.services.mozilla.com/D45956

--HG--
extra : moz-landing-system : lando
2019-09-16 16:46:27 +00:00
Lee Salzman 44eb8379af Bug 1547063 - Use FreeType metrics directly instead of querying Cairo. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D44497

--HG--
extra : moz-landing-system : lando
2019-09-16 17:15:10 +00:00
Lee Salzman 4e52e1c29b Bug 1547063 - Use SharedFTFace locking instead of Cairo locking. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D44496

--HG--
extra : moz-landing-system : lando
2019-09-16 17:12:38 +00:00
Lee Salzman 286a7bbfff Bug 1547063 - Use SharedFTFace in thebes. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D44494

--HG--
extra : moz-landing-system : lando
2019-09-16 17:07:59 +00:00
Cosmin Sabou 8113720646 Backed out 8 changesets (bug 1547063) for causing bug 1581466. a=backout
Backed out changeset c969a93b0ca7 (bug 1547063)
Backed out changeset 003f5a79c6a7 (bug 1547063)
Backed out changeset 2c7032b4d022 (bug 1547063)
Backed out changeset 23892ecc6ef8 (bug 1547063)
Backed out changeset af6e6807ece7 (bug 1547063)
Backed out changeset ebc71e607938 (bug 1547063)
Backed out changeset 772c3427c791 (bug 1547063)
Backed out changeset e74a67e2afe3 (bug 1547063)
2019-09-16 10:44:20 +03:00
Lee Salzman 0d6ebe2503 Bug 1547063 - Use FreeType metrics directly instead of querying Cairo. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D44497

--HG--
extra : moz-landing-system : lando
2019-09-15 03:01:19 +00:00
Lee Salzman 1ad0ba9769 Bug 1547063 - Use SharedFTFace locking instead of Cairo locking. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D44496

--HG--
extra : moz-landing-system : lando
2019-09-15 03:01:02 +00:00
Lee Salzman a9377fd974 Bug 1547063 - Use SharedFTFace in thebes. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D44494

--HG--
extra : moz-landing-system : lando
2019-09-15 03:00:32 +00:00
Jean-Yves Avenard 11ac9e9cf8 Bug 1540581 - P6. Tidy some C++ declarations in gfx/. r=gerald,jrmuizel
* Remove redundant virtual keywords
* Mark all destructors of inheriting classes as virtual for clarity
* Mark all classes without virtual destructor as final (exposed errors)
* Make destructor virtual where it needed to be (some were missing)
* Replace empty ({}) code declaration in header with = default
* Remove virtual unused methods

I probably missed some, it quickly became a rabbit hole.

Differential Revision: https://phabricator.services.mozilla.com/D26060

--HG--
extra : moz-landing-system : lando
2019-04-11 12:36:51 +00:00
Jeff Muizelaar 6bf19bfac4 Bug 1516677. Remove unused drawtarget parameter. r=jfkthame
With bug 1509358 having landed we don't need a draw target in a bunch of
places.  This removes it from those places.

Differential Revision: https://phabricator.services.mozilla.com/D15481

--HG--
extra : moz-landing-system : lando
2018-12-31 11:43:27 +00:00
Tooru Fujisawa 7983faeb5d Bug 1511393 - Use c-basic-offset: 2 in Emacs mode line for C/C++ code. r=nbp 2018-12-01 04:52:05 +09:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Jonathan Kew 0165cf1194 Bug 1478716 - Ensure we only call FT_Get_MM_Var once per face (and cache the result in the font entry), to avoid being bitten by freetype bug 52955 on Ubuntu. r=lsalzman 2018-08-01 22:39:05 +01:00
Jonathan Kew e92b9e44cf Bug 1449605 - part 1 - Rearrange thebes font code so that the decision whether to apply synthetic-bold is deferred until actually instantiating a font, not made during the font-matching process. r=jwatt
This rearranges how synthetic-bold use is determined in the font selection
& rendering code. Previously, we would decide during the font-selection
algorithm whether we need to apply synthetic-bold to the chosen face, and
then pass that decision through the fontgroup (storing it in the FamilyFace
entries of the mFonts array there) down to the actual rendering code that
instantiates fonts from the faces (font entries) we've selected.

That became a problem for variation fonts because in the case of a user
font, we may not have downloaded the resource yet, so we just have a "user
font container" entry, which carries the descriptors from the @font-face
rule and will fetch the actual resource when needed. But in the case of a
@font-face rule without a weight descriptor, we don't actually know at
font-selection time whether the face will support "true" bold (via a
variation axis) or not, so we can't reliably make the right decision about
applying synthetic bold.

So we now defer that decision until we actually instantiate a platform font
object to shape/measure/draw text. At that point, we have the requested
style and we also have the real font resource, so we can easily determine
whether fake-bold is required.

(This patch should not result in any visible behavior change; that will
come in a second patch now that the architecture supports it.)
2018-05-01 10:30:50 +01:00
Jonathan Kew 464c469099 Bug 1440938 - Fall back to cairo's glyph metrics API if FreeType fails in some way, or if we're not using a variation font. r=lsalzman 2018-02-28 22:02:25 +00:00
Jonathan Kew 6cf89ddd0e Bug 1427641 - patch 8 - Refactor gfxFT2FontBase glyph-width code so that we properly respect variations when getting character widths during InitMetrics. r=lsalzman 2018-01-02 13:29:54 +00:00
Jonathan Kew 88ac266967 Bug 1427641 - patch 3 - Add variation data to the cairo_ft_*_font objects, so they can properly track instances of the same font resource used with different variation parameters. r=lsalzman 2017-12-07 13:22:49 +00:00
Jonathan Kew 5080cdedd5 Bug 1427641 - patch 2 - Convert variation values into FreeType's data type, and apply them to the FT_Face. r=lsalzman 2017-12-06 14:42:42 +00:00
Jonathan Kew 7ef5a362b4 Bug 1427641 - patch 1 - Get glyph widths directly from the FreeType face, instead of via a cairo scaled_font wrapper. r=lsalzman 2017-12-06 13:51:39 +00:00
Lee Salzman 2276117381 Bug 1385029 - remove redundant CairoScaledFont accessor from gfxFont subclasses. r=jfkthame
MozReview-Commit-ID: BjcKkCgSZdG
2017-08-07 16:20:40 -04:00
Lee Salzman 84420597a9 Bug 1383767 - remove cases of recursive locking of FreeType inside thebes. r=jfkthame
MozReview-Commit-ID: 1KuOq8jmj0H
2017-07-26 23:24:48 -04:00
Carsten "Tomcat" Book 8941796c79 Backed out changeset cecd14ecca85 (bug 1383767) 2017-07-27 08:19:54 +02:00
Lee Salzman bcac1f2797 Bug 1383767 - remove cases of recursive locking of FreeType inside thebes. r=jfkthame
MozReview-Commit-ID: 1KuOq8jmj0H
2017-07-26 23:24:48 -04:00
Lee Salzman a168dcdbf3 Bug 1348980 - implement UnscaledFont API for Moz2D and thebes. r=jfkthame 2017-04-06 17:41:02 -04:00
Nicholas Nethercote 2a8e0225ac Bug 1232822 (part 1) - Moz2Dify SetupCairoFont(). r=jfkthame.
This is now trivial.
2015-12-15 13:56:40 -08:00
Ehsan Akhgari 883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
John Daggett 7837d2ecf9 Bug 1109403 - trim out unused Azure FontOptions struct. r=m_kato 2014-12-10 13:09:30 +09:00
Jonathan Kew 43167d1667 Bug 1097615 - Add MOZ_OVERRIDE annotations to subclasses of gfxFont. r=jdaggett 2014-11-17 09:59:50 +00:00
Jonathan Watt d6d15a2f78 Bug 1093811 - Convert the gfxFont::GetGlyphWidth() virtual method to take a Moz2D DrawTarget instead of a Thebes gfxContext. r=jfkthame 2014-11-10 21:41:41 +00:00
Jonathan Kew 55f3a61af3 Bug 1065002 pt 1.1 - Rename gfxFont::GetMetrics to GetHorizontalMetrics, and add a GetMetrics wrapper to access it. r=jdaggett 2014-09-30 07:37:40 +01:00
Jonathan Kew 088699795b bug 985220 - remove the old GDI, Uniscribe and DWrite text-shaping code paths, as we now use HarfBuzz or Graphite for all shaping on Windows. r=jdaggett 2014-06-09 15:47:31 +01:00
Jonathan Kew fbe8c6fe21 backout changeset 59b2dd6b5048 (bug 985220) due to MS Sans Serif regression with Thai system locale (see bug 1020826). 2014-06-06 22:41:09 +01:00
Jonathan Kew 0d94ebb7d2 bug 985220: remove the old GDI, Uniscribe and DWrite text-shaping code paths, as we now use HarfBuzz or Graphite for all shaping on Windows. r=jdaggett 2014-03-19 12:27:44 +00:00
Jonathan Kew 3eb1fdd857 bug 847344 - refactor gfxFont/gfxFontEntry and associated classes for more efficient use of HarfBuzz and Graphite shaper APIs. r=roc 2013-05-16 17:29:20 +01:00
Ehsan Akhgari e368dc9c85 Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script.  Here's the source of the script for
future reference:

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t

convert PRIntn int
convert PRUintn unsigned

convert PRSize size_t

convert PROffset32 int32_t
convert PROffset64 int64_t

convert PRPtrdiff ptrdiff_t

convert PRFloat64 double
2012-08-22 11:56:38 -04:00
Nicholas Cameron 0fdb7cc441 Bug 752380. Refactor gfxFont out of Azure. r=Bas 2012-05-17 10:30:10 +12:00
Gervase Markham 82ff7027aa Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Bas Schouten cf4dd68f30 Bug 743593: Properly cast gfxFont based on type. r=jfkthame 2012-04-11 16:55:31 +02:00
Bas Schouten c2d1a88783 Bug 702851: Move mScaledFont into gfxFont superclass. r=jdaggett 2011-12-15 17:12:40 +01:00
Michael Wu d2b70213ac Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
--HG--
rename : tools/trace-malloc/bloatblame.c => tools/trace-malloc/bloatblame.cpp
2011-09-28 23:19:26 -07:00
Zack Weinberg 97e0f97e09 Bug 648385: Remove gfxFont::GetUniqueName, r=jdaggett
--HG--
extra : rebase_source : 41f923803127440ab903e91c7f24e020b97b83f5
2011-04-11 17:59:42 -07:00
John Daggett e872fa383e Bug 602792. Lazy initialize mUseFontGlyphWidths to avoid unnecessary font io. r=jkew, a=blocker 2011-01-22 01:44:33 +09:00
Jonathan Kew b1172f2565 bug 624310 - get glyph widths via directwrite rather than font tables when using simulated bold. r=bas a=joe 2011-01-21 10:35:21 +00:00