Commit Graph

122 Commits

Author SHA1 Message Date
Botond Ballo
cade60817b Bug 1773256 - Use ProjectPoint when transforming coordinates from parent to child in BrowserParent. r=tnikkel
This patch also backs out the incorrect fix for bug 1745834
(see comment 12 on the bug for an explanation).

Differential Revision: https://phabricator.services.mozilla.com/D149321
2022-06-15 05:29:52 +00:00
Razvan Cojocaru
4de44a620e Bug 1770289 - Change the return type of nsLayoutUtils::ComputeSuitableScaleForAnimation() to MatrixScales. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D147835
2022-06-01 23:19:11 +00:00
Razvan Cojocaru
31f93c6a79 Bug 1767121 - Change the type of StackingContextHelper::mScale to MatrixScales. r=botond
Fix a minor typo while at it: "Inherrited" -> "Inherited".

Differential Revision: https://phabricator.services.mozilla.com/D146298
2022-05-19 01:45:52 +00:00
Dan Robertson
b3a76a25b6 Bug 1676299 Part 4: Modify BaseMatrix::ScaleFactors() to return a ScaleFactors2D. r=botond
This changes BaseMatrix::ScaleFactors() to return a ScaleFactors2D instead of
a SizeTyped.

Depends on D145041

Differential Revision: https://phabricator.services.mozilla.com/D144666
2022-04-30 01:35:24 +00:00
Razvan Cojocaru
94c557a449 Bug 1733313 - Change EffectsInfo::mScaleX/Y into a Scale2D and rename to mRasterScale. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D144274
2022-04-26 03:12:38 +00:00
Botond Ballo
903ab2474a Bug 1745834 - When adding a 3D transform to WebRenderScrollData, project it to 2D when appropriate. r=tnikkel
The main-thread codepath projects 3D transforms to 2D in
nsLayoutUtils::GetTransformToAncestor() when the transformed frame
returns false for Combines3DTransformWithAncestors().

This patch makes the transforms sent to APZ behave the same way.

Differential Revision: https://phabricator.services.mozilla.com/D142522
2022-04-16 01:37:38 +00:00
Doug Thayer
8e52ae48e7 Bug 1743304 - Semi-reduntantly propagate raster space inheritance in gecko r=gw
So, it turns out I didn't fully test the patch from bug 1740262 after I made my
final changes to it. A change that I had in the patch which I thought was
unnecessary, because it didn't fix the problem by itself, turns out to in fact
be necessary. It turns out we still need to inherit the parent stacking
context's `mRasterizeLocally` value inside gecko, or else we could have scale
changes which get dropped on the WebRender side. I do think long term WebRender
should handle all of this itself, because I believe there are still potential
issues lurking here when we start to think of this across the process boundary,
but I don't think I'm the right person right now to untangle everything to
cleanly move everything necessary into WebRender, so I think the solution for
right now is to have Gecko somewhat but not entirely reduntantly handle raster
space inheritance itself, in addition to WebRender handling raster space
inheritance in order to partially cover the process boundary case. This is not
a pretty solution, but as far as I can tell it fixes the issues that bug
1730710 introduced without regressing the performance back to pre-1730710
levels.

Differential Revision: https://phabricator.services.mozilla.com/D132308
2021-11-28 21:47:04 +00:00
Doug Thayer
20501215ca Bug 1730710 - Propagate raster spaces in GPU process r=gw
This actually does two things. One: it lets child stacking contexts inherit out
of process raster spaces by checking the parent stacking context's raster space
inside WR itself, and Two: it mirrors the logic in get_raster_space_for_prim
which undoes the device_pixel_scale for pinch zooms in order to get a
consistent glyph rasterization scale. This second thing won't affect the test
page linked in the bug, but it will affect the performance of, say, animating a
whole browser's scale, which is useful for reasons.

Differential Revision: https://phabricator.services.mozilla.com/D125562
2021-10-01 15:12:37 +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
Timothy Nikkel
c0ff54a411 Bug 1724901. Use the scale from ancestor documents in other processes in the StackingContextHelper. r=jrmuizel
This ensures images and svg content and anything else rasterized in the content process has the right scale.

Differential Revision: https://phabricator.services.mozilla.com/D122540
2021-08-18 03:44:56 +00:00
Botond Ballo
73a3311dc2 Bug 1719913 - Simplify representation of StackingContextHelper::mDeferredTransformItem. r=tnikkel
Maybe<T*> is a redundant representation if there is no semantic
difference between Nothing() and Some(nullptr), and just makes
for cumbersome access syntax.

Differential Revision: https://phabricator.services.mozilla.com/D120568
2021-07-28 03:20:18 +00:00
Timothy Nikkel
34d90e4d6e Bug 1715369. Handle the case of a StackingContextHelper inside a deferred transform item with a different asr. r=mstange
Whenever the asr of the deferred transform item differs from the current asr and we are about to enter a new StackingContextHelper (as opposed to just when we enter a transformed frame) flush the deferred transform item, so it's transform doesn't get lost.

This is similar to https://phabricator.services.mozilla.com/D8111. In fact we are extending https://phabricator.services.mozilla.com/D8111 to every time we enter a StackingContextHelper. https://phabricator.services.mozilla.com/D8111 was concerned with solving the case of having two nested transform items with different asrs and making sure we don't lose the outer transform item, here we need to solve the case of an outer transformed item and an inner StackingContextHelper (which is not for a transform) with a different asr and making sure we don't lose the outer transform item.

Note that some of the items I added CreatesStackingContextHelper return true don't always make a new StackingContextHelper. It seemed better to be consistent and I think the only downside is a little less perf because we have to create a few more scrolldata nodes.

Differential Revision: https://phabricator.services.mozilla.com/D118815
2021-07-08 23:07:11 +00:00
Jamie Nicol
77f3d7d435 Bug 1694707 - Select correct scroll root within fixed position items with dynamic toolbar. r=gw
Currently when selecting the scroll root for picture caching, if a
non-Zoom transform is encountered we give up and select the root
spatial node. This is because the transform may be non-axis aligned.

When the Fenix dynamic toolbar is enabled, fixed position items must
create a spatial node with an animated transform, so that they can be
positioned asynchronously by APZ when the toolbar moves.

The combination of these two things means for that scroll frames
within fixed position items we always select the root spatial node,
meaning that the entire contents invalidates continuously while
scrolling.

To fix this, add a flag to the Transform ReferenceFrameKind which
marks the transform as always being a 2D scale or translation. When
selecting the scroll root, we can continue searching through such
reference frames, as we already do for Zoom frames. Set this flag true
for references frames created due to the dynamic toolbar.
Additionally, assert that the transform is indeed a 2d scale or
translation after it is resolved.

The condition of the transform being only a 2d scale and translation
is shared with ReferenceFrameKind::Zoom, so that has been removed and
its uses updated to use this new flag instead. An additional
should_snap flag has also been added, so that we continue to snap zoom
transforms, and additionally snap the dynamic-toolbar related
transforms too.

Lastly, this adds some unit tests for find_scroll_root.

Differential Revision: https://phabricator.services.mozilla.com/D106809
2021-03-02 21:53:41 +00:00
Timothy Nikkel
fef87b0861 Bug 1662062. Make StackingContextHelper constructor handle pinch zooming resolution when calculatoring the scale. r=jrmuizel
Looks like it's just a case we missed. This affects on desktop and android.

Differential Revision: https://phabricator.services.mozilla.com/D97716
2020-11-28 09:50:14 +00:00
Dorel Luca
8ca1392bde Backed out changeset 774fb7eed629 (bug 1662062) for Build bustages in StackingContextHelper.cpp. CLOSED TREE 2020-11-28 11:13:29 +02:00
Timothy Nikkel
6ded84f154 Bug 1662062. Make StackingContextHelper constructor handle pinch zooming resolution when calculatoring the scale. r=jrmuizel
Looks like it's just a case we missed. This affects on desktop and android.

Differential Revision: https://phabricator.services.mozilla.com/D97716
2020-11-27 14:11:48 +00:00
Kartikaya Gupta
e50c01637d Bug 1662800 - Fix matrix multiplication order. r=botond
When combining transform matrices for deferred transforms, we were multiplying
them in the wrong order. This caused incorrect behaviour when one of the matrices
had a scale factor.

Differential Revision: https://phabricator.services.mozilla.com/D96199
2020-11-07 11:19:56 +00:00
Timothy Nikkel
75ffc060f9 Bug 1637067. Make the StackingContextHelper constructor handle transforms that cannot be drawn 2d the same as ChooseScale. r=jrmuizel
In StackingContextHelper::StackingContextHelper we want to handle the case of "no passed in transform" differently from "passed in transform but it cannot be drawn 2d". This is a little tricky because ChooseScale always has a transform passed in: in the non-wr case it is a scaling matrix by the parent scale. We could call ChooseScale if canDraw2D is false and get the same value for mScale but we also need to keep mInheritedTransform in sync.

This issue arose before: https://bugzilla.mozilla.org/show_bug.cgi?id=1449958#c3

And we want to be careful not to regress that bug, that bug was concerning content without a transform, so we should be good.

The testcase has a parent element with rotateY(-80deg) and a child element with rotateY(80deg), the combined transform is flat with no scaling even though each transform individually would have a very small x scale. There's no way to choose a good scale by looking at each transform individually, and since we only currently store transforms as 2d matrices we can't look at the full combined transform in order to choose a scale. Thus we must use a unit scale, like ChooseScale does.

Differential Revision: https://phabricator.services.mozilla.com/D75289
2020-05-20 08:16:04 +00:00
Timothy Nikkel
cfdc4b0922 Bug 1637067. Use the same kind of preserve3d in the StackingContextHelper constructor as in ChooseScale. r=jrmuizel
transform_style is set to frame->Extend3DContext, but ChooseScale uses frame->Combines3DTransformWithAncestors()

Differential Revision: https://phabricator.services.mozilla.com/D75288
2020-05-20 08:16:03 +00:00
Timothy Nikkel
b2c908af8d Bug 1626259. When computing the scale for a stacking context with webrender look at this stacking context to see if it is preserve 3d and not it's parent to match FrameLayerBuilder::ChooseScale. r=jrmuizel
Back when webrender did not call FrameLayerBuilder::ChooseScale (it was called ChooseScaleAndSetTransform back then until it was factored out in bug 1415987) bug 1449640 landed which made the webrender scale choosing more closely align with FrameLayerBuilder::ChooseScale by not computing a scale of there was preserve3d or perspective involved. That patch had a bug, it looked at the parent stacking context helper to see if it had preserve 3d, but FrameLayerBuilder::ChooseScale looks at the current "stacking context".

This didn't cause a problem in the testcase from this bug until bug 1569215 landed. In the testcase in this bug we have a stacking context with a 2d transform whose parent stacking context is preserve3d. So we pass down the scale from the parent stacking context and completely ignore the scale induced by the 2d transform. Passing 1.f to ChooseScale instead of the parent scale factor "undid" this mistake, so when that was fixed we regressed this testcase.

Differential Revision: https://phabricator.services.mozilla.com/D69167
2020-04-03 01:24:54 +00:00
Timothy Nikkel
2470350f9b Bug 1569215. In StackingContextHelper constructor pass parent scale to ChooseScale. r=jrmuizel
This might seem like we are including the parent scale twice because it is also included in mInheritedTransform but FrameLayerBuilder::ChooseScale only incorporates the passed in scale when combining it with a scale computed purely based on the local transform induced by this stacking context item.

This also fixes bug 1564698 and doesn't regress bug 1495163 (the only testcase I can still find for the regressing bug, bug 1415987).

Differential Revision: https://phabricator.services.mozilla.com/D39867
2019-08-01 02:03:19 +00:00
Doug Thayer
78132cddf9 Bug 1441308 - Core renderroot splitting changes r=kats,sotaro
This is a large patch that contains all of the core changes for
renderroot splitting.

Differential Revision: https://phabricator.services.mozilla.com/D20701
2019-03-22 18:28:42 +00:00
Ciure Andrei
be6acddb9e Backed out 7 changesets (bug 1441308)for causing webrender build bustages CLOSED TREE
Backed out changeset 1764701d11d1 (bug 1441308)
Backed out changeset 32f7793dfd1a (bug 1441308)
Backed out changeset d8b4d6ec9b40 (bug 1441308)
Backed out changeset e2f83e4816dd (bug 1441308)
Backed out changeset baee8ada680f (bug 1441308)
Backed out changeset c09a51622e98 (bug 1441308)
Backed out changeset 737807563dd5 (bug 1441308)
2019-03-22 10:52:44 +02:00
Doug Thayer
4c535e830a Bug 1441308 - Core renderroot splitting changes r=kats,sotaro
This is a large patch that contains all of the core changes for
renderroot splitting.

Differential Revision: https://phabricator.services.mozilla.com/D20701
2019-03-22 03:15:14 +00:00
Sylvestre Ledru
0ad8a25536 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D19663
2019-02-15 08:15:57 +00:00
Oana Pop Rus
b08973e907 Merge inbound to mozilla-central. a=merge 2019-02-06 11:53:48 +02:00
Glenn Watson
2b6303cb18 Bug 1524385 - Set the current clip chain on the stacking context item. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D18527
2019-02-06 04:35:37 +00:00
Emilio Cobos Álvarez
0f2323fb6e Bug 1498639 - Give WR the id of the scroll frame perspective scrolls relative to, and compute the right transform based on that. r=kats,kvark
I think this is as clean as it can get.

Differential Revision: https://phabricator.services.mozilla.com/D17848
2019-01-28 23:41:08 +00:00
Bobby Holley
8c2421bab3 Bug 1522017 - Introduce StackingContextParams to avoid death by a thousand argument. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D17434
2019-01-24 10:44:35 -08:00
Emilio Cobos Álvarez
4a95ef861d Bug 1520664 - Cleanup ReferenceFrame so that each of them has a single matrix. r=kvark
The only thing using both was perspective, but that's not really needed with the current setup.

This more closely matches Gecko, too.

Differential Revision: https://phabricator.services.mozilla.com/D16764
2019-01-17 21:13:07 +01:00
Brindusan Cristian
cd5e06b47d Backed out changeset bbc57e229df6 (bug 1520664) for webrender bustages. CLOSED TREE 2019-01-17 19:20:00 +02:00
Emilio Cobos Álvarez
bbecfdf57d Bug 1520664 - Bug 1498639 - Cleanup ReferenceFrame so that each of them has a single matrix. r=kvark
The only thing using both was perspective, but that's not really needed with the current setup.

This more closely matches Gecko, too.

Differential Revision: https://phabricator.services.mozilla.com/D16764
2019-01-17 16:08:35 +00:00
Emilio Cobos Álvarez
64fbfbfd7c Bug 1514384 - Pass the current clip chain id instead of clipping to the filter bounds. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D16206
2019-01-11 22:19:19 +01:00
Jeff Muizelaar
eca4405235 Bug 1509182. Switch from using WrFilterOp to using FilterOp directly. r=nical
This avoids code duplication and simplifies push_stacking_context

Differential Revision: https://phabricator.services.mozilla.com/D16050
2019-01-10 19:41:08 +00:00
Cosmin Sabou
199c8bac19 Backed out changeset 10dedfde1015 (bug 1509182) for causing build bustages. 2019-01-10 20:52:49 +02:00
Jeff Muizelaar
d39e0bb1d1 Bug 1509182. Switch from using WrFilterOp to using FilterOp directly. r=nical
This avoids code duplication and simplifies push_stacking_context

Differential Revision: https://phabricator.services.mozilla.com/D16050
2019-01-10 18:40:56 +00:00
Csoregi Natalia
30efca58e6 Backed out changeset 8e078c86db82 (bug 1509182) for bustage on WebRenderTypes.h:789. CLOSED TREE 2019-01-10 18:15:42 +02:00
Jeff Muizelaar
3cebb8d71e Bug 1509182. Switch from using WrFilterOp to using FilterOp directly. r=nical
This avoids code duplication and simplifies push_stacking_context

Differential Revision: https://phabricator.services.mozilla.com/D16050
2019-01-10 14:20:21 +00:00
Dzmitry Malyshau
d07162d4a1 Bug 1518605 - New WebRender ClipId/SpatialId API. r=kats
Port to separate SpatialId from ClipId in Webrender API (WR PR #3251).
Patch was originally written and reviewed on bug 1503447.

Depends on D16005

Differential Revision: https://phabricator.services.mozilla.com/D16006
2019-01-09 03:27:07 +00:00
Lee Salzman
61b2c937f8 Bug 1524509 - track whether a WR stacking context is animated separately from whether it should rasterize locally. r=jrmuizel 2019-02-05 16:29:11 -05:00
Timothy Nikkel
2657dcbfcd Bug 1415987. Use ChooseScale to choose a scale in WebRender. r=jrmuizel 2018-12-21 16:07:21 -06:00
Sylvestre Ledru
e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Kartikaya Gupta
f8194628cd Bug 1511042 - Back out some commits from bug 1503447 for introducing correctness and perf regressions. r=backout
This backs out hg commits 1e214baf8fc1, 7d4adeee5236, and f5ffebdcc014.
2018-11-29 14:24:25 -05:00
Dzmitry Malyshau
fd5e285d97 Bug 1503447 - Always use zero origin for WR reference frames and stacking contexts r=kats
Previously, WebRender was getting a rectangle for reference frames
and stacking contexts, and it had to carefully treat the origin of this rectange:
  - by offseting all the items in a stacking context
  - by negatively compensating the sticky frame scroll port according to the
parent reference frame origin

With this change, we stop providing any non-zero origins. Instead we accomplish
the same behavior using existing API primitives, such as reference frames:
  1. when a stacking context has an origin, we push another reference frame for it
  2. when computing the sticky frame scroll port, we take this origin into account

This slightly simplifies Gecko-WR API, but more importantly it would allow WR to
get rid of this logic (of handling origins), which in turn would allow to switch
the reference frames from push()/pop() model to just define(), like we do for
scroll/sticky frames already.

Differential Revision: https://phabricator.services.mozilla.com/D13081
2018-11-28 15:32:41 +00:00
Kartikaya Gupta
0fd2e0d79f Bug 1490393 - Accumulate the deferred transform down the StackingContextHelper chain if the ASR matches. r=mstange
The implementation of deferred transforms did not handle the case where
we ended up deferring multiple transform items before encountering the
APZ-relevant display item. In this case we need to somehow accumulate
all the deferred transforms. This patch accomplishes that, and includes
a mochitest that exercises the relevant behaviour.

Depends on D8109

Differential Revision: https://phabricator.services.mozilla.com/D8110
2018-11-01 21:14:31 +00:00
Kartikaya Gupta
24a2955355 Bug 1490393 - Extract a helper method on StackingContextHelper to get the deferred transform matrix. r=mstange
Depends on D8108

Differential Revision: https://phabricator.services.mozilla.com/D8109
2018-11-01 21:12:29 +00:00
Jeff Muizelaar
b379bdd2ef Bug 1493268. Re-generate FFI header and adjust bindings.
Changes GlyphRasterSpace to RasterSpace.
2018-09-22 21:19:52 -04:00
Jeff Muizelaar
1362a7f202 Bug 1490033. Use IsStyleMaybeAnimated to set up snapping surface transform. r=mstange
This catches all animations instead of those that only run on the compositor.

Differential Revision: https://phabricator.services.mozilla.com/D6543
2018-09-21 23:28:34 -04:00