Commit Graph

70 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
515d97a3e9 Bug 1772692 - AnimationInfo::EnumerateGenerationOnFrame shouldn't need to create a window renderer. r=hiro
There's no need to lazily create a renderer here. We already avoided
this in content processes, but there's no need to do so in the parent
process either.

This shouldn't change behavior, but might help with bug 1772691, and
generally seems cleaner.

Differential Revision: https://phabricator.services.mozilla.com/D148337
2022-06-05 23:20:45 +00:00
David Shin
05f3a0bee8 Bug 1770217 - Move conversion between layers::TimingFunction and ComputedTimingFunction into ComputedTimingFunction. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D146836
2022-05-27 18:57:14 +00:00
Boris Chiou
410350e076 Bug 1737180 - Part 1: Populate scroll timeline information when adding animations for webrender r=hiro
We don't send the animation to the compositor if it's scroll-timeline is
inactive (e.g. no layout frame or no scrollable frame).

Besdies, we also add a new struct, ScrollTimelineOptions, to represent
scroll timeline information in the IPC messages.

This patch handles the main thread side, and extract the information
from the transaction and store into AnimationStorageData.
We will sample ths scroll animations later in the patch series.

Differential Revision: https://phabricator.services.mozilla.com/D140548
2022-04-05 18:48:16 +00:00
sotaro
07bb5b9eb6 Bug 1741783 - Rename PuppetWidget::HasLayerManager() to HasWindowRenderer() r=gfx-reviewers,nical
PuppetWidget already renamed GetLayerManager() to GetWindowRenderer().

Differential Revision: https://phabricator.services.mozilla.com/D131465
2021-11-18 14:16:00 +00:00
Andi-Bogdan Postelnicu
13a062f45f Bug 1519636 - First reformat with clang-format 13.0.0. r=firefox-build-system-reviewers,sylvestre,mhentges
Updated with clang-format version 13.0.0 (taskcluster-OgjH5lasS5K_fvefdRcJVg)

Depends on D131114

Differential Revision: https://phabricator.services.mozilla.com/D129119
2021-11-16 08:07:30 +00:00
Jeff Muizelaar
dea081d3e0 Bug 1734506 - Remove Layer. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D127753
2021-10-07 15:24:07 +00:00
Marian-Vasile Laza
aa5e6b1b3b Backed out 2 changesets (bug 1734506, bug 1734502) for causing build bustages. CLOSED TREE
Backed out changeset 542b8b4e17ca (bug 1734506)
Backed out changeset b37746f292da (bug 1734502)
2021-10-07 05:15:58 +03:00
Jeff Muizelaar
aac35e5a89 Bug 1734506 - Remove Layer. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D127753
2021-10-07 01:21:16 +00:00
Matt Woodrow
0f8591792b Bug 1727682 - Make WebRenderLayerManager not inherit LayerManager. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D124433
2021-09-05 22:36:45 +00:00
Matt Woodrow
eea082d1f2 Bug 1726291 - Remove FrameLayerBuilder. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D122930
2021-08-23 03:07:31 +00:00
Cosmin Sabou
1efa0d3a4e Backed out changeset e111894317cc (bug 1726291) for causing assertion failures on WebRenderCommandBuilder.cpp. CLOSED TREE 2021-08-20 06:22:40 +03:00
Matt Woodrow
2a95268df2 Bug 1726291 - Remove FrameLayerBuilder. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D122930
2021-08-20 02:20:39 +00:00
Hiroyuki Ikezoe
342f18451b Bug 1724327 - Replace nsLayoutUtils::GetCrossDocParentFrame in CreateAnimationData with nsLayoutUtils::GetCrossDocParentFrameInProcess. r=boris
It's non WebRender specific, so it will not be a problem on Fission,
additionally it's not used on non WebRender with retained display stuff
either.

Differential Revision: https://phabricator.services.mozilla.com/D121929
2021-08-06 00:00:50 +00:00
Matt Woodrow
8964031845 Bug 1721537 - Split out WindowRenderer base class from LayerManager. r=miko
Depends on D120439

Differential Revision: https://phabricator.services.mozilla.com/D120440
2021-07-22 22:58:57 +00:00
Simon Giesecke
46908cfb51 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Botond Ballo
1074cb3575 Bug 1667594 - Move nsLayoutUtils::RectCallback to namespace scope. r=emilio,jgilbert
This allows it to be forward-declared (while a nested class cannot be),
such that headers files that use RectCallback by pointer or reference
do not need to include nsLayoutUtils.h.

This avoids including nsLayoutUtils.h in nsRange.h.

Differential Revision: https://phabricator.services.mozilla.com/D91685
2020-09-30 21:06:47 +00:00
Hiroyuki Ikezoe
c732a8f63f Bug 1659227 - Change the partial pre-render rect unit to LayoutDeviceRect. r=botond
In SVG coordinates the rect size might be fractional.

Differential Revision: https://phabricator.services.mozilla.com/D90648
2020-09-23 06:33:17 +00:00
Hiroyuki Ikezoe
27d51d5131 Bug 1659227 - Handle SVG{Inner,Outer}Frame as the clip frame for partial pre-render. r=heycam,botond
In SVG frame tree SVG{Inner,Outer}Frame is normally not scrollable but clips
descendants, thus nsLayoutUtils::GetNearestScrollableFrame is not able to find
the clip/scroll frame.  So in this change, we introduce
GetNearestOverflowClipFrame which is a similar function to
GetNearestScrollableFrame but it also checks whether the frame is SVGInnerFrame
or SVGOuterFrame which is clipping the given nsIFrame during walking up the
frame tree.

In this change we also change the logic to get the clip/scroll frame and the scroll
id as follows;

1) Get the nearest overflow clip frame in the same document
2) Use the root frame if there is no clip frame
3) Then try to find the scroll id if the clip frame is asynchronously scrollable

so that it becomes clearer before.  It's still messy though.

Differential Revision: https://phabricator.services.mozilla.com/D90647
2020-09-23 06:37:31 +00:00
Hiroyuki Ikezoe
38d812103a Bug 1660089 - Use the nearest scrollable frame as the clip frame if the scrollable frame is overflow:hidden. r=botond
Without this change, the transition in the reftest in this commit has never
been composited because it's misrecognized as __jank__.
(Note that a tricky part to understand the jank is that we expand the pre-render
region based on the transformed frame size [1], in this case it's 400px width,
so that the expanded area will be smaller than the size based on 800px.)

[1] https://searchfox.org/mozilla-central/rev/73a14f1b367948faa571ed2fe5d7eb29460787c1/layout/base/nsLayoutUtils.cpp#10043,10045

Differential Revision: https://phabricator.services.mozilla.com/D88199
2020-08-27 00:09:59 +00:00
Simon Giesecke
1fbb2b245e Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-04 11:27:07 +00:00
Noemi Erli
c5adcfe981 Backed out 4 changesets (bug 1654992, bug 1654991) for causing timeous in mask-opacity-1e.html
Backed out changeset 11f0f54c6e0a (bug 1654992)
Backed out changeset a353dd5b3f08 (bug 1654991)
Backed out changeset 6a7964ba549f (bug 1654991)
Backed out changeset cf3bfb91d98c (bug 1654991)
2020-08-03 22:09:36 +03:00
Simon Giesecke
9d2e516112 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-03 14:54:18 +00:00
Hiroyuki Ikezoe
3e4a2976a0 Bug 1656421 - Use the viewport frame size for the clip rect if there is no root scroll frame. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D85548
2020-07-31 18:15:32 +00:00
Hiroyuki Ikezoe
7a52eef516 Bug 1638152 - Inform transform value in the clip rectangle and the offset from the reference frame for the partial pre-render check on WebRender. r=botond
On WebRender there is no layer tree structures so that we can't accumulate
transform values up to the nearest APZ's scroll layer by walking up the layer
tree, or we can't tell a given transform animation is inside a perspective layer
to decide whether we need to apply the offset from the reference frame or not
[1]. So we get the accumulated transform by using
nsLayoutUtils::GetTransformToAncestor on the main-thread and inform it to the
compositor thread, and also inform the offset which is set conditionally [2]
so that we don't need to tell whether the transform animation is inside a
perspective layer or not on the compositor thread.

I am not yet 100% sure that these values are same both on WebRender and non
WebRender in all cases, once after partial pre-rendering transforms have
been used in the wild well enough and any problem has not appeared, even if
there are problems we should fix them then the non WebRender version should
eventually use this same setup instead of walking up the layer tree.

[1] https://searchfox.org/mozilla-central/rev/85ae3b911d5fcabd38ef315725df32e25edef83b/gfx/layers/CompositorAnimationStorage.cpp#273-275
[2] https://searchfox.org/mozilla-central/rev/85ae3b911d5fcabd38ef315725df32e25edef83b/layout/painting/nsDisplayList.cpp#7879-7891

Differential Revision: https://phabricator.services.mozilla.com/D83201
2020-07-21 10:09:06 +00:00
Ting-Yu Lin
ede6f9503a Bug 1637130 - Rename visual overflow to ink overflow. r=dbaron
This patch is generated by:

```
# Rename the nsOverflowType enum.
rg -l "eVisualOverflow" layout/ gfx/ | xargs sed -i "s/eVisualOverflow/eInkOverflow/g"

# Rename and drop the "Get" prefix from various functions.
rg -l "GetVisualOverflowRect" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowRect/InkOverflowRect/g"
rg -l "GetPreEffectsVisualOverflowRect" layout/ gfx/ | xargs sed -i "s/GetPreEffectsVisualOverflowRect/PreEffectsInkOverflowRect/g"
rg -l "GetVisualOverflowFromDeltas" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowFromDeltas/InkOverflowFromDeltas/g"
rg -l "GetScrollableOverflowRect" layout/ gfx/ | xargs sed -i "s/GetScrollableOverflowRect/ScrollableOverflowRect/g"

# Rename, drop the "Get" prefix, and change the suffix "Area" to "Rect"
# (because they return nsRect) for the two methods in nsLineBox.
rg -l "GetVisualOverflowArea" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowArea/InkOverflowRect/g"
rg -l "GetScrollableOverflowArea" layout/ gfx/ | xargs sed -i "s/GetScrollableOverflowArea/ScrollableOverflowRect/g"

# Rename rest of the functions and variables.
rg -l "VisualOverflow" layout/ gfx/ | xargs sed -i "s/VisualOverflow/InkOverflow/g"
rg -l "visual overflow" layout/ gfx/ | xargs sed -i "s/visual overflow/ink overflow/g"
rg -l "visualOverflow" layout/ gfx/ | xargs sed -i "s/visualOverflow/inkOverflow/g"
rg -l "visOverflow" layout/ gfx/ | xargs sed -i "s/visOverflow/inkOverflow/g"
rg -l "vis-overflow" layout/ gfx/ python/ | xargs sed -i "s/vis-overflow/ink-overflow/g"

./mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D84231
2020-07-20 20:17:36 +00:00
Hiroyuki Ikezoe
fe5384124d Bug 1651910 - Drop inherited scale values and hasPerspectiveParent in TransformData. r=kats
They haven't been used effectively since bug 1403915.

Differential Revision: https://phabricator.services.mozilla.com/D83040
2020-07-14 02:28:36 +00:00
Hiroyuki Ikezoe
98c4bd8d3f Bug 1324591 - Report janked animations to the main-thread and update them on the main-thread. r=botond,boris
The machinery to report janked animations is;

1) Store the partial pre-rendered animation id and the Animation object in a
   hashtable in LayerManager
2) Store the animation id in the Animation object as well
3) When we detect jank, we send the animation id to the main-thread via an IPC
   call
4) Find the Animation object with the id in the hashtable and update the
   Animaiton
5) Whenever the partial pre-rendered Animation stop running on the compositor
   i.e. the Animation finished normally, the Animation's target element is
   changed, etc. etc., remove the Animation from the hashtable

Depends on D75731

Differential Revision: https://phabricator.services.mozilla.com/D75732
2020-07-05 11:45:01 +00:00
Hiroyuki Ikezoe
5a9374e63c Bug 1324591 - Inform the partial prerender rect, the overflowed SideBits, the scroll id of the nearest scrollable frame and its rectable to the compositor. r=botond
nsDisplayTransform doesn't have enough room to store the partial prerender rect
and the overflowed SideBits unfortunately (it will exceed 512 bytes limit [1]).
So we get the partial prerender rect and calculate the overflowed SideBits just
before we send transform animation information to the compositor.

[1] https://searchfox.org/mozilla-central/rev/fa52bedc4b401c12251513fa1c9df1753a29abb2/layout/painting/nsDisplayList.cpp#7318

Depends on D81480

Differential Revision: https://phabricator.services.mozilla.com/D75730
2020-07-05 11:43:33 +00:00
Hiroyuki Ikezoe
9474b879dd Bug 1324591 - Store the corresponding LayersId for each animation on the compositor. r=kats
Depends on D75727

Differential Revision: https://phabricator.services.mozilla.com/D75728
2020-07-05 11:42:55 +00:00
Brindusan Cristian
5bbac659d5 Backed out 9 changesets (bug 1324591) for linux build bustages on central on nsDisplayList.h.
Backed out changeset 75966ee1fe65 (bug 1324591)
Backed out changeset d6a01c6bc40e (bug 1324591)
Backed out changeset fef36ff2ea3d (bug 1324591)
Backed out changeset 4a4ae4bd95d1 (bug 1324591)
Backed out changeset 732804c83add (bug 1324591)
Backed out changeset 84657a3522fb (bug 1324591)
Backed out changeset e6c74ba41007 (bug 1324591)
Backed out changeset 8e6d4e9f5aa0 (bug 1324591)
Backed out changeset 6bc284863aff (bug 1324591)
2020-07-05 13:45:35 +03:00
Hiroyuki Ikezoe
87475fb14a Bug 1324591 - Report janked animations to the main-thread and update them on the main-thread. r=botond,boris
The machinery to report janked animations is;

1) Store the partial pre-rendered animation id and the Animation object in a
   hashtable in LayerManager
2) Store the animation id in the Animation object as well
3) When we detect jank, we send the animation id to the main-thread via an IPC
   call
4) Find the Animation object with the id in the hashtable and update the
   Animaiton
5) Whenever the partial pre-rendered Animation stop running on the compositor
   i.e. the Animation finished normally, the Animation's target element is
   changed, etc. etc., remove the Animation from the hashtable

Differential Revision: https://phabricator.services.mozilla.com/D75732
2020-07-05 02:21:01 +00:00
Hiroyuki Ikezoe
54e7fc1a2d Bug 1324591 - Inform the partial prerender rect, the overflowed SideBits, the scroll id of the nearest scrollable frame and its rectable to the compositor. r=botond
nsDisplayTransform doesn't have enough room to store the partial prerender rect
and the overflowed SideBits unfortunately (it will exceed 512 bytes limit [1]).
So we get the partial prerender rect and calculate the overflowed SideBits just
before we send transform animation information to the compositor.

[1] https://searchfox.org/mozilla-central/rev/fa52bedc4b401c12251513fa1c9df1753a29abb2/layout/painting/nsDisplayList.cpp#7318

Differential Revision: https://phabricator.services.mozilla.com/D75730
2020-07-05 02:19:38 +00:00
Hiroyuki Ikezoe
83e9c47dab Bug 1324591 - Store the corresponding LayersId for each animation on the compositor. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D75728
2020-07-05 02:48:51 +00:00
Hiroyuki Ikezoe
1e44647c3d Bug 1561225 - Revert the WebRender part for bug 1636119. r=longsonr
And check `ShouldSnapToGrid` when we create a stacking context for the
transform display item.

I was totally missing a comment [1] in CreateAimationData.

[1] https://searchfox.org/mozilla-central/rev/3ce874dc2703831af3e5ef3a1d216ffd08057fa5/gfx/layers/AnimationInfo.cpp#683-685

Differential Revision: https://phabricator.services.mozilla.com/D75668
2020-05-16 20:41:49 +00:00
Hiroyuki Ikezoe
b2a0fb7003 Bug 1638201 - Reuse AnimationStorageData in AnimationInfo. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D75453
2020-05-15 21:30:25 +00:00
longsonr
2a15970acc Bug 1636119 - Don't snap SVG content during animation r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D74505
2020-05-14 10:43:11 +00:00
Emilio Cobos Álvarez
eed6cb9e9f Bug 1636731 - Use FunctionRef for animation generation enumeration. r=hiro
I see the allocation and deallocation of the std::function show up in
profiles.

Differential Revision: https://phabricator.services.mozilla.com/D74551
2020-05-10 02:17:47 +00:00
Hiroyuki Ikezoe
8d9bbe8251 Bug 1634943 - Move animation related stuff in nsDisplayList.cpp into AnimationInfo class. r=boris
Depends on D73573

Differential Revision: https://phabricator.services.mozilla.com/D73574
2020-05-06 01:42:05 +00:00
Razvan Maries
79ca463781 Backed out 8 changesets (bug 1634943) for build bustages on AnimationInfo.h. CLOSED TREE
Backed out changeset 2ee9c0fc07bf (bug 1634943)
Backed out changeset 812f8cfff1b2 (bug 1634943)
Backed out changeset c446c1edc943 (bug 1634943)
Backed out changeset 6ef1fcc1d428 (bug 1634943)
Backed out changeset 5e4ccd0bffac (bug 1634943)
Backed out changeset bf3c4e7b4691 (bug 1634943)
Backed out changeset 8f310f49a366 (bug 1634943)
Backed out changeset 421cd778da3d (bug 1634943)
2020-05-05 13:50:47 +03:00
Hiroyuki Ikezoe
9f1e705cfb Bug 1634943 - Move animation related stuff in nsDisplayList.cpp into AnimationInfo class. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D73574
2020-05-05 10:27:07 +00:00
Hiroyuki Ikezoe
eec634debf Bug 1620873 - Make MotionPathData Maybe<MotionPathData> in TransformData. r=boris
Having MotionPathData in layers::Animation is a bit inefficient for animations
other than transform like properties.

Differential Revision: https://phabricator.services.mozilla.com/D65921
2020-03-10 01:30:08 +00:00
Simon Giesecke
83e48517da Bug 1613985 - Use default for equivalent-to-default constructors/destructors in gfx. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D65288
2020-03-04 15:39:20 +00:00
Eric Rahm
0ae8490353 Bug 1610388 - Remove nsAutoPtr usage from gfx/. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D60456
2020-01-21 01:25:28 +00:00
Boris Chiou
7dc27b5bd6 Bug 1591629 - Split TransformData into 2 parts - transform data and motion path data. r=hiro
So we don't need to create motion path data if there is no offset-path style
and no animations of offset-path.

Differential Revision: https://phabricator.services.mozilla.com/D57907
2020-01-08 09:02:36 +00:00
Boris Chiou
c48ea594c8 Bug 1591629 - Keep TransformData only in the first element when passing animation data through IPC. r=hiro
The benefits are:
1. For the rest `layers::Animation`s, their `TransformData` are `Nothing()`,
   so we can avoid any posisible copy.
2. In the compositor, we move `TransformData` out of the array, and use
   `UniquePtr` to avoid including AnimationHelper.h into AnimationInfo.h,
   which causes some compilation errors because LayersMessages.h is not
   visible in AnimationInfo.h.

Differential Revision: https://phabricator.services.mozilla.com/D57751
2020-01-08 09:02:28 +00:00
Boris Chiou
4d3a02f5b6 Bug 1429305 - Cache gfx path. r=hiro
We cache the path in AnimationInfo for layers, and in
CompsoitorAnimationStorage for web-renderer.

Differential Revision: https://phabricator.services.mozilla.com/D50013
2019-10-31 21:36:39 +00:00
Ryan Hunt
7144ca54c8 Bug 1534395 - Rename TabChild to BrowserChild. r=nika
This commit renames TabChild to BrowserChild.

Differential Revision: https://phabricator.services.mozilla.com/D28135
2019-04-09 17:39:01 -05:00
Alex Gaynor
b8181f15ab Bug 1538796 - Part 3 - convert IPDL OptionalOpacity union to use native Maybe syntax; r=kats
Depends on D24748

Differential Revision: https://phabricator.services.mozilla.com/D24749
2019-03-25 19:29:46 +00:00
Boris Chiou
c7ea398b64 Bug 1425837 - Part 5: AnimationInfo::HasTransformAnimation should check other OMTA transform-like properties r=hiro
This function was added for B2G actually, to check if the layer has OMTA for
painting high-res layer. However, It's worth to let it also check other
OMTA transform-like properties.

Depends on D22565

Differential Revision: https://phabricator.services.mozilla.com/D19636
2019-03-18 18:04:58 +00:00
Boris Chiou
6099a4a63f Bug 1425837 - Part 3: Don't store AnimationArray (a.k.a. AnimationInfo::mAnimations) on the compositor thread. r=birtles
The original implementation about "setting animations" is a little bit hard
to read. In `SetAnimations()`, we create a new intermediate data,
`AnimData`, and we mutate the original animations. And then iterate this
mutated animations & intermediate data for sampling. In this bug, we are
planning to group the AnimData as a useful data structure for supporting
multiple properties transform-like animations, so it seems the structure
of original animations may be hard to use after that. Therefore,
we decide to do some reworks on this:

First, we do renames,
1. InfalliableTArray to nsTArray. (They are the same.)
2. AnimData to PropertyAnimation.
3. SetAnimations() to ExtractAnimations(), which returns
   nsTArray<PropertyAnimationGroup>. Each entry in the array is for one
   property. In this patch, there is only one entry. We will extend this
   to multiple entries in the next patch.

And then rework `ExtractAnimations()`, which stores all the necessary data
in `PropertyAnimationGroup`. For WR, we store this in
`CompositorAnimationStorage`. For non-WR, we store it in `AnimationInfo`.
So we can just use this organized data structure for supporting multiple
properties animations. (See the next patch.)

Depends on D22563

Differential Revision: https://phabricator.services.mozilla.com/D23062
2019-03-18 18:04:48 +00:00