Instead, top level tile cache pictures are stored in the scene.
Follow up tasks in this bug will be simplified by having pictures
only exist when they have Some(..) for requested_composite_mode.
This patch removes one case of a pass-through picture, and
simplfies some of the surrounding code in the process.
Differential Revision: https://phabricator.services.mozilla.com/D101539
All LRU partitions use the same freelist to store the entries, and only have
separate LRU indexes. The shared freelist makes it easier to transfer an entry
from one LRU partition to another. If instead we used different LRUCache
instances, moving entries between partitions would be cumbersome because we
would need to look up the strong handle for the entry so that we could remove it
from the old freelist.
Differential Revision: https://phabricator.services.mozilla.com/D102122
When I wrote this patch, I thought that it would simplify the next patch in this
series, but I think it didn't make much of a difference in the end.
I still think this patch improves things and is worth taking, though.
Differential Revision: https://phabricator.services.mozilla.com/D102121
Fetch the DRM device in the EGL version of glxtest, set it in gfxInfo and pass
it to gfxVars. Finally, use it in nsDMABufDevice::Configure().
While on it, also clean up EGL typedefs and defines a bit to match how it's
done for GLX.
Inspired by and copied from wlroots and Xwayland. Thanks to emersion!
Differential Revision: https://phabricator.services.mozilla.com/D98108
Fetch the DRM device in the EGL version of glxtest, set it in gfxInfo and pass
it to gfxVars. Finally, use it in nsDMABufDevice::Configure().
While on it, also clean up EGL typedefs and defines a bit to match how it's
done for GLX.
Inspired by and copied from wlroots and Xwayland. Thanks to emersion!
Differential Revision: https://phabricator.services.mozilla.com/D98108
Fetch the DRM device in the EGL version of glxtest, set it in gfxInfo and pass
it to gfxVars. Finally, use it in nsDMABufDevice::Configure().
While on it, also clean up EGL typedefs and defines a bit to match how it's
done for GLX.
Inspired by and copied from wlroots and Xwayland. Thanks to emersion!
Differential Revision: https://phabricator.services.mozilla.com/D98108
1. On Wayland, use `get_egl_status()` by default
2. On X11/EGL use `x11_egltest()`, avoiding runtime dependencies on GLX
3. Avoid dlopening libgl/libgles on EGL if not needed
4. Some Wayland/X11 `ifdef` cleanups
5. Don't throw warnings when on mesa and using pci device detection
Depends on D101383
Differential Revision: https://phabricator.services.mozilla.com/D100638
The limit wasn't doing anything useful anymore, because one of the recent texture
cache refactorings made it so that we weren't actually evicting these glyphs from
the texture cache. In the future, we can implement a similar limit in the texture
cache itself, by giving it per-cache-type limits rather than a global limit.
Differential Revision: https://phabricator.services.mozilla.com/D101834
Also disable for users with 64-bit Firefox with 1-2 cores, and less than
2 GB of physical memory. It was already disabled for 32-bit Firefox.
Differential Revision: https://phabricator.services.mozilla.com/D101052
Lack of support of (hardware) WebRender should not block Software
WebRender support. This can happen when ANGLE isn't supported, for
example.
Differential Revision: https://phabricator.services.mozilla.com/D100445
This uses SkDraw::ComputeResScaleForStroking to ensure we exactly match the resolution scale
that is chosen for drawing the stroked path inside the guts of Skia. This should ensure these
two don't get out of sync.
This also cleans out the old overscale code in ComputeResScaleForStroking that was necessary
during an ancient Skia porting effort but has now bitrotted into irrelevance.
Differential Revision: https://phabricator.services.mozilla.com/D101686
The new version contains
- A bug fix for the bucketed allocator (we don't currently use it)
- A few fixes that can happen when requesting large enough allocation sizes to cause integer overflows. At the moment we never request an allocation larger than 512px so we are safe but it's still good to stay up to date.
Differential Revision: https://phabricator.services.mozilla.com/D101608
Add a new texture type alpha8_glyphs to the texture cache and store
alpha glyphs in it. Because the opengl texture format is R8 but the
shader requires to read the texture's alpha channel, we must swizzle
the components. We cannot rely on texture swizzling due to driver
bugs, so add the necessary code to the shader to do so manually.
Differential Revision: https://phabricator.services.mozilla.com/D101643
ANGLE appears to truncate uploads from a PBO in cases where the
UNPACK_ROW_LENGTH is greater than the width of the upload. We
encounter this due to rounding up the stride of our data to be a
multiple of 4 bytes. Don't do that on ANGLE.
Note that we only hit this issue in wrench, as in Firefox we do not
use PBO uploads with ANGLE.
Differential Revision: https://phabricator.services.mozilla.com/D101663
The previous traversal strategy for assigning render tasks is very
simple and works fine for normal content. However, it's possible to
create graphs with very deep levels of nesting and dependencies
that cause the pass traversal to not terminate quickly.
This patch contains two changes to fix these cases:
- Recursion in assign_render_pass will early out if a shorter
path has been found.
- Remove recursion from assign_free_pass, iterating each task once.
Differential Revision: https://phabricator.services.mozilla.com/D101541
In rare cases, WR can invalidate a tile, but still compute a dirty rect that doesn't intersect that tile.
flush_composites expects all updated tiles to have recorded at least one overlap (for itself), so we set this manually (as we in the normal path after the early return).
Differential Revision: https://phabricator.services.mozilla.com/D101427
When the iframe is inside a scaled container, the offset to the reference frame
needs to be scaled.
This change fixes both a rendering issue (bug 1682197) and a hit-testing issue
(bug 1682200) altogether for non WebRender.
Differential Revision: https://phabricator.services.mozilla.com/D100218
There's JS running since we save the active status till we restore it,
so arbitrary things can happen, including receiving an IPC message from
the child saying that we're now really active.
If then we restore the wrong (old) status, stuff gets confused and
sadness ensues.
Screenshotting background tabs seems to work without this so it's not
clear to me why messing with the activeness state was necessary to begin
with.
Differential Revision: https://phabricator.services.mozilla.com/D101060
In cases where clips are in the same coordinate space as the parent
picture surface (but different from the primitive), we can apply
a simple optimization to reduce the size of clip mask allocations.
In the linked test case, this drastically reduces the size of clip
masks that are drawn (each of the many clip masks drops from approx
1000 x 1000 pixels to approx 64 x 64 pixels).
Differential Revision: https://phabricator.services.mozilla.com/D101298
This change spreads the release asserts to functions that are invoked by other
callers, potentially increasing the cases where the assert will fail. This is
being done intentionally; we want additional information on the reasons for
the crashes.
Differential Revision: https://phabricator.services.mozilla.com/D101063
This is a minor adjustment to the font-selection heuristics implemented in bug 1371386:
for emoji codepoints, we should accept the font(s) specified in the font.name-list.emoji
preference even if it's a monochrome font for characters that would normally be expected
to use a color rendering, as this is the user's choice.
Differential Revision: https://phabricator.services.mozilla.com/D101162
We need to be able to delay instantiation of the drawing region until after we have the
dirty rects from start_compositing. This was currently not routed to RenderCompositor,
which is required to do this. Further, SwCompositor needs to always keep track of the
RenderCompositor that it is associated with regardless of whether or not it is a native
compositor so that this hook can be properly engaged.
Differential Revision: https://phabricator.services.mozilla.com/D100974
Restructure how frame building handles building of the surface
render task structures.
In future parts of this bug, a surface may have multiple "sub-passes"
where the rendering is separated into different render tasks that
write to the same target (without clear on subsequent sub-passes).
For example, this will be used to allow mix-blend-mode and
backdrop-filter to issue readbacks directly from picture cache
tiles rather than forcing draws to an intermediate surface.
The `add_child_render_task` method will be expanded to support
the case of a surface having multiple sub-passes, adding the
render task to the correct sub-pass.
Differential Revision: https://phabricator.services.mozilla.com/D101122
`DisplayListBuilder::PushRoundedRect`, used for unordered list bullets and the
like, draws rounded rectangles as ordinary rectangles with rounded borders that
have a radius of half the rectangle. Unfortunately, this leads to tiny white
dots at the center of the bullet under some magnifications. I haven't diagnosed
why - perhaps there's something somewhere that snaps borders outward.
Increasing the thickness of the borders to (an impossible) 60% of the width of
the rectangle makes the problem go away. If this kludge doesn't work, we could
add a rectangle covering the center.
Differential Revision: https://phabricator.services.mozilla.com/D100753
The webrender wrench macos build, which is cross-compiled, needs a
macOS native libLLVM (a .dylib) to link against. The file is currently
part of the macosx-cross toolchain, but that was more incidental than
intentional. As we're going to change the macosx-cross toolchain in a
way that will remove the libLLVM.dylib, pull the file from the macOS
native clang.
Differential Revision: https://phabricator.services.mozilla.com/D101150
Popup widgets are easier to detect because the "window" widget and the "view"
widget for them are the same object.
With toplevel widgets, most platforms (IIRC all non-Windows platforms) have
separate nsIWidget objects for the "window" widget (toplevel) and the "view"
widget (child), and this code has a reference to the view / child widget.
Differential Revision: https://phabricator.services.mozilla.com/D101062
This is a small extract from a change I tried to land earlier.
It refactors the GL version queries, no functional changes here.
Differential Revision: https://phabricator.services.mozilla.com/D101082
When ANativeWindow size is too big, EGLSurface creation could fail. And it should not happen on normal use case. But the error situation happens during org.mozilla.geckoview.test.ScreenshotTest.giantScreenshot.
Differential Revision: https://phabricator.services.mozilla.com/D101128
render_impl() calls draw_frame(). We were drawing the debug overlays in both
functions, so the overlays were rendered twice.
This patch removes the drawing in draw_frame() and keeps the one in render_impl().
For anything that uses the debug renderer, such as the "epochs" overlay, this
means that the drawing commands were appended twice, and then all commands were
executed at the end of render_impl().
Comparing the "epochs" debug overlay with and without this change, this patch
noticeable]y reduces its opacity from "extra opaque" (due to double drawing) to
"normal translucency".
Also, when the native compositor was used, any debug drawing in draw_frame()
that wasn't using the debug renderer didn't actually work, because it wasn't
going into the debug overlay surface - only render_impl() correctly binds the
debug overlay surface when the native compositor is used.
Differential Revision: https://phabricator.services.mozilla.com/D100961
Also disable for users with 64-bit Firefox with 1-2 cores, and less than
2 GB of physical memory. It was already disabled for 32-bit Firefox.
Differential Revision: https://phabricator.services.mozilla.com/D101052
In bug 1676474 an issue was reported regarding partial present on
Mali-G77 devices. This was introduced in bug 1675159, which refactored
some partial present logic and shifted the order of some OpenGL calls
around. As a precaution, we disabled the feature on all Mali-Gxx
devices.
The bug seems to occur when eglSetDamageRegion is called after
rendering to an offscreen render target (in this case due to texture
cache or GPU cache updates), but without the driver being flushed in
some way. This appears to be a bug in the Mali driver.
This patch moves the eglSetDamageRegion call back to its original
location -- after all offscreen render targets have been rendered,
immediately before rendering to the main framebuffer -- which fixes
the issue. It also re-enables the feature on all Mali-Gxx devices.
Differential Revision: https://phabricator.services.mozilla.com/D101018
Most of that is *rendering* logic, so the change moves it closer to the renderer.
One tiny bit - `enum DebugItem` - is used in frame building, so I left it in its own small module at the root.
Differential Revision: https://phabricator.services.mozilla.com/D100936
Crash could happen with WebRender rendering when RenderCompositorEGL is not ready for rendering. With the change, RenderCompositorEGL::BeginFrame() is not called when RenderCompositorEGL is not ready.
Differential Revision: https://phabricator.services.mozilla.com/D100871
Not the most elegant, but reworking the PDMFactory to be fully re-initialized would be a significant change, as only the WMFDecoderModule requires it we take some shortcuts.
Differential Revision: https://phabricator.services.mozilla.com/D100308
Upon starting the RDD and GPU process; we check their decoding capabilities and send it to the parent process. It will then broadcast this information to all content children so that RemodeDecoderModule::Supports can return if a codec is supported or not.
Differential Revision: https://phabricator.services.mozilla.com/D100306
ID3D11Query could be recycled. It was already done at RenderCompositorANGLE.
CompositorD3D11 is used in RenderCompositorD3D11SWGL.
Differential Revision: https://phabricator.services.mozilla.com/D100380
We shouldn't be trying to create the wrapping source surface here here GetBuffer
fails - in this case because of a shmem allocation failure. There are already ample
log notes about the failure so just bailing out and not spewing more warning spam
here seems like the right thing to do. Downwind code already deals with mFirstSource
not being set, so we should be safe.
Differential Revision: https://phabricator.services.mozilla.com/D100739