Граф коммитов

41115 Коммитов

Автор SHA1 Сообщение Дата
Robert Mader f691c9ecf9 Bug 1718569 - Implement custom FBO management, r=jgilbert,gfx-reviewers
Instead of using the Wayland EGL platform. The later is very convenient
but has several limitations. Managing FBOs allows to make our code more
similar to that of MacOS as well as the Wayland software backend.

Most importantly, it will allow us to cleanly implement partial damage
by giving us direct acces to previously submitted buffers, allowing us
to blit back from them, similar like in
`NativeLayerCA::HandlePartialUpdate`.
There are several other fields where more control over buffers will
come in handy, too many to describe them here in detail.

Note: we still use individual buffer pools for each tile. However, this
change brings everything into place to allow us to change to a more
`SurfacePoolCA`-style shared pool. That will reduce GPU-memory usage.

Includes some minor cleanups here and there.

Depends on D119013

Differential Revision: https://phabricator.services.mozilla.com/D118925
2021-07-13 13:44:12 +00:00
Nicolas Silva 6fb5745981 Bug 1716648 - Don't cache large linear gradients with hard stops. r=gfx-reviewers,lsalzman
Very large gradients are rendered at a lower resolution which is fine for most gradients as they tend to be smooth transitions, but looks bad when there are hard stops.

Differential Revision: https://phabricator.services.mozilla.com/D119628
2021-07-13 13:00:54 +00:00
Nicolas Silva 4948481cab Bug 1716648 - Avoid stretching with large linear gradients in some cases. r=gfx-reviewers,lsalzman
The tile size edtermines the number of pixels we allocate for the gradinrt pattern, and is eventually clamped to a maximum value. Minimizing the tile size after other transformations avoids some cases where we request more area than we need.

Differential Revision: https://phabricator.services.mozilla.com/D119627
2021-07-13 13:00:54 +00:00
Nicolas Silva 6a1d26379e Bug 1719297 - Address uninitialized value warning (valgrind) in HitTestInfoManager. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D119186
2021-07-13 11:32:33 +00:00
Glenn Watson 669caffa87 Bug 1696842 - Establish raster roots for more picture composite modes r=gfx-reviewers,lsalzman
Add MixBlend and ComponentTransfer to the picture composite modes that
unconditionally establish a raster root.

All the known bugs with the raster root code have been fixed, so let's
start incrementally enabling raster roots for more picture modes, and
fix any regressions that come from these before making raster roots
the default for all surfaces.

Differential Revision: https://phabricator.services.mozilla.com/D117954
2021-07-13 06:01:37 +00:00
Sandor Molnar 6c075398dd Backed out 2 changesets (bug 1718570, bug 1718569) for causing wpt failures in /css/css-flexbox/flexbox-align-self-vert-001. CLOSED TREE
Backed out changeset 59cdbaaa6a7b (bug 1718570)
Backed out changeset 489ce763c140 (bug 1718569)
2021-07-13 08:52:28 +03:00
Robert Mader 7f684896cb Bug 1718570 - Implement full partial damage support, r=gfx-reviewers,aosmond
This becomes possible as a side effect of making sure that the current
buffer content is always completely valid, by blitting from the
previous buffer, analogous to
`NativeLayerCA::HandlePartialUpdate` and
`WindowSurfaceWaylandMB::HandlePartialUpdate`.

Apart from reducing overpaint, this improves correctness is many
situations, avoiding glitches.

Note: the approach here may not be optimal concerning efficiency yet
and improvements are planed after further refactoring.

Depends on D118925

Differential Revision: https://phabricator.services.mozilla.com/D119015
2021-07-13 00:55:30 +00:00
Robert Mader f3231d9976 Bug 1718569 - Implement custom FBO management, r=jgilbert,gfx-reviewers
Instead of using the Wayland EGL platform. The later is very convenient
but has several limitations. Managing FBOs allows to make our code more
similar to that of MacOS as well as the Wayland software backend.

Most importantly, it will allow us to cleanly implement partial damage
by giving us direct acces to previously submitted buffers, allowing us
to blit back from them, similar like in
`NativeLayerCA::HandlePartialUpdate`.
There are several other fields where more control over buffers will
come in handy, too many to describe them here in detail.

Note: we still use individual buffer pools for each tile. However, this
change brings everything into place to allow us to change to a more
`SurfacePoolCA`-style shared pool. That will reduce GPU-memory usage.

Includes some minor cleanups here and there.

Depends on D119013

Differential Revision: https://phabricator.services.mozilla.com/D118925
2021-07-13 00:55:29 +00:00
Bob Owen 5657013012 Bug 1717209: Copy to a new canvas texture, when re-forwarding a texture that is still read locked. r=lsalzman
If we are re-forwarding a texture that has not been updated then it might still
be read locked. We rely on the read lock for us to know when the Compositor or
Renderer has finished with the texture. So this change copies it to a new
texture, which we can safely read lock.
If the texture is not read locked then we ensure that it is set as updated,
which means we will read lock it as we forward it.

Differential Revision: https://phabricator.services.mozilla.com/D119546
2021-07-12 19:16:28 +00:00
Nicolas Silva 50cfda52b2 Bug 1719708 - Improve the precision of profile start/end time. r=gfx-reviewers,mstange
Instead of storing the start time which can be a very large number as f64, keep it in ns as u64 and do the float conversion for the time difference instead.
In addition, the merge function was not behaving synmetrically. It was intended to work as old.merge(new) but we have at least one place in the code where we write it as new.merge(old). In practice takiung the max of the start times when merging two start times does what we want in both direction and makes merging less error prone.

Differential Revision: https://phabricator.services.mozilla.com/D119432
2021-07-09 08:20:16 +00:00
Robert Mader 6369b642b9 Bug 1719516 - Add names to some AutoLock arguments in NativeLayerCA. r=mstange
To be more consistent with the rest of the code base and make the
header file easier to read. Also remove an usused function declaration.

Differential Revision: https://phabricator.services.mozilla.com/D119335
2021-07-09 06:49:33 +00:00
Timothy Nikkel 4bc9cae2ee Bug 1715369. Add test. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D119139
2021-07-08 23:07:11 +00:00
Timothy Nikkel 0d00be970f Bug 1715369. Handle the case of a StackingContextHelper inside a deferred transform item with a different asr. r=mstange
Whenever the asr of the deferred transform item differs from the current asr and we are about to enter a new StackingContextHelper (as opposed to just when we enter a transformed frame) flush the deferred transform item, so it's transform doesn't get lost.

This is similar to https://phabricator.services.mozilla.com/D8111. In fact we are extending https://phabricator.services.mozilla.com/D8111 to every time we enter a StackingContextHelper. https://phabricator.services.mozilla.com/D8111 was concerned with solving the case of having two nested transform items with different asrs and making sure we don't lose the outer transform item, here we need to solve the case of an outer transformed item and an inner StackingContextHelper (which is not for a transform) with a different asr and making sure we don't lose the outer transform item.

Note that some of the items I added CreatesStackingContextHelper return true don't always make a new StackingContextHelper. It seemed better to be consistent and I think the only downside is a little less perf because we have to create a few more scrolldata nodes.

Differential Revision: https://phabricator.services.mozilla.com/D118815
2021-07-08 23:07:11 +00:00
Florian Quèze df151e59a2 Bug 1719218 - Remove the need for MOZ_GECKO_PROFILER ifdefs in code using ChildProfilerController, r=gerald,necko-reviewers,dragana.
Differential Revision: https://phabricator.services.mozilla.com/D119132
2021-07-08 16:20:10 +00:00
Florian Quèze 673e38408d Bug 1719218 - Build ProfilerParent even when MOZ_GECKO_PROFILER is not defined, r=gerald,necko-reviewers,nika,dragana.
Differential Revision: https://phabricator.services.mozilla.com/D119131
2021-07-08 16:20:08 +00:00
Jamie Nicol 790229886f Bug 1719367 - Hook up default clear color to RenderCompositorLayersSWGL. r=sotaro
Fenix makes use of the default clear color by setting it to a dark
color when the dark theme is enabled to avoid white flashes while
pages are loading. In bug 1663732 we hooked this functionality up to
webrender, however, it was only used by the draw compositor. Now with
software webrender on Android, we sometimes use
RenderCompositorLayersSWGL rather than the draw compositor, and users
are therefore experiencing white flashes during page loads.

This adds a clear_color argument to StartCompositing(), which
RenderCompositorLayersSWGL uses to set the CompositorOGL's clear
color. This patch also makes Renderer::clear_color not an Option
type, as we only ever used it in Some form, and that simplifies the
FFI.

Differential Revision: https://phabricator.services.mozilla.com/D119272
2021-07-08 11:46:37 +00:00
Timothy Nikkel c67f52b6bb Bug 1715187. Add test. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D119249
2021-07-08 09:48:21 +00:00
Timothy Nikkel a29d03dbc6 Bug 1715187. Factor out the resolution from the transform we set on the WebRenderLayerScrollData in nsDisplayRemote::UpdateScrollData. r=botond,hiro
The resolutio needs to be applied on top of any other transforms on that WebRenderLayerScrollData.

Differential Revision: https://phabricator.services.mozilla.com/D118326
2021-07-08 09:48:20 +00:00
Sandor Molnar 53b20ea46f Backed out changeset b5ad7d43bc54 (bug 1719367) for causing build bustages. CLOSED TREE 2021-07-08 12:28:55 +03:00
Jamie Nicol 8ee6c18a77 Bug 1719367 - Hook up default clear color to RenderCompositorLayersSWGL. r=sotaro
Fenix makes use of the default clear color by setting it to a dark
color when the dark theme is enabled to avoid white flashes while
pages are loading. In bug 1663732 we hooked this functionality up to
webrender, however, it was only used by the draw compositor. Now with
software webrender on Android, we sometimes use
RenderCompositorLayersSWGL rather than the draw compositor, and users
are therefore experiencing white flashes during page loads.

This adds a clear_color argument to StartCompositing(), which
RenderCompositorLayersSWGL uses to set the CompositorOGL's clear
color. This patch also makes Renderer::clear_color not an Option
type, as we only ever used it in Some form, and that simplifies the
FFI.

Differential Revision: https://phabricator.services.mozilla.com/D119272
2021-07-08 09:01:28 +00:00
Jamie Nicol c848d251a0 Bug 1670622 - Ensure GL context is current prior to webrender initialization. r=gfx-reviewers,jgilbert
We sometimes see webrender renderer initialization failing due to an
invalid max texture size being reported. The logcat shows that there
is no current GL context, and as a result glGet returns 0 when
querying the max texture size. This occurs after the
AndroidSharedBlitGL context has been destroyed on the renderer thread,
leaving no context as current.

This patch adds a call to MakeCurrent() for the renderer's OpenGL
context prior to renderer initialzation. This means we successfully
query the texture size and avoid the initialization error.

Differential Revision: https://phabricator.services.mozilla.com/D119334
2021-07-08 08:59:49 +00:00
Timothy Nikkel 1dc5a6c586 Bug 1719406. Update expected gecko metrics when we update zoom. r=botond
When calling nsDOMWindowUtils::SetResolutionAndScaleTo in a test it's possible to have a layers update that only updates the zoom and nothing else. NotifyLayersUpdated will update the zoom but not the expected gecko metrics when this happens.

Differential Revision: https://phabricator.services.mozilla.com/D119248
2021-07-08 02:06:06 +00:00
Markus Stange 3576e40671 Bug 1719516 - Rename some aLock arguments to aProofOfLock in NativeLayerCA. r=rmader
This is more consistent with other parts of the codebase.

Differential Revision: https://phabricator.services.mozilla.com/D119312
2021-07-07 19:05:59 +00:00
Jonathan Kew bf3113343b Bug 1716841 - Update font-size-adjust keywords to match CSSWG resolution in csswg-drafts/#6288. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D118198
2021-07-07 11:58:40 +00:00
Glenn Watson ab040bb3d1 Bug 1719238 - Fix selection of glyph sizes during pinch-zoom r=jnicol,gfx-reviewers
When picture cache tiles were changed to be raster roots, this
broke quantizing of glyph sizes based on current scale. Restore
this behavior for high-quality pinch-zoom mode, and also select
the correct fixed scale for low-quality zoom mode.

Differential Revision: https://phabricator.services.mozilla.com/D119145
2021-07-07 07:01:29 +00:00
Glenn Watson 519642aea1 Bug 1717207 - Fix incorrect sub_slice_index assignment in some cases. r=gfx-reviewers,kvark
Previously, the child primitives of off-screen surfaces were not
being atomically treated as a single unit. This meant that the
primitives may be assigned to different sub-slices, under certain
edge case conditions.

As a short term fix, let the picture cache code know when an off
screen surface is being processed during primitive dependency
updates. This ensures that all child primitives within a surface
will be assigned to the same sub-slice.

Differential Revision: https://phabricator.services.mozilla.com/D119052
2021-07-06 20:22:32 +00:00
Jed Davis 2257145e1c Bug 1635451 - Minimize content processes' connections to the X server. r=jgilbert,stransky,nika
This patch launches content processes with the `MOZ_HEADLESS` env var set
if they're using GTK with an X11 display (and there's no other reason
they'd need GTK).

The goal is to avoid exhausting Xorg's default limit of 256 clients if
there are many content processes due to Fission.  If these conditions
are met, the content process doesn't need to eagerly connect to the X
server.  This does not affect the sandbox policy, and content processes
can still use X if needed for, e.g.,  WebGL.

The boolean pref `dom.ipc.avoid-gtk`, set by default, controls this
feature.  In the future it could also be extended to minimize GTK use
with Wayland displays.

Note that disabling `widget.non-native-theme.enabled`, which is also
enabled by default, will restore the use of X11 in all content processes
even if this pref is set; the alternative is that widgets wouldn't render
in that case.

This change will also save some memory for now-unnecessary instances of
GTK's global state, and improve content process startup time.

Remove also the temp pref dom.ipc.remote-mozIcon because it cannot work
anymore with the content process being headless.

Differential Revision: https://phabricator.services.mozilla.com/D112197
2021-07-06 07:42:42 +00:00
Jed Davis dc3ae62544 Bug 1635451 - Allow GLX to work in headless content processes. r=jgilbert
This follows what we're already doing for EGL: a refcounted object
which can own the X connection, where we hold a weak reference from
the library object so that multiple contexts opportunistically share
the display but we close the connection when the last context is
freed/GCed.

In a process where GTK is initialized, we borrow its display instead of
opening a new one, which preserves the existing behavior.

Differential Revision: https://phabricator.services.mozilla.com/D112195
2021-07-06 07:42:42 +00:00
Glenn Watson 5e48211fc7 Bug 1718157 - Add a rudimentary on screen debug log system r=gfx-reviewers,kvark
This is useful for debugging problems on systems such as android
or windows which can sometimes be tricky to get reliable console
output logging.

Differential Revision: https://phabricator.services.mozilla.com/D118772
2021-07-06 00:55:17 +00:00
Nicolas Silva 963407d195 Bug 1717592 - Support screen raster-space in the opaque image brush. r=gfx-reviewers,lsalzman
This fixes the regressions that prevented https://phabricator.services.mozilla.com/D114954 from landing.

Differential Revision: https://phabricator.services.mozilla.com/D118370
2021-07-05 15:46:02 +00:00
Nicolas Silva 620dab6635 Bug 1717592 - Allow rendering tiles and segments with the opaque pass in more cases. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D114954
2021-07-05 15:46:02 +00:00
Hiroyuki Ikezoe 7d2d0b1c1b Bug 1705976 - A test that double tapping inside OOP iframe doesn't zoom if the top level document disallows zooming. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D119042
2021-07-05 00:48:42 +00:00
sotaro 1dbe2952b1 Bug 1718497 - Copy opaque tile instead of premultiplied blending r=lsalzman
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
2021-07-05 00:08:07 +00:00
Dzmitry Malyshau b261452e22 Bug 1716120 - Bump the compositor thread stack size to 320K r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D118840
2021-06-27 01:23:38 +00:00
Cosmin Sabou 41149697f3 Backed out changeset 26f4d57d3de5 (bug 1716120) for causing asan webgl failures. CLOSED TREE 2021-06-26 05:11:25 +03:00
Dzmitry Malyshau 8f6bb374fe Bug 1716120 - Bump the compositor thread stack size to 320K r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D118840
2021-06-25 21:56:35 +00:00
Jeff Muizelaar 416aaca8c8 Bug 1718334 - RELEASE_ASSERT the last map succeeded. r=jgilbert
The RELEASE_ASSERT below is failing so this will help
us narrow down which Map() call it might be.

Differential Revision: https://phabricator.services.mozilla.com/D118866
2021-06-25 20:56:14 +00:00
Jonathan Kew b066854b29 Bug 1561868 - Give the RebuildFontList message a raised priority, so that it is processed ahead of Vsync. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D118846
2021-06-25 20:12:14 +00:00
Jeff Gilbert afdbf9538b Bug 1459526 - Handle full-range video in Webrender. r=gw,lsalzman
+ 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
2021-06-25 19:16:22 +00:00
Robert Mader 26c93593a4 Bug 1646135 - Set draw buffer after eglMakeCurrent when using desktop GL,r=gfx-reviewers,lsalzman
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
2021-06-25 15:29:29 +00:00
Brindusan Cristian 4920fc0ffd Backed out changeset 717b4a7cc264 (bug 1646135) as requested by rmader for causing a regression.
CLOSED TREE
2021-06-25 18:19:50 +03:00
Jeff Muizelaar e71c762245 Bug 1717117: Enable low-quality-pinch-zoom pref on Android Nightly. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D118224
2021-06-25 14:48:50 +00:00
Florian Quèze cd399a71a2 Bug 1717991 - Remove ifdefs around code that adds profiler markers with custom marker schemas, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D118680
2021-06-25 13:28:01 +00:00
Robert Mader 3f85e626d8 Bug 1646135 - Set draw buffer after eglMakeCurrent on Wayland and X11,r=gfx-reviewers,lsalzman
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
2021-06-25 12:34:27 +00:00
Brindusan Cristian 3b52a2bfa1 Backed out changeset e5d0803d80dd (bug 1646135) for causing mochitest-plain crashes.
CLOSED TREE
2021-06-25 15:07:31 +03:00
Robert Mader dc15197dd2 Bug 1646135 - Set draw buffer after eglMakeCurrent on Wayland and X11,r=gfx-reviewers,lsalzman
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
2021-06-25 11:22:11 +00:00
Jonathan Kew a0abb0f180 Bug 1717595 - Ensure we check the fontgroup's validity before using it to build a textrun or otherwise access its cached font instances. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D118733
2021-06-25 10:14:17 +00:00
Glenn Watson 8a866e5314 Bug 1718166 - Ensure glyph scale quantization is >= 1 r=gfx-reviewers,jnicol
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
2021-06-25 09:25:10 +00:00
Iulian Moraru 1a8cb02555 Backed out changeset 10a229d128c0 (bug 1459526) for causing reftest failures on short.mp4.lastframe.html. CLOSED TREE 2021-06-25 06:34:36 +03:00
Jeff Gilbert 5c14187731 Bug 1459526 - Handle full-range video in Webrender. r=gw,lsalzman
+ 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
2021-06-24 23:43:31 +00:00