Commit Graph

30 Commits

Author SHA1 Message Date
Bas Schouten
364c8feb0e Bug 1221616: Use ID2D1CommandList instead of a bitmap for temporary D2D drawing. r=jrmuizel 2015-11-12 17:00:52 +01:00
Nathan Froyd
9c5965b035 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
e504437747 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
46d6f38e68 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
Bas Schouten
b919761dbb Bug 1153609: Push layers for cleartype when trying to draw cleartype glyphs to a transparent layer. r=jrmuizel
This patch lets us repush all layers with their backgrounds copied when drawing subpixel AA'ed text to a transparent surface. This can be wasteful since the last layer that was pushed could already have had its pixels where the glyphs will be drawn made opaque, however we have no way of knowing this so we have to always repush the layers.
2015-05-29 14:49:19 +02:00
Bas Schouten
08c24bf928 Bug 1161815: Use a single ID2D1SolidColorBrush per DrawTarget. r=jrmuizel 2015-05-07 02:38:10 +02:00
Bas Schouten
00978f25c7 Bug 1151821: Make globalCompositeOperator work correctly when a complex clip is pushed. r=jrmuizel 2015-04-10 07:09:31 +02:00
Andrea Marchesini
cece1d9f00 Bug 1156632 - Remove unused forward class declarations - patch 6 - the rest of the tree, r=ehsan 2015-04-22 08:29:24 +02:00
Carsten "Tomcat" Book
66220aefcc Backed out changeset 1610ee9ba5d8 (bug 1151821) for m1 test failures 2015-04-10 11:12:51 +02:00
Bas Schouten
73a938302d Bug 1151821: Make globalCompositeOperator work correctly when a complex clip is pushed. r=jrmuizel 2015-04-10 07:09:31 +02:00
Ehsan Akhgari
33bb32f549 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
David Anderson
cf720c0a8e Implement GetMaxTextureSize in the basic compositor. (bug 1135883, r=mattwoodrow) 2015-02-24 13:39:01 -08:00
Brian Smith
f239d701ac Bug 1119072, Part 16: Replace uses of hash_set with unodered_set (gfx), r=bas
--HG--
extra : rebase_source : 6fe532f999372f71b7e544231b4727c86aa34d70
2015-01-08 15:42:38 -08:00
Bas Schouten
d4181f7c5f Bug 1099335: Base decision to use a complex clip on whether a DT supports regoin clipping. r=jrmuizel
DrawTargets that support region clipping are able to clip to regions effectively. Other DrawTargets go through expensive complex clip paths. When invalidating regions we have code that draws in multiple steps when using Direct2D to avoid this expense, we should base the decision to do this simply on whether the DrawTarget supports fast region clipping.
2014-11-16 19:17:40 +00:00
Bas Schouten
62c763162c Bug 1085187: Properly deal with sampling restriction when using DataSourceSurfaces. r=jrmuizel 2014-10-29 23:40:38 +01:00
Bas Schouten
c46391eb0a Bug 1066670: Deal with a failed brush creation by drawing transparent black. r=jrmuizel 2014-09-14 23:51:34 +02:00
Bas Schouten
97d8894b02 Bug 1062412: Support blending composition operations in D2D 1.1. r=jrmuizel 2014-09-14 23:51:31 +02:00
Bas Schouten
76796092a4 Bug 1060960: Fix D2D 1.1 backend's ClearRect to deal with transforms and complex clips. r=jrmuizel 2014-09-14 23:51:29 +02:00
Matt Woodrow
8c5c06f212 Bug 1046550 - Part 2: Allow creating D2D 1.1 DrawTargets for D3D11 textures. r=bas 2014-09-14 23:51:27 +02:00
Jonathan Watt
d103dd96a6 Bug 1027763, part 4 - Add a new DrawTarget::GetType() method and three generic type enum values for it to return. r=Bas, r=jrmuizel 2014-06-27 10:17:49 +01:00
Jonathan Watt
3480cabb15 Bug 1027763, part 1 - Rename DrawTarget::GetType() to DrawTarget::GetBackendType() in Moz2D code. r=Bas 2014-06-19 21:35:33 +01:00
Matt Woodrow
375c837dc3 Bug 996929 - Implement OptimizeSourceSurface for all Moz2D backends. r=Bas 2014-04-17 12:45:25 +12:00
Ehsan Akhgari
cc2dbcc735 Bug 935778 - Part 0.6: Add support for MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME and use it in moz2d
X-Git-Commit-ID: bc256ac44cbba52b04f8f0390965632ec4507608
2014-02-24 08:23:37 -05:00
Benoit Jacob
06f7a9c4a2 Bug 958375 - 8/9 - Make remaining Moz2D enums typed - r=Bas
Specifically:
  r=Bas for manual changes
  f=Bas for automatic changes
See attachments on the bug for the specific breakdown.
2014-01-10 14:06:17 -05:00
Benoit Jacob
2d5774ca0a Bug 958375 - 6/9 - Make BackendType and NativeSurfaceType typed enums - r=Bas
Specifically:
  r=Bas for manual changes
  f=Bas for automatic changes
See attachments on the bug for the specific breakdown.
2014-01-10 14:06:16 -05:00
Jacek Caban
983c106d3e Bug 944908 - Fixed mingw compilation in gfx/2d/. r=bas.schouten 2013-12-23 14:03:16 +01:00
Markus Stange
f96cfc66b0 Bug 924102 - Add a FilterNode implementation that uses Direct2D 1.1 effects. Most of this patch was written by Bas. r=mstange, r=Bas 2013-11-27 12:25:16 +01:00
Markus Stange
3b8525bea8 Bug 924102 - Implement DrawTarget filter APIs with FilterNodeSoftware for Cairo, CG, D2D, D2D1 and Dual. r=Bas 2013-11-27 12:22:56 +01:00
Birunthan Mohanathas
0816e609ee Bug 784739 - Switch from NULL to nullptr in miscellaneous directories; r=ehsan
--HG--
extra : rebase_source : 8ace754e117a12e2599f5a90030f13a3a7064fed
2013-11-25 14:02:47 -05:00
Bas Schouten
7c1ee02372 Bug 883004 - Part 3: Add Direct2D 1.1 backend to Moz2D. r=jrmuizel 2013-07-17 14:12:22 +02:00