This removes some calls to commit_span from inside the draw_span specializers.
Instead it relies upon the span rasterizer loop to do some of the work, which
will incur a function pointer call in the rare case we actually return out
of a specializer early. This shouldn't be that performance critical and will
remove some inliner bloat.
Also, I refactored commit_output in the rasterizer itself to hopefully cause
fewer template instantiations which should also further reduce inliner bloat.
Differential Revision: https://phabricator.services.mozilla.com/D104150
When we change the namespace, we discard all cached resources and their
associated keys from the WebRender cache. As such if any transaction
comes in with the old namespace ID, we can safefully discard the entire
update, since we will need to recreate any that we are using anyways.
This patch also adds new asserts to ensure we never get old namespace
IDs for individual keys in a valid resource update. This should never
happen in practice.
Differential Revision: https://phabricator.services.mozilla.com/D104236
GfxInfo::RefreshMonitors() could not be called in ScreenHelperWin::RefreshScreens(), since the RefreshScreens() is called within nsAppShell::Init(). Then GfxInfo::RefreshMonitors() is called during WM_DISPLAYCHANGE event handling.
Differential Revision: https://phabricator.services.mozilla.com/D103661
These changes make nsDisplayCompositorHitTestInfo inherit directly from nsDisplayItem, which should shrink it slightly. This also simplifies the logic: hit testing information is now available at nsDisplayItem level as opposed to nsPaintedDisplayItem.
Differential Revision: https://phabricator.services.mozilla.com/D103773
In the case that we have a painted minimal display port apzc knows about the scroll frame already, it just has the minimal amount of painted content. So we can tell apz right away. Note that the async transform for minimal dp's are still the identity so we'll still jank minimap dp's before the painted regular dp reaches the apzc.
Differential Revision: https://phabricator.services.mozilla.com/D103858
This patch is the result of auditing all places that look at the presence or absence of a display port to handle minimal display ports (HasDisplayPort, GetDisplayPort, etc).
Broadly speaking the places were in two categories:
1) things related to painting, that want to consider minimal display ports as display ports for purposes of things like sending over metadata and separating out layers.
2) things that care about async scrolling, and so actually want to have a properly sized display port.
Type 1) were not changed by this patch. Type 2) were changed to consider minimal display ports as not display ports.
Again, we are aiming to leave behaviour unchanged.
Differential Revision: https://phabricator.services.mozilla.com/D103856
We introduce a new type of display port, a minimal display port. It is controlled via a property on the content element. When the property is present any other display port specified on the element is ignored and instead the display port rect is computed by assuming 0 display port margins and no alignment (this reuses the existing code for display port suppression).
We then add code to set a minimal display port on every scroll frame that is painted that has WantAsyncScroll() when certain prefs are set (the prefs are disabled as of this patch though).
We then need to manage removing the minimal display port property when, before this patch, we would have created a regular display port. As well we need to add the minimal display port property when, before this patch, we would have removed a regular display port.
In order to do this I audited all sites where we set the display port rect and display port margins property. The changes to the code for handling the removal display ports happens in a later patch.
My audit found that all of the places we set a display port want to clear the minimal display port property except:
-UpdateSub/RootFrame in APZCCallbackHelper
-UpdateDisplayPortMarginsForPendingMetrics in DisplayPortUtils
UpdateDisplayPortMarginsForPendingMetrics is basically a fast path of the UpdateSub/RootFrame code. These are the places where we handle calls to RequestContentRepaint from apz. By adding an assert and running it through try server I found that UpdateSub/RootFrame can create a display port in the following cases:
-a scroll info layer
-a scroll frame with !WantAsyncScroll() (the main thread never creates a display port for a scroll frame with !WantAsyncScroll()) (for example if the main thread creates a scroll id and sends over metadata via nsLayoutUtils::GetRootMetaData, and then the scroll rect changes, that will cause a RequestContentRepaint call)
-a few instances that don't fall into the above that happened on try server but didn't reproduce for me locally, so I don't know more about them.
It's not very important whether we clear the minimal display port property for these cases or not (the first two cases we don't async scroll the scroll frame at all, the last case seems quite rare).
Note that we intentionally do not change the existing behaviour of zero margin display ports set via SetZeroMarginDisplayPortOnAsyncScrollableAncestors as we are aiming for no behaviour changes with this patch (until we flip the pref). A later patch in a different bug handles changing these display ports over to minimal display ports.
Differential Revision: https://phabricator.services.mozilla.com/D103855
This fixes incorrect rendering when either the source or backdrop
tasks establish a raster root.
By design, it also changes mix-blend backdrop readbacks to work in
a way that can handle readbacks from picture cache tiles, which is
a follow up optimization being worked on.
Differential Revision: https://phabricator.services.mozilla.com/D103853
This fixes incorrect rendering when either the source or backdrop
tasks establish a raster root.
By design, it also changes mix-blend backdrop readbacks to work in
a way that can handle readbacks from picture cache tiles, which is
a follow up optimization being worked on.
Differential Revision: https://phabricator.services.mozilla.com/D103853
This change had previously been backed out due to causing rendering
issues on HTC 10 Android, and some Linux Radeon cards (bug 1687554).
On the HTC 10, the issue was that the extra case statement added to
the text run shader caused the glslopt optimized shader to become too
complex for the device, resulting in rendering issues. Since bug
1689316 has landed, the optimized shader output is simpler and this
issue is avoided.
On radeon, we have established that the problem is due to the format
of the texture and that the shader is fine. Furthermore, the shader
works correctly with either R8 or RGBA8 texture data, as all of the
channels contain the alpha value in the RGBA8 textures. Therefore we
continue to use RGBA8 textures for alpha glyphs on Linux Radeon, but
switch to R8 on other platforms.
Differential Revision: https://phabricator.services.mozilla.com/D104082
This patch adds a diagnostic assert to check if the namespace of the
blob image key matches the current namespace of the process's
WebRenderBridgeChild. Other long lived users of image keys (i.e. shared
surfaces produced by imagelib) have to check to ensure their cached
image keys haven't gone out of scope due to a namespace update (e.g. tab
moved to a new window, GPU process crash). The caching for blob images
however is very different and should be cleared in these cases. This
assert will confirm this.
Differential Revision: https://phabricator.services.mozilla.com/D104066
This patch adds a diagnostic assert to check if the namespace of the
blob image key matches the current namespace of the process's
WebRenderBridgeChild. Other long lived users of image keys (i.e. shared
surfaces produced by imagelib) have to check to ensure their cached
image keys haven't gone out of scope due to a namespace update (e.g. tab
moved to a new window, GPU process crash). The caching for blob images
however is very different and should be cleared in these cases. This
assert will confirm this.
Differential Revision: https://phabricator.services.mozilla.com/D104066
GfxInfo::RefreshMonitors() could not be called in ScreenHelperWin::RefreshScreens(), since the RefreshScreens() is called within nsAppShell::Init(). Then GfxInfo::RefreshMonitors() is called during WM_DISPLAYCHANGE event handling.
Differential Revision: https://phabricator.services.mozilla.com/D103661