Commit Graph

51 Commits

Author SHA1 Message Date
Nicholas Nethercote
d238d3b67f Bug 1209812 (part 2) - Remove gfxImageFormat::A1. r=nical.
This value is never written anywhere, so it's not needed, and gfx::Surface
doesn't have an equivalent.
2015-09-28 12:07:44 -07:00
Nicholas Nethercote
6aeed47e98 Bug 1209812 (part 1) - Remove casts between cairo_format_t and gfxImageFormat. r=nical.
cairo_format_t and gfxImageFormat have their equivalent constants in the same
order, so you can just cast between them, which is kind of nasty.

This patch replaces all such casts with explicit conversions via calls to new
conversion functions. These functions will be removed in a subsequent patch.
2015-09-28 21:11:52 -07: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
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
Amanda Sambath
0fb27c44e6 Bug 1158120 - Replace gfxIntSize by mozilla::gfx::IntSize in gfx/thebes part 1. r=nical 2015-06-01 10:26:19 +02: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
Jonathan Watt
4073d96b5b Bug 1019681 - Remove gfxASurface's MovePixels() and FastMovePixels() methods and their overrides. r=Bas
--HG--
extra : rebase_source : 49445275b3b6ad94ffb2f9f4375e6a81ebf2842c
2014-06-05 01:03:07 +01:00
Jonathan Watt
1bff7ee358 Bug 975900 follow-up to fix unified build failures. r=me on CLOSED TREE 2014-02-25 01:30:48 +00:00
Jonathan Watt
e51d5225c2 Bug 975900 - Convert imgUtils to Moz2D (from gfxASurface to SourceSurface). r=mattwoodrow
--HG--
extra : rebase_source : aaa405346704d67005a4453de34cf67d68e2a7c6
2014-02-25 00:51:45 +00:00
Benoit Jacob
981c6431d3 Bug 959380 - 2/5 - Make gfxImageFormat a typed enum - r=jrmuizel
find . -type f | grep -v \./obj | grep -v \.hg | xargs sed -i 's/\(^\|[^A-Za-z0-9_]\)gfxImageFormat\(ARGB32\|RGB24\|A8\|A1\|RGB16_565\|Unknown\)\($\|[^A-Za-z0-9_]\)/\1gfxImageFormat::\2\3/g'
2014-01-23 13:26:40 -05:00
Andreas Pehrson
77bbd54cd0 Bug 943293 - Add CopyTo in gfxImageSurface to copy to a DataSourceSurface 2013-11-27 11:03:36 +01:00
Ehsan Akhgari
a23cd291d5 Bug 924221 - Minimize the #includes in gfx/thebes; r=bjacob
--HG--
extra : rebase_source : af198eb9b9739ce718ba0d16c385624a722cde51
2013-10-07 19:15:59 -04:00
Benoit Jacob
0f90257361 Bug 913872 - Take nested enums out of gfxASurface - 1/3 : automatic changes - r=jrmuizel
Generated by these regexes:

find . -name '*.h' -o -name '*.cpp' -o -name '*.mm' | grep -v '\.hg' | grep -v '^\.\/obj' | xargs sed -i 's/gfx[A-Za-z0-9_]*Surface\:\:[a-z]*\(\(ImageFormat\|SurfaceType\|ContentType\|MemoryLocation\)[0-9A-Za-z_]*\)/gfx\1/g'

find . -name '*.h' -o -name '*.cpp' -o -name '*.mm' | grep -v '\.hg' | grep -v '^\.\/obj' | xargs sed -i 's/gfx[A-Za-z0-9_]*Surface\:\:[a-z]*\(\(CONTENT_\|MEMORY_\)[0-9A-Za-z_]*\)/GFX_\1/g'

find . -name '*.h' -o -name '*.cpp' -o -name '*.mm' | grep -v '\.hg' | grep -v '^\.\/obj' | xargs sed -i 's/\(^\|[^A-Za-z0-9_]\)\(CONTENT_COLOR\|CONTENT_ALPHA\|CONTENT_COLOR_ALPHA\|CONTENT_SENTINEL\|MEMORY_IN_PROCESS_HEAP\|MEMORY_IN_PROCESS_NONHEAP\|MEMORY_OUT_OF_PROCESS\)\($\|[^A-Za-z0-9_]\)/\1GFX_\2\3/g'

find . -name '*.h' -o -name '*.cpp' -o -name '*.mm' | grep -v '\.hg' | grep -v '^\.\/obj' | xargs sed -i 's/\(^\|[^A-Za-z0-9_]\)\(ImageFormatARGB32\|ImageFormatRGB24\|ImageFormatA8\|ImageFormatA1\|ImageFormatRGB16_565\|ImageFormatUnknown\|SurfaceTypeImage\|SurfaceTypePDF\|SurfaceTypePS\|SurfaceTypeXlib\|SurfaceTypeXcb\|SurfaceTypeGlitz\|SurfaceTypeQuartz\|SurfaceTypeWin32\|SurfaceTypeBeOS\|SurfaceTypeDirectFB\|SurfaceTypeSVG\|SurfaceTypeOS2\|SurfaceTypeWin32Printing\|SurfaceTypeQuartzImage\|SurfaceTypeScript\|SurfaceTypeQPainter\|SurfaceTypeRecording\|SurfaceTypeVG\|SurfaceTypeGL\|SurfaceTypeDRM\|SurfaceTypeTee\|SurfaceTypeXML\|SurfaceTypeSkia\|SurfaceTypeSubsurface\|SurfaceTypeD2D\|SurfaceTypeMax\)\($\|[^A-Za-z0-9_]\)/\1gfx\2\3/g'
2013-09-24 16:45:13 -04:00
Matt Woodrow
cf41ef0285 Bug 917703 - Mark gfxSubimageSurface as opaque if it is within the opaque rect of the parent surface. r=roc 2013-09-20 21:50:05 +12:00
Matt Woodrow
9ff7267e16 Bug 917703 - Avoid copying to a sub image in CreateSamplingRestrictedDrawable if possible. r=roc 2013-09-19 17:23:31 +12:00
Wes Kocher
b03b0b7668 Backed out 5 changesets (bug 907926, bug 911393, bug 917703) due to OSX reftest bustage during an unrelated CLOSED TREE
Backed out changeset 94a6733b01dc (bug 907926)
Backed out changeset 44108fb6f7cc (bug 917703)
Backed out changeset f2dd2a27af69 (bug 911393)
Backed out changeset fdb0d1053128 (bug 907926)
Backed out changeset b3616b786e8f (bug 907926)
2013-09-19 17:56:18 -07:00
Matt Woodrow
ea0898d9ec Bug 917703 - Avoid copying to a sub image in CreateSamplingRestrictedDrawable if possible. r=roc 2013-09-19 17:23:31 +12:00
Birunthan Mohanathas
186d1e17e2 Bug 784739 - Switch from NULL to nullptr in gfx/thebes/; r=ehsan 2013-07-31 11:44:31 -04:00
Catalin Iacob
83b78343dc Bug 798914 (part 5) - Use newly introduced mozilla::MallocSizeOf instead of nsMallocSizeOfFun. r=njn.
--HG--
extra : rebase_source : fc472490dd978d165f02f77ed37f07aed6e5bb61
2013-06-23 14:03:39 +02:00
Milan Sreckovic
581f025119 Bug 845125 - Add gfxImageSurface constructor that allocates more space than needed, change AlphaBoxBlur to not hold on to the data and let the callers manage it. r=jmuizelaar 2013-04-19 12:13:18 +02:00
Aryeh Gregor
e78504c9a9 Bug 859817 - Remove implicit conversions from raw pointer to already_AddRefed; r=Ms2ger 2013-04-22 14:15:59 +03:00
Mats Palmgren
d5826be6d7 Bug 786533 - Replace NS_MIN/NS_MAX with std::min/std::max and #include <algorithm> where needed. r=ehsan 2013-01-15 13:22:03 +01:00
Nicholas Nethercote
081c9df69e Bug 820132 - Measure imgFrame::mOptSurface's size where possible, instead of calculating it. r=joedrew.
--HG--
extra : rebase_source : da7616356429242e924a09df1124b1dbab13ad60
2012-12-18 21:59:30 -08:00
Nicholas Nethercote
da226d8e42 Bug 711901 - When possible, measure, don't compute, the size of imgFrame::mImageSurface. r=joedrew.
--HG--
extra : rebase_source : 72dc61c2618166262ec6d83778d7bd2a3a7b5d61
2012-11-26 16:29:56 -08:00
Trevor Saunders
e2db6e1941 bug 798595 - remove useless prmem.h includes r=ehsan 2012-10-04 02:14:06 -04:00
Ehsan Akhgari
8c296bbcd4 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
Aryeh Gregor
57c0ad57fb Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
Nicholas Cameron
ee1596e1ef Bug 746896. Fix a bug with printing Azure canvas. r=joe 2012-06-15 10:00:44 +12:00
Matt Brubeck
72ef8c96fc Back out bug 761890, bug 746896, and bug 759036 because of reftest failures
--HG--
extra : rebase_source : b5bdad8a69eab8e9ba35d21637c0bbcb18bce703
2012-06-11 22:50:31 -07:00
Nicholas Cameron
7ebb6c0c00 Bug 746896. Fix a bug with printing Azure canvas. r=joe
--HG--
extra : rebase_source : 0f1b44a5be4a3b7fa3f4df3080de50da96b95c58
2012-06-08 11:42:21 +12:00
Gervase Markham
87620f5676 Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Benoit Girard
4eff732ee7 Bug 746344 - gfxImageSurface should allow allocation without memset. r=jmuizelaar a=jpr
--HG--
extra : rebase_source : 271a72ec7911299d2a185df7c5139c00997e55df
2012-04-17 17:55:11 -04:00
Mike Hommey
8707a0e9c7 Bug 738176 - Completely disable jemalloc when it's supposed to be disabled on OSX, and cleanup exposed APIs. r=jlebar,r=khuey 2012-04-05 09:20:53 +02:00
Ehsan Akhgari
2a602a5685 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Landing on a CLOSED TREE
2011-10-17 10:59:28 -04:00
Josh Matthews
9d68aebc29 Bug 686453 - Create invalid cairo surfaces instead of null pointers when possible. r=jrmuizel 2011-09-13 10:49:01 -04:00
Michael Wu
d8e503c38b 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
Dominic Fandrey
0ab2f46136 Bug 645398 - Substitute PR_(MAX|MIN|ABS|ROUNDUP) macro calls; r=roc 2011-06-02 14:56:50 +02:00
Robert O'Callahan
c957ae039e Bug 641426. Part 5: Avoid operator== where possible to distinguish between 'equal edges' and 'equal areas' for rectangles. r=dbaron,sr=cjones 2011-04-19 15:07:23 +12:00
Chris Jones
aa1ced7f8a Bug 635035, part 4: Implement MovePixels() for image surfaces. r=roc 2011-03-09 11:27:37 -06:00
Chris Jones
b2e95d051c Bug 629799, part 2: Ensure that gfxImageSurfaces are aligned well for alpha recovery. r=roc 2011-02-16 16:43:30 -06:00
Chris Jones
8c8ad2f763 Bug 618265: Fix leaking gfxSharedImageSurfaces. r=joe sr=vlad a=b 2011-01-04 10:40:54 -06:00
Daniel Holbert
92783cf367 Bug 612662 patch 1: Skip RecordMemoryUsed call in gfxImageSurface constructor if our surface is invalid. r=roc a=blocking-final 2010-11-19 08:56:05 -08:00
Matt Woodrow
0a67be7b51 Bug 605057 - Add gfxASurface::GetAsImageSurface to convert generic surfaces into image surfaces without copies (if possible). r=roc a=b 2010-11-11 15:31:22 -05:00
Benjamin Smedberg
ae4a853966 Bug 596451 part D - Hook up asynchronous plugin painting on Windows. This part allows opaque plugins to paint correctly. r=jmathies 2010-10-25 13:57:13 -04:00
Oleg Romashin
346c73181d Bug 556487 - Subimage API. r=roc a=blocking2.0 2010-09-15 09:02:42 -07:00
Benjamin Smedberg
3a5f09a601 Revert bug 595337 because of persistent leaks running mochitests, and bug 556487 because of in-process test failures (crashes) and a reftest failure. 2010-09-14 14:50:24 -07:00
Oleg Romashin
dcd9fb6f7a Bug 556487 - Subimage API. r=roc a=blocking2.0 2010-09-14 12:01:02 -07:00
Bobby Holley
9b62c35018 Bug 578357 - Use fallible allocation for image frames.r=joe,cjones;a=blocker 2010-08-23 15:42:51 -07:00
Karl Tomlinson
31f02e5551 b=579676 use the same alpha recovery code for gfxWindowsNativeDrawing and gfxXlibNativeRenderer r=roc 2010-08-09 14:19:17 +12:00