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

80 Коммитов

Автор SHA1 Сообщение Дата
Martin Stransky 3e893cfd93 Bug 1609538 - Workarounds for Mutter 3.36, r=jhorak
This is based on a patch by robert.mader

This is supposed to be a minimal patchset to make Firefox work on
Mutter 3.36 in a similar fassion as on 3.34. The changes should
be compatible with any Wayland compositor, especially those that
do similar agressive culling and frame callback reduction.
While technically non-optimal, they should work as a short time
solution.

1.: Do not commit the toplevel surface in moz_container_move. Instead
use gdk_window_invalidate_rect, which (hopefully) triggers a surface
commit as well while not interfering in the order of commands. The is
necessary as the previous commit would commit invalid state in certain
scenarios (like fullscreening).
This fixes broken fullscreening.

2.: Do not set an opaque region on containers if that would cover the
whole toplevel surface. This works around problems concerning mouse
input responsiveness, as a completely covered toplevel surface might
not get frame callbacks any more, but we currently rely on it to process
input events like mouse movements.

3.: Only set an opaque region on the toplevel surface when maximized.
While the toplevel opaque region is actually redundant as long as the
content surface has an opaque region set, we need it for workaround 2.
But we want to unset it when not needed as occasianally it is not in
sync, creating glitches when e.g. unmaximizing.

Differential Revision: https://phabricator.services.mozilla.com/D65476

--HG--
extra : moz-landing-system : lando
2020-03-05 09:02:02 +00:00
Noemi Erli dbf1182de3 Backed out changeset 1bfe014fc3fa (bug 1609538) for causing Linux bustages in widget_gtk 2020-03-05 07:19:08 +02:00
Robert Mader f0fbff5f02 Bug 1609538 - Workarounds for Mutter 3.36. r=stransky
This is supposed to be a minimal patchset to make Firefox work on
Mutter 3.36 in a similar fassion as on 3.34. The changes should
be compatible with any Wayland compositor, especially those that
do similar agressive culling and frame callback reduction.
While technically non-optimal, they should work as a short time
solution.

1.: Do not commit the toplevel surface in `moz_container_move`. Instead
use `gdk_window_invalidate_rect`, which (hopefully) triggers a surface
commit as well while not interfering in the order of commands. The is
necessary as the previous commit would commit invalid state in certain
scenarios (like fullscreening).
This fixes broken fullscreening.

2.: Do not set an opaque region on containers if that would cover the
whole toplevel surface. This works around problems concerning mouse
input responsiveness, as a completely covered toplevel surface might
not get frame callbacks any more, but we currently rely on it to process
input events like mouse movements.

3.: Only set an opaque region on the toplevel surface when maximized.
While the toplevel opaque region is actually redundant as long as the
content surface has an opaque region set, we need it for workaround 2.
But we want to unset it when not needed as occasianally it is not in
sync, creating glitches when e.g. unmaximizing.

Differential Revision: https://phabricator.services.mozilla.com/D64966

--HG--
extra : moz-landing-system : lando
2020-03-04 10:52:13 +00:00
Martin Stransky b432a2a607 Bug 1618493 [Wayland] Set opaque region for accelerated window immediately, r=jhorak"
Recently opaque region is set when wl_surface is obtained by renderer/compositor.
It does not work as GL/WebRender get wl_surface only once and creates egl_window
on top of it so the opaque region is never updated.

Differential Revision: https://phabricator.services.mozilla.com/D64583

--HG--
extra : moz-landing-system : lando
2020-02-27 16:39:32 +00:00
Sylvestre Ledru 4c2070edf7 Bug 1611599 - gcc-10: Add an explicit include to glib.h r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D61064

--HG--
extra : moz-landing-system : lando
2020-01-27 09:16:44 +00:00
Martin Stransky 2f5ac3876d Bug 1606751 [Wayland] Manage opaque region of mozcontainer internally, r=heftig
nsWindow::UpdateOpaqueRegion() is used from Main thread and it collides with
moz_container_get_wl_surface() where opaque region is used and which is called from Compositor thread.

As a fix don't set opaque region directly for mozcontainer but rather just use a flag to signalize
there's an update needed and calculare/set the opaque region at moz_container_get_wl_surface() or
moz_container_egl_window_set_size().

Differential Revision: https://phabricator.services.mozilla.com/D58840

--HG--
extra : moz-landing-system : lando
2020-01-06 20:18:19 +00:00
Martin Stransky 0f1c8a2adc Bug 1605120 [Wayland] Calculate and set opaque region for all wayland surfaces, r=heftig
Calculate and set correct opaque regions for all wl_surfaces, which are:

- mShell - toplevel window with CSD decorations, opaque mask needs to be shifted by titlebar/CSD size and subtracted transparent corners.
- mContainer - child window with subtracted transparent corners.

Differential Revision: https://phabricator.services.mozilla.com/D57797

--HG--
extra : moz-landing-system : lando
2020-01-02 13:35:26 +00:00
Gurzau Raul 28b5d5b3af Backed out changeset ad7cc9457eb1 (bug 1605120) for failing at nsWindow.cpp on a CLOSED TREE. 2019-12-23 23:10:43 +02:00
Martin Stransky 9d3726a816 Bug 1605120 [Wayland] Calculate and set opaque region for all wayland surfaces, r=heftig
Calculate and set correct opaque regions for all wl_surfaces, which are:

- mShell - toplevel window with CSD decorations, opaque mask needs to be shifted by titlebar/CSD size and subtracted transparent corners.
- mContainer - child window with subtracted transparent corners.

Differential Revision: https://phabricator.services.mozilla.com/D57797

--HG--
extra : moz-landing-system : lando
2019-12-23 19:50:14 +00:00
Martin Stransky 7c668f73cb Bug 1602309 [Wayland] Set opaque region directly to mShell wl_surface to bypass Gtk opaque region cache, r=heftig
Differential Revision: https://phabricator.services.mozilla.com/D56554

--HG--
extra : moz-landing-system : lando
2019-12-11 09:26:43 +00:00
Marc Streckfuss 2625fe32a5 Bug 1353652 - Fix unified builds r=karlt
Differential Revision: https://phabricator.services.mozilla.com/D55281

--HG--
extra : moz-landing-system : lando
2019-12-03 14:03:01 +00:00
Kenny Levinsen 1c5650fe48 Bug 1542808 - Implement widget-local VsyncSource for Wayland windows. r=stransky,lsalzman
Lets Wayland sessions run vsync off wayland surface frame callbacks by creating
an interface for widgets to return a local VsyncSource, if applicable.

This interface is currently used for the compositor, and for refresh drivers
in the parent process. It is not yet used for vsync in content processes.

Differential Revision: https://phabricator.services.mozilla.com/D28430

--HG--
extra : moz-landing-system : lando
2019-11-27 00:21:33 +00:00
Martin Stransky 54ae606371 Bug 1593408 [Wayland] Position mozcontainer wayland subsurface at moz_container_move(), r=jhorak
WebRender does not call moz_container_get_wl_egl_window() before each frame so mozcontainer
is not positioned properly here.

As a fix position mozcontainer directly at moz_container_move() if there are resources
for it.

Also always call moz_container_get_wl_surface() at moz_container_get_wl_egl_window()
to make sure an underlying mozcontainer surface is properly positioned.

Differential Revision: https://phabricator.services.mozilla.com/D52362

--HG--
extra : moz-landing-system : lando
2019-11-08 14:28:39 +00:00
Martin Stransky f677c03233 Bug 1589642 - Use gfxPlatformGtk instead of GDK_IS_X11_DISPLAY(gdk_display_get_default() to check current dispay type, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D49724

--HG--
extra : moz-landing-system : lando
2019-11-07 14:28:55 +00:00
Martin Stransky 17cc08c81c Bug 1594729 [Wayland] Mark mozcontainer as moved at moz_container_get_wl_surface(), r=jhorak
Also rename surface_position_update to surface_position_needs_update to make it more clear.

Differential Revision: https://phabricator.services.mozilla.com/D52171

--HG--
extra : moz-landing-system : lando
2019-11-07 15:41:24 +00:00
Razvan Maries 67e6a22efa Backed out changeset e1e3835cafc7 (bug 1589642) for build bustages on nsClipboard.cpp. CLOSED TREE 2019-11-07 15:03:59 +02:00
Martin Stransky a2d726855c Bug 1589642 - Use gfxPlatformGtk instead of GDK_IS_X11_DISPLAY(gdk_display_get_default() to check current dispay type, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D49724

--HG--
extra : moz-landing-system : lando
2019-11-07 12:30:00 +00:00
Martin Stransky 93728f0682 Bug 1592933 - [Wayland] Get scale factor from nsWindow::GdkScaleFactor() and set it when wl_surface/egl_window is used for rendering, r=jhorak
Remove moz_container_get_scale() and use only nsWindow::GdkScaleFactor() to get scale factor for wl_surface and wl_egl_window.
Always set the scale factor when wl_surface / wl_egl_window is queued for rendering.

Differential Revision: https://phabricator.services.mozilla.com/D51252

--HG--
extra : moz-landing-system : lando
2019-11-06 13:18:43 +00:00
Martin Stransky 04afc29457 Bug 1592350 [Wayland] Call wl_surface_commit() on parent surface when subsurface position is updated, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D51133

--HG--
extra : moz-landing-system : lando
2019-10-31 19:00:30 +00:00
Martin Stransky 0595546bfc Bug 1587008 - [Wayland] Get wl_egl_window size from compositor by nsWindow::SetEGLNativeWindowSize, r=jhorak
We can't set wl_egl_window from widget code as it must match GL rendering pipeline,
so let compositor to set the egl window size.

Depends on D49136

Differential Revision: https://phabricator.services.mozilla.com/D49137

--HG--
extra : moz-landing-system : lando
2019-10-15 19:25:47 +00:00
Dorel Luca 518c1a81eb Backed out 2 changesets (bug 1587008) for build bustage on src/widget/gtk/GtkCompositorWidget.cpp. CLOSED TREE
Backed out changeset 9e610c4628e1 (bug 1587008)
Backed out changeset afc6499c8f1f (bug 1587008)

--HG--
extra : rebase_source : 3c3cc17ada4079f279809cae1ece2e226fde5acf
extra : histedit_source : c7f61dbede0eda8ea3b0a1dfa5c67f8650f4ca81
2019-10-15 19:10:32 +03:00
Martin Stransky 11e2fafd1f Bug 1587008 - [Wayland] Get wl_egl_window size from compositor by nsWindow::SetEGLNativeWindowSize, r=jhorak
We can't set wl_egl_window from widget code as it must match GL rendering pipeline,
so let compositor to set the egl window size.

Depends on D49136

Differential Revision: https://phabricator.services.mozilla.com/D49137

--HG--
extra : moz-landing-system : lando
2019-10-15 13:12:25 +00:00
Martin Stransky 6cbfee645f Bug 1588448 - [Wayland] Check mozcontainer wl_surface before we use it, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D49189

--HG--
extra : moz-landing-system : lando
2019-10-15 08:28:56 +00:00
Martin Stransky 41e46a8792 Bug 1578464 - [Wayland] Set opaque region for toplevel window, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D47602

--HG--
extra : moz-landing-system : lando
2019-10-02 08:57:44 +00:00
Martin Stransky ce56a99d89 Bug 1578464 - [Wayland] Set opaque region to wl_surface of toplevel window, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D46280

--HG--
extra : moz-landing-system : lando
2019-09-20 12:58:03 +00:00
Martin Stransky 2ba6437bbb Bug 1579794 - [Wayland] Use wl_surface_damage_buffer() and require wl_compositor v.4, r=jhorak
Use wl_surface_damage_buffer() to propagate wl_buffer damage to avoid rounding errors and
rendering artifacts for HiDPI wl_buffers.

Depends on D45165

Differential Revision: https://phabricator.services.mozilla.com/D45166

--HG--
extra : moz-landing-system : lando
2019-09-10 07:58:56 +00:00
Martin Stransky d9c5ad8e86 Bug 1555899 - [Wayland] Added more wayland logging, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D33910

--HG--
extra : moz-landing-system : lando
2019-06-11 20:38:44 +00:00
Dorel Luca 486b17b628 Backed out 2 changesets (bug 1555899) for Build bustage. CLOSED TREE
Backed out changeset 2de31fc4c99c (bug 1555899)
Backed out changeset 335510024f81 (bug 1555899)
2019-06-08 00:37:35 +03:00
Martin Stransky 6b29386225 Bug 1555899 - [Wayland] Added more wayland logging, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D33910

--HG--
extra : moz-landing-system : lando
2019-06-06 09:38:28 +00:00
Martin Stransky eb09749a72 Bug 1554525 - [Wayland] Implement WindowBackBufferDMABuf backend for Wayland renderer, r=jhorak
- Rename recent WindowBackBuffer class to WindowBackBufferShm to clearly state that it uses Shm memory to store the pixel buffer.
- Implement WindowBackBufferDMABuf which stores pixel data in GPU memory in WaylandDMABufSurface object.
- Use WaylandDMABufSurface as a wayland backend when DMABuf is available and gfx.wayland_dmabuf_backend.enabled is set.
- Implement WindowImageSurface which temporary stores front buffer pixel data. It's used when front buffer is used by compositor and we want to draw.
  Instead of the front/back buffer flip and read-back data from front buffer, don't flip, store the drawing and draw the pixels when compositor
  releases the front buffer.

Differential Revision: https://phabricator.services.mozilla.com/D32635

--HG--
extra : moz-landing-system : lando
2019-05-29 12:50:18 +00:00
Sylvestre Ledru e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

Differential Revision: https://phabricator.services.mozilla.com/D28956

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Martin Stransky 1ffeea40ca Bug 1517205 - Make nsWaylandDisplay() global, r=lsalzman
Lazilly create nsWaylandDisplay objects and remove them at Firefox quit.

nsWaylandDisplay objects should stay as global objects and don't be created/released.
The creation/removal wastes resources on server side as the wl_registry objects at nsWaylandDisplay has to be stored at server
side and can't be removed until firefox ends [1] anyway.

Also the removed nsWaylandDisplay causes crashes when display
topology changes due to the global nature of the wl_registry.

[1] https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_registry

Differential Revision: https://phabricator.services.mozilla.com/D26673

--HG--
extra : moz-landing-system : lando
2019-04-09 21:39:51 +00:00
Martin Stransky 0961433659 Bug 1536099 - [Wayland] Provide logging to Wayland surface, r=ashie
Differential Revision: https://phabricator.services.mozilla.com/D23854

--HG--
extra : moz-landing-system : lando
2019-03-23 02:53:07 +00:00
Martin Stransky 9c4a67d013 Bug 1535567 - [Wayland] Request initial frame callback again if parent wl_surface changes, r=ashie
When xdg_popup window is created, sometimes the underlying wl_surface is changed during map/show event.
We need to check surface ID and recreate the frame callback then.

Differential Revision: https://phabricator.services.mozilla.com/D23662

--HG--
extra : moz-landing-system : lando
2019-03-18 13:16:42 +00:00
Martin Stransky 18098c6cf6 Bug 1534963 - Provide logging to mozcontainer, r=ashie
Differential Revision: https://phabricator.services.mozilla.com/D23328

--HG--
extra : moz-landing-system : lando
2019-03-18 12:52:46 +00:00
Sylvestre Ledru 4aa92e3091 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D22514
2019-03-13 10:19:06 +01:00
sotaro bb1cae8db3 Bug 1531300 - Handle multiple moz_container_unmap_wayland()/moz_container_map_wayland() r=stransky
Bug 1527804 did not expect multiple moz_container_unmap_wayland()/moz_container_map_wayland() calls. inital_draw_cb should not be cleared in multiple moz_container_unmap_wayland().

Differential Revision: https://phabricator.services.mozilla.com/D21522

--HG--
extra : moz-landing-system : lando
2019-02-28 13:33:02 +00:00
sotaro 1579a88e49 Bug 1527804 - Trigger composite from frame_callback_handler() r=stransky
Bug 1514156 expects that nsWindow::OnExposeEvent() is called after frame_callback_handler() called. But it did not happen during opening add-ons(gecko profiler). Then we need to trigger rendering directly from frame_callback_handler() call.

Differential Revision: https://phabricator.services.mozilla.com/D20272

--HG--
extra : moz-landing-system : lando
2019-02-25 12:15:50 +00:00
Sylvestre Ledru 41d1d79094 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D19663

--HG--
extra : moz-landing-system : lando
2019-02-15 08:15:57 +00:00
sotaro 0e2cb6d4e8 Bug 1514156 - Add RenderCompositorEGL for wayland r=nical
When GDK_BACKEND is wayland, widget is not fully mapped during creating CompositorSession. Needs to create valid EGLSurface after widget is fully mapped.

Differential Revision: https://phabricator.services.mozilla.com/D18940
2019-02-12 16:33:31 +09:00
Martin Stransky c20796e702 Bug 1522474 - [Wayland] Commit wl_surface state right after its creation, r=ashie
Differential Revision: https://phabricator.services.mozilla.com/D17498

--HG--
extra : moz-landing-system : lando
2019-01-25 03:37:52 +00:00
Martin Stransky 59a8114e76 Bug 1521012 - [Linux/GNOME] Use X shape mask to draw transparent corners when we draw to titlebar, r=lsalzman
To support rounded corners of Gtk+ titlebar themes (Adwaita, Radiance..) in GNOME we need to use X shape mask
as fully transparent toplevel window causes various issues (like Bug 1516224).

We draw mShell as transparent and mContainer as non-transparent with shape mask applied. The shape mask
is generated only when titlebar rendering is enabled and it's generated from GtkHeaderBar Widget
to match the exact look.

We use existing mTransparencyBitmap for the shape mask where mTransparencyBitmapForTitlebar controls
whether it's a general shape mask or our specialised shape for titlebar only.

This is already enabled for GNOME environment by default. So there's a new preference
widget.default-hidden-titlebar added to easily disable it if any issue appears
during testing.

Differential Revision: https://phabricator.services.mozilla.com/D17283

--HG--
extra : moz-landing-system : lando
2019-01-23 12:36:25 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Martin Stransky 1d8979cc73 Bug 1512416 - [Wayland/OpenGL] Resize wl_elg_window when widget scale changes, r=jhorak"
Differential Revision: https://phabricator.services.mozilla.com/D14404

--HG--
extra : moz-landing-system : lando
2018-12-20 11:54:13 +00:00
Dorel Luca d586d50b96 Backed out changeset be2cd52df099 (bug 1512416) for build bustage 2018-12-19 14:24:31 +02:00
Martin Stransky 973fb364ec Bug 1512416 - [Wayland/OpenGL] Resize wl_elg_window when widget scale changes, r=jhorak"
Differential Revision: https://phabricator.services.mozilla.com/D14404

--HG--
extra : moz-landing-system : lando
2018-12-19 08:46:27 +00:00
shindli 1c998613b1 Backed out changeset 61de4550c887 (bug 1512416) for bustages in builds/worker/workspace/build/src/widget/gtk/mozcontainer.cpp:230:15 2018-12-18 15:53:38 +02:00
Martin Stransky 4f8c2372b0 Bug 1512416 - [Wayland/OpenGL] Resize wl_elg_window when widget scale changes, r=jhorak"
Differential Revision: https://phabricator.services.mozilla.com/D14404

--HG--
extra : moz-landing-system : lando
2018-12-18 08:59:18 +00:00
Sylvestre Ledru 7cf43b9bc0 Bug 1513205 - Ride along, update some code to match the Google coding style r=Ehsan
# ignore-this-changeset

Depends on D14595

Differential Revision: https://phabricator.services.mozilla.com/D14597

--HG--
extra : moz-landing-system : lando
2018-12-14 18:10:08 +00:00
Martin Stransky ba6e539858 Bug 1485616 - [Wayland] Wait with drawing until mozcontainer init is finished, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D14070

--HG--
extra : moz-landing-system : lando
2018-12-11 10:09:13 +00:00