Copy tiles data when tiles are opaque instead of blending them.
RenderCompositorLayersSWGL always blends tiles as premultiplied tiles. But it could not handle clear tiles and caused Bug 1718497. The problem does not happen with RenderCompositorSWGL. It copies tile data when tile is opaque. Then, RenderCompositorSWGL handles clear tiles correctly.
Differential Revision: https://phabricator.services.mozilla.com/D118953
+ Begin to add video tests to ensure we ratchet towards correctness.
+ Test rec709 x (yuv420p, yuv420p10, gbrp) x (tv, pc) x codecs.
+ Just mark fuzziness for now. Better would be e.g. 16_127_233 'bad
references'.
Differential Revision: https://phabricator.services.mozilla.com/D115298
Original patch by Erik Kurzinger: D118304
The following is currently not well-defined by the EGL specification:
1. Create context.
2. Make it current with no default framebuffer (as a surface-less context, ie bind EGL_NO_SURFACE for both surfaces)
3. Make it current with a default framebuffer (ie with some draw/read surfaces)
After Step #3 what is the current draw buffer state? is it GL_NONE or GL_BACK?
With Mesa's EGL implementation, the answer is GL_BACK, and WebRender's EGL
backend currently assumes this behavior. However with the proprietary NVIDIA
driver the answer is actually GL_NONE, meaning any rendering done after step #3
will be lost.
As a fix, Firefox can simple call glDrawBuffer after making a surface current
to set the draw buffer appropriately, either to GL_BACK for a double-buffered
surface or to GL_FRONT for single-buffered. As mentioned above, this is
redundant on Mesa, but should also be harmless.
Differential Revision: https://phabricator.services.mozilla.com/D118743
Original patch by Erik Kurzinger: D118304
The following is currently not well-defined by the EGL specification:
1. Create context.
2. Make it current with no default framebuffer (as a surface-less context, ie bind EGL_NO_SURFACE for both surfaces)
3. Make it current with a default framebuffer (ie with some draw/read surfaces)
After Step #3 what is the current draw buffer state? is it GL_NONE or GL_BACK?
With Mesa's EGL implementation, the answer is GL_BACK, and WebRender's EGL
backend currently assumes this behavior. However with the proprietary NVIDIA
driver the answer is actually GL_NONE, meaning any rendering done after step #3
will be lost.
As a fix, Firefox can simple call glDrawBuffer after making a surface current
to set the draw buffer appropriately, either to GL_BACK for a double-buffered
surface or to GL_FRONT for single-buffered. As mentioned above, this is
redundant on Mesa, but should also be harmless.
Differential Revision: https://phabricator.services.mozilla.com/D118743
Original patch by Erik Kurzinger: D118304
The following is currently not well-defined by the EGL specification:
1. Create context.
2. Make it current with no default framebuffer (as a surface-less context, ie bind EGL_NO_SURFACE for both surfaces)
3. Make it current with a default framebuffer (ie with some draw/read surfaces)
After Step #3 what is the current draw buffer state? is it GL_NONE or GL_BACK?
With Mesa's EGL implementation, the answer is GL_BACK, and WebRender's EGL
backend currently assumes this behavior. However with the proprietary NVIDIA
driver the answer is actually GL_NONE, meaning any rendering done after step #3
will be lost.
As a fix, Firefox can simple call glDrawBuffer after making a surface current
to set the draw buffer appropriately, either to GL_BACK for a double-buffered
surface or to GL_FRONT for single-buffered. As mentioned above, this is
redundant on Mesa, but should also be harmless.
Differential Revision: https://phabricator.services.mozilla.com/D118743
Now that picture cache tiles are raster roots, their scale is
expressed via the device-pixel scale. This means the calculated
scale can be too small when zoom factor is < 1 and a pinch-zoom
is currently active.
This is not a complete fix, it's an interim improvement until we
implement a proper fix. A complete fix will need to include the
device-pixel scale in the quantization process. However, this will
take some time to get right, since the existing code for selecting
a glyph size is quite complex due to different permutations and
how that code has evolved.
Differential Revision: https://phabricator.services.mozilla.com/D118781
+ Begin to add video tests to ensure we ratchet towards correctness.
+ Test rec709 x (yuv420p, yuv420p10, gbrp) x (tv, pc) x codecs.
+ Just mark fuzziness for now. Better would be e.g. 16_127_233 'bad
references'.
Differential Revision: https://phabricator.services.mozilla.com/D115298
Updating raster_scale in post_update can mean that it is
updated one frame too late. This can cause reftest failures
in tests that set the scale factor (without an APZ) and then
capture that frame.
Differential Revision: https://phabricator.services.mozilla.com/D118672
This ensures we get the correct advances for the variation settings that are in use,
not just the font's "default" advances from the hmtx table.
(I'm sad there wasn't a testcase that detected this regression, so added one here.)
Differential Revision: https://phabricator.services.mozilla.com/D118571
Fixes a case where at the end of a pinch-zoom on the Draw compositor
the tiles would be drawn incorrectly (due to the transforms not
being quite right for the local-to-surface case here, which was
affecting the occlusion calculations).
Differential Revision: https://phabricator.services.mozilla.com/D118559
In bug 1717519 we're seeing access violations when writing
to the destination with SWGL. This does some early writes
to try to catch the problem earlier.
Differential Revision: https://phabricator.services.mozilla.com/D118556
This extends on the changes in part 12a and consumes the new PortRef-based API
in all existing process types other than the fork server. The IPDL C++ unit
tests were already broken before this change, and were not updated.
Differential Revision: https://phabricator.services.mozilla.com/D112777
This allows the draw compositor to correctly work with the low
quality pinch-zoom mode.
It also allows handling more external surfaces as compositor
surfaces, by allowing anything with a 2d scale and/or offset.
The y-flip special casing is removed since it's handled by the
general compositor transform support now.
Differential Revision: https://phabricator.services.mozilla.com/D118318
This extends on the changes in part 12a and consumes the new PortRef-based API
in all existing process types other than the fork server. The IPDL C++ unit
tests were already broken before this change, and were not updated.
Differential Revision: https://phabricator.services.mozilla.com/D112777
Actually, APZ's zoomToRect doens't support position: fixed content. If so,
we use PresShell's scrollIntoView instead to scroll focused content if it
isn't visible.
Differential Revision: https://phabricator.services.mozilla.com/D117728
This removes the last use of DefineClip from Gecko, which will
allow removing and simplifying a lot of the clip handing code
during scene building in WR.
Differential Revision: https://phabricator.services.mozilla.com/D118121
Unlike buffer release callbacks, which can't happen after the
corresponding buffer was destroyed, frame callbacks can apparently
arrive even if the corresponding surface was destroyed.
This kinda makes sense as frame callbacks have independent objects
which actually can get destroyed manually.
Also wait for the lock in the destructor to not unref the surface
below our feet.
Differential Revision: https://phabricator.services.mozilla.com/D118274
This caused e.g. WebGL content to get hidden as it always fell out
of bounds. As a side effect clean up the whole custom transform math.
Differential Revision: https://phabricator.services.mozilla.com/D118288
This changes font-family storage to reuse the rust types, removing a
bunch of code while at it. This allows us to, for example, use a single
static font family for -moz-bullet and clone it, rather than creating a
lot of expensive copies.
Differential Revision: https://phabricator.services.mozilla.com/D118011
+ Begin to add video tests to ensure we ratchet towards correctness.
+ Test rec709 x (yuv420p, yuv420p10, gbrp) x (tv, pc) x codecs.
+ Just mark fuzziness for now. Better would be e.g. 16_127_233 'bad
references'.
Differential Revision: https://phabricator.services.mozilla.com/D115298
This means that double tapping on an oop iframe "works" in that we don't try (and fail) to zoom the oop iframe. But it also means it is impossible to zoom to some content inside that oop iframe. Instead the best we can do is zoom to the oop iframe itself. This is consistent with what Chrome and Safari currently do. Allowing zooming to content inside an oop iframe would be decently complicated and it doesn't seem worth it. Bug 1715179 is on file for this.
Differential Revision: https://phabricator.services.mozilla.com/D116925
This was introduced in D106246. Most likely it is only necessary
on uncomposited legacy desktops. So on Linux only enable it for X11,
leaving out Wayland.
Removing it makes `RenderCompositorSWGL` behave (more) equally to
`RenderCompositorOGLSWGL`, massively reducing overpaint on certain
websites like testufo.com and improving frame rates on many low-end
devices.
Differential Revision: https://phabricator.services.mozilla.com/D118192
Over time the render target debug view has accidentally started
displaying other texture cache textures too, and then not actually
showing render targets. This makes it show only render target textures
again, as intended.
Differential Revision: https://phabricator.services.mozilla.com/D118187
Instead of drawing updates into the correct spot in the destination
DataSourceSurface we just use it as scratch space and always
draw in the top-left with stride = bpp*width.
We add a dstOffset to the upload functions to support using
a subsurface.
Differential Revision: https://phabricator.services.mozilla.com/D116501
This means that double tapping on an oop iframe "works" in that we don't try (and fail) to zoom the oop iframe. But it also means it is impossible to zoom to some content inside that oop iframe. Instead the best we can do is zoom to the oop iframe itself. This is consistent with what Chrome and Safari currently do. Allowing zooming to content inside an oop iframe would be decently complicated and it doesn't seem worth it. Bug 1715179 is on file for this.
Differential Revision: https://phabricator.services.mozilla.com/D116925
+ Begin to add video tests to ensure we ratchet towards correctness.
+ Test rec709 x (yuv420p, yuv420p10, gbrp) x (tv, pc) x codecs.
+ Just mark fuzziness for now. Better would be e.g. 16_127_233 'bad
references'.
Differential Revision: https://phabricator.services.mozilla.com/D115298
This means that double tapping on an oop iframe "works" in that we don't try (and fail) to zoom the oop iframe. But it also means it is impossible to zoom to some content inside that oop iframe. Instead the best we can do is zoom to the oop iframe itself. This is consistent with what Chrome and Safari currently do. Allowing zooming to content inside an oop iframe would be decently complicated and it doesn't seem worth it. Bug 1715179 is on file for this.
Differential Revision: https://phabricator.services.mozilla.com/D116925
Currently we prevent partial picture cache tile invalidation on all
Mali devices to workaround a driver bug. (See bug 1663355 and bug
1691955.) This driver bug affects some Mali-G and Mali-T devices, but
currently we apply the workaround for any Mali GPU.
Mali-400 may or may not be affected by the same driver bug, but since
it uses software webrender we certainly do not need to apply this
workaround.
Allowing partial invalidation should allow for smaller texture uploads.
Differential Revision: https://phabricator.services.mozilla.com/D118017
The values in ScaleOffset keys for the spatial node comparer can
often have very small differences that are causing invalidations but
are not going to affect the rendered content in any noticeable way.
This is _probably_ mostly due to inaccuracies in the way we calculate
the results in get_relative_transform. Instead of using the fast
form parent.inverse().accumulate(child), we could instead traverse
the tree from the parent, accumulating the local transforms. This
would be slightly less efficient but could probably be cached.
There may also be other sources of floating point inaccuracy that
is introduced in the calculations, so for now we will ignore any changes
which have a scale/translation change of < 0.001.
Differential Revision: https://phabricator.services.mozilla.com/D117968
Only a cosmetic change. There is a check during initialization that the constants match the sequential order so little room for getting it wrong.
Differential Revision: https://phabricator.services.mozilla.com/D117702
Also expose the information in the profiler HUD and rename some counters to make it more apparent when specific to the atlases as opposed to other textures managed by the texture cache.
Differential Revision: https://phabricator.services.mozilla.com/D117695
TextureImageEGL doesn't seem to provide any value beyond
BasicTextureImage. It's last usage was bug 814159.
Removing this has the side effect of using BasicTextureImage
for small images instead of always using TilingTextureImage.
Differential Revision: https://phabricator.services.mozilla.com/D117904
Only a cosmetic change. There is a check during initialization that the constants match the sequential order so little room for getting it wrong.
Differential Revision: https://phabricator.services.mozilla.com/D117702
Also expose the information in the profiler HUD and rename some counters to make it more apparent when specific to the atlases as opposed to other textures mamanged by the texture cache.
Differential Revision: https://phabricator.services.mozilla.com/D117695
Ensure that we only invalidate tiles if the surface scale changes
in low-quality pinch zoom mode, since it's irrelevant if the
compositor surface scale changes.
Differential Revision: https://phabricator.services.mozilla.com/D117727
vqmovn_u16 is very different semantically then _mm_packus_epi16. _mm_packus_epi16 treats the input as signed 16-bit integers and narrows to unsigned 8-bit.
vqmovn_u16, however, is an unsigned to unsigned narrow. vqmovun_s16 does what we actually need here, which is to treated the input as signed 16-bit and narrow to unsigned 8-bit.
Differential Revision: https://phabricator.services.mozilla.com/D117705
Only a cosmetic change. There is a check during initialization that the constants match the sequential order so little room for getting it wrong.
Differential Revision: https://phabricator.services.mozilla.com/D117702
Also expose the information in the profiler HUD and rename some counters to make it more apparent when specific to the atlases as opposed to other textures mamanged by the texture cache.
Differential Revision: https://phabricator.services.mozilla.com/D117695
Building on previous patches, this adds a preference to enable
a low quality pinch-zoom mode that reuses cached tiles where
possible.
It doesn't currently redraw at the higher quality scale at the
end of a pinch-zoom, and there are some sampling artifacts in some
cases. However, it should be enough to do some performance testing
on low and devices and see if it helps.
Differential Revision: https://phabricator.services.mozilla.com/D117497
Although blob images let us support very large images, it's easiest
avoid things getting way too big by just reusing our existing limit.
Differential Revision: https://phabricator.services.mozilla.com/D117580
Reject software rasterizers on Linux (except Software WebRender) when
trying to create full WebRender, unless WebRender was force enabled.
Differential Revision: https://phabricator.services.mozilla.com/D117534
When trying to create a GLContextEGL or GLContextGLX, we should check to
see what our display is backed by. If using a software driver, we should
fail to create the context for WebRender, so that it can fallback to
Software WebRender.
Differential Revision: https://phabricator.services.mozilla.com/D117473
Now that picture cache tiles establish raster roots, we can
separate the tile (compositor surface) transform from the local
transform of the tile.
This means we no longer need to check and invalidate tiles if a
fractional device space position is set (we can either round to
a device pixel in the compositor transform, or supply a fractional
translation to the compositor and allow it to handle it).
Differential Revision: https://phabricator.services.mozilla.com/D117378
I haven't been able to reproduce the issue here locally and test this directly, but according to
the reporter a build with this patch works for them.
My guess is that perhaps IDWriteLocalizedStrings::GetLocaleName has been returning a failure result,
causing us to drop the relevant font from the list altogether. We can handle that better by still
including the font, even if we're unsure which name matches the system locale.
This patch also adds a few gfxWarning() messages in places where we really don't expect things
to fail, but if they do, it might help us understand why fonts fail to appear.
Differential Revision: https://phabricator.services.mozilla.com/D117406
In order to avoid system compositor and wire overhead.
Also make more internals of `NativeSurfaceWayland` private.
Depends on D116675
Differential Revision: https://phabricator.services.mozilla.com/D116721
Make the vsync source request frame callbacks from opaque native
layers. This is necessary as opaque layers may occlude the
MozContainer surface, which is normally used for frame callbacks.
Wayland compositors may (and are encouraged to) optimize away
such callbacks, so we need to make sure to request frame callbacks
from actually visible surfaces.
Callbacks are requested for all layers, but only the first callback
will trigger the vsync source.
In order to get this right concerning multiple requested callbacks,
possibly being called from different threads etc., introduce a
callback abstraction, `CallbackMultiplexHelper`, to make this simple
to handle for callers.
Differential Revision: https://phabricator.services.mozilla.com/D116026
On certain adreno devices we encountered frequent driver crashes
during glLinkProgram. The crash appears to be caused by a combination
of compiling a shader with some GLSL code the driver doesn't like,
compiling shaders concurrently in multiple threads (eg webrender's
renderer thread and Fenix's Android UI render thread), and said
threads having a certain stack address.
Specifically, the GLSL code the driver doesn't like is a vector
bitwise-and followed by a conversion to bvec, which occurs in many of
webrender's shaders.
While we have control over webrender's renderer thread, we are unable
to synchronize with or control the stack address of the UI render
thread. Fortunately, we can rewrite the GLSL code to use scalar
bitwise-ands, therefore avoiding the crash.
Differential Revision: https://phabricator.services.mozilla.com/D117427
This will allow us to select either rasterizing the tiles with a
scale factor of 1.0 (for high performance mode) or at the current
scale of the pinch-zoom (for high quality mode).
Differential Revision: https://phabricator.services.mozilla.com/D116796
This is just cleanup while I was looking at why the test still fails
sometimes locally even with my patch. It is a bit racy because
BrowserChild's visible rect is not set by the time we do the
cross-process paint, so we clip everything...
This doesn't affect users and I have some upcoming PTO though, so will
look into it when I'm back.
Differential Revision: https://phabricator.services.mozilla.com/D116924
These annotations were useful for fixing crashes without known steps
to reproduce in the past, but the frequency of setting and unsetting
the annotations has a measurable impact on performance. This patch
therefore disables the annotations, but keeps the code behind a flag
so that it can easily be enabled if required for a future bug.
Differential Revision: https://phabricator.services.mozilla.com/D117152
Ensure that tiled image clip masks are calculated relative to the
raster root, not world space. Add a regression test for this.
Differential Revision: https://phabricator.services.mozilla.com/D117122
Picture cache code was using final device-space rect instead of the
actual raster rect when determining the readback coordinates for
mix-blend-mode effects. These are equivalent in most cases, but can
be different _if_ the picture cache is also establishing a raster root.
Differential Revision: https://phabricator.services.mozilla.com/D117113
We still need the blocklist to control rollout on Android, but on
desktop, we should be shipping Software WebRender to all users, except
those in safe mode or whom have explicitly disabled WebRender.
Differential Revision: https://phabricator.services.mozilla.com/D117088
Prior to making a draw call, we orphan the instance data VBO and
upload the new instance data in to the new buffer. In cases where the
new buffer is the same size as a previous one (as is the case when
compositing picture cache tiles), the Adreno 3xx driver gets confused
an appears to use the old orphaned data for the draw call.
To work around this, manually unbind then rebind the VAO after the
instance VBO has been orphaned. This tricks the driver in to using the
new VBO.
Differential Revision: https://phabricator.services.mozilla.com/D117033
We still need the blocklist to control rollout on Android, but on
desktop, we should be shipping Software WebRender to all users, except
those in safe mode or whom have explicitly disabled WebRender.
Differential Revision: https://phabricator.services.mozilla.com/D117088
Store CompositeTile instances in local space, and add support for compositor
transforms that can map local -> raster -> device space without access to the
spatial tree.
This is prep work for supporting picture cache tiles that are scaled by the
composite step during pinch-zoom, for low-end GPUs. Follow up patches will
port the native compositor surface and external descriptors to also work
in local space, converting to raster or device space on demand as required.
Differential Revision: https://phabricator.services.mozilla.com/D116331
This will ensure that when we re-land bug #1713544, it contains
a fix for an assertion failure that occurs when two transforms
are complex, but combined result in a 2d transform that we can
handle as a compositor surface.
Differential Revision: https://phabricator.services.mozilla.com/D116961
We always attempt to zoom to the width of the element we double tap on, cutting off the top/bottom of the element if necessary. For elements that contain text that are relatively quite tall this is good. But for things like images which are not really that tall, but just happen to have a taller aspect ratio then the viewport it is not ideal.
Differential Revision: https://phabricator.services.mozilla.com/D114582
I think I see why now the 90% check of bug 1707560 was there, to prevent situations like this. But that bug fixed a real problem so we want to make a forward fix of this issue.
The problem happens when we take a tall element and change our rect to have the same aspect ratio as the composited area. We center the new rect on the tap point, so unless the cursor is in he center of the screen the new rect will be out of the composited area. This is fine if we actually zoom, but if we are already zoomed it will just result in scrolling, which we do not want. We want to zoom out in this situation.
Since ZoomToRect performs any scrolling and zooming to zoom to the rect we can just do that scrolling ourselves and give the two rects a common origin and then decide if we are already zoomed in as far as we can for this tap point.
Differential Revision: https://phabricator.services.mozilla.com/D116367
Analogous to D102835 we need to make GDK aware of opaque surfaces
so frame callbacks get emitted for these surfaces as well. Otherwise
GDK may get stuck waiting on callbacks when used on compositors
that don't emit callbacks for occluded surfaces (which is explicitly
encouraged by the Wayland spec).
GDK runs on the main thread, so we need to dispatch these action
to the main thread as well.
Differential Revision: https://phabricator.services.mozilla.com/D116747
Analogous to D102835 we need to make GDK aware of opaque surfaces
so frame callbacks get emitted for these surfaces as well. Otherwise
GDK may get stuck waiting on callbacks when used on compositors
that don't emit callbacks for occluded surfaces (which is explicitly
encouraged by the Wayland spec).
GDK runs on the main thread, so we need to dispatch these action
to the main thread as well.
Differential Revision: https://phabricator.services.mozilla.com/D116722
And then use this to disable the default zoom in in a couple of tests. The tablecell test specifically checks that we don't zoom in on tablecells. The hscrollable test checks that we don't scroll when double tapping and it would like to zoom out.
Differential Revision: https://phabricator.services.mozilla.com/D116457
This provides feedback to the user, otherwise nothing happens and the user doesn't know if their input was accepted or not. This matches what Chrome does.
We add a new flag for ZoomToRect that only double tap uses. We also need to add the cursor position to the ZoomTarget struct as that is what we will be zooming in on. (CalculateRectToZoomTo has a little bit of refactoring to calculate this point sooner and without an intermediate variable.)
The rest of the patch is some logic in ZoomToRect to decide when to do this, and some math to compute the zoom to rect (which is similar to the zoom out code).
Differential Revision: https://phabricator.services.mozilla.com/D116370
CLOSED TREE
Backed out changeset 52dd9f9ddded (bug 1712726)
Backed out changeset 98052e01cacd (bug 1712726)
Backed out changeset 2a7d13d97415 (bug 1712726)
Store CompositeTile instances in local space, and add support for compositor
transforms that can map local -> raster -> device space without access to the
spatial tree.
This is prep work for supporting picture cache tiles that are scaled by the
composite step during pinch-zoom, for low-end GPUs. Follow up patches will
port the native compositor surface and external descriptors to also work
in local space, converting to raster or device space on demand as required.
Differential Revision: https://phabricator.services.mozilla.com/D116331
Store CompositeTile instances in local space, and add support for compositor
transforms that can map local -> raster -> device space without access to the
spatial tree.
This is prep work for supporting picture cache tiles that are scaled by the
composite step during pinch-zoom, for low-end GPUs. Follow up patches will
port the native compositor surface and external descriptors to also work
in local space, converting to raster or device space on demand as required.
Differential Revision: https://phabricator.services.mozilla.com/D116331
This passes the swgl context down from the renderer
instead of using the current context. This ensures
we report all of the contexts and don't double report.
Differential Revision: https://phabricator.services.mozilla.com/D116474
With D100581 LLVM added support for -Wunused-but-set-parameter and -Wunused-but-set-variable.
1. we shouldn't treat these warning as errors
2. for harfbuzz we apply a patch that has also been upstreamed, #2995, since pragma directives are somehow borken in clang vs gcc.
Differential Revision: https://phabricator.services.mozilla.com/D116604
This passes the swgl context down from the renderer
instead of using the current context. This ensures
we report all of the contexts and don't double report.
Differential Revision: https://phabricator.services.mozilla.com/D116474
Even if requirePaints is false, we still index into the APZ test
data using paints.length - 1 and use those data structures
unconditionally. Therefore the code still requires a paint either
way in order to not throw an exception.
Depends on D116531
Differential Revision: https://phabricator.services.mozilla.com/D116532
Store CompositeTile instances in local space, and add support for compositor
transforms that can map local -> raster -> device space without access to the
spatial tree.
This is prep work for supporting picture cache tiles that are scaled by the
composite step during pinch-zoom, for low-end GPUs. Follow up patches will
port the native compositor surface and external descriptors to also work
in local space, converting to raster or device space on demand as required.
Differential Revision: https://phabricator.services.mozilla.com/D116331
Right now X11-only builds will use `RendenderCompositorOGL` with EGL,
which could lead to unexpected bugs that are hard to diagnose.
It also makes code harder to read if code in `MOZ_WAYLAND` blocks
is used by the X11 backend.
While on it, rename and reorder `PauseRemoteRenderer()` so it matches
its counterpart `MaybeResumeCompositor()` better.
Note: This revision was accepted in D116315 but some bug in lando
required a recreation.
Differential Revision: https://phabricator.services.mozilla.com/D116530
force-disable was originally override other enabling prefs (gfx.webrender.enabled, gfx.webrender.all, and gfx.webrender.all.qualified). But it does not override gfx.webrender.software, since gfx.webrender.software is used for testing in CI.
Differential Revision: https://phabricator.services.mozilla.com/D116439
And don't fire the touchcancel event in the case where the content calls
preventDefault() for contextmenu events. This is going to be a behavior
change, but Chrome actually does fire a touchcancel event only if the Chrome's
context menu is opened, so this change will make our behavior match Chrome.
To tell whether our own context menu is opened or not, we use
mDefaultPreventedByChrome flag. Unfortunately this approach is applicable only
for Android since Android is the only one platform we call preventDefault() [1]
when opening context menu.
[1] https://searchfox.org/mozilla-central/rev/95c41d54c3fd65d51976d5188842a69b459a7589/mobile/android/actors/ContentDelegateChild.jsm#100
Differential Revision: https://phabricator.services.mozilla.com/D115964
On a long press touch event we fire a contextmenu event and if the contextmenu
is opening, we fire a touchcancel event. Unfortunately we had been checking
the return value, nsEventStatus, from nsIWidget::DispatchInputEvent via
nsContentUtils::SendMouseEvent to tell whether the context menu is opening or
not. So, we unintentionally fire the touchcancel event if the context menu is
NOT going to be opened because of preventDefault() in a contextmenu event
listener in the content itself.
NOTE: The oparator<< for the new PreventDefaultResult enum will be used in
APZ logging code.
[1] https://searchfox.org/mozilla-central/rev/95c41d54c3fd65d51976d5188842a69b459a7589/mobile/android/actors/ContentDelegateChild.jsm#100
Differential Revision: https://phabricator.services.mozilla.com/D115963
This is essentially dead-code removal. Since the GetNormalizedAppVersion()
now always returns 86, the value of the `migration` variable in
GetMouseWheelAnimationDurations() is always 100. And thus the function
always returns the unmodified minMS and maxMS values stored in the prefs.
We can therefore remove the function entirely and just use the pref
values directly in the callers.
Differential Revision: https://phabricator.services.mozilla.com/D116322
Follow up patches will store composite tiles and descriptors in the
local space of the tile. For that reason, we need to build them
earlier, before the local_valid_rect is cleared when the render
task(s) are created.
This patch is refactoring only, it shouldn't have any functional effect.
Differential Revision: https://phabricator.services.mozilla.com/D116327
If we don't set `UiCompositorControllerParent`'s other pid during in-process
initialization, we release assert when trying to log IPDL traffic via
`MOZ_IPC_MESSAGE_LOG`.
Differential Revision: https://phabricator.services.mozilla.com/D116271
This is to work around fuzzers repeatedly finding test cases with 2^16 clip masks or other type of render tasks. Not something we would see in real pages nor something that we would handle well at all even with 32 bits ids but at least it won't get in the way of fuzzing.
Differential Revision: https://phabricator.services.mozilla.com/D116214
Starting to simplify which parts of the composite state will require
true world coordinates compared to those that can operate in local
(pre-compositor-transform) coordinates.
Differential Revision: https://phabricator.services.mozilla.com/D116183
It was always one (previous commits removed the public API for changing
it). The use of global_device_pixel_scale from the remaining code will be
removed in follow up patches.
Differential Revision: https://phabricator.services.mozilla.com/D116175
Prior to bug 1712871, when SwCompositor was instantiated, max_update_rects was always 1 for SwCompositor. Bug 1712871 inadvertently made it default to 0 on Linux, which is not what we want. This reverts the behavior for RenderCompositorSWGL so that max_update_rects is again 1.
Differential Revision: https://phabricator.services.mozilla.com/D116301
When we update a blob image recording because of a visibility change,
the invalid rect may be empty. We still need to iterate over all of the
items in the blob for merging purposes, to include their metadata (i.e.
the bounds) in the recording. We should not attempt to re-record any
elements that are not within the invalid rect because that may change
our dependencies on external images and/or fonts. This patch fixes how
transform and filter display items would be re-recorded without being
invalidated.
This could happen because of a race with factor of 2 scaling for
example. If imagelib decides to trim the old surfaces and replace them
with factor of 2 scaling variants, a re-recording might end up with a
different result than before.
Differential Revision: https://phabricator.services.mozilla.com/D116190
In bug 1670538 we started setting RUSTC_BOOTSTRAP for Rust 1.50+
Rust 1.50+ gives a warning if we set in build.rs so don't.
Differential Revision: https://phabricator.services.mozilla.com/D116131
browser_test_scrollbar_in_extension_popup_window.js set DRAWWINDOW_DRAW_VIEW as argument of snapshotWindow(). But it is not passed to CanvasRenderingContext2D::DrawWindow(). snapshotWindowWithOptions() could pass options to the DrawWindow().
Differential Revision: https://phabricator.services.mozilla.com/D115973
The callback transform is stored as a content property, so the relevant
condition is whether we've seen a frame whose *content element* contains
the RCD-RSF callback transform.
Differential Revision: https://phabricator.services.mozilla.com/D116062
Gecko always sets this to be 1.0 anyway, since various other parts
of the code need to handle this differently for snapping purposes.
This patch removes the public API parts, a follow up patch will
simplify the internal code by removing handling of world -> device
pixels.
Differential Revision: https://phabricator.services.mozilla.com/D115855
In order to do that, move buffer type specific code into
`NativeSurfaceWayland` and create subclasses for SHM and EGL
buffers.
This should help identify bugs, improve the code structure for
additional buffer types (e.g. YUV) and makes us get closer
to the CA backend.
Also includes some minor unrelated cleanups.
Differential Revision: https://phabricator.services.mozilla.com/D115938
After D113532, a depth-buffer is not needed any more for the draw
compositor and it was subsequently removed from the EGL and GLX
context providers in D115216. This, however, broke the experimental
Wayland native compositor integration, which still needs it.
`SurfacePoolCA` solves this by manually attaching a depth buffer in
`CreateFramebufferForTexture`. `SurfacePoolWayland` will likely be
able to do the same eventually, however until that is the case
we need the GL context to provide it.
While on it, move the hardcoded bits into a better place below the
hard-coded values for ANGLE and remove now used code to make things
less cluttered.
Context: the `aDepth` argument was introduced in D76417 for EGL on X11
support, which used `RenderCompositorOGL`. This was changed in D108508,
making X11/EGL use `RenderCompositorEGL` instead, which uses a shared
GL singleton. This again required the color depth to be independent of
the window, so 32bit color depth was hardcoded in D109737. Therefore,
the `aDepth` and other things introduced in D76417 can be removed again.
Finally, it was found that we only need 32bit depth when used with
HW-WR, see also D114959.
Differential Revision: https://phabricator.services.mozilla.com/D115760