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

84 Коммитов

Автор SHA1 Сообщение Дата
Ryan Hunt 85ff4bdc33 Bug 1523969 part 8 - Move method definition inline comments to new line in 'gfx/'. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D21108

--HG--
extra : rebase_source : 48a4586f507891f3a2f0f970e9b9a0b15f0f3d61
2019-02-25 16:07:19 -06:00
Chris Peterson e77882620f Bug 1528881 - Part 4: gfx/2d: Make some global functions static. r=lsalzman
And #include "BufferUnrotate.h" in BufferUnrotate.cpp for BufferUnrotate() function prototype.

clang's -Wmissing-prototypes option identifies global functions that can be made static (because they're only called from one compilation unit) or removed (if they're never called).

gfx/2d/BufferUnrotate.cpp:17:6 [-Wmissing-prototypes] no previous prototype for function 'BufferUnrotate'
gfx/2d/DrawTargetCairo.cpp:195:6 [-Wmissing-prototypes] no previous prototype for function 'ReleaseData'
gfx/2d/DrawTargetCairo.cpp:201:18 [-Wmissing-prototypes] no previous prototype for function 'CopyToImageSurface'
gfx/2d/DrawTargetCairo.cpp:239:18 [-Wmissing-prototypes] no previous prototype for function 'GetAsImageSurface'
gfx/2d/DrawTargetCairo.cpp:251:18 [-Wmissing-prototypes] no previous prototype for function 'CreateSubImageForData'
gfx/2d/DrawTargetCairo.cpp:272:18 [-Wmissing-prototypes] no previous prototype for function 'ExtractSubImage'
gfx/2d/DrawTargetCairo.cpp:308:18 [-Wmissing-prototypes] no previous prototype for function 'GetCairoSurfaceForSourceSurface'
gfx/2d/DrawTargetRecording.cpp:26:6 [-Wmissing-prototypes] no previous prototype for function 'RecordingSourceSurfaceUserDataFunc'
gfx/2d/DrawTargetRecording.cpp:272:6 [-Wmissing-prototypes] no previous prototype for function 'RecordingFontUserDataDestroyFunc'
gfx/2d/DrawTargetWrapAndRecord.cpp:26:6 [-Wmissing-prototypes] no previous prototype for function 'WrapAndRecordSourceSurfaceUserDataFunc'
gfx/2d/DrawTargetWrapAndRecord.cpp:358:6 [-Wmissing-prototypes] no previous prototype for function 'WrapAndRecordFontUserDataDestroyFunc'
gfx/2d/FilterNodeSoftware.cpp:1816:6 [-Wmissing-prototypes] no previous prototype for function 'IsAllZero'
gfx/2d/FilterNodeSoftware.cpp:183:37 [-Wmissing-prototypes] no previous prototype for function 'CloneAligned'
gfx/2d/MacIOSurface.cpp:442:6 [-Wmissing-prototypes] no previous prototype for function 'MacIOSurfaceBufferDeallocator'
gfx/2d/QuartzSupport.mm:38:6 [-Wmissing-prototypes] no previous prototype for function 'cgdata_release_callback'
gfx/2d/ScaledFontMac.cpp:191:10 [-Wmissing-prototypes] no previous prototype for function 'CalcTableChecksum'
gfx/2d/ScaledFontMac.cpp:224:5 [-Wmissing-prototypes] no previous prototype for function 'maxPow2LessThan'
gfx/2d/unittest/TestCairo.cpp:12:6 [-Wmissing-prototypes] no previous prototype for function 'TryCircle'

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

--HG--
extra : rebase_source : b42bce33ed899caeb89e462d99a5cde29a9bb559
extra : intermediate-source : 7923cc86a6394bcd2fb3b7e38f458a5180d31e11
extra : source : 02388f2454e8842d2c023bf9f9fab222d8130093
2019-02-16 18:08:30 -08:00
Jeff Muizelaar 0c609e94c7 Bug 1522021. Propagate input size to CreateSimilarDrawTarget for filters. r=mstange
This lets us avoid drawing the complete input for ever tile when
drawing filters into a tile.

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

--HG--
extra : moz-landing-system : lando
2019-01-27 23:36:04 +00:00
Jeff Muizelaar b0d9cc5e6d Bug 1522310. Use GetRect() instead of IntRect(IntPoint(), GetSize()) in Filters code. r=mstange
This is needed so that we can use SourceSurfaces that don't have a
implicit 0,0 origin like those that would come from a DrawTargetTiled
or DrawTargetOffset.

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

--HG--
extra : moz-landing-system : lando
2019-01-25 23:03:16 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +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
Andi-Bogdan Postelnicu b2d4c86823 Bug 1453795 - GFX - Initialize member fields in classes/ structures. r=nical
--HG--
extra : rebase_source : 56f2cc017632bf27115490ae05254019108c6179
extra : amend_source : 98ea6c3c02a9f7650d2cf65deaf5085cf9a2efa4
2018-06-16 17:42:33 +03:00
Bas Schouten 7e185acb09 Bug 1473937 - Part 1: Add Opacity filter and software implementation. r=mstange 2018-07-17 21:11:13 +02:00
Miko Mynttinen 0b8872867b Bug 1393367 - Change MOZ_ASSERT to MOZ_RELEASE_ASSERT. r=mstange, r=fbraun 2018-04-12 14:18:03 +02:00
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Ryan Hunt 28164f62e6 Make FilterNodeSoftware intermediate surface caching thread safe (bug 1436723, r=mstange)
This commit introduces a lock on each FilterNodeSoftware around the cached surface.

This lock must be acquired whenever the cached surface is accessed. Currently this
is when the Filter is invalidated or painted.

When painting we only hold the cache lock when determining if we need to compute
a new surface, and after we have computed that new surface. This allows another
thread that may be painting that filter node at a different rect to not contend
on the cache. This is just theoretical though as DrawTargetTiled doesn't clamp
the source rect of the Filter command to the tile rect.

MozReview-Commit-ID: KFVZ35e1czB

--HG--
extra : rebase_source : a22918df80a24fad216a834a5737249cab570f08
2018-02-09 13:46:04 -06:00
Ryan Hunt bdc27969fe Restore FilterNodeSoftware intermediate surface caching (bug 1436723, r=mstange)
This is a just a back out of changeset 6882857e1bb5.

MozReview-Commit-ID: 9Z6iEHl3eAy

--HG--
extra : rebase_source : 3d091c72a6e589e702d90ffe6800e131b009604b
2018-02-08 15:21:06 -06:00
Ryan Hunt 2f60fa5264 Make debug bounds checking for FilterNodeSoftware thread safe (bug 1425056, r=mstange)
This debug only bounds checking is not thread safe to any filter nodes drawing at
the same time. I believe it makes sense to just manually calculate the bounds and
pass them along in the functions that need them.

MozReview-Commit-ID: 9GiYRbWuVF6

--HG--
extra : rebase_source : 388187ef92505a946d4e0a9392353373a9cfeced
2017-12-18 13:06:30 -06:00
Ryan Hunt f425854b5b Don't cache SourceSurface's in FilterNodeSoftware (bug 1425056, r=mstange)
Caching SourceSurfaces on a filter node is not thread safe to multiple
threads executing the same filter node at the same time. We could add
a mutex to every filter node and guard on that, but I think it makes
sense to just remove the caching for now. I'm open to readding this,
if this proves to be a problem.

MozReview-Commit-ID: Ca38WlG3V89

--HG--
extra : rebase_source : f0e63b4996928eea5588801d1a724c4a9f3d5040
2017-12-18 12:46:09 -06:00
Ryan Hunt 493d9c30b5 Lock access to PowCache in FilterNodeLighting (bug 1425056, r=mstange)
PowCache is not thread safe to the same filter node being drawn by multiple threads
at the same time. In this case I think it's easiest to just add a mutex for this
filter node.

MozReview-Commit-ID: 7pHuFYGxV4B

--HG--
extra : rebase_source : 3f0d9bc608880082a54b245d2fc4f7b970222a9a
2017-12-20 10:36:23 -06:00
Milan Sreckovic 099cfc4242 Bug 1423570: Use BaseRect access methods instead of member variables in gfx/ r=bas.schouten
MozReview-Commit-ID: ZGySgc9oP3

--HG--
extra : rebase_source : 23aadc10e9885002290155684b2c495780d979ce
2017-12-19 15:48:39 -05:00
Daniel Holbert 126bd9e1a4 Bug 1412427 part 8: (automated patch) Switch a bunch of C++ files in gfx to use our standard mode lines. r=jrmuizel
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py

For every file that is modified in this patch, the changes are as follows:
 (1) The patch changes the file to use the exact C++ mode lines from the
     Mozilla coding style guide, available here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

 (2) The patch deletes any blank lines between the mode line & the MPL
     boilerplate comment.

 (3) If the file previously had the mode lines and MPL boilerplate in a
     single contiguous C++ comment, then the patch splits them into
     separate C++ comments, to match the boilerplate in the coding style.

MozReview-Commit-ID: 77D61xpSmIl

--HG--
extra : rebase_source : c6162fa3cf539a07177a19838324bf368faa162b
2017-10-27 16:10:06 -07:00
Milan Sreckovic e3cd0a3157 Bug 1387514: Upgrade BaseRect (derived classes) width and height direct member variable use to instead use Width()/SetWidth() and Height()/SetHeight() in .cpp files in gfx/*. r=milan
MozReview-Commit-ID: 1jESowJKdyp

--HG--
extra : rebase_source : 3839cdea46729a9af05c777215cffcb9f42a2018
2017-08-14 08:29:28 -04:00
Markus Stange 5e31e7f15d Bug 1336622 - Don't allow subnormal surfaceScale values to be used in the lighting filter calculations. r=jrmuizel, a=abillings
MozReview-Commit-ID: LkmLX7zOfGe

--HG--
extra : rebase_source : dfa40584251197fcdb348f7b9d30c4d944e305b3
extra : amend_source : c5ba2619bfe43240103876085652047e96089c01
2017-02-09 14:29:47 -05:00
Milan Sreckovic 29bb09b7ff Bug 1330012: When caching power table for filters, avoid and optimize out the degenerate cases. r=bas,mstange.schouten
MozReview-Commit-ID: GlJYE8SLwJC

--HG--
extra : rebase_source : 162ce2ff033e8d43e6780a89d9029342c3af4041
2017-01-18 13:36:23 -05:00
vincentliu 795c5d6b58 Bug 1329849 - In SVG filter lighting code, bail out if kernelUnitLength is negative or zero. r=dholbert 2017-01-19 21:07:25 +08:00
Milan Sreckovic 5459132cb1 Bug 1296731: Add parameter to GetAlignedStride and check for overflow. r=bas
MozReview-Commit-ID: 5Ptm0bxwKdG

--HG--
extra : rebase_source : 535f2fa2447a1401b76acc0b82ce210b3c4d6dfc
2016-08-25 13:57:39 -04:00
Edwin Flores 4650e9bcec Bug 1292402 - Zero uninitialised padding in FilterNodeSoftware.cpp - r=mstange 2016-08-17 09:26:11 +01:00
Andi-Bogdan Postelnicu af65fa1246 Bug 1282424 - initialize member variable |mSpecularConstantInt| in SpecularLightingSoftware. r=mstange
MozReview-Commit-ID: 8ch1A9bGiBj

--HG--
extra : rebase_source : ee673828507d5de411c1a807f9b43ce542e34f21
2016-06-27 16:26:01 +03:00
Jonathan Watt 0b33916487 Bug 1277862, part 1 - Rename Moz2D's Filter to SamplingFilter in gfx/2d/. r=Bas 2016-05-25 17:01:18 +01:00
Milan Sreckovic bf9a6ffcc5 Bug 1219494 - Part 2. gfx/2d and gfxCrash. r=milan
* * *
Bug 1219494: Part 3. gfx/thebes, gfx/src and gfxCrash
2015-11-26 08:38:00 +01:00
Chris Peterson 46bb7c80dd Bug 1228947 - Replace mfbt/Constants.h with math.h. r=roc
--HG--
extra : rebase_source : 4ab2c4a917ea90055e48bd6adcb53904f2266ee0
2015-11-27 20:49:55 -08: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 583afa0965 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
Tom Klein 7893b08d5b Bug 1203376 - Honor filter region settings for lighting filters. r=mstange
--HG--
extra : rebase_source : adecead97d734b9bb9b5b104b88edf81c82a13a4
2015-10-07 08:25:00 +02:00
Robert O'Callahan ff15b1bada Bug 1202317. Bail out early if RequestRect is going to do redundant work. r=mstange
--HG--
extra : commitid : JQHaCF87nEG
extra : rebase_source : facdbfb7d1d06b64920e8f014367145cfdea9a43
2015-09-07 17:08:36 +12: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
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
Andreas Pehrson f9165d38d7 Bug 1162357 - Convert some usage of DataSourceSurface::GetData() to Map(). r=bas
--HG--
extra : rebase_source : aebb45613926c64355e5b193bc79166cf04292be
2015-06-10 19:01:00 +08:00
Andrew Comminos 1013161996 Bug 1167356 - Handle return value of DataSourceSurface::Map wherever possible. r=Bas
--HG--
extra : rebase_source : fe4fcb9c3a89e2573e6fde423ed8d96f31e00f14
2015-06-11 13:06:23 -04:00
Nathan Froyd c24f5f4e7c Bug 1116905 - part 3 - remove dependence on implicit conversion from T* to TemporaryRef<T>, gfx changes; r=jrmuizel 2015-04-30 15:20:30 -04:00
Milan Sreckovic 76dd5cd892 Bug 1140113 - Catch direct (and some indirect) callers of CreateDrawTarget* and deal with failure. r=mstange 2015-03-09 15:48:20 -04:00
Markus Stange 6e4e723923 Bug 1092634 - Let feColorMatrix and feComponentTransfer generate output outside their input's bounds. r=Bas
This makes the color matrix and component transfer Moz2D filters generate
an infinite output, which is then cropped to the primitive's filter
primitive subregion by a subsequent crop filter node. This still gives us
different behavior than other browser when the primitive subregion is
overridden using the x/y/width/height attributes - other browsers either
ignore those completely (IE) or only let them crop the default subregion
(which is defined to be the same as the input subregion) and not enlargen
it - but I'll fix that in a separate bug.
2015-02-09 14:04:11 -05:00
Markus Stange 14017f7761 Bug 1117304 - Make sure the tile filter doesn't call CopyRect on surfaces with different formats. r=Bas 2015-01-05 18:40:27 +01:00
Benoit Girard 700fbb43f7 Bug 1105834 - Part 1: Add CreateDataSourceSurfaceByCloning to moz2d. r=mstange,bas 2014-11-28 18:11:03 -05:00
Julian Seward ed42e63485 Bug 1078211 - Uninitialised value use in DoUnpremultiplicationCalculation_SIMD. r=mstange.
--HG--
extra : rebase_source : f6c2050339ff24c2e067f0533fe0e7a1589288e5
2014-12-09 13:12:34 +01:00
Wes Kocher 99f09b4b90 Backed out 3 changesets (bug 1105834) for non-unified bustage
Backed out changeset 33592fd41f1f (bug 1105834)
Backed out changeset c3e505887e9f (bug 1105834)
Backed out changeset 6aad17f431d1 (bug 1105834)
2014-12-08 17:15:46 -08:00
Benoit Girard 263a1d279b Bug 1105834 - Part 1: Add CreateDataSourceSurfaceByCloning to moz2d. r=mstange,bas 2014-11-28 18:11:03 -05:00
Wes Kocher 92049c1863 Backed out changeset 41ecbb9a5fac (bug 1092634) for reftest bustage 2014-11-18 17:21:08 -08:00
Markus Stange cacfe982d9 Bug 1092634 - Let feColorMatrix and feComponentTransfer generate output outside their input's bounds. r=Bas
This makes the color matrix and component transfer Moz2D filters generate an infinite output, which is then cropped to the primitive's filter primitive subregion by a subsequent crop filter node. This still gives us different behavior than other browser when the primitive subregion is overridden using the x/y/width/height attributes - other browsers either ignore those completely (IE) or only let them crop the default subregion (which is defined to be the same as the input subregion) and not enlargen it - but I'll fix that in a separate bug.
2014-11-18 17:21:19 -05:00
Markus Stange 1d372b2e28 Bug 1076695 - Don't convert alpha surfaces into RGBA surfaces for FilterNodeTransformSoftware. r=Bas 2014-10-16 12:35:58 +02:00
Wes Kocher 1a2c9fd8d4 Backed out changeset bb80c2b08bc0 (bug 1076695) for being the likely cause of the ASAN reftest permafail 2014-10-07 17:30:54 -07:00
Markus Stange 4c6fa36735 Bug 1076695 - Don't convert alpha surfaces into RGBA surfaces for FilterNodeTransformSoftware. r=Bas 2014-10-07 16:18:01 +02:00
Markus Stange 33956e6925 Bug 983241 - Allow filterNodeSoftware->SetInput(*, nullptr) in order to drop reference to input surface / filter. r=Bas 2014-09-25 15:19:28 -04:00