Граф коммитов

41 Коммитов

Автор SHA1 Сообщение Дата
Jamie Nicol dcf72a8a69 Bug 1569339 - Handle position: sticky correctly in webrender whilst zoomed. r=botond
Webrender positions sticky items relative to the viewport rect set on
their ancestor scroll frame, which it expects to be in local
space. The viewport should be set to what gecko calls the scroll
frame's "scroll port" (relative to its reference frame).

Previously we were setting this to be `composition bounds /
resolution`, which gives the correct results at the initial zoom
level, but causes sticky items to jump around when the zoom
changes. This occurs because the composition bounds of the RCD-RSF do
not change as the zoom changes, and instead remain equal to the
widget's size.

The layout viewport remains at the correct size when zoomed, but
unfortunately doesn't have the correct origin. And FrameMetrics does
not provide the constant "initial zoom" value we require to obtain the
desired viewport rect from the composition bounds. To fix this we
therefore must query the scroll port and offset directly from the
scrollable frame, meaning the value remains correct even as the zoom
changes.

Differential Revision: https://phabricator.services.mozilla.com/D60970

--HG--
extra : moz-landing-system : lando
2020-02-04 16:40:48 +00:00
Andrew Osmond fce484c34f Bug 1574493 - Part 3. Stop rounding rects/clips during display list building. r=jrmuizel
Rounding in layout pixels is very close to snapping in raster pixels if
there are no transforms involved. This is why it worked most of the time
and fell flat in many edge cases. In future parts of this series, we
will trust scene building and frame building to do the heavy lifting for
snapping purposes.

Differential Revision: https://phabricator.services.mozilla.com/D45058

--HG--
extra : moz-landing-system : lando
2019-09-14 16:17:04 +00:00
Ciure Andrei a4046ec458 Backed out 6 changesets (bug 1574493) for causing nested-sticky-2.html to perma fail CLOSED TREE
Backed out changeset 358746636448 (bug 1574493)
Backed out changeset 34aef5498237 (bug 1574493)
Backed out changeset 1f88e2031c76 (bug 1574493)
Backed out changeset 07c588b5ea10 (bug 1574493)
Backed out changeset 0685e8d3510e (bug 1574493)
Backed out changeset 15d4390220c4 (bug 1574493)
2019-09-13 19:26:50 +03:00
Andrew Osmond 25866edb78 Bug 1574493 - Part 3. Stop rounding rects/clips during display list building. r=jrmuizel
Rounding in layout pixels is very close to snapping in raster pixels if
there are no transforms involved. This is why it worked most of the time
and fell flat in many edge cases. In future parts of this series, we
will trust scene building and frame building to do the heavy lifting for
snapping purposes.

Differential Revision: https://phabricator.services.mozilla.com/D45058

--HG--
extra : moz-landing-system : lando
2019-09-13 14:03:23 +00:00
Ciure Andrei 8c3feea58a Backed out 6 changesets (bug 1574493) for causing nested-sticky-1.html to perma fail CLOSED TREE
Backed out changeset fdc25a90b0ef (bug 1574493)
Backed out changeset 0ce3c48c1f79 (bug 1574493)
Backed out changeset 326b9f96614b (bug 1574493)
Backed out changeset b0817c0aee77 (bug 1574493)
Backed out changeset 70d99c264df9 (bug 1574493)
Backed out changeset e5217ab4b668 (bug 1574493)
2019-09-13 16:17:47 +03:00
Andrew Osmond b2d4e121cb Bug 1574493 - Part 3. Stop rounding rects/clips during display list building. r=jrmuizel
Rounding in layout pixels is very close to snapping in raster pixels if
there are no transforms involved. This is why it worked most of the time
and fell flat in many edge cases. In future parts of this series, we
will trust scene building and frame building to do the heavy lifting for
snapping purposes.

Differential Revision: https://phabricator.services.mozilla.com/D45058

--HG--
extra : moz-landing-system : lando
2019-09-13 10:48:31 +00:00
Gurzau Raul fe4bb6d539 Backed out 6 changesets (bug 1574493) for wrench failures at stacking-context-clip.yaml on a CLOSED TREE.
Backed out changeset 8a8736ac4e25 (bug 1574493)
Backed out changeset 4a3294e88823 (bug 1574493)
Backed out changeset 0c26ecdc1ddc (bug 1574493)
Backed out changeset 11257f7b3ad3 (bug 1574493)
Backed out changeset dcedc286ad9d (bug 1574493)
Backed out changeset 87f216e0753d (bug 1574493)
2019-09-12 18:34:07 +03:00
Andrew Osmond 320cbbf828 Bug 1574493 - Part 3. Stop rounding rects/clips during display list building. r=jrmuizel
Rounding in layout pixels is very close to snapping in raster pixels if
there are no transforms involved. This is why it worked most of the time
and fell flat in many edge cases. In future parts of this series, we
will trust scene building and frame building to do the heavy lifting for
snapping purposes.

Differential Revision: https://phabricator.services.mozilla.com/D45058

--HG--
extra : moz-landing-system : lando
2019-09-12 12:42:41 +00:00
Botond Ballo a2fc3d72a6 Bug 1563717 - Divide the RCD-RSF ScrollFrame item's clip rect by the resolution. r=kats
The clip rect is derived from the composition bounds, which is in units that
are outside the resolution, but it's applied to the ScrollFrame item which is
inside the resolution.

Differential Revision: https://phabricator.services.mozilla.com/D37939

--HG--
extra : moz-landing-system : lando
2019-07-27 02:31:37 +00:00
Alexis Beingessner 99e4403911 Bug 1529992 - disable the MergeClipLeaf optimization for all shadows properly. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D27114

--HG--
extra : moz-landing-system : lando
2019-04-15 23:13:49 +00:00
Daniel Varga e452ed972c Backed out 2 changesets (bug 1529992) for reftest failure at http://10.0.2.2:8854/tests/layout/reftests/bugs/1529992-1.html == http://10.0.2.2:8854/tests/layout/reftests/bugs/1529992-1-ref.html. On a CLOSED TREE
Backed out changeset 87b64e169b1b (bug 1529992)
Backed out changeset ddf29d68efb2 (bug 1529992)
2019-04-15 23:22:29 +03:00
Alexis Beingessner d1cb43b8ac Bug 1529992 - disable the MergeClipLeaf optimization for all shadows properly. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D27114

--HG--
extra : moz-landing-system : lando
2019-04-15 17:25:34 +00:00
Kartikaya Gupta 557527a0b6 Bug 1539953 - Initialize mScrollId to the root scroll id. r=kvark
A spatial id of 0 refers to the root reference frame on the WR side, but
we shouldn't be using that on the Gecko side at all. Due to the
early-exit codepath in ClipManager we were actually sending some display
items with this spatial id over to WebRender. Although this doesn't
appear to cause any user-visible problems it seems wrong and can confuse
debugging other issues.

Differential Revision: https://phabricator.services.mozilla.com/D25296

--HG--
extra : moz-landing-system : lando
2019-03-29 14:13:38 +00:00
Doug Thayer cb0fa9cf3b Bug 1441308 - Remove unnecessary StackingContextHelper params from clips r=kats
These aren't used, so I'm just getting rid of them as cleanup.

Differential Revision: https://phabricator.services.mozilla.com/D20693

--HG--
extra : moz-landing-system : lando
2019-03-13 16:44:05 +00:00
Kartikaya Gupta c366cdefb9 Bug 1528987 - Send the gecko scroll offsets for scrollframes to WR. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D20667

--HG--
extra : moz-landing-system : lando
2019-02-21 21:06:25 +00:00
Glenn Watson 43dfba16ac Bug 1524385 - Set the current clip chain on the stacking context item. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D18527

--HG--
extra : moz-landing-system : lando
2019-02-06 04:35:37 +00:00
Kartikaya Gupta 2030952357 Back out two changesets from bug 1523776 for causing multiple regressions. r=backout 2019-01-31 14:44:33 -05:00
Daniel Varga 325e31df1d Merge mozilla-central to mozilla-inbound. a=merge 2019-01-31 06:30:06 +02:00
Kartikaya Gupta c8c588bf80 Bug 1523776 - Don't set the parent link when creating a new clip chain. r=kvark
It turns out that setting the parent link on a clip chain is no longer
needed (and probably hasn't been since WR started applying a stacking
context's clip to the SC's contents). In fact it can produce incorrect
behaviour in some cases, because it doesn't match the semantics of
Gecko's clip chains. This removes the parent link on the Gecko side and
adds a test for this scenario.

Differential Revision: https://phabricator.services.mozilla.com/D18101

--HG--
extra : moz-landing-system : lando
2019-01-30 21:39:38 +00:00
Sylvestre Ledru 47a5dd1fb8 Bug 1519636 - Reformat everything to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D16388

--HG--
extra : moz-landing-system : lando
2019-01-16 08:50:07 +00:00
WR Updater Bot e70e863f16 Bug 1518605 - Some follow-up fixes to make the different builds green. r=kats
Depends on D16006

Differential Revision: https://phabricator.services.mozilla.com/D16007

--HG--
extra : moz-landing-system : lando
2019-01-09 03:27:48 +00:00
Dzmitry Malyshau cddd33e700 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

--HG--
extra : moz-landing-system : lando
2019-01-09 03:27:07 +00:00
Kartikaya Gupta e8565762a1 Bug 1508647 - Don't treat mSeparateLeaf as an output. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D14473

--HG--
extra : moz-landing-system : lando
2018-12-17 17:41:48 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Kartikaya Gupta cd40821489 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 54ba2010c1 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

--HG--
extra : moz-landing-system : lando
2018-11-28 15:32:41 +00:00
Ehsan Akhgari ca162bee20 Bug 1508472 - Part 4: Fourth batch of comment fix-ups in preparation for the tree reformat r=sylvestre
This is a best effort attempt at ensuring that the adverse impact of
reformatting the entire tree over the comments would be minimal.  I've used a
combination of strategies including disabling of formatting, some manual
formatting and some changes to formatting to work around some clang-format
limitations.

Differential Revision: https://phabricator.services.mozilla.com/D13193

--HG--
extra : moz-landing-system : lando
2018-11-28 09:16:55 +00:00
Matt Woodrow 43bc692c89 Bug 1509226 - Avoid allocations to serialize clips. r=jrmuizel
MozReview-Commit-ID: CetmS5cZCMP

Differential Revision: https://phabricator.services.mozilla.com/D12721

--HG--
extra : moz-landing-system : lando
2018-11-26 02:32:15 +00:00
Dzmitry Malyshau f076ce43c0 Bug 1503447 - Remove the clip->ASR == item->ASR hacky code path r=kats
Previously, WebRender ignored clip_node_id on the clip/scroll stack
when pushing clips or reference frames. This got fixed to be more consistent in:
https://github.com/servo/webrender/pull/3315

Now Gecko can use the clip chains generated for display items naturally,
instead of smuggling the last clip through the scroll_node_id, which is what
was happening in this hacky code branch being removed.

Differential Revision: https://phabricator.services.mozilla.com/D12216

--HG--
extra : moz-landing-system : lando
2018-11-17 15:44:40 +00:00
Dzmitry Malyshau aa76de2aae Bug 1503447 - Remove Nothing() semantic from ASR overrides r=kats
Previously, the ASR overrides contained Maybe<ClipId>, where Nothing() corresponded to taking the top of the clip/scroll stack instead of overriding. This change removes the associated complexity by ensuring that we always provide the ClipId.

Differential Revision: https://phabricator.services.mozilla.com/D11813

--HG--
extra : moz-landing-system : lando
2018-11-14 14:15:16 +00:00
Ryan Hunt 2226bcc8a3 Bug 1504220 - Move ScrollableLayerGuid, ViewID, ZoomConstraints from FrameMetrics.h r=botond
This commit attempts to lower the pain of modifying FrameMetrics.h.

It looks like most includes really only want ViewID or
ScrollableLayerGuid, so this commit factors them out into a separate
header. In the process FrameMetrics::ViewID is changed to
ScrollableLayerGuid::ViewID, which personally seems like a better
place for it now that we have RepaintRequest. Unfortunately that
requires a lot of places to be updated.

After this commit there are still a couple of major places that
FrameMetrics is included.
 * nsDisplayList.h
 * nsIScrollableFrame.h
 * Layers.h

Those are going to be more tricky or impossible to fix so they're
not in this commit.

Differential Revision: https://phabricator.services.mozilla.com/D10722

--HG--
rename : gfx/layers/FrameMetrics.h => gfx/layers/ScrollableLayerGuid.h
rename : gfx/layers/FrameMetrics.h => gfx/layers/ZoomConstraints.h
extra : rebase_source : 29ac79f91460a181bf7437af5c371207e22858e2
extra : source : c2e70e531075493fc6e374dcec862827f0bc6e77
2018-11-01 15:15:46 -05:00
Andrew Osmond fb274b0684 Bug 1502454 - Ensure we are consistent in how we define and use scroll IDs with WebRender. r=kats
In ClipManager::DefineScrollLayers, we don't always create a scroll ID
for each ASR. We may fail to get the scroll metadata, or it may not be
scrollable, in which case we should use the scroll ID of its ancestor
(or the root scroll ID if there is no ancestor). This should fix a crash
where we simply assumed the leaf of an ASR tree will always have a valid
scroll ID.

Differential Revision: https://phabricator.services.mozilla.com/D10708
2018-11-02 13:08:58 -04:00
Kartikaya Gupta ee2016670c Bug 1519636 - Follow-up to properly turn off clang formatting for debug logging code. r=me 2019-01-30 15:11:20 -05:00
Andrew Osmond 3370375e1c Bug 1471671 - Avoid crash with WebRender when the scroll metadata is unavailable. r=kats
We are seeing crash reports in the wild where there is no scroll
metadata available for an ASR for a display item and its clip. It
appears that in the non-WR path, it skips such items, so we should
probably do the same thing with WebRender. If the scrolling ends up
being wrong, hopefully a reproducible use case will make its way to use
to further debug, as the crash reports have not yielded anything to date.

Differential Revision: https://phabricator.services.mozilla.com/D9699
2018-10-25 13:39:28 -04:00
Kartikaya Gupta a971a37e5f Bug 1485834 - Allow recomputing the cumulative resolution in ComputeScrollMetadata. r=botond
We need to correctly populate the cumulative resolution field in the
ScrollMetadata in order to support zooming. Without this, the cumulative
resolution doesn't include the presShell resolution, and that results in
APZ getting into an inconsistent state.

Currently, the cumulative resolution is populated from the
ContainerLayerParameters object's scale, but in the case of WebRender,
we call ComputeScrollMetadata with an empty ContainerLayerParameters
since don't actually do layer building or rasterization in Gecko.
This patch makes this more explicit by changing the argument to a
Maybe<ContainerLayerParameters> and passing Nothing() from the WebRender
call sites.

In this scenario, we just use the cumulative presShell resolution as
the cumulative resolution, which should be correct for WebRender as
we won't have an "extra" CSS-derived resolution applied on the Gecko
side.

Depends on D9120

Differential Revision: https://phabricator.services.mozilla.com/D9121

--HG--
extra : moz-landing-system : lando
2018-10-19 14:24:50 +00:00
Andrew Osmond 75ee4d6a42 Bug 1496726 - Fix how some display item containers were missing from the clip optimization exclusion list. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D7966
2018-10-09 13:09:08 -04:00
Andrew Osmond 86d7bb0dde Bug 1485420 - Part 2. Make ClipManager trim clip chains which can be merged with the display item. r=mstange 2018-09-14 10:42:23 -04:00
Kartikaya Gupta 8b47047d0c No Bug - Fix logging now that clip ids are size_t. r=me and DONTBUILD 2018-06-20 16:30:13 -04:00
Kartikaya Gupta 63feb7051a Bug 1425565 - Use the container ASR for sticky items when building WebRender clips. r=mstange
Even if the sticky item has a fixed descendant, we want to use the
sticky container item's "real" ASR when computing the WR clips because
otherwise the WR item doesn't get attached to the correct scrolling
layer.

MozReview-Commit-ID: JVnzEIBeLKp

--HG--
extra : rebase_source : 806e43eb65d46eb5151e21b0a5eb09168b2df82d
2018-05-18 15:19:47 -04:00
Kartikaya Gupta b19c697041 Bug 1458598 - Override scrollframes with their descendant reference frames. r=mstange
The test case has a fixed item A inside a scrollframe B which is inside
a reference frame C which is inside the root scrollframe D. The
ClipManager code currently uses D's scrollid as the scrolling ancestor
for A, because the gecko display list's ASR is set up that way. However,
we really want to set C as the scrolling ancestor, because otherwise the
item A gets hoisted out of C and the transform from C doesn't get
applied to it. This patch ensures that when we enter C, we install an
override so that anything that would have used D's scrollid ends up
using C's, which results in the correct behaviour.

MozReview-Commit-ID: 31tscfT4xWW

--HG--
extra : rebase_source : 03df2fa5519b2592a2c9f598af0f3f1500773718
2018-05-08 09:16:29 -04:00
Kartikaya Gupta 1eb717ccf5 Bug 1377187 - Rewrite the clipping code to use the new clipchain API. r=mstange
The clip chain API in webrender allows us to build the clip state in WR
so that it matches the gecko display list more closely. This patch throws
away ScrollingLayersHelper.* and introduces ClipManager.* which pushes
the clip state to WR using the new method. A quick summary of the new
method is below.

Each display item in gecko has a DisplayItemClipChain which is a chain
of individual clips. The individual clips are defined in WR, and the
clip ids for those clips are put into a WR clip chain using the new
define_clip_chain API. Furthermore, each clip chain can also have a
parent chain, which is used to link a DisplayItemClipChain to the parent
display item's DisplayItemClipChain. This allows the WR clip state to
closely match the structure of the gecko display list clip state,
resulting in more correct behaviour.

There are a few other major changes that are lumped into this patch and
that were tricky to separate into their own patches:
- The collapsing of WrScrollId and WrStickyId into WrClipId. On the WR
  side all the clip ids are treated the same anyway. Trying to preserve
  the arbitrary distinction on the gecko side was resulting in
  increasingly convoluted code, with different kinds of Variant<..>
  types in the method signatures. It was much simpler and resulted in a
  bunch of code deletion to just collapse the types.
- Moving the "override" mechanism from WebRenderAPI to ClipManager. The
  override mechanism (explained in ClipManager.h) was simplified by
  moving it into ClipManager, because it removed the need for tracking
  additional clip stack state in WebRenderAPI.

MozReview-Commit-ID: GGbdFyJGprK

--HG--
extra : rebase_source : baa56ff179e917b0ab5a5c186a3a415761f8050a
2018-05-08 09:08:39 -04:00