Commit graph

60 commits

Author SHA1 Message Date
Kartikaya Gupta
2e785a4671 Bug 1462961 - Refactor to save a nsDisplayTransform* instead of just the transform matrix. r=jrmuizel
Instead of just storing the gfx::Matrix from the nsDisplayTransform on
the stacking context for scrolldata use, we now store a pointer to the
entire nsDisplayTransform item. We will need this in the next patch.
This patch should not have any functional changes.

MozReview-Commit-ID: 7qsZpL3Ka0X

--HG--
extra : rebase_source : b42957c83ef0591e72fa5b58ceb6650fda96e0b2
2018-05-23 16:08:18 -04:00
Jeff Muizelaar
d142ce9731 Bug 1461849. Snapping surface transform. r=mstange
Capture a snapping surface transform. This is used
by svg/blob code to compute an fractional offset
to the nearest intermediate surface.

MozReview-Commit-ID: 6EFNvluvzvA

--HG--
extra : rebase_source : f26e7fa823883e93742970c2e8d687319a7eaf5b
2018-05-16 18:14:46 -04:00
Hiroyuki Ikezoe
b63fbaf5f6 Bug 1460389 - Constify arguments for StackingContextHelper ctor. r=kats
MozReview-Commit-ID: 14fu7EYESwu

--HG--
extra : rebase_source : 48dd25d7ad42abde9643d4fec50bff9aa08c41ef
2018-05-15 08:59:33 +09:00
Kartikaya Gupta
85e5ccd033 Bug 1458598 - Expose the generated reference frame id for stacking contexts. r=mstange
This is just plumbing, no functional changes yet.

MozReview-Commit-ID: FlmnMVammse

--HG--
extra : rebase_source : edede45a77a829dbd125dc1f18a4c2a4bc8087c1
2018-05-08 09:16:26 -04:00
Alexis Beingessner
239a528013 Bug 1435094 - wire up GlyphRasterSpace to nsDisplayTransform. r=kats,mstange
When a transform thinks it's animated we should abandon screen rasterization
and instead favour local rasterization. This produces a more visually
pleasant rendering, as pixel-snapping "wobbles" the text between
frames.

The float scale of GlyphRasterSpace::Local is currently unused, but this
PR tries its best to set it to a reasonable value, based on discussion
with glennw about the intended semantics. We agreed it should specify
the scale *relative* to the parent stacking context, which means it's
just whatever scaling the stacking context's transform applies. It's
possible we'll need to clamp this value or make it properly 2-dimensional
later on.

Some book-keeping is added to StackingContextHelper to ensure that
GlyphRasterSpace::Screen is never requested by a descendent
of a stacking context using GlyphRasterSpace::Local.

nsDisplayMask is changed to use a StackingContextHelper to ensure
rasterSpace is properly propagated.

In addition, this is the first commit making use of cbindgen's new support
for bridging Rust enums natively into C++! This bumps our minimum cbindgen
to 6.0.0 (just released).

MozReview-Commit-ID: 9AlsB6nUheB

--HG--
extra : rebase_source : 247e5b197e998682cb4bb74f6f9319a9a4dd3264
2018-05-03 20:38:37 -04:00
Noemi Erli
0ec806df24 Backed out changeset f8ad5962fc89 (bug 1435094) bustage in /builds/worker/workspace/build/src/layout/painting/nsDisplayList.cpp on a CLOSED TREE 2018-04-27 04:14:39 +03:00
Alexis Beingessner
4bb2580c85 Bug 1435094 - wire up GlyphRasterSpace to nsDisplayTransform. r=kats,mstange
When a transform thinks it's animated we should abandon screen rasterization
and instead favour local rasterization. This produces a more visually
pleasant rendering, as pixel-snapping "wobbles" the text between
frames.

The float scale of GlyphRasterSpace::Local is currently unused, but this
PR tries its best to set it to a reasonable value, based on discussion
with glennw about the intended semantics. We agreed it should specify
the scale *relative* to the parent stacking context, which means it's
just whatever scaling the stacking context's transform applies. It's
possible we'll need to clamp this value or make it properly 2-dimensional
later on.

Some book-keeping is added to StackingContextHelper to ensure that
GlyphRasterSpace::Screen is never requested by a descendent
of a stacking context using GlyphRasterSpace::Local.

nsDisplayMask is changed to use a StackingContextHelper to ensure
rasterSpace is properly propagated.

In addition, this is the first commit making use of cbindgen's new support
for bridging Rust enums natively into C++! This bumps our minimum cbindgen
to 6.0.0 (just released).

MozReview-Commit-ID: 9AlsB6nUheB

--HG--
extra : rebase_source : 978e51dbedeb1542e0829752b7f828ffeb2872e9
2018-04-25 10:47:34 -04:00
Jeff Muizelaar
7bd5060424 Bug 1450134. Replace ToRelativeLayoutRect() with ToRoundedLayoutRect(). r=kats
This function doesn't use any StackingContextHelper state anymore.
We should make what it does clearer and move it to a better place.

--HG--
extra : rebase_source : 1727be9657169547d842ec9b6887837abedbefdf
2018-03-29 17:57:43 -04:00
Jeff Muizelaar
04e6e86d0f Bug 1450134. Remove ToRelativeLayoutPoint(). r=kats
It's completely unused.

--HG--
extra : rebase_source : 235f41e637502a7d44292faea4b003e60c460dcb
2018-03-29 17:57:00 -04:00
Jeff Muizelaar
2fd17450bb Bug 1449640. Don't compute a scale for 3d transformed content. r=kats
This matches the behaviour of ChooseScaleAndSetTransform()

MozReview-Commit-ID: LxtkQn2XdYT

--HG--
extra : rebase_source : 9d2a9b1af9bf039def408f86982da835b7120e36
2018-03-27 17:46:34 -04:00
Kartikaya Gupta
1ad07c54db Bug 1449478 - Avoid clobbering transforms in the WebRenderScrollData. r=jrmuizel
Due to an oversight in bug 1423370, the code I added was setting the
transform on a WebRenderLayerScrollData after initializing it, but the
initialization might have populated the transform. Thus the
transform-set that I added would have clobbered the transform. This
updates the code to combine the two transforms instead which avoids
the clobber.

MozReview-Commit-ID: 4mKJTLSMD9J

--HG--
extra : rebase_source : c486c5866739ab040d81f9f9a43b2b8a04c2d383
2018-03-28 06:32:06 -04:00
Kartikaya Gupta
3c7d5a8b07 Bug 1423370 - Create fewer WebRenderLayerScrollData items for transformed items. r=jrmuizel
Instead of creating a new layer scroll data for every single
nsDisplayTransform item, we only create a new layer scroll data for
nsDisplayTransform items with perspective. In addition, we save the
transform from the non-perspective nsDisplayTransform items on the
StackingContextHelper, and then apply it to layer scroll data items that
are created by display items nested inside those nsDisplayTransforms.

This effectively makes two changes to the structure of the layer scroll
data sent to APZ:
(1) we will drop layer scroll data items for transforms that APZ doesn't
care about (i.e. the non-perspective ones that don't wrap APZ-relevant
display items).
(2) we will collapse layer scroll data items that only had a transform
into its descendant layer scroll data items. This should be functionally
equivalent, since the transform is still in the right place relative to
everything else.

The net result is fewer layer scroll data items.

MozReview-Commit-ID: HV6QPfuUrje

--HG--
extra : rebase_source : ecfe1810f9889e7ce5096e1bc42cc30a92b43b4a
2018-03-27 12:02:28 -04:00
Jeff Muizelaar
752dcfe2ff Bug 1437965. Remove some unused functionality from StackingContextHelper. r=kats
The only call to IsBackfaceVisible() was removed when we added proper backface
visible support.

MozReview-Commit-ID: ALAF4a0ScQJ

--HG--
extra : rebase_source : 9a138f9ca4244105b4692b340c95e1dbc03f0356
2018-02-13 13:20:46 -05:00
Kartikaya Gupta
69c3c5a3be Bug 1432541 - Don't reuse clips across a stacking context with a nonzero position. r=mstange
In bug 1426386, I made it so that in some cases, part or all of the
transform component of a stacking context got moved to the bounds
top-left. However I neglected to update the ScrollingLayersHelper, which
was relying on the transform to know if it could reuse clips across a
stacking context boundary. It now also needs to check the bounds
top-left as a result of the aforementioned change.

MozReview-Commit-ID: 7mDRSYqZ8bF

--HG--
extra : rebase_source : bdf433c772853d39e29c0288776db7a88129ac2f
2018-01-25 18:19:42 -05:00
Kartikaya Gupta
18a07f55d3 Bug 1426386 - Expose WR stacking context bounds via StackingContextHelper. r=mstange
MozReview-Commit-ID: AGFSq0wxxQi

--HG--
extra : rebase_source : 62ba354170dc9cbddf3d5571c5a55be481038226
2018-01-22 12:00:30 -05:00
Margareta Eliza Balazs
76eb08dabe Backed out 3 changesets (bug 1426386) for R2 failing in /layout/reftests/position-sticky/transformed-2.html on Windows on a CLOSED TREE
Backed out changeset 4416e585cf77 (bug 1426386)
Backed out changeset 1e675415a7a0 (bug 1426386)
Backed out changeset 5402e62aaa71 (bug 1426386)
2018-01-16 22:57:00 +02:00
Kartikaya Gupta
c160a5bc6a Bug 1426386 - Expose WR stacking context bounds via StackingContextHelper. r=mstange
MozReview-Commit-ID: 2Z2npMkX5vD

--HG--
extra : rebase_source : 241c4c7f3f6b6504797940481d16f6a99092f6ae
2018-01-16 13:04:56 -05:00
Andreea Pavel
25ec44cbbe Backed out 3 changesets (bug 1426386) backed out for failing reftest layout/reftests/position-sticky/transformed-2.html on Android on a CLOSED TREE
Backed out changeset ba85e9043c8a (bug 1426386)
Backed out changeset a233b4ffcfc9 (bug 1426386)
Backed out changeset b14272ea68fd (bug 1426386)
2018-01-16 19:39:12 +02:00
Kartikaya Gupta
4423cdae80 Bug 1426386 - Expose WR stacking context bounds via StackingContextHelper. r=mstange
MozReview-Commit-ID: 97leGF0od1y

--HG--
extra : rebase_source : 27c447b3eb74ad0b2c988e1a4a41ba0f485f7434
2018-01-16 08:41:59 -05:00
Kartikaya Gupta
d763b16932 Bug 1422057 - Avoid caching clips across stacking contexts with non-identity transforms. r=mstange
When a clip is defined in WebRender, any transforms on the containing
stacking contexts are baked into the clip's position. Therefore, trying
to use a clip that was defined inside a transformed stacking context in
other parts of the WR display list doesn't work properly. This was a
latent bug in ScrollingLayersHelper that was previously not exposed
because in these cases Gecko itself creates separate
DisplayItemClipChain items. Now that we are going to deduplicate those
DisplayItemClipChain items, it exposes this latent bug which we need to
fix.

MozReview-Commit-ID: Icd7L1JuY8s

--HG--
extra : rebase_source : 08749125b68b537244a054d00a41f671670d00bb
2018-01-06 09:52:58 -05:00
Ciure Andrei
48e5c9892f Merge mozilla-central to autoland. r=merge a=merge CLOSED TREE 2017-12-02 12:19:55 +02:00
Andrew Osmond
cc5c98e1d3 Bug 1420648 - Ensure WebRender computes the snapped image decode size the same as the fallback path. r=tnikkel 2017-12-01 07:18:53 -05:00
Jeff Muizelaar
6f2c43a0f8 Bug 1422414. Remove unused StackingContextHelper::mOrigin. r=mstange
Now that ToRelativeLayoutPoint does no math we should be able to
eliminate a copy of the glyph buffer.

MozReview-Commit-ID: 1o6awTyE95v

--HG--
extra : rebase_source : 0133fd64fb96c1d5541f036b7f7f3ec8701cd3fd
2017-12-01 22:20:33 -05:00
peter chang
8d32c73914 Bug 1410334 - Create correct animation properties based on WrAnimationProperty info, r=kats
MozReview-Commit-ID: 6LNbwQd9IfX

--HG--
extra : rebase_source : 2b53786ae996237bef7bf8100087b3f48667d718
2017-11-15 16:09:21 +08:00
Daniel Holbert
126bd9e1a4 Bug 1412427 part 8: (automated patch) Switch a bunch of C++ files in gfx to use our standard mode lines. r=jrmuizel
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py

For every file that is modified in this patch, the changes are as follows:
 (1) The patch changes the file to use the exact C++ mode lines from the
     Mozilla coding style guide, available here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

 (2) The patch deletes any blank lines between the mode line & the MPL
     boilerplate comment.

 (3) If the file previously had the mode lines and MPL boilerplate in a
     single contiguous C++ comment, then the patch splits them into
     separate C++ comments, to match the boilerplate in the coding style.

MozReview-Commit-ID: 77D61xpSmIl

--HG--
extra : rebase_source : c6162fa3cf539a07177a19838324bf368faa162b
2017-10-27 16:10:06 -07:00
Kartikaya Gupta
cf3b87c06e Bug 1410527 - Update how we tell WR about position:sticky elements. r=mstange
My original understanding of the API was flawed, and so while I had
position:sticky working in some cases it didn't work properly in a lot
of other cases. This patch corrects the usage of the API to match what
WR is expecting and fixes a lot of test cases.

MozReview-Commit-ID: AdMux19Fk9U

--HG--
extra : rebase_source : e7f970a710b2079501a91eeeac8c292b603210dc
2017-10-25 15:21:32 -04:00
Kartikaya Gupta
d8ac050c91 Bug 1409856 - Update all the WebRender code to use LayoutDevice units instead of Layer units. r=jrmuizel
MozReview-Commit-ID: DP3hwlFWyZC
2017-10-18 22:25:11 -04:00
Morris Tseng
0ccd47dc22 Bug 1403459 - Passing transform-style from display item directly. r=kats
MozReview-Commit-ID: JVhjSFmvnAq

--HG--
extra : rebase_source : a1c4bb15d1679d650ece0af6ddbe052c5a61034b
2017-09-25 11:19:12 +08:00
Jeff Muizelaar
4c11ad7643 Bug 1407654. Inline ToRelativeLayoutPoint. r=kats
This is a very short function and is showing up in profiles because
it's used inside of a hot loop while we're constructing glyph runs.
2017-10-11 11:44:41 -04:00
Kevin Chen
57ae515fa5 Bug 1406305 - Remove unused arguments in StackingContextHelper's constructor; r=kats
MozReview-Commit-ID: 47owLOUhMBM
2017-10-06 15:06:08 +08:00
Kartikaya Gupta
2f1948343f Bug 1403915 - Remove the WebRender*Layer classes and functions that refer to them. r=jrmuizel
MozReview-Commit-ID: 2syFwMc7j3r

--HG--
extra : rebase_source : 9a3852506820eb09328d91007581d74786eba9b0
2017-10-03 16:31:08 -04:00
Ethan Lin
2902b1bde2 Bug 1395501 - Part1. Store inherited scale in stacking context. r=jrmuizel,kats
MozReview-Commit-ID: 6LsTJa05uFV
2017-09-29 12:09:51 +08:00
Kartikaya Gupta
da21f7fca0 Bug 1399505 - Generate WR sticky frames from nsDisplayStickyPosition display items. r=mstange
MozReview-Commit-ID: 4ZCcdlBtEGi

--HG--
extra : rebase_source : 435696d31faef583f8abf3267a14b4699c449716
2017-09-21 10:11:41 -04:00
Morris Tseng
ce9b629335 Bug 1392200 - Add backface-visibility support for layers-free mode. r=kats
For layers-full mode, we set the backface-visibility to visible because
visibility would be handled by FLB and layers.

MozReview-Commit-ID: CUbeUabfC7K
2017-09-21 14:41:38 +08:00
Kartikaya Gupta
a96084d405 Bug 1400034 - Back out changes that introduce scaling complexity to StackingContextHelper. r=ethlin,pchang
This backs out bug 1399050, bug 1394308 (2 patches), and bug 1391499. I
believe these patches sent us down a path that would make the code
increasingly more complex, when in fact we can do a more "direct"
translation from the gecko display list to the WR display list and make
things a lot simpler and more correct.

MozReview-Commit-ID: ZXXkI9DXiY

--HG--
extra : rebase_source : 47ce1fcb87f0c21d158ee06f38e2b3303f999270
2017-09-17 10:37:42 -04:00
Ethan Lin
87d42ae44a Bug 1393077 - Part1. Round the transformed rectangles and transformed points in StackingContextHelper. r=kats
MozReview-Commit-ID: Gk5z6BwsuTM

--HG--
extra : rebase_source : 36db102162518622f1da659ff83fb71fe4d9eccf
2017-08-31 17:59:41 +08:00
peter chang
75200fdf13 Bug 1394308 - Pass perspective transform attribute to compositor for OMTA, r=kats
MozReview-Commit-ID: EjyuCfnswqu

--HG--
extra : rebase_source : 556db00f7c58b8b49bdafe9ca77785bce819a000
2017-09-07 11:50:41 +08:00
peter chang
7780b1e846 Bug 1394308 - Apply inherited scale for OMTA to support layers-free, r=kats
Expose the API to get/set inherited scale from stacking context and we can
use these APIs to calculate correct scale for OMTA

MozReview-Commit-ID: DZEkodHTy8v

--HG--
extra : rebase_source : be3c978c8f48c9b1bfcd01cff6bb8200092b5e60
2017-09-06 16:29:52 +08:00
peter chang
f68e87377c Bug 1391499 - Apply the inherited scale from ancestors, r=kats
To render the nested transforms properly, we need to store the inherited scale from ancestors for children.
Then apply the inherited scale for children's bounds

MozReview-Commit-ID: KYyibUD8J2j

--HG--
extra : rebase_source : fe2aeb842af477475767d0cf22c780c36b2487f0
2017-08-18 21:51:19 +08:00
Sebastian Hengst
80cced1397 Backed out changeset 22d7763100aa (bug 1391499) for build bustage on Windows at gfx/layers/wr/StackingContextHelper.cpp(105): 'Size': undeclared identifier. r=backout 2017-08-28 12:28:55 +02:00
peter chang
834299eb19 Bug 1391499 - Apply the inherited scale from ancestors, r=kats
To render the nested transforms properly, we need to store the inherited scale from ancestors for children.
Then apply the inherited scale for children's bounds

MozReview-Commit-ID: KYyibUD8J2j

--HG--
extra : rebase_source : 82c2695990e23eb47a4f185e0a53a865f3d1ff0f
2017-08-18 21:51:19 +08:00
Morris Tseng
89a7571411 Bug 1392200 - Check backface:hidden in layers-free mode. r=kats
MozReview-Commit-ID: 9guOx0NPjmV
2017-08-22 13:46:30 +08:00
Morris Tseng
6391dec171 Bug 1389027 - Support nsDisplayPerspective in layers-free mode. r=kats
MozReview-Commit-ID: K0RCuQ8WEE3
2017-08-14 17:31:55 +08:00
Ethan Lin
2f3e874c80 Bug 1386553 - Move boundary calculations from each item's CreateWebRenderCommands to StackingContextHelper constructor. r=kats
MozReview-Commit-ID: 7PJIghki2g2

--HG--
extra : rebase_source : cc54e11719239814eee6f6e6f7360fbc0d10f0ad
2017-08-03 17:41:41 +08:00
Sebastian Hengst
a1ff1e3d1d Backed out changeset e5b859d66536 (bug 1386553) for Windows bustage at layers/StackingContextHelper.h(50). r=backout on a CLOSED TREE 2017-08-03 09:57:53 +02:00
Ethan Lin
a05d601f59 Bug 1386553 - Move boundary calculations from each item's CreateWebRenderCommands to StackingContextHelper constructor. r=kats
MozReview-Commit-ID: 7PJIghki2g2
2017-08-03 15:24:25 +08:00
Morris Tseng
fbee651cc7 Bug 1378606 - Support mix-blend-mode in layers-free mode.
MozReview-Commit-ID: LNORKj1bUYq
2017-08-03 11:27:45 +08:00
Ryan Hunt
017d292cac Bug 1382128 part 2 - Remove WrPoint, WrSize, WrRect, WrMatrix, and WrColor. r=kats
MozReview-Commit-ID: 9koNScu4CyE

--HG--
extra : rebase_source : 68185e949ddf2ae346a5d597d056a7f2d9ea7a28
2017-07-18 18:32:46 -04:00
Ryan Hunt
3f3cb0a954 Bug 1382128 part 1 - Use a namespace in webrender_bindings. r=kats
MozReview-Commit-ID: 3JTMa9Ix5S7

--HG--
extra : rebase_source : 0bea14d9e395cab260d2db5135b1f64e9f82b2e2
2017-06-27 19:20:36 -04:00
Ethan Lin
82a7c2b5e4 Bug 1372118 - Part3. Implement CreateWebRenderCommands for text, transform and background color. r=jrmuizel, r=kats
MozReview-Commit-ID: JRoSjygSFHc
2017-06-30 17:23:20 -07:00