- Enable GL_TEXTURE_RECTANGLE_ARB only when the extension is supported
- Switch Green and Alpha colors in NV12 shader when compositing on Wayland. Is's because vaExportSurfaceHandle() exports UV plane in DRM_FORMAT_GR88 format so we have to use R and G channels and not R and A as we have now.
Differential Revision: https://phabricator.services.mozilla.com/D63349
--HG--
extra : moz-landing-system : lando
This removes the need for explicit #ifdef NS_BUILD_REFCNT_LOGGING without
introducing user-defined destructors when it is not defined.
Also, some uses of virtual for declaring destructors are replaced by the
appropriate override declaration through these changes.
Differential Revision: https://phabricator.services.mozilla.com/D62604
--HG--
extra : moz-landing-system : lando
The render backend's frame builder config is kept only in order to send updates to the scene builder's frame builder config which will update the scene's in the next transaction. If need be the scene configs can be updated right away by looping over the documents. This avoids confusing bugs where only updating the backend's config affects the visibility pass but not the rest.
Differential Revision: https://phabricator.services.mozilla.com/D63337
--HG--
extra : moz-landing-system : lando
This removes the need for explicit #ifdef NS_BUILD_REFCNT_LOGGING without
introducing user-defined destructors when it is not defined.
Also, some uses of virtual for declaring destructors are replaced by the
appropriate override declaration through these changes.
Differential Revision: https://phabricator.services.mozilla.com/D62604
--HG--
extra : moz-landing-system : lando
Use ThinVec instead, which is compatible with nsTArray, and makes stuff much
harder to misuse.
Differential Revision: https://phabricator.services.mozilla.com/D63256
--HG--
extra : moz-landing-system : lando
Use ANDROID_native_fence_sync to synchronize WebGL renderin. It's similar to KHR_fence_sync
but it the fence can be exported to file descriptor and shared among processes so we can create
the fence by WebGL producer and then wait in renderer.
Use glFinish() as a fallback when ANDROID_native_fence_sync is not available.
Differential Revision: https://phabricator.services.mozilla.com/D62712
--HG--
extra : moz-landing-system : lando
Continuing on the trend of having all of the gpu data encoding in gpu_types.rs so that it is easy to find and to avoid repeating it in batch.rs.
Depends on D62928
Differential Revision: https://phabricator.services.mozilla.com/D63178
--HG--
extra : moz-landing-system : lando
A quality-of-life improvement that will make it easier to change the encoding of the user data without having to repeat the correct casting, bit shifting and masking in many places. It also makes it harder to encode the data incorrectly by mistake or forget information.
Differential Revision: https://phabricator.services.mozilla.com/D62928
--HG--
extra : moz-landing-system : lando
GENERATED_FILES now defaults to python3 unless py2=True is specified as
an argument. All existing GENERATED_FILES scripts and GeneratedFile
templates have the py2=True attribute added, so this patch should
effectively be a no-op.
Going forward, individual scripts can be converted to python3 and their
corresponding py2=True attribute can be deleted. In effect, this patch
will be backed out in pieces until all scripts run in python3, at which
point the py2 attribute itself can be removed.
Differential Revision: https://phabricator.services.mozilla.com/D60919
--HG--
extra : moz-landing-system : lando
This should remove the allocation and copy in
TextureD3D::ensureRenderTarget() in some situations.
Differential Revision: https://phabricator.services.mozilla.com/D62952
--HG--
extra : moz-landing-system : lando
On GLES, the default shader behaviour is to use highp(32bit) integers
in the vertex shader and mediump(16bit) integers in the fragment shader. This
causes issues in the border shader due to bitshifting with 16 bits. The
fix here is to only shift by 8 bits as the data can be represented in a
16bit integer and forcing mediump in the vertex shader as well.
Differential Revision: https://phabricator.services.mozilla.com/D62784
--HG--
extra : moz-landing-system : lando
The crash reports all have allocation failures in their gfx critical log indicating that the best we can do is bail out without crashing and hope that enough memory will be freed before we run into an infallible allocation.
Differential Revision: https://phabricator.services.mozilla.com/D63085
--HG--
extra : moz-landing-system : lando
Change GPUProcessManager::OnPreferenceChange() and
RDDProcessManager::OnPreferenceChange() to only queue preference changes when
the child process is in the act of launching. And don't start observing
preference changes until we launch the child process rather that at startup.
Differential Revision: https://phabricator.services.mozilla.com/D62112
--HG--
extra : moz-landing-system : lando
This should remove the allocation and copy in
TextureD3D::ensureRenderTarget() in some situations.
Differential Revision: https://phabricator.services.mozilla.com/D62952
--HG--
extra : moz-landing-system : lando
Now that GfxInfo supports allowlisting, we can port our existing
configuration in gfxPlatform to using allowlist rules. This will
greatly increase maintainability and certainty that the expected
devices are getting WebRender.
Differential Revision: https://phabricator.services.mozilla.com/D62325
--HG--
extra : moz-landing-system : lando
Factor some parts of the YUV brush shader out into a shared
yuv.glsl shader include.
In future, this shader code will also be referenced by the
composite.glsl shader when using the simple (Draw) compositing
mode, to composite video surfaces directly into the framebuffer
where possible.
Differential Revision: https://phabricator.services.mozilla.com/D63123
--HG--
extra : moz-landing-system : lando
Now that GfxInfo supports allowlisting, we can port our existing
configuration in gfxPlatform to using allowlist rules. This will
greatly increase maintainability and certainty that the expected
devices are getting WebRender.
Differential Revision: https://phabricator.services.mozilla.com/D62325
--HG--
extra : moz-landing-system : lando
The rejection process consumes the ErrorResult, so an rvalue reference is the honest thing here.
Differential Revision: https://phabricator.services.mozilla.com/D62632
--HG--
extra : moz-landing-system : lando
This is done using a similar approach to CreateWebRenderCommands
but slightly modified. In particular the active layer check needs
to be done before we're ready to CreateWebRenderCommands, but once
we decide to activate an item, we can't let CreateWebRenderCommands
fail. Unfortunately, the need to query ImageLib for support means
we need to do basically ~all of the work of CreateWebRenderCommands
to do this check.
As such, this introduces a modified version of CreateWebRenderCommands
that SVGGeometryFrames implement with a "dry run" flag. When true,
it runs the same code but stops short of mutating the WR DL/state.
ImageLib may be encouraged to do some extra work that could be thrown
away, but I'm not sure there's any way to avoid that.
For now, only SVGImageFrame actually provides an implementation. The
bulk of the implementation is handling the on-by-default
preserveAspectRatio feature of SVG images. It was cleaner to just
reimplement that logic than reuse the existing preserveAspectRatio
code, as it was too tangled up in the particulars of how the PaintSVG
path is designed.
Differential Revision: https://phabricator.services.mozilla.com/D59925
--HG--
extra : moz-landing-system : lando
GENERATED_FILES now defaults to python3 unless py2=True is specified as
an argument. All existing GENERATED_FILES scripts and GeneratedFile
templates have the py2=True attribute added, so this patch should
effectively be a no-op.
Going forward, individual scripts can be converted to python3 and their
corresponding py2=True attribute can be deleted. In effect, this patch
will be backed out in pieces until all scripts run in python3, at which
point the py2 attribute itself can be removed.
Differential Revision: https://phabricator.services.mozilla.com/D60919
--HG--
extra : moz-landing-system : lando
This patch makes the CPU side incorporate the raster scale when
calculating the subpixel position of a glyph. It also makes the shader
side not include the glyph scale factor when recalculating the glyph
position (since it was not known/used when determining the subpixel
position in the first place). This makes the subpixel position stable
when we transition between Screen and Local(raster_scale) spaces.
Differential Revision: https://phabricator.services.mozilla.com/D62812
--HG--
extra : moz-landing-system : lando
GENERATED_FILES now defaults to python3 unless py2=True is specified as
an argument. All existing GENERATED_FILES scripts and GeneratedFile
templates have the py2=True attribute added, so this patch should
effectively be a no-op.
Going forward, individual scripts can be converted to python3 and their
corresponding py2=True attribute can be deleted. In effect, this patch
will be backed out in pieces until all scripts run in python3, at which
point the py2 attribute itself can be removed.
Differential Revision: https://phabricator.services.mozilla.com/D60919
--HG--
extra : moz-landing-system : lando
Simplify some of the logic related to handling multiple
compositor surfaces in future, specifically:
* Only rebuild the tiles map when the tile rect changes.
* Remove need for tiles_to_draw array.
Differential Revision: https://phabricator.services.mozilla.com/D62694
--HG--
extra : moz-landing-system : lando
This is done using a similar approach to CreateWebRenderCommands
but slightly modified. In particular the active layer check needs
to be done before we're ready to CreateWebRenderCommands, but once
we decide to activate an item, we can't let CreateWebRenderCommands
fail. Unfortunately, the need to query ImageLib for support means
we need to do basically ~all of the work of CreateWebRenderCommands
to do this check.
As such, this introduces a modified version of CreateWebRenderCommands
that SVGGeometryFrames implement with a "dry run" flag. When true,
it runs the same code but stops short of mutating the WR DL/state.
ImageLib may be encouraged to do some extra work that could be thrown
away, but I'm not sure there's any way to avoid that.
For now, only SVGImageFrame actually provides an implementation. The
bulk of the implementation is handling the on-by-default
preserveAspectRatio feature of SVG images. It was cleaner to just
reimplement that logic than reuse the existing preserveAspectRatio
code, as it was too tangled up in the particulars of how the PaintSVG
path is designed.
Differential Revision: https://phabricator.services.mozilla.com/D59925
--HG--
extra : moz-landing-system : lando
The blocklist currently works by checking the current configuration
against a set of GfxDriverInfo rules. We stop searching as soon as we
find the first match, and return whatever status code that has.
This patch adds a second pass for features marked for allowing. The
current blocklisting rules will still apply as normal. However it will
then review the allowlist rules using the same logic. If we don't get
a match, then we block the feature otherwise we use the allow status
code given in the rule.
New status codes introduced as part of this patch are as follows:
DENIED - Did not match any rules on the allowlist.
ALLOW_ALWAYS - Same as STATUS_OK but passed the allowlist.
ALLOW_QUALIFIED - Same as ALLOW_ALWAYS but should be controlled by
our qualified preference for experimentation purposes.
Differential Revision: https://phabricator.services.mozilla.com/D62322
--HG--
extra : moz-landing-system : lando
The blocklist currently works by checking the current configuration
against a set of GfxDriverInfo rules. We stop searching as soon as we
find the first match, and return whatever status code that has.
This patch adds a second pass for features marked for allowing. The
current blocklisting rules will still apply as normal. However it will
then review the allowlist rules using the same logic. If we don't get
a match, then we block the feature otherwise we use the allow status
code given in the rule.
New status codes introduced as part of this patch are as follows:
DENIED - Did not match any rules on the allowlist.
ALLOW_ALWAYS - Same as STATUS_OK but passed the allowlist.
ALLOW_QUALIFIED - Same as ALLOW_ALWAYS but should be controlled by
our qualified preference for experimentation purposes.
Differential Revision: https://phabricator.services.mozilla.com/D62322
--HG--
extra : moz-landing-system : lando
Add support to the yaml reader and writer to be able to specify
that a primitive should set the PREFER_COMPOSITOR_SURFACE flag.
This flag is not currently used, but in future will signal the
picture caching code to promote a primitive to draw on a native
compositor surface where possible.
Differential Revision: https://phabricator.services.mozilla.com/D62693
--HG--
extra : moz-landing-system : lando
- Update WaylandDMABUFTextureClientOGL to work with WaylandDMABufSurfaceRGBA which is used for GL/WebRender compositor
with dmabuf texture backend.
- Update WaylandDMABUFTextureHostOGL to work with both RGBA and NV12 surface formats.
- Use GLTextureSource instead of EGLImageTextureSource as we need to store more than one texture there with NV12
and pass the textures there by CreateTextureSourceForPlane().
- Implement NV12 related function by WaylandDMABUFTextureHostOGL (color space, color range, sub-textures num).
- Add NV12 implementation to PushResourceUpdates()/PushDisplayItems() for WebRender.
Differential Revision: https://phabricator.services.mozilla.com/D62004
--HG--
extra : moz-landing-system : lando
We need to export more planes in SurfaceDescriptorDMABuf and also YUV color space.
Differential Revision: https://phabricator.services.mozilla.com/D62000
--HG--
extra : moz-landing-system : lando
ClientReadbackLayer::RenderLayer is the only other RenderLayer implementation that doesn't have a RenderMaskLayers calls, does it need it?
Depends on D62180
Differential Revision: https://phabricator.services.mozilla.com/D62181
--HG--
extra : moz-landing-system : lando
composite_simple() calculates combined dirty rect from all tile's dirty rect. But the combined dirty rect becomes invalid when there is an old tile that was dropped. The dropped tile's dirty rect is not counted in composite_simple().
Differential Revision: https://phabricator.services.mozilla.com/D62531
--HG--
extra : moz-landing-system : lando
With this patch, a minimal valid rect is calculated for each
picture cache tile. This is used to reduce the scissor rect
during tile rasterization, and the draw rect during tile
compositing, whenever there is a partial tile.
Differential Revision: https://phabricator.services.mozilla.com/D62177
--HG--
extra : moz-landing-system : lando
For Draw (non-native) and CA modes, we include the per-tile
valid rect in the clip rect from the surface.
For DC (non-virtual) mode, a per-tile clip rect is set on the
visual for each tile, separate from the overall clip rect that
is set on the surface visual.
For DC (virtual) mode, the Trim API is used to remove pixels
in the virtual tile area that are outside the valid / clipped
region.
Note: Although the valid rect is now applied in the native
compositors, it's currently only based on the overall picture
cache bounding rect. Thus, with this patch there isn't any
noticeable performance improvement. Once this lands and is
working correctly, the follow up patch to calculate a smaller
valid region per-tile is a small amount of work.
Differential Revision: https://phabricator.services.mozilla.com/D61424
--HG--
extra : moz-landing-system : lando
I think this probably only shows up with fission oop iframes, tabs probably avoid this path.
The problem occurs when we reconstruct the containing iframe for a style change, we briefly hide the child document, clearing the display list on the parent via ClearCachedResources. Then show it again, we attempt an empty transaction and this succeeds because there is nothing to stop it. (The non-wr case fails because the layer contents are missing and that causes the empty transaction to fail.)
So keep track if we have sent a display list to the parent to allow/disallow an empty transaction.
This fixes a couple webrender+fission reftest failures but it's also a general rendering bug in webrender+fission reproducible in a regular browser.
Differential Revision: https://phabricator.services.mozilla.com/D61577
--HG--
extra : moz-landing-system : lando
I think this probably only shows up with fission oop iframes, tabs probably avoid this path.
The problem occurs when we reconstruct the containing iframe for a style change, we briefly hide the child document, clearing the display list on the parent via ClearCachedResources. Then show it again, we attempt an empty transaction and this succeeds because there is nothing to stop it. (The non-wr case fails because the layer contents are missing and that causes the empty transaction to fail.)
So keep track if we have sent a display list to the parent to allow/disallow an empty transaction.
This fixes a couple webrender+fission reftest failures but it's also a general rendering bug in webrender+fission reproducible in a regular browser.
Differential Revision: https://phabricator.services.mozilla.com/D61577
--HG--
extra : moz-landing-system : lando
So as to avoid UB. It is somewhat unfortunate/dumb the fact that we need to do
this and we can't detect when we forget to do it :(
Give it uint8_t as it's type as that's enough and consistent with LogicalSide.
Differential Revision: https://phabricator.services.mozilla.com/D62390
--HG--
extra : moz-landing-system : lando
When BasicCompositor is used, BasicCompositor does not use CompositorWindow.
Differential Revision: https://phabricator.services.mozilla.com/D61345
--HG--
extra : moz-landing-system : lando
This is another one which is included everywhere. If the OOL call mattered we
could move these to a different header or something, but I suspect it won't.
Differential Revision: https://phabricator.services.mozilla.com/D62173
--HG--
extra : moz-landing-system : lando
We include it everywhere because it's included from gfxTypes.h.
This should avoid including all the generated bindings _everywhere_.
Differential Revision: https://phabricator.services.mozilla.com/D62174
--HG--
extra : moz-landing-system : lando
In bug 1578329 I introduced two scoping mistakes:
- A marker was made to have a shorter duration.
- A label was scoped too short and so would most likely be missed during
sampling.
This patch reverts to the original wider scope.
Differential Revision: https://phabricator.services.mozilla.com/D62274
--HG--
extra : moz-landing-system : lando
Fourth iteration: improve the detail in reported tile invalidations.
The invalidation enum stores the old and new values for lightweight
types. For a change in PrimCount, the old and new list of ItemUids is
stored (if logging is enabled); the tool can then diff the two to see
what was added and removed. To convert that back into friendly strings,
the interning activity is used to build up a map of ItemUid to a string.
A similar special-casing of Content Descriptor will print the item
that's invalidating the tile, plus the origin and/or rectangle.
Also adding zoom and pan command line options both to fix high-DPI
issues and also to allow zooming out far enough to see out-of-viewport
cache lifetime and prefetching due to scrolling.
Also fix a bug where interning updates get lost if more than one update
happens without building a frame: switch to a vector of serialized
updatelists (one per type) instead of allowing just one string (per
type).
Differential Revision: https://phabricator.services.mozilla.com/D61656
--HG--
extra : moz-landing-system : lando
The test is meant to check that tupes work and a tuple of a single element needs a comma to differentiate it from just being the element.
Differential Revision: https://phabricator.services.mozilla.com/D61681
--HG--
extra : moz-landing-system : lando
This ensures that even if APZ is force-disabled, the permanent offset between
the visual and layout viewports is preserved during rendering.
Differential Revision: https://phabricator.services.mozilla.com/D62094
--HG--
extra : moz-landing-system : lando
Bug 1609002 made it so that the async scroll offset sent to webrender
is taken from only the layout component of the async transform, rather
than the combined layout and visual components. The consequence of
this is that the layout-only transform is in LayerPixel space (and
unnaffected by the async zoom) rather than ParentLayerPixel
space (which is affected by async zoom).
To convert the value to LayoutDevicePixel space, as webrender expects,
we were dividing by the pinch zoom scale, which includes the async
zoom. This was causing content to jump around whilst async panning and
zooming, as the scroll offset was incorrectly scaled. This is fixed
by instead dividing by the cumulative resolution, which does not
include the async zoom.
Differential Revision: https://phabricator.services.mozilla.com/D61787
--HG--
extra : moz-landing-system : lando
Bug 1609002 made it so that the async scroll offset sent to webrender
is taken from only the layout component of the async transform, rather
than the combined layout and visual components. The consequence of
this is that the layout-only transform is in LayerPixel space (and
unnaffected by the async zoom) rather than ParentLayerPixel
space (which is affected by async zoom).
To convert the value to LayoutDevicePixel space, as webrender expects,
we were dividing by the pinch zoom scale, which includes the async
zoom. This was causing content to jump around whilst async panning and
zooming, as the scroll offset was incorrectly scaled. This is fixed
by instead dividing by the cumulative resolution, which does not
include the async zoom.
Differential Revision: https://phabricator.services.mozilla.com/D61787
--HG--
extra : moz-landing-system : lando
To avoid computing transform bounds over and over. It is generally just better.
Replace the various "overridebounds" thingies by using the "fallback" of the
transform-reference-box code which we need anyway.
Differential Revision: https://phabricator.services.mozilla.com/D61890
--HG--
extra : moz-landing-system : lando
Implement WaylandDMABUFSurfaceImage which is backed by dma buf memory on Wayland and it holds
decoded video images produced by ffmpeg va-api decoder.
Differential Revision: https://phabricator.services.mozilla.com/D61678
--HG--
extra : moz-landing-system : lando
Implement WaylandDMABUFSurfaceImage which is backed by dma buf memory on Wayland and it holds
decoded video images produced by ffmpeg va-api decoder.
Differential Revision: https://phabricator.services.mozilla.com/D61678
--HG--
extra : moz-landing-system : lando
This patch adds reporting the surface types used by the image frame in a
bit mask (such if it is a CAPTURE including a DATA_SHARED, the mask will
be 1 << CAPTURE | 1 << DATA_SHARED), as well as an estimated size
included in the report as decoded-unknown for when we do not know if the
surface is on the heap or the non-heap specifically. This is the default
implementation for a SourceSurface as well, so we should no longer have
the case where surfaces appear empty despite being in the cache. It also
makes requests being validated as always notable for reporting purposes.
Differential Revision: https://phabricator.services.mozilla.com/D61458
--HG--
extra : moz-landing-system : lando
We will no longer allow OMTP on 32-bit systems with less than 2GB of RAM
and 2 or fewer cores. These systems are unlikely to realize a benefit
from OMTP and see a higher than normal incidence of OOM crashes in the
content process due to OMTP having a higher memory footprint.
Differential Revision: https://phabricator.services.mozilla.com/D60058
--HG--
extra : moz-landing-system : lando
We incorporate the reference frame origin offset for non-animated
transforms, but forgot for animated transforms. Since the offset itself
is not animated, we should still incorporate it into the snapping
transform.
Differential Revision: https://phabricator.services.mozilla.com/D61689
--HG--
extra : moz-landing-system : lando
The test is meant to check that tupes work and a tuple of a single element needs a comma to differentiate it from just being the element.
Differential Revision: https://phabricator.services.mozilla.com/D61681
--HG--
extra : moz-landing-system : lando
SyncObjectD3D11Host::Synchronize() calling in RenderCompositorANGLE::BeginFrame() is still necessary for D3D11DXVA2Manager::CopyToImage(). Then backout Bug 1596630.
Differential Revision: https://phabricator.services.mozilla.com/D61658
--HG--
extra : moz-landing-system : lando