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

51 Коммитов

Автор SHA1 Сообщение Дата
Andrew Osmond 91b071ed14 Bug 1618345 - Enforce proper color management by splitting gfx::Color into sRGBColor and DeviceColor types. r=jrmuizel
gfx::Color is currently misused in many places. The DrawTargets expect
the color space to be in device space, e.g. what we are actually going
to draw using. Everything sitting above generally deals with sRGB, as
specified in CSS. Sometimes we missed the conversion from sRGB to device
space when issuing draw calls, and similarly sometimes we converted the
color to device space twice.

This patch splits the type in two. sRGBColor and DeviceColor now
represent sRGB and device color spaces respectively. DrawTarget only
accepts DeviceColor, and one can get a DeviceColor from an sRGBColor via
the ToDeviceColor helper API. The reftests now pass with color
management enabled for everything (e.g. CSS) instead of just tagged
raster images.

There will be a follow up patch to enable color management everywhere by
default on all supported platforms.

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

--HG--
extra : moz-landing-system : lando
2020-03-09 14:16:17 +00:00
Masayuki Nakano 982428a83e Bug 253889 - part 1: Get rid of nsIPresShell from gfx r=jwatt
`gfxUtils::WriteAsPNG()` is the only user of `nsIPresShell` in `gfx`, but
nobody calls it.  So, we can get rid of it with `nsIPresShell` reference.

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

--HG--
extra : moz-landing-system : lando
2019-05-02 07:43:49 +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
Masayuki Nakano 60e014c55e Bug 1544215 - Make nsIContentVewer::GetPresShell() return mozilla::PresShell instead of nsIPresShell r=bzbarsky
Additionally, this patch makes `nsDocumentViewer` which is the only
implementation of `nsIContentViewer` use `mozilla::PresShell` directly
rather than via `nsIPresShell`.

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

--HG--
extra : moz-landing-system : lando
2019-04-16 02:47:26 +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
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01: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 2e91c61468 Bug 1377328 - part 2 - Annotate raw pointers used for refcounted objects in font-related code. r=milan 2017-06-29 17:52:43 -07:00
cku 4790d4da73 Bug 1351440 - Part 4. Pass imgDrawingParams to nsSVGPaintServerFrame::GetPaintServerPattern. r=jwatt
The reason of this change is the same as for Part 2, except that this commit fixes
nsSVGPaintServerFrame::GetPaintServerPattern rather than PaintSVG.

Commit-ID: 691YrKZ0Lm9
MozReview-Commit-ID: KSnFhCndFUk
2017-05-18 22:03:50 +02:00
cku d85d3ab378 Bug 1351440 - Part 2. Encapsulate DrawResult and imgIContainer::FLAG_* into imgDrawingParams, and pass it to PaintSVG. r=jwatt
The DrawResult return was not in fact anything to do with the success or
failure of that method, but was actually passing out a very specific piece of information
about the success or failure of any imagelib drawing that may not have occurred
under the various PaintSVG calls.

The signature of PaintSVG is changed from
  DrawResult PaintSVG(...., uint32 flags);
to
  void PaintSVG(...., imgDrawingParams& aPackage);

imgDrawingParams wraps DrawResult and imgIContainer::FLAG_* as a pack, pass through
PaintSVG to imagelib draw calls under beneath.

MozReview-Commit-ID: IOq2evUAOQF
2017-05-18 22:03:41 +02:00
Sebastian Hengst 41f1727bf4 Backed out changeset f3460d42d23c (bug 1351440) 2017-05-18 21:15:35 +02:00
Sebastian Hengst 00458fa236 Backed out changeset 2ea1279576d2 (bug 1351440) 2017-05-18 21:15:26 +02:00
cku c412dd10b9 Bug 1351440 - Part 4. Pass imgDrawingParams to nsSVGPaintServerFrame::GetPaintServerPattern. r=jwatt
The reason of this change is the same as for Part 2, except that this commit fixes
nsSVGPaintServerFrame::GetPaintServerPattern rather than PaintSVG.

Commit-ID: 691YrKZ0Lm9
MozReview-Commit-ID: KSnFhCndFUk

--HG--
extra : rebase_source : 3397613129fff6023833cdc3bd639f0d2b151652
extra : source : fa29f1920a88d88bcf0f5239462d32ee8955895c
2017-05-09 02:14:08 +08:00
cku eaa4406688 Bug 1351440 - Part 2. Encapsulate DrawResult and imgIContainer::FLAG_* into imgDrawingParams, and pass it to PaintSVG. r=jwatt
The DrawResult return was not in fact anything to do with the success or
failure of that method, but was actually passing out a very specific piece of information
about the success or failure of any imagelib drawing that may not have occurred
under the various PaintSVG calls.

The signature of PaintSVG is changed from
  DrawResult PaintSVG(...., uint32 flags);
to
  void PaintSVG(...., imgDrawingParams& aPackage);

imgDrawingParams wraps DrawResult and imgIContainer::FLAG_* as a pack, pass through
PaintSVG to imagelib draw calls under beneath.

MozReview-Commit-ID: IOq2evUAOQF

--HG--
extra : rebase_source : 66c9a9e391c2f9e142575f42fd47b37334ec5752
extra : source : 97a08873177c0f18edffdb1b5589c77843a50553
2017-05-05 17:19:43 +08:00
cku a55d02afd1 Bug 1345853 - Part 4. Pass sync decode flag down to nsSVGPatternFrame::PaintPattern. r=tnikkel
MozReview-Commit-ID: 1bHMINhs121

--HG--
extra : rebase_source : 8da9c0d77dd9a32be392f43d3be266d365894b3a
2017-03-25 03:19:18 +08:00
cku 148bb081ca Bug 1345853 - Part 1. Pass DrawResult from nsSVGPatternFrame::PaintPattern back to nsDisplaySVGGeometry::Paint. r=mstange,tnikkel
I did many change in many files in this patch. But the goal is pretty simple: To
pass the return value of nsSVGPatternFrame::PaintPattern back to the caller
(nsDisplaySVGGeometry). My suggestion is to review this patch right from
nsSVGPatternFrame.cpp.

I made two mistakes in bug 1258510
1. We should not return directly at [1]. RemoveStateBits at l418 will be skip.
2. nsSVGPatternFrame::PaintPattern should return both SourceSurface and draw
result, so that we can update UpdateDrawResult in display item.

All the other changes are to
1. make sure the return value of nsSVGPatternFrame::PaintPattern goes back to
nsDisplaySVGGeometry::Paint correctly.
2. Since the return value of nsSVGPatternFrame::PaintPattern change, we need
modify all existed callers.

I also filed bug 1346124 for handle the returning value of PaintMarkers.

[1] https://hg.mozilla.org/mozilla-central/file/c0700bedb4f7/layout/svg/nsSVGPatternFrame.cpp#l415

MozReview-Commit-ID: Iq9RPQ6Omz0

--HG--
extra : rebase_source : ca7a35bb9f5e27880d5dc62e03feb91b6ac3435d
2017-03-21 10:12:23 +08:00
Sebastian Hengst e4de847b3c Backed out changeset 836d16519edf (bug 1345853) for frequently failing its own test pattern-big-image.html. r=backout 2017-03-17 21:54:01 +01:00
cku e2d44c26bf Bug 1345853 - Part 1. Pass DrawResult from nsSVGPatternFrame::PaintPattern back to nsDisplaySVGGeometry::Paint. r=mstange,tnikkel
I did many change in many files in this patch. But the goal is pretty simple: To
pass the return value of nsSVGPatternFrame::PaintPattern back to the caller
(nsDisplaySVGGeometry). My suggestion is to review this patch right from
nsSVGPatternFrame.cpp.

I made two mistakes in bug 1258510
1. We should not return directly at [1]. RemoveStateBits at l418 will be skip.
2. nsSVGPatternFrame::PaintPattern should return both SourceSurface and draw
result, so that we can update UpdateDrawResult in display item.

All the other changes are to
1. make sure the return value of nsSVGPatternFrame::PaintPattern goes back to
nsDisplaySVGGeometry::Paint correctly.
2. Since the return value of nsSVGPatternFrame::PaintPattern change, we need
modify all existed callers.

I also filed bug 1346124 for handle the returning value of PaintMarkers.

[1] https://hg.mozilla.org/mozilla-central/file/c0700bedb4f7/layout/svg/nsSVGPatternFrame.cpp#l415

MozReview-Commit-ID: Iq9RPQ6Omz0

--HG--
extra : rebase_source : bc338b1a33f1dbf209706577b2455315dfb855e2
2017-03-16 12:17:19 +08:00
Jonathan Watt db80f397f6 Bug 1058040, part 2 - Rename gfxTextContextPaint to SVGContextPaint and add some code comments. r=dholbert 2016-07-22 14:56:09 +01:00
Jonathan Watt c5d930fd27 Bug 1058040, part 1 - Move gfxTextContextPaint to a separate file to enable use in imagelib. r=dholbert 2016-07-22 12:07:39 +01:00
Jonathan Watt 0e69308cc1 Bug 1290781 - Make the propagation of context paint to SVG glyphs much more robust. r=heycam 2016-07-21 14:33:11 +01:00
Jonathan Kew a4e2a6456b Bug 1268878 - Include various of gfxFontEntry's sub-objects in memory reporting. r=njn 2016-05-03 12:14:35 +01:00
Jonathan Watt c7da421b17 Bug 1266101, part 1 - Remove various bits of dead code related to painting SVG text. r=heycam 2016-04-21 14:39:30 +01:00
Jonathan Kew 28a9e2cf14 Bug 1265452 - Remove use of nsAutoPtr from gfx/thebes. r=jrmuizel 2016-04-15 20:45:37 +01:00
Mike Hommey ce9a5909d1 Bug 1225682 - Don't use nsAuto{,C}String as class member variables in gfx/. r=jrmuizel 2015-12-02 11:04:37 +09: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
Nicholas Nethercote 25d52ffe9f Bug 1208283 (part 1) - Change gfxPattern's single-arg constructor to take a gfx::Color& instead of a gfxRGBA&. r=jwatt.
--HG--
extra : rebase_source : 09fece3af01326be1ea7a5c29d52266323f09ade
2015-09-24 17:50:46 -07:00
Birunthan Mohanathas a8939590de 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
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
Jonathan Watt a6a8b844ba Bug 1073964 - Pass a const DrawTarget* through to nsSVGPaintServerFrame::GetPaintServerPattern so that it can create a pattern of the appropriate type. r=Bas 2014-09-29 14:15:19 +01:00
Jonathan Watt 91e483122f Bug 1025553, part 3 - Give gfxMatrix::Invert() the same semantics as Moz2D's Matrix::Invert(). r=Bas 2014-07-11 08:06:39 +01:00
Ehsan Akhgari eff9a278ad Bug 924221 - Minimize the #includes in gfx/thebes; r=bjacob
--HG--
extra : rebase_source : af198eb9b9739ce718ba0d16c385624a722cde51
2013-10-07 19:15:59 -04:00
Ehsan Akhgari fa0f489466 Bug 921753 - Part 4: Move DrawMode outside of gfxFont.h so that we won't need to #include that header everywhere DrawMode is needed; r=roc
This patch reduces the number of files that transitively #include
gfx/2d.h from 1268 to 1208.
2013-10-01 17:02:16 -04:00
Jonathan Kew c9f388d0f2 bug 916048 - SVG-in-OpenType glyphs should use the font's unitsPerEm value. r=roc 2013-09-14 12:40:57 +01:00
Edwin Flores 43e0322c30 Bug 798843 - Replace instances of 'object' with 'context' to match change in CSS values r=roc 2013-05-16 14:35:12 +12:00
Ryan VanderMeulen f6f2b44c8f Backed out changesets 6c097bdfc079, 51f5d900cd27, 9fdf99c07466, and b322938b37ef (bug 798843) due to intermittent Windows test failures. 2013-09-13 11:15:54 -04:00
Robert O'Callahan defc38fb5c Bug 906643. Part 7: Hook up animation support for gfxSVGGlyphs. r=jfkthame
There's a few things mashed together in this patch:
-- Enable animations in glyph documents
-- Make gfxSVGGlyphsDocument monitor the document's refresh driver to detect
updates
-- Forward updates to the gfxFontEntry
2013-08-20 01:08:45 +12:00
Edwin Flores b10976f9b2 Bug 798843 - Replace instances of 'object' with 'context' to match change in CSS values r=roc 2013-05-16 14:35:12 +12:00
Edwin Flores 0190219a9c Bug 801467 - Give SVG glyph documents a legitimate principal and URI so that references to paint servers are able to be resolved. r=roc,bz 2013-06-10 13:25:12 +01:00
Robert O'Callahan c53f00d548 Bug 906521. Part 6: Make gfxSVGGlyphs understand the new table format. r=jfkthame
This also adds a bunch of buffer sanity checks to the code. This may not be
strictly necessary, thanks to OTS, but I think we should code defensively here
too.

--HG--
extra : rebase_source : 26b11505aa143fae6f63cd5858c87a259bb54b50
2013-08-20 01:08:43 +12:00
Robert O'Callahan 4c69c3cd1c Bug 906521. Part 1: Remove support for 'glyphchar' since it's no longer in the spec. r=jfkthame
--HG--
extra : rebase_source : 1d694f6e8579b20dbbe5c5d02411f078d7c67a83
2013-08-20 01:08:43 +12:00
Gervase Markham 5103d820f9 Bug 715549 - remove last vestiges of tri-licence. DONTBUILD. 2013-07-19 16:08:33 +01: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
David Zbarsky c855cddefb Bug 847007: Remove nsIDocument includes r=Ms2ger 2013-03-21 20:05:19 -04:00
Robert O'Callahan f745e28a4c Bug 772726. Part 13: Fix handling of transforms in gfxTextObjectPaint. r=eflores,jwatt
gfxTextObjectPaint::GetFillPattern/GetStrokePattern should take the destination's CTM
as a parameter in order to set up the pattern matrix correctly, since the pattern matrix
is combined with the CTM by cairo/Thebes --- but we want the pattern rendering to be
independendt of the CTM, instead depending only on the TM set up when we initialized
the gfxTextObjectPaint.
We make SVGTextObjectPaint store matrices that map device space to pattern space.
2012-09-12 17:13:12 +12:00
Edwin Flores 6cea6e0646 Bug 719286 - Support new OpenType-in-SVG table format r=roc 2012-09-06 16:58:47 +12:00
Edwin Flores a8ea4d5da0 Bug 719286 - Use -moz-objectValue keywords in SVG glyphs r=roc 2012-09-06 16:58:47 +12:00
Edwin Flores 1b4129c7f5 Bug 719286 - Add support for -moz-objectFillOpacity and -moz-objectStrokeOpacity to SVG *-opacity fields in SVG glyphs r=roc 2012-09-06 16:58:47 +12:00
Edwin Flores 00ae723fe4 Bug 719286 - Include SVG glyphs when calculating glyph extents r=jfkthame 2012-09-06 16:58:46 +12:00
Edwin Flores 3b0fe9adec Bug 719286 - Add new gfxTextObjectPaint paint wrapper for use with SVG glyphs r=roc 2012-09-06 16:58:46 +12:00