36767 Commits

Author SHA1 Message Date
Jamie Nicol
b994c9e30a Bug 1632795 - Ensure invalidate_rendered_frame is not overridden by the frame being a no-op. r=gw
The RenderBackend can be sent an `invalidate_rendered_frame` flag to
indicate that the current rendered frame is invalid. This is useful
when the platform requires a render, eg when starting or resuming the
app on Android. Upon receiving this flag, the render backend will set
a variable `doc.rendered_frame_is_valid = false`. Later on it will
decide to skip rendering only if this variable is true, so by setting
the invalidate flag we should be able to ensure the next render will
occur.

However, the RenderBackend also tries to skip renders which it
determines are not required. Currently it does this by setting
`doc.rendered_frame_is_valid = true` if it decides the frame is a
no-op. This overwrites the previous value set by the
`invalidate_rendered_frame` flag, meaning webrender skips renderering
even though the platform has requested it.

This was resulting in the GVE app showing a black screen on startup,
and Fenix temporarily showing a black screen whilst opening a new tab,
because despite WebRenderBridgeParent requesting an invalidation
immediately on startup, webrender ignored that request until it
decided it actually had content to paint.

To fix this, the logic should be flipped. The value of
`doc.rendered_frame_is_valid` must be remembered across document
updates rather than defaulting to false. And instead of setting it
true if webrender thinks the frame is a no-op, we must set it false if
webrender thinks the frame is *not* a no-op.

Differential Revision: https://phabricator.services.mozilla.com/D72600
2020-04-27 16:28:54 +00:00
Jonathan Kew
b51adde34b Bug 1633354 - Fix visibility attribute for language-pack fonts on windows. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D72609
2020-04-27 14:38:04 +00:00
Stefan Hindli
d66d0256bb Bug 1630774 - Disabled 1325159-1.html and 1317403-1.html on Android r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D72526
2020-04-25 10:04:47 +00:00
Kartikaya Gupta
bd8d6597c2 Bug 1630781 - Reorder operations to increase idempotency of sampling APZ state during a vsync interval. r=botond
Refer to bug 1630781 comment 11 for a more detailed explanation of the problem.
A quick summary is that prior to this patch, the sampling operation involved
these steps:
- sample stored APZ state for composition
- advance animations to next vsync
- update stored APZ state to the one just computed
When sampling occured twice within a vsync interval, the stored APZ state
calculated at the end of the first sampling would be produced in the second
sampling, resulting in non-smooth scrolling. Note that the second and third
steps would only run once per vsync interval, but that was sufficient to cause
the problem.

With this patch, the order of the steps is reordered:
- update stored APZ state to that computed in the last vsync interval
- advance animations to next vsync and save it in the queue
- sample stored APZ state for composition
With this ordering (and with the first two steps only running once per vsync
interval), the third step now emits consistent data even if the steps are run
multiple times in a vsync interval. It does mean that the mSampledState deque
can have up to two items in it (front() being the state for the current vsync
interval, and back() being the state computed for the next vsync interval).

Although this problem only affected the WR codepath in practice, it could in
theory occur with the non-WR codepath too, if we for some reason ran the
TransformShadowTree code multiple times in a vsync interval. This patch updates
both codepaths with the new order of steps.

Differential Revision: https://phabricator.services.mozilla.com/D72046
2020-04-26 17:06:37 +00:00
Kartikaya Gupta
7a46942dee Bug 1630781 - Adjust test to account for extra composite required for WR hit-test. r=botond
We have had to apply this same fix in other tests in the past, for example in
helper_hittest_basic.html.

Differential Revision: https://phabricator.services.mozilla.com/D72045
2020-04-26 17:05:21 +00:00
Kartikaya Gupta
ead6b2732c Bug 1630781 - Allow mSampledState to temporarily hold more than one state. r=botond
Again, functionally this is a no-op since instead of replacing the back()
element, we do an emplace_back() followed by a pop_front().

Differential Revision: https://phabricator.services.mozilla.com/D72044
2020-04-27 01:02:34 +00:00
Kartikaya Gupta
6041ceee66 Bug 1630781 - Expand mSampledState into a deque. r=botond
The deque always has size 1, so this patch is functionally a no-op. It sets up
the usage of front() and back() to allow holding more than one item in a future
patch.

Depends on D72042

Differential Revision: https://phabricator.services.mozilla.com/D72043
2020-04-25 22:04:59 +00:00
Kartikaya Gupta
dba00154a9 Bug 1630781 - Encapsulate the mComposited* variables into a class. r=botond
No functional changes intended here, just code getting moved into a helper
class. Note that this patch folds RecalculateCompositedLayoutViewport into
ClampCompositedScrollOffset since there are no longer any independent callers
of the former function (as of bug 1627716).

Depends on D72041

Differential Revision: https://phabricator.services.mozilla.com/D72042
2020-04-25 01:00:07 +00:00
Kartikaya Gupta
5475382650 Bug 1630781 - Ensure the mComposited* fields are accessed safely across threads. r=botond
No functional change, since everything was safe already. But this propagates
the proof-of-lock a little further to make it more obvious that fields are
safely accessed.

Depends on D72040

Differential Revision: https://phabricator.services.mozilla.com/D72041
2020-04-25 00:49:23 +00:00
Kartikaya Gupta
5adfc0b92b Bug 1630781 - Eliminate the frame_delay pref, assume it true everywhere. r=botond,mstange
Having to think about multiple codepaths adds complexity and it doesn't seem
like we're going to turn this pref back off anytime soon.

Differential Revision: https://phabricator.services.mozilla.com/D72040
2020-04-25 00:47:54 +00:00
Glenn Watson
43db714391 Bug 1632705 - Part 3 - Add API for rounded rect clips. r=Bert
This adds the last remaining explicit API for defining clips of
a specific type, and ports wrench and examples to use them.

Differential Revision: https://phabricator.services.mozilla.com/D72284
2020-04-26 23:30:48 +00:00
Glenn Watson
b954ae4e56 Bug 1632705 - Part 2 - Add display item for rectangle clips. r=nical
This allows defining rectangle clips directly, rather than via
the generic clip region methods.

This patch doesn't make use of it in Gecko yet, but it will do
once we add the remaining rounded rect API.

Differential Revision: https://phabricator.services.mozilla.com/D72268
2020-04-27 09:08:04 +00:00
sotaro
d117745eaf Bug 1633303 - Add glDebugCallback support to non shared gl context with WebRender r=gw
Bug 1632096 added the capability to shared gl context with WebRender. This bug extends the support to non shared gl context.

Differential Revision: https://phabricator.services.mozilla.com/D72579
2020-04-27 02:51:48 +00:00
Glenn Watson
63892870eb Bug 1632705 - Part 1 - Remove complex clips from scroll frame definitions. r=kats,Bert
They aren't used, so can easily be removed as the first part of
this seried of patches.

If this functionality is ever required, it can be handled by the
caller defining complex clip nodes explicitly.

Differential Revision: https://phabricator.services.mozilla.com/D72261
2020-04-24 18:29:38 +00:00
Sylvestre Ledru
7f26dcf1b6 Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio
Done with:
./mach lint -l rustfmt --fix
with
rustfmt 1.4.12-stable (a828ffe 2020-03-11)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D72527
2020-04-25 21:21:32 +00:00
Lee Salzman
086657e157 Bug 1632376 - just scale pixels to integer 255 before rounding. r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D72095
2020-04-25 17:20:01 +00:00
Lee Salzman
d36a6bffc4 Bug 1632276 - support full-range unsigned int indexes in SWGL DrawElements. r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D72035
2020-04-25 17:02:49 +00:00
Sylvestre Ledru
34acbb653a Bug 1619165 - Reformat recent changes to the Google coding style r=andi
First reformat with clang-format 10

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D68802
2020-04-25 09:40:08 +00:00
Simon Giesecke
2d8c4390b7 Bug 1628715 - Part 15: Replace MOZ_NONNULL_RETURN by returning NotNull<elem_type*>. r=xpcom-reviewers,necko-reviewers,dragana,nika
Differential Revision: https://phabricator.services.mozilla.com/D71300
2020-04-24 13:35:27 +00:00
Simon Giesecke
c0341c3791 Bug 1628715 - Part 10: Activate nodiscard attributes on AppendElement(s). r=xpcom-reviewers,nika,peterv
Differential Revision: https://phabricator.services.mozilla.com/D70834
2020-04-24 14:34:15 +00:00
Simon Giesecke
191a830575 Bug 1628715 - Part 7: Add MOZ_NONNULL_RETURN to infallible nsTArray::AppendElements. r=xpcom-reviewers,necko-reviewers,nika,valentin
Differential Revision: https://phabricator.services.mozilla.com/D70831
2020-04-24 13:31:14 +00:00
sotaro
74fce68a04 Bug 1632096 - Forward WebRender gl(ANGLE) error message to gfx critical note r=gw
Differential Revision: https://phabricator.services.mozilla.com/D72123
2020-04-24 11:32:05 +00:00
Nicolas Silva
505c116b8f Bug 1612440 - Discard the SpatialTree's frame state after scene swap. r=gw
The information comes with SetDisplayList messages but was applied before scene building instead of during scene swap, which breaks the transaction model and looks like a bug.

Differential Revision: https://phabricator.services.mozilla.com/D71934
2020-04-23 20:39:35 +00:00
Narcis Beleuzu
3eaaf8fd77 Backed out changeset d84032238d5f (bug 1632096) for bustages on GLContext.h . CLOSED TREE 2020-04-24 05:46:10 +03:00
sotaro
41ebbb733f Bug 1632096 - Forward WebRender gl(ANGLE) error message to gfx critical note r=gw
Differential Revision: https://phabricator.services.mozilla.com/D72123
2020-04-23 22:58:27 +00:00
Glenn Watson
31dabce5a8 Bug 1632409 - Separate image mask API from the generic clip API in WR. r=kats
Separating out the generic clip definition API into image masks
(and other types in future) makes the serialized data smaller. More
importantly, it will allow us to simplify some of the WR clip internals
in future and optimize the performance spent in clip chain handling.

Differential Revision: https://phabricator.services.mozilla.com/D72125
2020-04-23 20:44:21 +00:00
Glenn Watson
a252244f3c Bug 1632389 - Remove image mask support from scroll layer API. r=nical
This is not used, so we can remove it as the first part of modifying
the public clip API in order to allow some internal optimizations.

If callers ever want to make use of this in future, it can be
achieved by placing an image mask clip node in the clip chain for
the primitives in the scroll layer.

Differential Revision: https://phabricator.services.mozilla.com/D72099
2020-04-23 11:39:42 +00:00
Dzmitry Malyshau
01bd7e3c8a Bug 1632323 - Separate WebGPU internal usage bits from the public API r=groves
Differential Revision: https://phabricator.services.mozilla.com/D72065
2020-04-23 15:52:01 +00:00
Jamie Nicol
f9253cf629 Bug 1632444 - Correctly detect target OS when deciding what shaders to optimize. r=jrmuizel
A previous patch attempted to optimize only GL or GLES shaders,
depending on the target platform. However, it was trying to detect the
platform by using `cfg!(target_os = {})`, but as this is in a
build script that actually detects the host platform instead. This
resulted in the wrong version of shaders being optimized, and
therefore falling back to unoptimized shaders at runtime.

This fix uses `env::var("CARGO_CFG_TARGET_OS")` instead, which works
correctly in build scripts.

Differential Revision: https://phabricator.services.mozilla.com/D72127
2020-04-23 12:23:35 +00:00
Nicolas Silva
20be49d861 Bug 1612440 - Separate scene and frame related data in DocumentView. r=gw
DocumentView has a mix of members that affect scene building and memebers that change frame to frame. These need to be updated at different rates and more importantly follow the respective flow of scene and frame transactions, which wasn't done properly before this change.

Depends on D71781

Differential Revision: https://phabricator.services.mozilla.com/D71927
2020-04-22 19:41:21 +00:00
Nicolas Silva
eef976c85a Bug 1612440 - Move some scene-related transaction handling code to the scene builder thread. r=gw
The goal is to move this code out of the render backend to avoid requiring the messages to transit through this thread. Other similar changes are in progress.

Differential Revision: https://phabricator.services.mozilla.com/D71781
2020-04-22 12:04:14 +00:00
Robert Mader
cd16f095fa Bug 1632137 - Do not require GL compat profile for Webrender, r=jgilbert
This mirrors GLX behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D71993
2020-04-22 20:25:44 +00:00
Glenn Watson
ff2b478716 Bug 1624988 - Improve inflation factor calculation for drop-shadows. r=kvark
Include the inflation factor from all drop-shadow filters when
calculating the overall inflation factor for a surface.

This doesn't fix cases with large offsets, which is a larger amount
of work to fix, but it fixes the common case and the referenced
case in this bug.

Differential Revision: https://phabricator.services.mozilla.com/D71878
2020-04-22 20:54:55 +00:00
Stefan Hindli
ff96217137 Backed out changeset f75deee57611 (bug 1624988) for wrench bustages CLOSED TREE 2020-04-22 23:42:32 +03:00
Glenn Watson
d251a60158 Bug 1624988 - Improve inflation factor calculation for drop-shadows. r=kvark
Include the inflation factor from all drop-shadow filters when
calculating the overall inflation factor for a surface.

This doesn't fix cases with large offsets, which is a larger amount
of work to fix, but it fixes the common case and the referenced
case in this bug.

Differential Revision: https://phabricator.services.mozilla.com/D71878
2020-04-22 14:26:21 +00:00
Kartikaya Gupta
17a76bc82d Bug 1627716 - Remove unused constants. r=geckoview-reviewers,agi
Depends on D71779

Differential Revision: https://phabricator.services.mozilla.com/D71780
2020-04-22 11:50:41 +00:00
Kartikaya Gupta
761f671816 Bug 1627716 - Remove some leftover IPC functions. r=botond
Depends on D71778

Differential Revision: https://phabricator.services.mozilla.com/D71779
2020-04-22 16:40:52 +00:00
Kartikaya Gupta
2f35aa94fe Bug 1627716 - Remove APZ/composition code related to DynamicToolbarAnimator. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D71778
2020-04-22 17:30:50 +00:00
Kartikaya Gupta
c840d0f81a Bug 1627716 - Remove now-unused SetRenderOffset code related to DynamicToolbarAnimator. r=jrmuizel
Depends on D71776

Differential Revision: https://phabricator.services.mozilla.com/D71777
2020-04-22 11:50:40 +00:00
Jamie Nicol
7beb14ca46 Bug 1631778 - Only optimize shaders for expected GL version on each platform r=jrmuizel
The full set of optimized shaders can be quite large, so only optimize
for the GL version we expect to be used on the target platform. That
is GLES on Android and Windows (where we presume ANGLE is being used),
and GL elsewhere.

If a different GL version is used we will simply fall back to the
unoptimized shaders.

Depends on D71905

Differential Revision: https://phabricator.services.mozilla.com/D71945
2020-04-22 17:16:48 +00:00
Dzmitry Malyshau
4b29474d3f Bug 1630813 - Remove gfx/wgpu/wgpu-native, move wgpu-remote out into gfx/wgpu_bindings r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D71699
2020-04-22 15:35:13 +00:00
Botond Ballo
74925f0fa3 Bug 1632042 - Fix inclusion of APZUtils.h in APZInputBridge.h. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D71880
2020-04-22 08:16:15 +00:00
Kartikaya Gupta
7b824820e7 Bug 1632180 - Update docker image and environment used for WebRender CI on Github to include clang. r=jnicol
Differential Revision: https://phabricator.services.mozilla.com/D71965
2020-04-22 14:52:24 +00:00
Jamie Nicol
5acad1e764 Bug 1631778 - Ensure webrender's shaders.rs is filled deterministically. r=jrmuizel
The list of pre-optimized shaders was being generated in a
non-deterministic order, causing large build time regressions. This
sort the list of shaders before writing them to the shaders.rs file.

Differential Revision: https://phabricator.services.mozilla.com/D71905
2020-04-22 13:51:13 +00:00
Jamie Nicol
c4506737ea Bug 1620014 - Snap animated transform offsets in webrender. r=aosmond
In bug 1589669 we ensured that webrender snaps the asynchronous scroll
offset correctly. Prior to that, the fractional offsets of picture
cache tiles were changing every frame, leading to excessive picture
cache invalidation. Since then, however, we have landed bug 1609002,
which made it so that asynchronous scrolling is split in to the scroll
offset and the visual viewport transform. The visual viewport
transform is sent to webrender as an animated transform property, and
since this was not being snapped it regressed the picture caching
invalidation fix. This change ensures that offset is snapped
correctly.

Differential Revision: https://phabricator.services.mozilla.com/D71920
2020-04-22 12:41:55 +00:00
Sam Dalton
522abc8e0e Bug 1626784 - Changed FPSCounter.cpp to check for emptiness with .empty() instead of .size() r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D69751
2020-04-22 12:56:01 +00:00
Nicolas Silva
3a6da68bf2 Bug 1612440 - Wrap the shared font instance map to a type exposed in the api crate. r=gw
This is a small preliminary refactoring that will be needed to let the api talk to the scene builder thread.

Differential Revision: https://phabricator.services.mozilla.com/D71325
2020-04-22 08:49:38 +00:00
Nicolas Silva
119986111e Bug 1631039 - Remove WebRender's recording infrastructre. r=gw
The code is untested, and mostly obsoleted by (multi) frame captures.
Also it gets in the way of some other changes I need to make.

Differential Revision: https://phabricator.services.mozilla.com/D71372
2020-04-22 08:49:38 +00:00
Nicolas Silva
4f156a4330 Bug 1612440 - Don't implement Serialize/Deserialize in some parts of th API. r=gw
Now that the capture code is gone, we don't use these serde implementations. They get in the way of changing the way transactions are represented so I'd like to remove a bunch of them for now.

Differential Revision: https://phabricator.services.mozilla.com/D71604
2020-04-22 08:48:24 +00:00
Lee Salzman
cc83337f4b Bug 1632025 - fix SWGL shader key parsing. r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D71874
2020-04-22 03:39:21 +00:00