Commit Graph

311 Commits

Author SHA1 Message Date
Jonathan Kew
c44e9387b9 Bug 691581 - Don't let a zero-sized font result in assertions from FUnitsToDevUnitsFactor(). r=jdaggett 2015-11-02 08:36:50 +00:00
Nigel Babu
d7e1ca78c0 Backed out changeset 6e7658cff5f5 (bug 691581) for upcoming bustage 2015-11-02 16:13:42 +05:30
Jonathan Kew
a307ac743c Bug 691581 - Don't let a zero-sized font result in assertions from FUnitsToDevUnitsFactor(). r=jdaggett 2015-11-02 08:36:50 +00:00
Jonathan Kew
2b2811e250 Bug 1216427 - part 1 - Ensure a character+VS sequence or a ligated Regional-Indicator flag symbol is deleted as a single unit when backspacing. r=emk 2015-10-26 10:47:16 +00:00
Nathan Froyd
e4e2da55c9 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
2015-10-18 01:24:48 -04:00
Nathan Froyd
5254890206 Bug 1207245 - part 3 - switch all uses of mozilla::RefPtr<T> to nsRefPtr<T>; r=ehsan
This commit was generated using the following script, executed at the
top level of a typical source code checkout.

 # Don't modify select files in mfbt/ because it's not worth trying to
 # tease out the dependencies currently.
 #
 # Don't modify anything in media/gmp-clearkey/0.1/ because those files
 # use their own RefPtr, defined in their own RefCounted.h.
find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    grep -v 'mfbt/RefPtr.h' | \
    grep -v 'mfbt/nsRefPtr.h' | \
    grep -v 'mfbt/RefCounted.h' | \
    grep -v 'media/gmp-clearkey/0.1/' | \
    xargs perl -p -i -e '
 s/mozilla::RefPtr/nsRefPtr/g; # handle declarations in headers
 s/\bRefPtr</nsRefPtr</g; # handle local variables in functions
 s#mozilla/RefPtr.h#mozilla/nsRefPtr.h#; # handle #includes
 s#mfbt/RefPtr.h#mfbt/nsRefPtr.h#;       # handle strange #includes
'

 # |using mozilla::RefPtr;| is OK; |using nsRefPtr;| is invalid syntax.
find . -name '*.cpp' -o -name '*.mm' | xargs sed -i -e '/using nsRefPtr/d'

 # RefPtr.h used |byRef| for dealing with COM-style outparams.
 # nsRefPtr.h uses |getter_AddRefs|.
 # Fixup that mismatch.
find . -name '*.cpp' -o -name '*.h'| \
    xargs perl -p -i -e 's/byRef/getter_AddRefs/g'
2015-10-18 00:40:10 -04:00
John Daggett
fedd10aa75 Bug 1182361 p2 - count generic lookups. r=heycam 2015-09-29 10:51:28 +09:00
Sotaro Ikeda
d3188aaccf Bug 1187145 - Replace nsBaseHashtable::Enumerate() calls in gfx/ with iterators r=njn 2015-09-24 08:31:30 -07:00
Jonathan Kew
93aeab026e Bug 1193519 pt 2 - Handle sideways-left orientation in gfx text-drawing code. r=dholbert 2015-09-24 10:23:34 +01:00
Nicholas Nethercote
4a526ace27 Bug 1189156 (part 2) - Don't use enumeration style for nsTHashtable::SizeOf{In,Ex}cludingThis(). r=erahm.
After this change, we have ShallowSizeOf{In,Ex}cludingThis(), which don't do
anything to measure children. (They can be combined with iteration to measure
children.)

And we still have the existing single-arg SizeOf{In,Ex}cluding() functions,
which work if the entry type itself defines SizeOfExcludingThis().
2015-07-29 01:50:52 -07:00
Nicholas Nethercote
242308999c Bug 1188745 - Rename nsTArray::SizeOfExcludingThis() as ShallowSizeOfExcludingThis(). r=froydnj.
This makes it clearer that, unlike how SizeOf*() functions usually work, this
doesn't measure any children hanging off the array.

And do likewise for nsTObserverArray.
2015-07-28 23:24:24 -07:00
Nicholas Nethercote
f90d7d78e3 Bug 1182962 (part 2) - Use nsTHashtable::Iterator in gfxFont. r=jfkthame. 2015-07-13 19:08:16 -07:00
Birunthan Mohanathas
47ed3a3675 Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Nathan Froyd
8780083336 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
Michael Layzell
4912cad20d Bug 1168176 - Mark gfxFontShaper::mFont as MOZ_NON_OWNING_REF. r=jtd 2015-05-25 11:32:00 -04:00
Michael Layzell
7af5642534 Bug 1167403 - Mark gfxFont::GlyphChangeObserver::mFont as MOZ_NON_OWNING_REF. r=jtd 2015-05-22 08:23:00 -04:00
Nicolas Belleville
1aab737b21 Bug 948466: Rename gfxPangoFonts to gfxFontconfigFonts. r=nical 2015-05-20 17:44:09 +02:00
John Daggett
ea003cf539 Bug 1056479 p2 - implement platform fontlist based on fontconfig. r=karlt
This patch implements a derived class of gfxPlatformFontList and a set of associated objects that uses fontconfig. It's a replacement for the existing gfxPangoFontGroup and gfxFontconfigUtils code. The fontconfig API is used to lookup all fonts on the system, which are grouped by family name.

Changes due to this patch:
- font style matching, the mapping of style attributes to a specific font, is now handled by the same Gecko code that is used on other plaforms. fontconfig substitutions are handled but fontconfig style matching no longer used.
- downloadable fonts using unicode-range are now supported
- local fullname lookups are only done with the English name of the font, as per the CSS3 Fonts spec, and not only other localized fullnames
- size-specific bitmap fonts are no longer supported
- fonts lacking a Unicode character map are no longer supported
2015-05-13 14:11:25 +09:00
Carsten "Tomcat" Book
c9d696c90e Backed out changeset 1223b73d62dc (bug 1056479) 2015-05-12 12:21:09 +02:00
John Daggett
ed4b836eba Bug 1056479 p2 - implement platform fontlist based on fontconfig. r=karlt
This patch implements a derived class of gfxPlatformFontList and a set of associated objects that uses fontconfig. It's a replacement for the existing gfxPangoFontGroup and gfxFontconfigUtils code. The fontconfig API is used to lookup all fonts on the system, which are grouped by family name.

Changes due to this patch:
- font style matching, the mapping of style attributes to a specific font, is now handled by the same Gecko code that is used on other plaforms. fontconfig substitutions are handled but fontconfig style matching no longer used.
- downloadable fonts using unicode-range are now supported
- local fullname lookups are only done with the English name of the font, as per the CSS3 Fonts spec, and not only other localized fullnames
- size-specific bitmap fonts are no longer supported
- fonts lacking a Unicode character map are no longer supported
2015-05-12 17:44:16 +09:00
Carsten "Tomcat" Book
1dea6c6eeb Backed out 10 changesets (bug 1056479) for bustage on a CLOSED TREE
Backed out changeset d5b1f2b78915 (bug 1056479)
Backed out changeset bcc65b714dd6 (bug 1056479)
Backed out changeset 0b35e8a463d2 (bug 1056479)
Backed out changeset 0933391809c9 (bug 1056479)
Backed out changeset 93bd67204fac (bug 1056479)
Backed out changeset 5260b93eb0b9 (bug 1056479)
Backed out changeset 130bea3f8623 (bug 1056479)
Backed out changeset 408e078cc18d (bug 1056479)
Backed out changeset a651c240979d (bug 1056479)
Backed out changeset d74ae8fcaac9 (bug 1056479)
2015-05-12 08:25:19 +02:00
John Daggett
9e4e336d17 Bug 1056479 p2 - implement platform fontlist based on fontconfig. r=karlt
This patch implements a derived class of gfxPlatformFontList and a set of associated objects that uses fontconfig. It's a replacement for the existing gfxPangoFontGroup and gfxFontconfigUtils code. The fontconfig API is used to lookup all fonts on the system, which are grouped by family name.

Changes due to this patch:
- font style matching, the mapping of style attributes to a specific font, is now handled by the same Gecko code that is used on other plaforms. fontconfig substitutions are handled but fontconfig style matching no longer used.
- downloadable fonts using unicode-range are now supported
- local fullname lookups are only done with the English name of the font, as per the CSS3 Fonts spec, and not only other localized fullnames
- size-specific bitmap fonts are no longer supported
- fonts lacking a Unicode character map are no longer supported
2015-05-12 14:51:17 +09:00
Jonathan Kew
0fc9d01b47 Bug 1155261 - Fix computation of glyph extents and text-frame visual overflow for vertical text frames. r=smontagu 2015-04-27 09:45:55 +01:00
L. David Baron
b0860d9d42 Bug 1144885 - Treat font-size-adjust: none as separate from font-size-adjust: 0. r=jdaggett
Without the patch, the addition to property_database.js leads to
failures related to the "0.0" and "0" values in
layout/style/test/test_value_computation.html .
2015-04-20 23:10:40 -07:00
Mike Hommey
95e047925a Bug 1138293 - Use malloc/free/realloc/calloc instead of moz_malloc/moz_free/moz_realloc/moz_calloc. r=njn
The distinction between moz_malloc/moz_free and malloc/free is not
interesting. We are inconsistent in our use of one or the other, and
I wouldn't be surprised if we are mixing them anyways.
2015-03-31 12:32:49 +09:00
Ehsan Akhgari
5cccea6f0f 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
Jonathan Kew
01795be486 Bug 1128190 - Always use a mask to render shadows for color glyphs, regardless of blur radius. r=roc 2015-02-02 09:19:28 +00:00
Nicholas Nethercote
0c5308f383 Bug 1124545 - Avoid creating the mergedFeatures hash table when possible. r=jdaggett.
When scrolling all the way through
https://bugzilla.mozilla.org/show_bug.cgi?id=MNG, |mergedFeatures| gets
initialized more than 50,000 times -- each one involving a heap allocation for
the entry storage -- but it never has anything put into it.

This patch refactors MergeFontFeatures to move |mergedFeatures| inside it. It
now doesn't get created in the common case.
2015-01-21 22:41:02 -08:00
Trevor Saunders
d4b4499949 bug 1122065 - use MOZ_OVERRIDE more in gfxish things r=jrmuizel 2015-01-19 17:41:12 -05:00
Robert O'Callahan
c2aff8ebad Bug 1099977. Part 2: Make gfxFont::Measure return an empty bounding-box when all glyphs are invisible. r=jfkthame 2014-11-18 23:23:45 +13:00
Jonathan Kew
7167410094 Bug 1062108 - Don't increase glyph advances when applying fake-bold to a fixed-pitch font. r=jdaggett 2015-01-08 12:51:00 +00:00
Jonathan Kew
84b25d732c Bug 1116480 - gfxTextRun::Measure needs to account for fake-italic transform when returning the bounding box. r=roc 2014-12-31 22:35:40 +00:00
Jonathan Kew
ab5902eac9 Bug 1108616 - part 2 - Add an explicitLanguage field to gfxFontStyle, and pass it down from callers. r=dbaron 2014-12-23 12:50:10 +00:00
Jonathan Kew
79125e0c6c Bug 1090168 - part 1 - Make textBaseline attribute in <canvas> work for vertical text. r=jdaggett 2014-11-13 08:58:04 +00:00
Jonathan Watt
76dce61fd4 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
John Daggett
34ee28c220 Bug 475891 - support unicode-range when matching userfonts (non-linux). r=jfkthame 2014-11-06 13:42:50 +09:00
Markus Stange
e1612eaf91 Bug 1055634 - Propagate font smoothing background colors to layers. r=roc 2014-10-24 18:32:23 +02:00
Jonathan Kew
a4405591a5 Bug 1081867 - Convert textrun metrics to physical coordinates before merging with visual-overflow region. r=smontagu 2014-10-16 09:40:19 +01:00
Carsten "Tomcat" Book
c9209156c7 Backed out changeset 1abddb50ed34 (bug 1081867) for bustage on a CLOSED TREE 2014-10-16 11:42:11 +02:00
Jonathan Kew
97e0934b55 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
23c39de8a4 Bug 902762 pt 2 - Support for vertical textruns and fonts through gfxTextRun::Draw. r=jdaggett 2014-10-01 20:25:48 +01:00
Jonathan Kew
9e9486bb55 Bug 902762 pt 1 - Pass a 'vertical' flag to font shapers, and support vertical shaping through harfbuzz. r=jdaggett 2014-10-01 20:25:48 +01:00
Jonathan Kew
5529561cad Bug 1065002 pt 1.3 - Add an Orientation parameter to gfxFont::GetMetrics and dispatch to horizontal or vertical as needed. r=jdaggett 2014-09-30 07:38:26 +01:00
Jonathan Kew
f27bd56ff3 Bug 1065002 pt 1.2 - Add CreateVerticalMetrics to gfxFont, to read/synthesize metrics for vertical layout. r=jdaggett 2014-09-30 07:38:06 +01:00
Jonathan Kew
574d7b41fa 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
5e73cfca46 bug 1057331 - add orientation flags to gfxShapedText/gfxTextRun and to glyph runs within the text run, and split glyph runs on orientation changes. r=jdaggett 2014-09-16 12:25:45 +01:00
Jonathan Kew
5d90bffbae bug 1066043 - split gfxFont.cpp and .h into more manageably-sized pieces. r=jdaggett
--HG--
rename : gfx/thebes/gfxFont.cpp => gfx/thebes/gfxFontEntry.cpp
rename : gfx/thebes/gfxFont.h => gfx/thebes/gfxFontEntry.h
rename : gfx/thebes/gfxFont.cpp => gfx/thebes/gfxGlyphExtents.cpp
rename : gfx/thebes/gfxFont.h => gfx/thebes/gfxGlyphExtents.h
rename : gfx/thebes/gfxFont.cpp => gfx/thebes/gfxTextRun.cpp
rename : gfx/thebes/gfxFont.h => gfx/thebes/gfxTextRun.h
2014-09-16 10:58:12 +01:00
John Daggett
c477ae474b Bug 1062058 part 3 - make userfont entry a container of the platform font entry. r=heycam 2014-09-08 16:23:20 +09:00
John Daggett
09ffb13285 Bug 1062058 part 2 - rename userfont classes and adjust flags. r=heycam 2014-09-08 16:23:20 +09:00
Ehsan Akhgari
cd5081982f Bug 1048243 - Fix more bad implicit constructors in gfx; r=jrmuizel 2014-08-05 17:58:40 -04:00