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

83 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Kew 315b16ea22 Bug 1621248 - Declare various gfxPlatform and font-list subclasses as 'final'. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D66204

--HG--
extra : moz-landing-system : lando
2020-03-10 15:00:56 +00:00
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 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 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 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
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
Sylvestre Ledru e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

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

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +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
Lee Salzman dd26a2555b Bug 1495661 - reuse the default UnscaledFontDWrite for variation fonts. r=jfkthame 2018-10-11 11:19:25 -04:00
Bas Schouten 3f601ce856 Bug 1479640: Restructure cleartype parameter code to run less frequently and only in the parent process. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D4784

--HG--
extra : moz-landing-system : lando
2018-09-13 18:59:27 +00: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 aaa8afd3af Bug 1435472 - Discard and re-create mAzureScaledFont if it was created with the wrong sUseClearType setting. r=bas 2018-03-20 13:46:40 +00:00
Lee Salzman 7755d675bb Bug 1394568 - plumb synthetic italics flag through thebes and Moz2D into WebRender. r=gankro 2018-01-09 10:37:49 -05:00
Jonathan Kew 5f318d222b Bug 1334761 - Update ClearType usage at startup, and flush caches and reflow everything if it changes during the session. r=bas 2017-09-14 17:26:53 +01:00
Lee Salzman 24cb8efdec Bug 1385029 - remove virtual from gfxFont::GetCairoScaledFont. r=jfkthame
MozReview-Commit-ID: FNXL9aKtlKa
2017-08-07 16:20:48 -04:00
Lee Salzman a21ad6d19e Bug 1385029 - require implementation of gfxFont::GetScaledFont and remove unnecessary gfxPlatform::GetScaledFontForFont. r=jfkthame
MozReview-Commit-ID: GP1Aekecb0s
2017-08-07 16:20:44 -04:00
Lee Salzman 2d696d5c34 Bug 1376026 - fix plumbing of DWrite parameters for Skia fonts to not depend on gfxPlatform. r=jrmuizel
MozReview-Commit-ID: 5K9201eCSv
2017-06-30 14:09:05 -04:00
Sebastian Hengst 522fc18c93 Backed out changeset 24421d72ba08 (bug 1376026) 2017-07-07 21:42:09 +02:00
Lee Salzman ab6885d706 Bug 1376026 - fix plumbing of DWrite parameters for Skia fonts to not depend on gfxPlatform. r=jrmuizel
MozReview-Commit-ID: 5K9201eCSv
2017-06-30 14:09:05 -04:00
Carsten "Tomcat" Book fbc9f302f1 Backed out changeset d09fb3a5cedf (bug 1376026) 2017-07-06 08:11:48 +02:00
Lee Salzman edc6db4195 Bug 1376026 - fix plumbing of DWrite parameters for Skia fonts to not depend on gfxPlatform. r=jrmuizel 2017-06-30 14:09:05 -04:00
Jonathan Kew 3bcb26919c Bug 1365776 - Use the IDWriteFontFace1 interface if available to get glyph advances from DirectWrite more cheaply. r=jrmuizel 2017-05-19 22:25:28 +01:00
Jonathan Kew 4b5525bbf7 Bug 1362167 - Use strongly-typed enum classes instead of generic uint16_t fields for the gfxShapedText and gfxTextRun flags. r=jrmuizel 2017-05-04 22:27:05 +01:00
Lee Salzman a168dcdbf3 Bug 1348980 - implement UnscaledFont API for Moz2D and thebes. r=jfkthame 2017-04-06 17:41:02 -04:00
Daniel Holbert eb14ae51cf Bug 1329670: Change gfxFont::CopyWithAntialiasOption to return UniquePtr instead of raw pointer. r=jfkthame
MozReview-Commit-ID: B5UNazyXPL2
2017-01-09 09:41:35 -08:00
Bas Schouten 1d78258aee Bug 1325199: Only read system parameters for ClearType when we receive a paint event. r=jrmuizel
MozReview-Commit-ID: EjQyCcdWXEc
2016-12-22 12:06:15 +01:00
Mason Chang b844183f9d Bug 1309917 - Stop defaulting to system wide default fonts if no IDWriteFont exists. r=jfkthame 2016-10-12 15:53:04 -07:00
Jonathan Kew 993ba1a742 Bug 1296742 - Initialize gfxGDIFont's metrics at construction time, like other platform font subclasses, and remove its no-longer-needed support for init-on-first-use pattern. r=jrmuizel 2016-08-22 21:39:19 +01:00
Jonathan Kew 48c59f0c3d Bug 1282248 - Declare a bunch of gfxTextRun measurement/drawing methods and related helpers as const. r=m_kato 2016-06-27 17:41:55 +01:00
Jonathan Kew 28a9e2cf14 Bug 1265452 - Remove use of nsAutoPtr from gfx/thebes. r=jrmuizel 2016-04-15 20:45:37 +01:00
Mason Chang 2e3ff601d6 Bug 842894 - Support DirectWrite using the Skia backend. r=bas 2016-01-06 11:35:04 -08:00
Nicholas Nethercote 06e901cb9f Bug 1231550 - Use DrawTarget instead of gfxContext and/or nsRenderingContext in many places in font/text code. r=jfkthame.
AutoTextRun now only needs a DrawTarget instead of an nsRenderingContext, and
similar nsRenderingContext/gfxContext-to-DrawTarget replacements can be
propagated a long way up the call graph. This patch replaces 93 occurrences of
nsRenderingContext and 135 occurrences of gfxContext with DrawTarget; that's
13% of them.

The patch is mostly plumbing changes. A couple of not-entirely-plumbing
changes:

- It adds a comment about the null check in
  gfxGlyphExtents::GetTightGlyphExtentsAppUnits().

- A couple of functions simply had an unused gfxContext or nsRenderingContext
  parameter removed, e.g. SetLineBreaks().

--HG--
extra : rebase_source : 8f56994bb4d254a86788b17ab2864ebc758a7e6b
2015-12-15 13:56:41 -08:00
Nicholas Nethercote 2a8e0225ac Bug 1232822 (part 1) - Moz2Dify SetupCairoFont(). r=jfkthame.
This is now trivial.
2015-12-15 13:56:40 -08:00
Nathan Froyd 4094e18ff5 Bug 1233069 - add override declarations to Windows graphics headers; r=Bas
This change silences a number of -Winconsistent-missing-override
warnings on clang-cl.
2015-12-16 10:41:21 -05:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Nathan Froyd 974d8120f2 Bug 1161627 - part 2 - machine-convert TemporaryRef<T> to already_AddRefed<T>; r=ehsan
This conversion was done with the script:

  find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl' | \
    egrep -v 'cairo-win32-refptr.h|RefPtr.h|TestRefPtr.cpp' | \
    xargs sed -i -e 's/mozilla::TemporaryRef</already_AddRefed</g' \
                 -e 's/TemporaryRef</already_AddRefed</g'

Manual fixups were performed in the following instances:

- We handled mfbt/RefPtr.h manually so as to not convert TemporaryRef itself
  into already_AddRefed.

- The following files had explicit Move() calls added to make up for the lack
  of a copy constructor on already_AddRefed:

  dom/base/ImageEncoder.cpp
  dom/media/MediaTaskQueue.{h,cpp}
  dom/media/webaudio/PannerNode.cpp

- A redundant overload for MediaTaskQueue::Dispatch was deleted.

- A few manual fixups were required in mfbt/tests/TestRefPtr.cpp.

- Comments, using declarations, and forward declarations relating to
  TemporaryRef in dom/canvas/ and gfx/layers/ were changed to refer to
  already_AddRefed.
2015-06-17 10:00:52 -04: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
Robert O'Callahan 6630278821 Bug 1099977. Part 1: Make gfxDwriteFont cache GetSpaceGlyph. r=jfkthame
--HG--
extra : rebase_source : b658f532dfef60d68c2d3f4aeae08de9966033ed
2014-11-18 23:19:54 +13: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
Markus Stange defd3c048d Bug 1055634 - Propagate font smoothing background colors to layers. r=roc 2014-10-24 18:32:23 +02:00
Jonathan Kew 0e773b6fc0 Bug 1081867 - Convert textrun metrics to physical coordinates before merging with visual-overflow region. r=smontagu 2014-10-16 09:40:19 +01: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 68d2010cfd bug 1018551 - clean up redundancy in the font/shaper code. r=jdaggett 2014-05-31 08:12: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