Commit Graph

949 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
Sotaro Ikeda
263e73df6e Bug 1215027 - Fix EndFrameForExternalComposition() r=nical 2015-10-15 17:53:44 -07:00
Morris Tseng
9baf236c2f Bug 709490 - Part 7: If layer is not available, fallback to BasicCanvasLayer. r=roc 2015-10-12 11:21:03 +08:00
Nicholas Nethercote
e6cc09cd51 Bug 1211324 (part 4) - Replace GraphicsFilter constants with gfx::Filter equivalents. r=mattwoodrow.
The conversion is as follows:

- GraphicsFilter::FILTER_NEAREST == gfx::Filter::POINT
- GraphicsFilter::FILTER_GOOD    == gfx::Filter::GOOD
- GraphicsFilter::FILTER_BEST    == gfx::Filter::LINEAR

Also typedef GraphicsFilter to gfx::Filter; this will be removed in the next
patch.

These changes mean ToFilter() and ThebesFilter() are no longer needed.
2015-10-05 17:12:46 -07:00
David Anderson
07ff755338 Remove the static compositor backend variable. (bug 1211109 part 2, r=mattwoodrow) 2015-10-05 23:39:00 -07:00
Wes Kocher
38e6ef5aee Backed out 11 changesets (bug 709490) for webgl-color-test.html failures a=backout
Backed out changeset fc04c5d43550 (bug 709490)
Backed out changeset cd8f9410d335 (bug 709490)
Backed out changeset 6e687c9143c1 (bug 709490)
Backed out changeset 9b20f2c833c4 (bug 709490)
Backed out changeset f9d130aea88e (bug 709490)
Backed out changeset fc513b410949 (bug 709490)
Backed out changeset acf6220b431a (bug 709490)
Backed out changeset 9bceaf913791 (bug 709490)
Backed out changeset 37fba20111e2 (bug 709490)
Backed out changeset 2285ce1596b8 (bug 709490)
Backed out changeset fb4e09920569 (bug 709490)
2015-10-05 08:28:25 -07:00
Morris Tseng
4695e137b7 Bug 709490 - Part 7: If layer is not available, fallback to BasicCanvasLayer. r=roc 2015-10-05 10:50:16 +08:00
David Anderson
80f5317cbc Don't use Direct2D if CompositorD3D11::Initialize fails. (bug 1208638, r=jrmuizel) 2015-10-01 23:06:43 -07:00
Wes Kocher
d8619c7d1e Backed out changeset 919a831786f1 (bug 1208638) for windows build failures 2015-09-30 16:43:26 -07:00
David Anderson
6f09b1c220 Don't use Direct2D if CompositorD3D11::Initialize fails. (bug 1208638, r=jrmuizel) 2015-09-30 16:16:16 -07:00
Wes Kocher
6482c81f9b Backed out 13 changesets (bug 709490) for android webgl-color-test.html failures
Backed out changeset 5be7514914b6 (bug 709490)
Backed out changeset 04b6f94fbe8a (bug 709490)
Backed out changeset 00c0e85dd8cd (bug 709490)
Backed out changeset 221385b7b81a (bug 709490)
Backed out changeset ecc38c18734f (bug 709490)
Backed out changeset 22878c936384 (bug 709490)
Backed out changeset 0edcbb60eee3 (bug 709490)
Backed out changeset 5feceec2014b (bug 709490)
Backed out changeset 835b655cb873 (bug 709490)
Backed out changeset 6fbb4a3f8cf7 (bug 709490)
Backed out changeset a5f8646fa156 (bug 709490)
Backed out changeset 2ae1386916b3 (bug 709490)
Backed out changeset 6b29a2a0a8fb (bug 709490)
2015-09-29 08:57:36 -07:00
Morris Tseng
0b17a6fcc9 Bug 709490 - Part 7: If layer is not available, fallback to BasicCanvasLayer, r=roc 2015-09-29 11:51:25 +01:00
Nicholas Nethercote
7700404de3 Bug 1208300 (part 4) - Remove gfxRGBA and some related things. r=jwatt.
Hooray!
2015-09-24 19:24:16 -07:00
Nicholas Nethercote
15a95be5b4 Bug 1208283 (part 2) - Change ColorLayer::mColor, ColorLayerProperties::mColor, ReadbackLayer::mBackgroundColor from gfxRBGA to gfx::Color. r=jwatt.
This avoids some gfxRGBA-to-Color conversions.
2015-09-24 18:16:45 -07:00
Nicholas Nethercote
bcd2fb7111 Bug 1208345 - Remove gfxContext::GraphicsOperator. r=jwatt.
Also...

- Rename various "operator" identifiers as "op" to match |CompositionOp|.

- Rename |nsBackgroundLayerState::mCompositingOp| as |mCompositionOp| to match
  |CompositionOp|.

- Remove some deprecated functions that are no longer needed.
2015-09-24 22:38:58 -07:00
Nicholas Nethercote
55d5c653f3 Bug 1207944 (part 5) - Use SetColor(const Color&) when setting from a constructed gfxRGBA. r=jwatt.
In various places SetColor() gets passed a gfxRBGA that is constructed at the
call site. This patch changes these to construct a gfx::Color directly,
avoiding the subsequent conversion.
2015-09-23 23:42:58 -07:00
Lee Salzman
d240e9c991 Bug 1205045 - remove GTK calls from compositor thread. r=jmuizelaar 2015-09-15 16:46:39 -04:00
Thinker K.F. Li
c4820d6fca Bug 1097464 - Part 6: Handle preserves-3d by compositor. r=roc
Remove WrapPreserve3DList() and replaced it by creating a
nsDisplayTransform item for each transformed frame.

 - Add an additional item for each top frame extending 3D context to
   separate consequence contexts.

 - Effective transform of a layer is the accumulation of ancestors in
   the same 3D context.

 - The layers creating new context and extended by children need a
   temporary buffer if it's effective transform is not 2D.

 - Clip rects are accumulated along the context chain.

 - Visible rects of items are computed from dirty regions of the frame
   creating the context and accumulated transforms.

 - Bounds of items are computed from accumulated transforms and
   accumulated bounds of the descent frames.

 - Backface hidden is handled by compositor and BasicLayerManager.
2015-09-17 03:31:00 +02:00
Carsten "Tomcat" Book
42aa14ed8e Backed out 6 changesets (bug 1097464) for causing OS X 10.10 Reftest Errors
Backed out changeset fbf63ce1ba88 (bug 1097464)
Backed out changeset fdaf4cfa6707 (bug 1097464)
Backed out changeset 727ebd9f744a (bug 1097464)
Backed out changeset 03f03a776042 (bug 1097464)
Backed out changeset 5ec6364b87d7 (bug 1097464)
Backed out changeset 47d056b3af7f (bug 1097464)
2015-09-17 16:24:43 +02:00
Jamie Nicol
709cbe92db Bug 1200729 - Recompute FrameLayerBuilder item visibility if dirty region changes. r=mwoodrow
Make the FrameLayerBuilder remember for what region it has calculated
display item visibility, then recompute the visibility whenever the
dirty region it is passed to DrawPaintedLayer changes.

This means that the caller does not have to know the entire dirty region
that will be drawn for the transaction, but we can still optimise cases
where it knows some of the dirty region in advance.

This fixes a regression where MultiTiledContentClient's low-res display
port would not be painted if a smaller region of its high-res buffer had
already been painted that transaction, since the FrameLayerBuilder
had decided that most of the larger low-res region was invisible.
2015-09-15 14:41:42 +01:00
Thinker K.F. Li
0238a11403 Bug 1097464 - Part 6 - Handle preserves-3d by compositor. r=roc
Remove WrapPreserve3DList() and replaced it by creating a
nsDisplayTransform item for each transformed frame.

 - Add an additional item for each top frame extending 3D context to
   separate consequence contexts.

 - Effective transform of a layer is the accumulation of ancestors in
   the same 3D context.

 - The layers creating new context and extended by children need a
   temporary buffer if it's effective transform is not 2D.

 - Clip rects are accumulated along the context chain.

 - Visible rects of items are computed from dirty regions of the frame
   creating the context and accumulated transforms.

 - Bounds of items are computed from accumulated transforms and
   accumulated bounds of the descent frames.

 - Backface hidden is handled by compositor and BasicLayerManager.
2015-09-17 03:31:00 +02:00
David Anderson
97eba6dedd Support all blend modes in the basic compositor. (bug 1203829 part 1, r=mattwoodrow) 2015-09-15 13:07:05 -07:00
Bas Schouten
6f5ec66e8e Bug 1182147: Ensure ImageHost does not attempt to call DrawQuad with an effect unsupported by the compositor. r=nical 2015-09-04 18:31:52 +00:00
Kearwood (Kip) Gilbert
b892727b02 Bug 1157984 - Part 3: Correct bounding box transformations to support projections and correct clipping when transforming behind the camera,r=vlad
- Update callsites of Matrix4x4::TransformBounds to use
  Matrix4x4::TransformAndClipBounds.
2015-08-06 17:26:09 -07:00
Andrew Comminos
0d102690e9 Bug 788873 - Only rebind a GLXPixmap if the texture has changed. r=karlt 2015-08-26 23:46:33 -04:00
Bas Schouten
6391b21503 Bug 1190950: Check mappings and surfaces for UpdateFromSurface more robustly. r=mattwoodrow 2015-08-06 02:29:47 +00:00
Jamie Nicol
2ab13a5399 Bug 1187619 - Only optmimize FrameLayerBuilder visibility calculations if correct. r=mattwoodrow
Bug 1176077 introduced the parameter aDirtyRegion to
DrawPaintedLayerCallback, which allows the callback to recompute the
visibility of all items to be painted in that transaction in a single
go. However, this parameter can not always be determined correctly
when using RotatedBuffer, and using an incorrect value was causing
graphical glitches.

Make the parameter optional, and on null values do not perform the
optimisation. Pass null from ClientPaintedLayer, which uses
RotatedBuffer and was causing problems, but continue to pass the
correct value from other Layer implementations. This optimisation was
most important for tiled layers using progressive paint, so this is
okay.
2015-08-03 04:07:00 -04:00
Benoit Girard
5fbe3fc17d Bug 1072313 - Check for more leaks in the layers code. r=mstange 2015-07-29 11:57:03 -04:00
Lee Salzman
d7eac98ff6 Bug 1188462 - Fix inclusion of skia headers to use correct directory prefixes. r=jrmuizel 2015-07-29 16:31:40 -04:00
Vladimir Vukicevic
68637bd082 Bug 1179935, introduce complex viewport projections to Compositor, remove PrepareViewport; r=mstange
---
 gfx/layers/Compositor.h                          |  10 ---
 gfx/layers/basic/BasicCompositor.h               |   2 -
 gfx/layers/composite/TextureHost.h               |  34 +++++++-
 gfx/layers/d3d11/CompositorD3D11.cpp             |  47 +++++++---
 gfx/layers/d3d11/CompositorD3D11.h               |   4 +-
 gfx/layers/d3d9/CompositorD3D9.h                 |   2 +-
 gfx/layers/opengl/CompositingRenderTargetOGL.cpp |  23 +++--
 gfx/layers/opengl/CompositingRenderTargetOGL.h   |   2 +
 gfx/layers/opengl/CompositorOGL.cpp              | 104 +++++++++++++----------
 gfx/layers/opengl/CompositorOGL.h                |   6 +-
 10 files changed, 145 insertions(+), 89 deletions(-)
2015-05-19 13:51:26 -04:00
Bas Schouten
9c03d00213 Bug 1176363 - Part 1: Stop using DrawTargets off the main thread. r=mattwoodrow 2015-07-27 15:47:29 +00:00
Ryan VanderMeulen
0aac8791a5 Backed out changeset adbd8a7608e4 (bug 1176363) for mochitest-gl permacrashes. 2015-07-27 13:54:56 -04:00
Bas Schouten
ec0223aadb Bug 1176363 - Part 1: Stop using DrawTargets off the main thread. r=mattwoodrow 2015-07-27 15:47:29 +00:00
Kearwood (Kip) Gilbert
f78c0cd7bd Bug 1181240 - Part 3: Replace gfx3DMatrix with Matrix4x4 in gfx,r=vlad
- Refactored code to use Matrix4x4 instead of gfx3DMatrix.
- There is not expected to be any functional effect.
2015-07-10 17:06:35 -07:00
Jamie Nicol
b2e2b6eebb Bug 1176077 - Only recompute PaintedLayer item visibility when display list has changed. r=mattwoodrow
FrameLayerManager::RecomputeItemsVisibility() was being called on every
call to FrameLayerBuilder::DrawPaintedLayer(), each time for the region
to be painted by that paint call. This is inefficient when progressive
paint is enabled. Change it so that we compute the visibility of all the
layer's items within the total region to be painted, but only on the
first paint after the display list has been modified.
2015-07-21 09:19:25 +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
Nicolas Silva
4de07beb5f Bug 1180688 - Detect whether the widget will be able to present frames with BasicCompositor on Mac. r=mstange 2015-07-13 16:46:48 +02:00
Lee Salzman
86468a56ae Bug 1170390 - Make gfxPlatform::CreateOffscreenSurface use explicit format rather than guess. r=jrmuizel 2015-07-06 21:21:47 -04:00
Robert O'Callahan
327d7b9a2e Bug 1143575. Reimplement ImageContainer::GetPaintCount to be composition-aware. r=nical 2015-06-15 14:45:59 +12:00
Robert O'Callahan
3c924e5d41 Bug 1143575. Replace ImageContainer Lock methods with simplified AutoLockImage. r=nical 2015-03-27 12:07:53 +13:00
David Anderson
374dcc7a0b Bug 1148582 - Apply async transforms to (ancestor) mask layers correctly. r=botond 2015-06-30 21:07:09 -04:00
Markus Stange
375ab11d1c Back out bug 1148582 for static analysis bustage. 2015-07-01 01:20:59 -04:00
David Anderson
6c90f76817 Bug 1148582 - Apply async transforms to (ancestor) mask layers correctly. r=botond 2015-06-30 21:07:09 -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
Jeff Gilbert
9efc7525f7 Bug 1144906 - Add accel E10S backend for WebGL compositing. - r=jrmuizel,mattwoodrow,nical,sotaro 2015-06-04 17:15:38 -07:00
Wes Kocher
8d606f367a Backed out changeset c4d1692d88ee (bug 1144906) for OSX m(gl) permaorange 2015-06-04 16:50:59 -07:00
Jeff Gilbert
a930aa4fee Bug 1144906 - Add accel E10S backend for WebGL compositing. - r=jrmuizel,mattwoodrow,nical,sotaro 2015-06-04 14:21:32 -07:00
Kearwood (Kip) Gilbert
a1abfa3fe0 Bug 766345 - Part 1 - Implement DEAA Antialiasing for transformed layers (v5 Patch). r=vladimir, r=djg 2014-12-17 16:28:45 -08:00
Amanda Sambath
707664d6bb Bug 1158120 - Edit include and comments that contained gfxIntSize and nsIntSize. r=nical 2015-05-29 17:01:46 +02:00