The following functions are asynchronously called by a bit different ways. It seems not good. It seems better to unify them.
PrepareForUse()
NofityForUse()
NotifyNotUsed()
Differential Revision: https://phabricator.services.mozilla.com/D87709
Specifically:
- Remove hit test tag from common display item properties.
- Simplify WR bindings to use hit-test items exclusively.
- Remove support for transparent rectangles to be hit-test items.
- Remove support for any primitive to be a hit-test item.
Differential Revision: https://phabricator.services.mozilla.com/D87421
Previously, the content_size was used when defining an iframe
to set the size of the root scrollable area.
However, this was never useful (the root pipeline scroll frame
is not considered a scroll root, it's more of a placeholder).
The scroll frame for content is typically defined within the
iframe display list (which also allows non-scrolled content
within the iframe, such as a background rectangle color).
The existing content_size was causing problems in Gecko because
there are some snapping / rounding inaccuracies with fractional
DPI ratios, resulting in root scroll frames with +/- 1 pixel
scrollable size.
The simplest fix for this is to remove content_size altogether
and rely on the iframe display item to define the content size
of the root scroll frame for a pipeline.
Differential Revision: https://phabricator.services.mozilla.com/D85719
This largely reverts D81868, only keeping what's needed to make SwapBuffersWithDamage
work, and also adds BufferAge support to RenderCompositorOGL.
Differential Revision: https://phabricator.services.mozilla.com/D85565
CLOSED TREE
We don't need these macros anymore, for two reasons:
1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
and friends.
2. clang now warns for the "temporary that should have been a declaration" case.
The extra requirements on class construction also show up during debug tests
as performance problems.
This change was automated by using the following sed script:
```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d
# Remove individual macros, carefully.
{
# We don't have to worry about substrings here because the closing
# parenthesis "anchors" the match.
s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;
# Remove the longer identifier first.
s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}
# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```
and running:
```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```
Differential Revision: https://phabricator.services.mozilla.com/D85168
We don't need these macros anymore, for two reasons:
1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
and friends.
2. clang now warns for the "temporary that should have been a declaration" case.
The extra requirements on class construction also show up during debug tests
as performance problems.
This change was automated by using the following sed script:
```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d
# Remove individual macros, carefully.
{
# We don't have to worry about substrings here because the closing
# parenthesis "anchors" the match.
s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;
# Remove the longer identifier first.
s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}
# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```
and running:
```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```
Differential Revision: https://phabricator.services.mozilla.com/D85168
This is meant to save us in cases where the message loop in GPU process
receives commands related to resources that point to the old EGL context
that was just shut down. Since the symbols are erased, we'd end up with
trying to execute a nullptr on `MakeCurrent()`. With marking the context
as lost, however, no symbols will be accessed.
Differential Revision: https://phabricator.services.mozilla.com/D84868
MOZ_ALWAYS_TRUE causes process abort on failure. we do not want the process abort with false.
The failure could happen when context is lost. It is not necessary to handle the context lost in RenderDXGITextureHostOGL. It is already handled by RendererOGL.
Differential Revision: https://phabricator.services.mozilla.com/D85116
Just passing this along with the report is easier than
trying to store these functions some place as we do in other places.
These ops aren't used yet but will be in subsequent patches.
There's a bit of ugly around the bindings because of a cbindgen
limitation.
Differential Revision: https://phabricator.services.mozilla.com/D84916
This includes updates to authenticator, cubeb-coreaudio,
metal, gfx-backend-vulkan, gfx-backend-metal, freetype
libloading is duplicated because of ash
Differential Revision: https://phabricator.services.mozilla.com/D84688
This includes updates to authenticator, cubeb-coreaudio,
metal, gfx-backend-vulkan, gfx-backend-metal, freetype
libloading is duplicated because of ash
Differential Revision: https://phabricator.services.mozilla.com/D84688
This keeps us from accumulating frame buffers without bound.
Previously I was seeing as many 56 frame buffers in this list
during a tab cycling stress test.
Differential Revision: https://phabricator.services.mozilla.com/D84760
This includes updates to authenticator, cubeb-coreaudio,
metal, gfx-backend-vulkan, gfx-backend-metal, freetype
libloading is duplicated because of ash
Differential Revision: https://phabricator.services.mozilla.com/D84688
More leftover stuff from the document splitting effort. I'm leaving in the
corresponding APIs in webrender_api in case other consumers of WebRender
are using it.
Differential Revision: https://phabricator.services.mozilla.com/D84590
This makes it possible to download the capture from the artifacts of the
CI job. It would be nicer if the capture were written to a tarball/zipfile,
but having to download the files individually is better than nothing.
Depends on D84422
Differential Revision: https://phabricator.services.mozilla.com/D84423
Similar to ANGLE and WebGL, we should be checking if there is a device
reset after a render pass via the glGetGraphicsResetStatus API.
Additionally, we should allow for simulating a device reset on platforms
other than Windows when using WebRender.
Differential Revision: https://phabricator.services.mozilla.com/D83937
1/ the texture binding expects the pixel pointer to start at the top
left of the valid rectangle, not the top left of the entire mapped
layer;
2/ pending clears must be resolved before compositing the texture;
Differential Revision: https://phabricator.services.mozilla.com/D83587
SwCompositor needs to send SWGL textures references safely to the SwComposite
thread. However, the SWGL context's texture store may grow and make accessing
these tables unsafe. To work around this, this patch adds a LockedResource
API that locks down access to these textures ahead of time both to ensure that
no table access is necessary and to help detect any unexpected modifications
of these textures while they are locked. These LockedResource objects can then
be composited safely in another thread without interfering with normal SWGL
operation in the original that that isn't simultaneously using these textures.
Differential Revision: https://phabricator.services.mozilla.com/D82666
This spawns a new SwComposite thread inside SwCompositor. Tile composite jobs
are submitted over a channel to the thread, with a condition being signaled
after all jobs are processed. The SwCompositor computes a dependency order for
the tiles based on whether it overlaps a tile that has been invalidated and
needs to be updated during the current frame. As tiles are gradually updated,
all tiles that would depend on the update as denoted by the dependency order get
submitted so that composition can proceed. Ultimately, this allows tile updates
and compositing to work in parallel, pipelining much of the cost of compositing.
Differential Revision: https://phabricator.services.mozilla.com/D82474
The `clear_caches_with_quads` flags is meant to work around a bug in some
drivers' scissored clears, but its implementation uses the `GL_ALWAYS` depth
comparison function, which SWGL doesn't support.
SWGL does scissored clears very well, so simply turning this workaround off on
SWGL avoids the problem and gets good results.
Of course we could just make SWGL support `GL_ALWAYS`, but that would be kind of
annoying, since it basically disables depth checks altogether, and we want to
use entirely different paths when depth checks aren't needed.
Differential Revision: https://phabricator.services.mozilla.com/D81918
Bug 1592038 implemented a means for reducing memory usage resulting from needlessly
duplicated allocation of depth buffers when rendering WR picture cache tiles via
the NativeLayer interface. This aims to keep a similarly level of memory savings
even when using NativeLayer + SWGL.
SWGL allows, as an extension beyond OpenGL, specifying an allocation size separate
from the incidental size of a texture, which can be used to render to a smaller
valid rect of a texture without continually reallocating it every time the size
of the valid rect changes within the actual tile size. This functionality is used
to keep around only a single depth texture for the SWGL compositor that is resized
to accommodate the maximum requested tile size, so that any surface or tile can
use it as desired.
Differential Revision: https://phabricator.services.mozilla.com/D80274
Currently RendererOGL has mixed-in details of SWGL context creation which becomes messy
and slightly unanticipated based on the nomenclature and structure of RendererOGL. Based
on other work in bug 1646835, it becomes more natural to move this context creation into
the specific SWGL RenderCompositors so that RendererOGL can be agnostic to any SWGL
details.
Differential Revision: https://phabricator.services.mozilla.com/D80273
RenderCompositorOGL currently has many responsibilities including supporting
OpenGL compositor for Linux, whole-window compositing for Mac NativeLayerCA,
and per-cache-tile compositing for Mac NativeLayerCA. With the addition of
support for SWGL, this becomes even further complicated.
It becomes advantageous to separate out RenderCompositorOGL specifically as
only the basic OpenGL compositing case, as that naturally yields a simple and
isolated RenderCompositor.
What is left over becomes RenderCompositorNative, a basis for implementing
NativeLayer-based RenderCompositors. To cleanly isolate state and details of
when HW compositing or SW compositing is being used, these are further split
off into RCNativeOGL and RCNativeSWGL versions that deal with specific
isolated details of OpenGL and SWGL respectively.
RCNativeOGL deals with just setting up OpenGL FBOs for NativeLayers.
RCNativeSWGL's new task is just to deal mapping NativeLayers and providing
SWGL FBOs for them without involving OpenGL.
Differential Revision: https://phabricator.services.mozilla.com/D80270
RenderCompositors for SWGL that wish to provide accelerated compositing need to
subvert the existing Bind/Unbind hooks in the WR compositor. These compositors
need to keep track of their HW tiles without actually binding an OpenGL FBO
for WR to render picture cache tiles. SWGL needs to intervene and get a backing
buffer for tile from the RenderCompositor so that it can create a SWGL FBO for
WR to render the picture cache tile to.
To that end, this adds MapTile/UnmapTile as a replacement for Bind/Unbind for
those scenarios. This is done in a way that it affects only the WrCompositor of
webrender_bindings without actually altering WR's Compositor interface. This is
beneficial because WR does not have to understand the details of SWGL
integration and also so as not to complicate other users of WR such as Servo
who are not currently utilizing SWGL at all.
RenderCompositorOGL is initially modified to use these hooks in this patch. It
later became more convenient to restructure that in a follow-up patch.
Differential Revision: https://phabricator.services.mozilla.com/D80269
This is a first implementation of a software-only SWGL RenderCompositor
that relies on the existing widget hooks for Basic compositing. It attempts
to lock the widget and get a DT whose underlying data it can supply directly
to SWGL to composite to. Critically, it does not rely on OpenGL or any other
form of HW accel to function. The interface between the RenderCompositor and
SWGL will be further refined in follow-up patches.
Differential Revision: https://phabricator.services.mozilla.com/D80268
For performance reasons in SWGL software compositors. to avoid unnecessary
full-screen copies of the framembuffer, we need to allow those compositors to
map their underlying widget surfaces and pass that buffer to SWGL so that they
can be directly rendered to. That also requires supporting custom strides, as
we can't always enforce the particular layout of the buffers handed off to us.
To that end, InitDefaultFramebuffer is generalized to take such information
and then many places where we rely on a specific hard-coded SWGL-calculated
stride have been altered to deal with a caller-supplied stride.
Differential Revision: https://phabricator.services.mozilla.com/D80267
This moves the clipping responsibility into the layer. It also brings back
assertions that make sure that no invalid content reaches the screen.
On the layer side I'm renaming validRect to displayRect, because at the time
NextSurface* is called, that rect is not yet valid.
This implementation also allows having valid content outside of the display
rect. So, for example, if you grow and shrink the display rect multiple times
but most of the outer parts are transparent, in theory this allows you to paint
the transparent pixels only once rather than every time the display rect
expands.
Differential Revision: https://phabricator.services.mozilla.com/D79842
Now CompositorAnimationStorage::GetAnimatedValue() and SetAnimatedValue()s
are called on the sampler thread in case of WebRender, are called on the
compositor thread in case of non WebRender, so we drop assertions of
IsInCompositorThread check there. A mLock.AssertCurrentThreadOwns call in
each function should make sure the function gets called on the
sampler/compositor thread with acquiring the lock.
One caveat in this change is that in case we try to get an animation value via
nsIDOMWindowUtils.getOMTAStyle(), we do sample animations on the _compositor_
thread and we never call UpdateDynamicProperties, which means if it gets called
in testing refresh driver mode, visual results will differ from what the value
returned by the getOMTAStyle should look like. But it should be fine because we
disallow using any chrome priviledge APIs in reftests and also we will never use
the testing refresh driver mode in the reftest harness. Also in mochitests the
visual results' differences might make people confusing if the person can notice
it, but in principal getOMTAStyle() is designed to get computed animating values
so that it doesn't matter what the visual result is.
Differential Revision: https://phabricator.services.mozilla.com/D79982
* Majorly simplity CanvasRenderer
* Replace GLScreenBuffer with trivial GLSwapChain
* Use descriptor structs so that future SharedSurface changes aren't so painful
to propagate
* Mortgage/strip out more OffscreenCanvas code for now
Differential Revision: https://phabricator.services.mozilla.com/D75055
When a transform depends on the layout size of an element, one can see
visual distortions caused by the difference between the unsnapped size
used in the transform, and the snapped size calculated during scene
building. Ideally we could compute the transform after we snap, rather
than before. This patch adds support for a computed reference frame
which takes parameters to calculate the ideal transform dynamically.
In a future patch, we should make videos take advantage of this same
mechanism to avoid similar problems. This requires support for mirroring
and rotations.
Differential Revision: https://phabricator.services.mozilla.com/D77956
Simple implementation of skipping SyncObjectD3D11Host::Synchronize(). More optimization could be done in Bug 1635629.
Differential Revision: https://phabricator.services.mozilla.com/D75781
* Majorly simplity CanvasRenderer
* Replace GLScreenBuffer with trivial GLSwapChain
* Use descriptor structs so that future SharedSurface changes aren't so painful
to propagate
* Mortgage/strip out more OffscreenCanvas code for now
Differential Revision: https://phabricator.services.mozilla.com/D75055
* Majorly simplity CanvasRenderer
* Replace GLScreenBuffer with trivial GLSwapChain
* Use descriptor structs so that future SharedSurface changes aren't so painful
to propagate
* Mortgage/strip out more OffscreenCanvas code for now
Differential Revision: https://phabricator.services.mozilla.com/D75055
* Majorly simplity CanvasRenderer
* Replace GLScreenBuffer with trivial GLSwapChain
* Use descriptor structs so that future SharedSurface changes aren't so painful
to propagate
* Mortgage/strip out more OffscreenCanvas code for now
Differential Revision: https://phabricator.services.mozilla.com/D75055
When DWM is disabled, each window does not have own back buffer. They would paint directly to a buffer that was to be displayed by the video card. WM_PAINT via SendInvalidRegion() requests necessary re-paint. With it, RenderCompositorANGLE does not need to disable partial present.
Differential Revision: https://phabricator.services.mozilla.com/D77989
Do full render with WebRender when Dwn is disabled. It could be done by RenderCompositorANGLE::RequestFullRender().
Back out Bug 1638469. It disables WebRender during starting if Dwm is disabled. But Dwm is enabled/disabled dynamically. And we do not want to disable WebRender in this case.
Differential Revision: https://phabricator.services.mozilla.com/D77221
If |nsDisplayItem::CreateWebRenderCommands()| returns false, the items that have been pushed to |DisplayListBuilder::pending_chunk| need to be cleared, because the item will be pushed as an image instead. This happens, for example, when nsDisplayText encounters unsupported features.
Differential Revision: https://phabricator.services.mozilla.com/D77095
With current gecko, there are cases that compositor window is used even when it is not necessary. For example, fallback from DirectComposite with WebRender and fallback from double buffering with Compositor. With some gpu drivers, the fallbacks with compositor window causes rendering problem.
Differential Revision: https://phabricator.services.mozilla.com/D76470
EGL with buffer-age requires the application to keep the front buffer
fully consistent. This means we have to draw the previous frame's
damage as well. (But we don't need to include it in the hint we're
sending to the system compositor via SwapBuffersWithDamage.)
Differential Revision: https://phabricator.services.mozilla.com/D61062
By using RenderTextureHostWrapper, we could reduce re-creation of RenderDXGITextureHostOGL and RenderDXGIYCbCrTextureHostOGL.
Differential Revision: https://phabricator.services.mozilla.com/D74838
Previously, WR would attempt to detect at the start of frame
building if the spatial node of any picture cache contained
a non-axis-aligned transform, and disable picture caching in
that edge case.
However, picture caching can't (currently) be disabled when the
native compositor is active. In this mode, picture caching was
force enabled, causing an assertion failure due to unexpected
coordinate systems when updating pictures.
This patch changes the way the detection of scroll root logic
works such that we don't consider any scroll frame inside a
reference frame to be a valid scroll root for picture caching
purposes. Thus it's not possible to create a picture cache
where the reference spatial node has a non-axis-aligned transform.
Differential Revision: https://phabricator.services.mozilla.com/D75890
When android SurfaceTexture is rendered to WebGL, the SurfaceTexture should not be attached to GL context of WebRender.
Differential Revision: https://phabricator.services.mozilla.com/D66367
Part 1 of this patch enables subpixel AA in more cases when there
are multiple picture cache slices. Because of this, we can enable
extra picture cache slices by default, as a performance win for
the general case.
Users who want to force subpixel AA in more cases, at the cost of
performance can manually set the about:config value called
gfx.webrender.quality.force-subpixel-aa-where-possible.
Differential Revision: https://phabricator.services.mozilla.com/D75465
In this bug we're moving away from monolithic JNI headers to class-specific
headers so that we don't have to rebuild the world every time we make a change
to a JNI interface.
Differential Revision: https://phabricator.services.mozilla.com/D75377
In bug 1470348 we started to detach all SurfaceTextures from the
current GL context in CompositorOGL::Pause(). This was required for
VR, so that when the VR presentation was entered the SurfaceTextures
could be attached to the VR context instead.
When RenderCompositorEGL was implemented for webrender, we copied the
call to detach from CompositorOGL. However, due to extra complexity in
webrender's threading model, this is causing assertion failures.
VR no longer relies upon the SurfaceTextures being detached when the
compositor is paused, as it now uses its own SurfaceTexture
set. Therefore we can remove the detach call from both
CompositorOGL::Pause and RenderCompositorEGL::Pause.
Differential Revision: https://phabricator.services.mozilla.com/D74832
Reverts part of a change from bug 1632705 to allow close buttons
to be shown in Win7 under certain themes with WR enabled.
If it turns out that we need to support the clear rect + rounded
clip case, that can be implemented as a follow up - this is an
improvement for now though.
Differential Revision: https://phabricator.services.mozilla.com/D74752
There could be a case that new RenderThread::PrepareForUse() and new WebRender transaction by WebRenderBridgeParent::MaybeGenerateFrame() achieve during calling UpdateAndRender().
Differential Revision: https://phabricator.services.mozilla.com/D74365
Previously, WR would internally mark a parent stacking context
as requiring isolation when a stacking context with mix-blend-mode
was encountered.
However, this adds significant complexity to scene building in
WR, meaning that several decisions related to stacking context
redundancy, clip chain roots must be delayed until the stacking
context is popped.
By requiring the display list to annotate blend containers (Gecko
already has all this information available), we will be able to
simplify this scene building logic, which will unblock some
ongoing improvements to how clips are handled.
The patch introduces stacking context flags, and ports the existing
is_backdrop_root bool to be part of these flags. It also removes
an unused old field, cache_tiles.
Differential Revision: https://phabricator.services.mozilla.com/D73597
The implementation of this was previously ignoring the aRegion
parameter, so was completely broken. This is only used by the
Win7 widget code. This may fix an issue with drawing of window
close buttons on Windows 7 with WebRender enabled.
Differential Revision: https://phabricator.services.mozilla.com/D73163
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
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
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
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
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
Add a gecko pref "gfx.webrender.use-optimized-shaders". If enabled,
then when attempting to compile a webrender shader first look for the
optimized source. If the optimized source is not present, emit a
warning and fall back to the unoptimized source.
Use the optimized source by default in wrench, and add the flag
"--use-unoptimized-shaders" to override this.
Differential Revision: https://phabricator.services.mozilla.com/D70033
In the past EGL only supported GLES, not OGL. This has not been true
for a very long time, so lets support OGL context creation in the EGL
backend.
This allows e.g. the Wayland backend to use OGL contexts, which brings
it on par with the X11/GLX backend.
Differential Revision: https://phabricator.services.mozilla.com/D48096
This patch adds support for the capture and replaying of multiple frames
during normal operation of Firefox. Ctrl + Shift + 6 starts capturing
and pressing it again stops capturing. It attempts to capture the minimum
amount of data required to replay a sequence for debugging purposes.
There are several known limitations, particularly surrounding replaying
when transitioning between snapshots of the resource cache. It will
reload the entire document set, causing greater delay between frames.
Should you advance too quickly, it may also panic due to a race between
the current frame still being generated, and the new frame resetting the
resource cache state. These should be resolved with time, and the
current implementation should be workable to at least capture/debug most
animated issues with some effort.
It also adds support for loading dynamic properties which is necessary
for accurate replaying of a captured frame (sequence or individual)
which are in the middle of an animation.
Differential Revision: https://phabricator.services.mozilla.com/D59755
This patch adds support for the capture and replaying of multiple frames
during normal operation of Firefox. Ctrl + Shift + 6 starts capturing
and pressing it again stops capturing. It attempts to capture the minimum
amount of data required to replay a sequence for debugging purposes.
There are several known limitations, particularly surrounding replaying
when transitioning between snapshots of the resource cache. It will
reload the entire document set, causing greater delay between frames.
Should you advance too quickly, it may also panic due to a race between
the current frame still being generated, and the new frame resetting the
resource cache state. These should be resolved with time, and the
current implementation should be workable to at least capture/debug most
animated issues with some effort.
It also adds support for loading dynamic properties which is necessary
for accurate replaying of a captured frame (sequence or individual)
which are in the middle of an animation.
Differential Revision: https://phabricator.services.mozilla.com/D59755
CanvasClientSharedSurface did not handle a case that CanvasClientSharedSurface was re-created, but GLScreenBuffer was not re-created. And RenderCompositorEGL::Pause() detaches all SurfaceTesxtures, but RenderAndroidSurfaceTextureHostOGL did not handle it.
Differential Revision: https://phabricator.services.mozilla.com/D70667
--HG--
extra : moz-landing-system : lando
No functional changes here, just plumbing to allow the caller to
access all the results instead of just the one picked out by
bindings.rs.
Differential Revision: https://phabricator.services.mozilla.com/D69202
--HG--
extra : moz-landing-system : lando
WebRender could be used when WebRender does not use ANGLE. And there is a case that we want to use WebRender with ANGLE for testing.
Differential Revision: https://phabricator.services.mozilla.com/D69771
--HG--
extra : moz-landing-system : lando
This removes the WebRender side of the previous slow frame indicator and replace it with a simple implementation that only looks at the CPU time on the render backend and renderer thread involved for building a frame.
A followup patch will add a separate indicator for when the displaylist/ipc/scene bits take too long.
Differential Revision: https://phabricator.services.mozilla.com/D69247
--HG--
extra : moz-landing-system : lando
There's only one instance of this left (mSubBuilders) and that can be
easily removed as well.
Depends on D68865
Differential Revision: https://phabricator.services.mozilla.com/D68866
--HG--
extra : moz-landing-system : lando
Nothing creates the content render root anymore, so we can delete
references to it and wipe it off the face of the codebase. This makes
the non-default render root array a zero-length Array which is a template
specialization that lacks things like begin() end end(). So we need
to also rip out any code that tries to iterate these things, in order
to get compilation to succeed. The code would be a no-op anyway now
that there are no non-default render roots left.
Depends on D68864
Differential Revision: https://phabricator.services.mozilla.com/D68865
--HG--
extra : moz-landing-system : lando
Nothing uses the popover render root any more, so we can assume
render_root_variable == Popover is always false.
Depends on D68862
Differential Revision: https://phabricator.services.mozilla.com/D68863
--HG--
extra : moz-landing-system : lando
This is needed because display lists and DisplayItemCache have different lifetimes. For example, display lists can outlive WebRenderLayerManager when device reset occurs.
A slightly nicer way of fixing this would be to couple DisplayItemCache with nsDisplayList or nsDisplayListBuilder. This is would currently require a lot of refactoring to look nice, because the painting code still supports non-retained display lists and non-WR code paths.
Differential Revision: https://phabricator.services.mozilla.com/D68193
--HG--
extra : moz-landing-system : lando
This patch changes the underlying storage for WR display items in DisplayItemCache
from Vec<Option<CachedDisplayItem> to Vec<Vec<CachedDisplayItem>>.
This allows storing multiple WebRender display items for one Gecko display item.
The storage is populated by traversing BuiltDisplayList extra data portion
in display list format, which is roughly as follows:
RetainedItems(key k1)
Item1(..)
RetainedItems(key k2)
ItemN(..)
ItemN+1(..)
This would store Item1 under key k1, and ItemN and ItemN+1 under the key k2,
where k1 and k2 are arbitrary unique identifiers (currently of type uint16_t).
The entries in the storage are accessed by DisplayItemCache::get_iterator(key),
which is called by BuiltDisplayListIter, whenever it encounters a display item
DisplayItem::ReuseItems(key).
Differential Revision: https://phabricator.services.mozilla.com/D66443
--HG--
extra : moz-landing-system : lando
This patch changes the underlying storage for WR display items in DisplayItemCache
from Vec<Option<CachedDisplayItem> to Vec<Vec<CachedDisplayItem>>.
This allows storing multiple WebRender display items for one Gecko display item.
The storage is populated by traversing BuiltDisplayList extra data portion
in display list format, which is roughly as follows:
RetainedItems(key k1)
Item1(..)
RetainedItems(key k2)
ItemN(..)
ItemN+1(..)
This would store Item1 under key k1, and ItemN and ItemN+1 under the key k2,
where k1 and k2 are arbitrary unique identifiers (currently of type uint16_t).
The entries in the storage are accessed by DisplayItemCache::get_iterator(key),
which is called by BuiltDisplayListIter, whenever it encounters a display item
DisplayItem::ReuseItems(key).
Differential Revision: https://phabricator.services.mozilla.com/D66443
--HG--
extra : moz-landing-system : lando
In addition:
- Move the fast hit tester to the rust side of the bindings.
- Avoid blocking by requesting a hit tester early and only blocking if the request isn't delivered by the time of the first hit test query.
Differential Revision: https://phabricator.services.mozilla.com/D66994
--HG--
extra : moz-landing-system : lando
This patch removes the old thread_profiler bindings, and adds
support for profiling WR with the tracy profiler, which is a
much more advanced frame profiler.
Since it's very lightweight, and only instruments annotated CPU
and GPU zones, it can retain very large profiles, allowing
fine grained analysis of thread interactions, CPU spikes etc.
Differential Revision: https://phabricator.services.mozilla.com/D66926
--HG--
extra : moz-landing-system : lando
DisplayItemBuilder now has methods:
```
void StartGroup(nsPaintedDisplayItem* aItem);
void CancelGroup();
void FinishGroup();
bool ReuseItem(nsPaintedDisplayItem* aItem);
```
WebRender display items previously created between calls to StartGroup() and FinishGroup() will be reused by a call to ReuseItem(),
which will push DisplayItem::ReuseItem(key) to WR display list, if the Gecko display item has been retained and reused.
Calling CancelGroup() will discard the display items that have been pushed after calling StartGroup().
For example, inside nsDisplayBackgroundColor::CreateWebRenderCommands():
```
aBuilder.StartGroup(this);
aBuilder.PushRect(r, r, !BackfaceIsHidden(),
wr::ToColorF(ToDeviceColor(mColor)));
aBuilder.FinishGroup();
```
Differential Revision: https://phabricator.services.mozilla.com/D65356
--HG--
extra : moz-landing-system : lando
DisplayItemBuilder now has methods:
```
void StartGroup(nsPaintedDisplayItem* aItem);
void CancelGroup();
void FinishGroup();
bool ReuseItem(nsPaintedDisplayItem* aItem);
```
WebRender display items previously created between calls to StartGroup() and FinishGroup() will be reused by a call to ReuseItem(),
which will push DisplayItem::ReuseItem(key) to WR display list, if the Gecko display item has been retained and reused.
Calling CancelGroup() will discard the display items that have been pushed after calling StartGroup().
For example, inside nsDisplayBackgroundColor::CreateWebRenderCommands():
```
aBuilder.StartGroup(this);
aBuilder.PushRect(r, r, !BackfaceIsHidden(),
wr::ToColorF(ToDeviceColor(mColor)));
aBuilder.FinishGroup();
```
Differential Revision: https://phabricator.services.mozilla.com/D65356
--HG--
extra : moz-landing-system : lando
This adds support for tracking and invalidating tiles based on a
movable virtual offset.
Differential Revision: https://phabricator.services.mozilla.com/D65687
--HG--
extra : moz-landing-system : lando
gfx::Color is currently misused in many places. The DrawTargets expect
the color space to be in device space, e.g. what we are actually going
to draw using. Everything sitting above generally deals with sRGB, as
specified in CSS. Sometimes we missed the conversion from sRGB to device
space when issuing draw calls, and similarly sometimes we converted the
color to device space twice.
This patch splits the type in two. sRGBColor and DeviceColor now
represent sRGB and device color spaces respectively. DrawTarget only
accepts DeviceColor, and one can get a DeviceColor from an sRGBColor via
the ToDeviceColor helper API. The reftests now pass with color
management enabled for everything (e.g. CSS) instead of just tagged
raster images.
There will be a follow up patch to enable color management everywhere by
default on all supported platforms.
Differential Revision: https://phabricator.services.mozilla.com/D64771
--HG--
extra : moz-landing-system : lando
This patch adds an asynchronous hit tester that can perform hit testing queries without blocking on a synchronous message to the render backend thread, which is often busy building frames. This is done by having a shared immutable hit tester readable by any thread, atomically swapped each time the render backend processes a new scene or frame.
In order to asynchronously hit test without causing race conditions with APZ intenral state, the hit tester has to be built while the APZ lock is held.
Differential Revision: https://phabricator.services.mozilla.com/D45345
--HG--
extra : moz-landing-system : lando