Commit Graph

77 Commits

Author SHA1 Message Date
Nathan Froyd
7be5c61b60 Bug 1222569 - remove unused variable from DrawTargetD2D1.cpp; r=Bas 2015-11-06 15:09:03 -05:00
Bas Schouten
9e2d8fdf82 Bug 1220624: Make MaskSurface properly take into account the possibilities of partial uploads. r=jrmuizel 2015-11-05 00:05:26 +01:00
Milan Sreckovic
433bba9d13 Bug 1217192 - Use gfxCriticalNote where we're already using the non-default construction parameter. r=mchang 2015-10-21 14:34:00 +02: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
Milan Sreckovic
5ff2dfcf87 Bug 1130195: Don't immediately crash if we can't allocate image. Carry r=bas 2015-08-11 14:07:49 -07:00
Milan Sreckovic
f7b57da4d5 Bug 1182209 - Additional info with some critical errors. r=mchang
CLOSED TREE
2015-07-14 15:22:29 -04:00
Nicolas Silva
423571717d Bug 1178816 - Fix a crash when DrawTargetD2D1 fails to initialize. r=milan 2015-07-06 17:57:03 +02:00
Kyle
9a1a48febd Bug 1168189 - Force D2D1 CopySurface to use DrawBitmap like D2D. r=bas 2015-06-19 16:05:51 -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
Kyle Fung
11f9740fd3 Bug 1160070 - Used BitmapBrush instead of ImageBrush when no sampling bounds. r=bas 2015-06-12 17:28:25 -04:00
Andreas Pehrson
81e0a9a33e Bug 1162357 - Convert some usage of DataSourceSurface::GetData() to Map(). r=bas 2015-06-10 19:01:00 +08:00
Kyle
4d6d76abef Bug 1169039 - Check for NULL in every function that uses CreateEffect(). r=mstange 2015-05-28 15:46:16 -04:00
Bas Schouten
430438e8ee 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
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
Nathan Froyd
9ab3ed5081 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
Andrew Comminos
a5dc2315a8 Bug 1161642 - Utilize primitive blends where available for faster blending on D2D 1.1. r=bas 2015-05-11 08:47:00 -04:00
Bas Schouten
632e5c44f3 Bug 1161815: Use a single ID2D1SolidColorBrush per DrawTarget. r=jrmuizel 2015-05-07 02:38:10 +02:00
Bas Schouten
64652639b7 Bug 1151821: Make globalCompositeOperator work correctly when a complex clip is pushed. r=jrmuizel 2015-04-10 07:09:31 +02:00
Nicolas Silva
3cc1456d36 Bug 1155626 - Don't assume that Factory::GetD2D1Device returns a non-null device and add some gfxCriticalLog. r=Bas 2015-04-22 12:02:01 +02:00
Carsten "Tomcat" Book
0469548b82 Backed out changeset 1610ee9ba5d8 (bug 1151821) for m1 test failures 2015-04-10 11:12:51 +02:00
Bas Schouten
f6e47a1004 Bug 1151821: Make globalCompositeOperator work correctly when a complex clip is pushed. r=jrmuizel 2015-04-10 07:09:31 +02:00
Milan Sreckovic
76251cf9a3 Bug 1130195: Report the failed bitmap creation, but still crash. r=bschouten 2015-02-25 17:44:56 -05:00
Bas Schouten
7eefcc7b87 Bug 1083245: Pop all clips before copying to the destination blending surface. r=jrmuizel
We need to pop the clips from the decide context before flushing and copying to the destination blending surface, otherwise drawing commands executed on a pushed layer for clipping will not be realized on the destination surface for blending.

Note that this fixes most situation, but in the case of doing custom blending to an area of a surface which is not opaque while having a complex clip pushed this will still lead to some artifacts. I haven't seen this be a problem in practice though.
2015-02-04 22:03:21 +01:00
Bas Schouten
49a749aacd Bug 1089454: Prevent usage of incompatible graphics objects after device reset. r=jrmuizel 2015-01-28 00:54:19 +00:00
David Major
421e09c9a8 Bug 1122367: Null check the result of D2DFactory(). r=Bas 2015-01-20 10:56:59 +13:00
Bas Schouten
b96d7eb9fd Bug 1114398 - Part 1: Make Direct2D paths specifically typed to a backend type. r=jrmuizel 2015-01-08 00:10:48 +00:00
Milan Sreckovic
cad0a2e786 Bug 1101685 - Optionally assert in loggers, default to true on gfxCriticalError. Clean up the calls where large texture sizes were triggering the asserts in tests. r=nical 2014-12-17 17:54:04 -05:00
Carsten "Tomcat" Book
6da789ffc5 Backed out changeset 8b751f12a3ad (bug 1101685) for windows 7 debug crashtest/reftest crashes 2014-12-17 12:56:04 +01:00
Milan Sreckovic
6e9fe80392 Bug 1101685 - Optionally assert in loggers, default to true on gfxCriticalError. Clean up the calls where large texture sizes were triggering the asserts in tests. r=nical 2014-12-16 13:22:26 -05:00
Nicolas Silva
9e3136a18d Bug 1086670 - Add more gfxCriticalError logging in the D2D backend. r=jrmuizel 2014-11-26 21:05:01 +01:00
Bas Schouten
634ae2545c Bug 1101248: Properly check return values of creation functions in DrawTargetD2D1::Init. r=BenWa 2014-11-24 19:44:48 +00:00
Bas Schouten
6bfddfd2df Bug 892910: Deal with newSize becoming empty in CreatePartialBitmapForSurface. r=BenWa
This patch deals with the situation where newSize becomes empty and causes a division by 0 in the current code. It also ensures all the callers will abort any potential drawing when CreatePartialBitmapForSurface returns a nullptr.
2014-11-20 20:48:01 +00:00
Bas Schouten
d648e9fd93 Bug 1101130: Make Direct2D 1.1 clean up its resources on shutdown. r=jrmuizel 2014-11-20 00:16:48 +00:00
Bas Schouten
6626dc8849 Bug 1097293: Do not draw radial gradients when centers and radii are identical. r=jrmuizel
When Cinner and Couter are equal, as well as Rinner and Router, the algorithm described in the canvas specification will hit a division by 0. As described in section 7 of the Canvas2D specification nothing should be drawn in this situation.
2014-11-12 15:05:13 +00:00
Bas Schouten
52af2a52e4 Bug 1088235: Use DrawBitmap when we can. r=jrmuizel 2014-11-11 22:09:31 +00:00
Bas Schouten
fc6eaaa812 Bug 1085187: Properly deal with sampling restriction when using DataSourceSurfaces. r=jrmuizel 2014-10-29 23:40:38 +01:00
Bas Schouten
385031af0c Bug 1075615: Pretranslate the pattern matrix when the pattern specifies a sampling rect. r=jrmuizel 2014-10-01 19:50:24 +02:00
Markus Stange
e02b56d697 Bug 983574 - When setting a SourceSurface input on a FilterNodeD2D1, delay the conversion to ID2D1Image until the actual DrawFilter call. r=Bas 2014-09-25 15:18:29 -04:00
Nicolas Silva
a37988d95b Bug 1070018 - Log HRESULT error codes as hexadecimal values rather than signed integers. r=Bas 2014-09-23 11:35:39 -04:00
Bas Schouten
5791a666af Bug 1068613 - Addendum 2: Fix bustage due to stray character. r=bustage on a CLOSED TREE 2014-09-18 00:35:48 +02:00
Nicolas Silva
ee91f9fe40 Bug 1068613 - Part 3: Log failures in D2D, D2D 1.1 and the D3D11 TextureClient. r=bas 2014-09-17 23:23:09 +02:00
Bas Schouten
2e5b8e553d Bug 1066465: Fixup DrawTargetD2D1::DrawFilter to respect the AA mode and Finalize properly. r=jrmuizel 2014-09-14 23:52:47 +02:00
Bas Schouten
a75dad7004 Bug 1066463: Have DrawTargetD2D1::DrawSurface take the transform into account when doing a partial upload. r=jrmuizel 2014-09-14 23:52:46 +02:00
Bas Schouten
5043ce527f Bug 1066676: Make DrawTargetD2D1::DrawSurface respect the interpolation mode. r=jrmuizel 2014-09-14 23:51:35 +02:00
Bas Schouten
79a4eee66a Bug 1066673: Change DrawTargetD2D1::DrawSurfaceWithShadow to operate as per Canvas spec. r=jrmuizel 2014-09-14 23:51:35 +02:00
Bas Schouten
7fd7730f27 Bug 1066670: Deal with a failed brush creation by drawing transparent black. r=jrmuizel 2014-09-14 23:51:34 +02:00
Bas Schouten
0b17941a0e Bug 1066254: Make the temporary surface used in DrawTargetD2D1 always be transparent. r=jrmuizel 2014-09-14 23:51:33 +02:00
Bas Schouten
4aecb2ba7f Bug 1066153: Fail to create DrawTargetD2D1 over the maximum size. r=jrmuizel 2014-09-14 23:51:33 +02:00
Bas Schouten
5c79c96efc Bug 1066147: Clear new DrawTargets upon creation in D2D 1.1 backend. r=jrmuizel 2014-09-14 23:51:33 +02:00