Commit Graph

875 Commits

Author SHA1 Message Date
Sunny Sidhu
ae5c61f89f Bug 1220873 - Make Layer::mVisibleRegion a LayerIntRegion. r=botond 2015-11-29 02:07:55 -05:00
Matt Woodrow
a957c40d8f Bug 1168263 - Add nsDisplayPerspective and build separate layers for perspective. r=roc 2015-11-26 22:32:36 +13:00
Ting-Yu Lin
c6c490e067 Bug 1226875 - Remove nsIFrame::GetFirstChild(). r=mats 2015-11-26 17:12:39 +08:00
Timothy Nikkel
5daecb72b3 Bug 1222880. Followup to the followup to handle the case when aStopAtAnimatedGeometryRoot isn't an ancestor of aAnimatedGeometryRoot the same way we did before the patches of this bug. r=mattwoordrow (more or less)
Which is to return an empty scroll clip (instead of whatever scroll clip was accumulated in the for loop).

This patch is actually even slightly better than what we did before in that we can stop when we hit the root AGR (which is also the root reference frame) instead of the root of the frame tree. These would be different when painting a popup frame, or when not painting to the window.
2015-11-24 22:21:10 -06:00
Matt Woodrow
7bade5764e Bug 1222880 - Followup to handle the case when aStopAtAnimatedGeometryRoot isn't an ancestor of aAnimatedGeometryRoot. CLOSED TREE 2015-11-25 16:24:42 +13:00
Matt Woodrow
d405de37ca Bug 1222880 - Build a tree of AnimatedGeometryRoots to speed up traversal of ancestors. r=roc,tn 2015-11-25 11:53:51 +13:00
David Anderson
f64d767dfe Decouple CairoImage from ImageContainer. (bug 1222910, r=roc) 2015-11-17 00:09:00 -08:00
Nicholas Nethercote
2828d6ed1d Bug 1224482 (part 4) - Make GetClientSize() return a LayoutDeviceIntSize. r=kats. 2015-11-13 01:37:02 -08:00
Nicholas Nethercote
4ce3d974a8 Bug 1223690 - Remove implicit Rect conversions. r=jrmuizel.
gfxRect can be implicitly constructed from IntRect, which hides a number of
implicit conversion points, makes Moz2Dification harder, and has some
surprising effects.

This patch removes the implicit constructor and replaces it with an explicit
conversion function:

  gfxRect ThebesRect(const IntRect&)

This is the obvious outcome of removing the constructor.

But there is also a second, less obvious outcome: currently we do a number of
IntRect-to-Rect conversions using ToRect(), which (surprisingly) works because
it turns into an implicit IntRect-to-gfxRect conversion (via the implicit
constructor) combined with an explicit gfxRect-to-Rect conversion (via
ToRect()). I.e. we do two conversions, going from a Moz2D type to a Thebes
type and back to a Moz2D type!

So this patch also changes these conversion. It moves this existing function:

  Rect ToRect(const IntRect&)

from gfx2DGlue.h -- where it doesn't really belong because it doesn't involve
any Thebes types -- to gfx/2d/Rect.h, templatifying and renaming it as
IntRectToRect() in the process.

The rest of the patch deals with fall-out from these changes. The call sites
change as follows:

- IntRect-to-gfxRect conversions:
  - old: implicit
  - new: ThebesRect()

- IntRect-to-Rect conversions:
  - old: ToRect()
  - new: IntRectToRect()
2015-11-11 14:23:14 -08:00
Robert O'Callahan
9aad5e7477 Bug 1213582. Skip display items in ProcessDisplayItems if we only need items for event regions, and this item isn't one and doesn't have descendants. r=mattwoodrow 2015-11-11 15:09:21 +13:00
Botond Ballo
c16d0046cf Bug 1222661 - Replace ToUntyped(obj) calls with obj.ToUnknown*(). r=nical 2015-11-06 22:13:40 -05:00
Thinker K.F. Li
24e3c2ac49 Bug 1210784 - Layer tree invalidation with Preserves3D. r=roc 2015-11-02 18:28:00 +01:00
Kartikaya Gupta
b1750d55bf Bug 1205087 - Cache the AnimatedGeometryRoot on DisplayItem. r=roc 2015-10-05 17:09:34 -04:00
Timothy Nikkel
ce7cd52628 Bug 1156238. Skip setting async scroll clips if we aren't painting to the window because they are useless then. r=mstange
Displayports only get acted upon when painting to the window, and the async scroll clips only get computed when we use a displayport.

In addition we change an assert because if we are painting to the window then our root reference frame is either a root frame, or a popup frame. In either case we should not be able to get to out of flows outside of the frame subtree rooted at the root reference frame by following placeholders.
2015-11-03 02:03:47 -06:00
Timothy Nikkel
ac8b8d82e1 Bug 1156238. Fix the computation of animated geometry roots for transform items. r=mattwoodrow
Removing the "stop at ancestor" parameter from functions that compute AGR meant that nsLayoutUtils::GetAnimatedGeometryRootFor could no longer pass the display item's reference frame as the "stop at ancestor" which meant that the AGR could cross the reference frame for the item, which we don't want. So we make transformed frames into AGRs.

This makes the computation of display items whose frames are transformed tricky. We need the AGR of the transform item to be the ancestor AGR, not the underlying frame of the transform item (which is now an AGR). So we modify nsLayoutUtils::GetAnimatedGeometryRootFor to handle this. (The patch from bug 1205087 didn't suffer from this problem because it special cased the computation of the AGR of transform items. Leaving anybody who called nsLayoutUtils::GetAnimatedGeometryRootFor to get the wrong result.)

The computation of the AGR for scroll metadata in ContainerState::ProcessDisplayItems specifically bypassed nsLayoutUtils::GetAnimatedGeometryRootFor to avoid it's special processing of fixed background items. However we do want the AGR for scroll metadata to do this special processing of transform items. So we add a flag to bypass the fixed background behaviour and use it for the scroll metadata AGR.
2015-11-03 02:03:47 -06:00
Matt Woodrow
c9cc13ae59 Bug 1156238. Always stop at the root reference frame when looking for an animated geometry root. r=roc,mattwoodrow
This removes the "aStopAtAncestor" argument to agr computing functions. In most cases an AGR was passed for the stop at ancestor, so we'd stop at it anyway since it was an AGR. Most of the remaining cases the root reference frame was passed. And in a few cases something else was passed, which we probably don't want (returning something that isn't an AGR and isn't the root reference frame as an AGR).

The ShouldFixToViewport case is a little tricky. We want to get the AGR of the nearest viewport frame, but only if we don't have to cross our root reference frame to get it. This happens in practice for example when a select dropdown has background-attachment: fixed inside it.

Except for the ShouldFixToViewport bit, this patch is a subset of part 3 in bug 1205087 (which has more changes, and has been temporarily backed out, the remaining bits can hopefully land soon).

The ShouldFixToViewport part is by Timothy Nikkel <tnikkel@gmail.com>
2015-11-03 02:03:47 -06:00
Nigel Babu
abd59d7dc4 Backed out changeset de50fec5c3a6 (bug 1219020) 2015-11-03 11:59:06 +05:30
Matt Woodrow
d9c1868804 Bug 1219020 - Don't do layer tree comparisons for inactive layer trees that have changed layers since we'll invalidate it all anyway. r=roc 2015-11-03 16:48:42 +13:00
Birunthan Mohanathas
94998cf5fe Bug 1219392 - Capitalize mozilla::unused to avoid conflicts. r=froydnj 2015-11-02 07:53:26 +02:00
Markus Stange
4efcbe9627 Bug 1216580 - Make background-position:fixed clip stealing work with display items that create their own layer. r=mattwoodrow 2015-10-28 18:46:40 +01:00
Milan Sreckovic
7f8b397d0d Bug 1214802 - gfxEnv - consolidate environment variables used by the graphics code in one place. r=botond 2015-10-28 14:31:00 +01:00
Victor Porof
a1499ed3b5 Bug 1202657 - Add markers for workers' message passing and serialization/deserialization, r=smaug, jsantell, tromey, ejpbruel 2015-10-21 23:10:05 +02:00
Nathan Froyd
d7b3af33de Bug 1217662 - part 6 - remove Layers.h #include from FrameListBuilder.h; r=mattwoodrow
This change necessitates a few other header changes around the tree:
either places that we relying on FrameLayerBuilder.h to #include
ImageLayers.h for them, or places that were bootlegging headers from
ImageLayers.h.
2015-10-22 17:02:14 -04:00
Nathan Froyd
caa300f385 Bug 1217662 - part 5 - move FrameLayerBuilder and helper classes's ctors/dtors out-of-line; r=mattwoodrow
This change means that we don't have to have the definition of
LayerManager visible when FrameLayerBuilder is declared (which would be
necessary for, e.g. the ctor/dtor of ClippedDisplayItem), which means we
can get rid of the Layers.h include here in a subsequent patch.
2015-10-22 17:00:16 -04:00
Nathan Froyd
1bfe0f9919 Bug 1217662 - part 2 - move mozilla::layers::LayerUserData to a separate header; r=mattwoodrow
Having to include all of Layers.h just to get at the definition of
LayerUserData is inconvenient, especially as most of the interesting
things in Layers.h can be forward-declared.  Let's move LayerUserData to
its own header, so clients can include a small header for that,
forward-declare anything else they need from Layers.h, and reduce header
bloat.
2015-10-22 16:04:35 -04: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
Botond Ballo
4a35b398cb Bug 1205630 - Translate a fixed background display item's clip rect correctly when setting it on the layer. r=mstange 2015-09-25 12:55:00 -04:00
Botond Ballo
d73b6c895b Bug 1208661 - Do not assume that PaintRoot()'s contributions to the HTML paint dump will all be inside a <script> tag. r=BenWa 2015-09-25 19:23:13 -04:00
Phil Ringnalda
09589ca181 Back out 2 changesets (bug 1205630) for failing inactive-fixed-bg-bug1205630.xul on Mac and Windows
Backed out changeset 7ca5a29b914f (bug 1205630)
Backed out changeset 9db06671fc0d (bug 1205630)
2015-09-28 18:30:16 -07:00
Markus Stange
dcd5fc0233 Bug 1105832 - Also dump inactive layer managers when display list dumping is enabled. r=mattwoodrow 2015-09-25 18:37:30 -04:00
Botond Ballo
527a800195 Bug 1205630 - Translate a fixed background display item's clip rect correctly when setting it on the layer. r=mstange 2015-09-25 12:55:00 -04:00
Kartikaya Gupta
23f24fcef2 Back out the bits of bug 1205087 that cache the AnimatedGeometryRoot on DisplayItem. r=backout
The change breaks some scenarios with APZ scrolling, in particular the code
that layerizes the scroll handoff chain for deeply nested scrollable frames.
2015-09-28 15:17:34 -04:00
James Willcox
d1f8aa4767 Bug 1201541 - Use SingleTiledContentClient for non-scrollable layers on Android r=mattwoodrow 2015-09-28 09:36:58 -05: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
Markus Stange
50d6c0e45c Bug 1208438 - Don't allow layers with scrolling clips to occlusion-cull layers behind them. r=mattwoodrow 2015-09-25 15:47:41 +02:00
Wes Kocher
150bde0fe8 Backed out 2 changesets (bug 1208457, bug 1208438) for bg-fixed-child-mask.html failures
Backed out changeset 0499228f8fd1 (bug 1208438)
Backed out changeset 803a5e5c74ea (bug 1208457)
2015-09-25 13:01:33 -07:00
Matt Woodrow
1865dbb092 Bug 1205087 - Cache the AnimatedGeometryRoot on DisplayItem. r=roc 2015-09-24 18:26:36 -04:00
Matt Woodrow
c1b13e7499 Bug 1205087 - Remove LayerManager parameter for ShouldFixToViewport. r=roc 2015-09-24 18:25:08 -04:00
Markus Stange
e3659ab2df Bug 1208438 - Don't allow layers with scrolling clips to occlusion-cull layers behind them. r=mattwoodrow 2015-09-25 15:47:41 +02:00
Markus Stange
8e0a6f640c Bug 1203190 - Don't intersect with the visible rect for fixed background images. r=mattwoodrow 2015-09-25 14:40:52 +02: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
Markus Stange
2522db05ac Bug 1144534 - If we have tiling, don't reduce layer resolution for large transforms. r=mattwoodrow 2015-09-21 11:56:52 +02:00
Markus Stange
e70a5890d0 Bug 1195400 - Check ancestor geometry roots when determining scrollability of a layer. r=mattwoodrow 2015-09-20 18:28:18 +02: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
Thinker K.F. Li
a78d5fffcb Bug 1097464 - Part 5: Fix preserve3d wording for nsIFrame. r=roc 2015-09-17 03:31:00 +02:00
Phil Ringnalda
3a9573e728 Back out 2 changesets (bug 1205087) for mass bustage
CLOSED TREE

Backed out changeset 0573cd4aed27 (bug 1205087)
Backed out changeset 11a3cb42f729 (bug 1205087)
2015-09-17 19:30:42 -07:00
Matt Woodrow
398b1fd2de Bug 1205087 - Cache AnimatedGeometryRoot on nsDisplayItem. r=roc 2015-09-17 21:05:20 -04:00
Matt Woodrow
69fe1b8c9c Bug 1205087 - Remove LayerManager parameter for ShouldFixToViewport. r=roc 2015-09-17 21:03:42 -04: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