Commit Graph

19 Commits

Author SHA1 Message Date
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
Matt Woodrow
364da5a9e2 Bug 1199361 - Add texture memory reporters for YCbCr TextureClients. r=jrmuizel 2015-09-01 15:33:40 -04:00
Matt Woodrow
9fb0606cd1 Bug 1202700 - Use d3d9 device to upload YCbCr surfaces on the client side if possible. r=Bas 2015-09-10 13:21:43 -04:00
Carsten "Tomcat" Book
95e9b585b9 Backed out changeset edc0db4368a0 (bug 1199361) for suspicion of making OS X 10.6 reftest failing very frequently 2015-09-03 08:39:48 +02:00
Matt Woodrow
d3ec907229 Bug 1199361 - Add texture memory reporters for YCbCr TextureClients. r=jrmuizel 2015-09-01 15:33:40 -04:00
Andrea Marchesini
2a626aa941 Bug 1186725 - InitTextures should check if LockRect() returns an error, r=mattwoodrow 2015-08-10 14:47:22 +01: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
Matt Woodrow
b2195964d7 Bug 1173983 - Use R8 textures for d3d11 alpha textures since it appears to be better supported. r=Bas 2015-06-15 12:30:34 -04:00
Nicolas Silva
b15a31c2e0 Bug 1170143 - Build fix. r=me 2015-06-05 16:56:06 +02:00
Nicolas Silva
be829675ae Bug 1170143 - Add some error checks around the creation of dxgi ycbcr video frames. r=Bas 2015-06-05 16:19:11 +02:00
Matt Woodrow
0e97b4ba7e Bug 1153123 - Don't upload in the ImageBridge thread if A8 texture sharing is broken. r=Bas 2015-05-13 23:42:32 +12:00
Nathan Froyd
bb51644dac Bug 1160485 - remove implicit conversion from RefPtr<T> to TemporaryRef<T>; r=ehsan
Having this implicit conversion means that we can silently do extra
refcounting when it's completely unnecessary.  It's also an obstacle to
making RefPtr more nsRefPtr-like, so let's get rid of it.
2015-05-01 09:14:16 -04:00
Phil Ringnalda
4956ca4d78 Back out 75502ee740e0 (bug 1153123) for w-p-t bustage
CLOSED TREE
2015-05-15 20:37:24 -07:00
Matt Woodrow
b834f3afd6 Bug 1153123 - Don't upload in the ImageBridge thread if A8 texture sharing is broken. r=Bas 2015-05-13 23:42:32 +12:00
Ethan Lin
acd11da61d Bug 1053563 - Use a static create function to replace InitWith for TextureClient. r=nical 2015-04-29 19:34:00 +02:00
Matt Woodrow
a0df2b83e3 Bug 1145513 - Upload YCbCr image data on the client side when using d3d9 layers. r=nical 2015-03-23 15:13:56 +13:00
Matt Woodrow
0df9efc7e8 Bug 1138967 - Part 3: Add D3D11 YCbCr texture clients and upload on the client side. r=nical 2015-03-19 10:17:13 +13:00