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

110 Коммитов

Автор SHA1 Сообщение Дата
Martin Stransky 432226521b Bug 1657747 [Wayland] Remove DMABuf backend from SW compositor, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D86342
2020-08-08 08:50:29 +00:00
Martin Stransky f600821505 Bug 1656727 [Wayland] Check mDelayedCommitHandle before we use it, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D86261
2020-08-07 10:29:45 +00:00
Martin Stransky 8fc11cb1ca Bug 1645734 [Wayland] Move gbm library interface from nsWaylandDisplay, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D79695
2020-06-23 06:27:09 +00:00
Martin Stransky 74141f6a50 Bug 1645704 [Wayland] Rename WaylandDMABufSurface to DMABufSurface at widget/gtk, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D79636
2020-06-21 13:59:24 +00:00
Simon Giesecke 82dc9b2271 Bug 1642949 - Replace uses of RemoveElementAt by RemoveLastElement/PopLastElement where possible. r=necko-reviewers,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78027
2020-06-10 10:46:14 +00:00
Butkovits Atila e3dce68834 Backed out 3 changesets (bug 1643289, bug 1642949) for causing failure at test_headless_screenshot.html. CLOSED TREE
Backed out changeset 98c420f73380 (bug 1643289)
Backed out changeset 9447ea8910aa (bug 1643289)
Backed out changeset 0c827da9d847 (bug 1642949)
2020-06-10 10:07:23 +03:00
Simon Giesecke d419f0ff08 Bug 1642949 - Replace uses of RemoveElementAt by RemoveLastElement/PopLastElement where possible. r=necko-reviewers,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78027
2020-06-10 05:49:28 +00:00
Martin Stransky cb61ee92f5 Bug 1643149 [Wayland] Fix MozContainer deadlock, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D78278
2020-06-04 13:50:46 +00:00
Martin Stransky b650f11f94 Bug 1641778 [Wayland] Always lock wayland surface when se use it, r=jhorak
- moz_container_wayland_get_surface() is replaced by moz_container_wayland_surface_lock()/moz_container_wayland_surface_unlock()
pair which ensures the surface is locked and won't be destroyed by other thread when window is hidden for instance.

- nsWindow::GetWaylandSurface() is removed and nsWindow::GetMozContainer() needs to be used instead.

Differential Revision: https://phabricator.services.mozilla.com/D77698
2020-06-02 16:22:16 +00:00
Martin Stransky ec6a3bec56 Bug 1619882 [Wayland] Implement dmabuf global ref count, r=jhorak
This patch implements:

- Global surface UID for better tracking/debugging. The UID is passes acros all processes so we can track
  surface usage.
- WaylandAllocateShmMemory() function which uses shm_open() instead of files at tmp for Shm memory creation.
- DMABufRefcount() class based on eventfd() which is used as a global surface reference count.

Differential Revision: https://phabricator.services.mozilla.com/D76689
2020-05-29 15:21:50 +00:00
Martin Stransky 8ee72ddd94 Bug 1635362 [Wayland] Split mozcontainer implementation for X11 and Wayland, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D73794
2020-05-13 13:11:49 +00:00
Dorel Luca 365efa35da Backed out changeset 44d68ed90676 (bug 1635362) for Mochitest failures in browser/browser_Telemetry_timestamp_test.js. CLOSED TREE 2020-05-12 15:50:41 +03:00
Martin Stransky 9273e0a347 Bug 1635362 [Wayland] Split mozcontainer implementation for X11 and Wayland, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D73794
2020-05-12 10:14:21 +00:00
Martin Stransky edbe69232a Bug 1636072 [Wayland] Don't crash when GetWlBuffer() fails, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D74663
2020-05-12 09:20:25 +00:00
Mihai Alexandru Michis c48271d35e Backed out changeset 54d6f39b880a (bug 1635362) for causing failures in test_bug659071.html and browser_Telemetry_timestamp_test.js
CLOSED TREE
2020-05-11 17:26:29 +03:00
Martin Stransky d8946e5c38 Bug 1635362 [Wayland] Split mozcontainer implementation for X11 and Wayland, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D73794
2020-05-11 12:25:58 +00:00
Martin Stransky bf0f8f24a0 Bug 1627469 [Wayland] [Wayland] Don't use oversized wl_surface sizes, r=jhorak
- Calculate size of wl_buffer as an intersection of widget size and nsWindow bound size.
  We can't use wl_buffer bigger than nsWindow bound as it leads to rendering artifacts.

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

--HG--
extra : moz-landing-system : lando
2020-04-06 07:01:33 +00:00
Martin Stransky 1c00ea0aa0 Bug 1625296 [Wayland] Enable basic compositor smooth drawing by widget.wayland-smooth-rendering pref, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D68457

--HG--
extra : moz-landing-system : lando
2020-03-30 21:12:37 +00:00
Bogdan Tara e93ba090b8 Backed out changeset 2a1b5f29d43d (bug 1625296) for bustages complaining about WindowSurfaceWayland.cpp CLOSED TREE 2020-03-30 17:26:10 +03:00
Martin Stransky 822447aeb7 Bug 1625296 [Wayland] Enable basic compositor smooth drawing by widget.wayland-smooth-rendering pref, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D68457

--HG--
extra : moz-landing-system : lando
2020-03-30 13:40:22 +00:00
Martin Stransky c811449120 Bug 1623060 [Wayland] Respect GtkWidget size then committing to wayland surface, r=jhorak
Mutter 3.36 requests exact match of wl_surface/wl_subsurface size so we need to respect
wl_surface size (GtkWidget size) and create a wl_subsurface with the same size.

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

--HG--
extra : moz-landing-system : lando
2020-03-18 09:43:34 +00:00
Simon Giesecke cb0734d274 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in widget. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D66012

--HG--
extra : moz-landing-system : lando
2020-03-16 10:56:57 +00:00
Bogdan Tara c60fd3fdd2 Backed out 4 changesets (bug 1613985) for causing build bustages CLOSED TREE
Backed out changeset fba0caac746c (bug 1613985)
Backed out changeset 8605d7a19107 (bug 1613985)
Backed out changeset 41e858fbf235 (bug 1613985)
Backed out changeset 847433cf1e0a (bug 1613985)
2020-03-16 12:41:41 +02:00
Simon Giesecke 2d961c08ab Bug 1613985 - Use default for equivalent-to-default constructors/destructors in widget. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D66012

--HG--
extra : moz-landing-system : lando
2020-03-16 09:14:12 +00:00
Martin Stransky ff552649ea Bug 1613364 [Wayland] Derive WaylandDMABufSurfaceRGBA from WaylandDMABufSurface, r=jhorak
We need WaylandDMABufSurface to hold both RGBA and YUV surfaces co create WaylandDMABufSurface as a base
class and derive WaylandDMABufSurfaceRGBA from it.

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

--HG--
extra : moz-landing-system : lando
2020-02-12 22:34:27 +00:00
Jan Horak 10ddd6b106 Bug 1609732 Ignore window position in the WindowSurfaceWayland::Lock; r=stransky
The window position of the popup can be changed which does not mean that the
screen size changed. Only window dimmensions are relevant there. Also as part of this
fix, don't use HideWaylandWindow when calling gdk_window_move_to_rect because it removes
the popup from gVisibleWaylandPopupWindows which breaks popup hierarchy sometimes.

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

--HG--
extra : moz-landing-system : lando
2020-01-21 15:46:23 +00:00
Martin Stransky fbf6218371 Bug 1599393 [Wayland] Use dmabuf for basic compositor under preference, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D54692

--HG--
extra : moz-landing-system : lando
2019-12-11 15:37:44 +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 d1e715dc78 Bug 1594688 [Wayland] Don't use mUseDMABuf directly, query UseDMABufBackend() instead as mUseDMABuf is initialized there, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D52142

--HG--
extra : moz-landing-system : lando
2019-11-07 12:15:44 +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 724a9d7e4f Bug 1583732 [Wayland] Use DMABUF for fullscreen updates only, r=jhorak
Add IsDMABufBuffer identification to WindowBackBuffer

Use two sets of wayland buffers (shm and dmabuf) and use dmabuf for fullscreen updates only
when dmabuf is enabled.

Split GetWaylandBufferToDraw() to GetWaylandBufferRecent() and GetWaylandBufferWithSwitch()
to better reflect actual function.

Add CreateWaylandBuffer() to create and store Wayland buffer and use it at SetNewWaylandBuffer()
to change an active wayland buffer or create a new one.

When CACHE_MISSING image cache is selected we draw directly to wayland buffer if it's available
and cache drawing when wayland buffer is missing only. That produces flickering when small buffer parts are
sent to compositor early and the buffer is blocked for further rendering.

This patch enables direct rendering of bigger screen parts only (like page scrolling) to eliminate small
buffer updates.

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

--HG--
extra : moz-landing-system : lando
2019-11-01 21:11:06 +00:00
Martin Stransky d45caa1d42 Bug 1588579 [Wayland] Use explicit names for surface release methods, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D49192

--HG--
extra : moz-landing-system : lando
2019-10-15 08:24:17 +00:00
Martin Stransky 878cb981d1 Bug 1582405 - [Wayland] Assert only when we want to commit attached buffer, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D46908

--HG--
extra : moz-landing-system : lando
2019-09-26 07:58:26 +00:00
Martin Stransky a33bdb4e60 Bug 1578380 - [Wayland] Use WaylandDMABufSurface as ref-counted and store GLContext, r=jhorak
Depends on D46841

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

--HG--
extra : moz-landing-system : lando
2019-09-24 11:30:16 +00:00
Oana Pop Rus a22fdc5e79 Backed out 8 changesets (bug 1578380) for causing build bustages in ContentClient.cpp on a CLOSED TREE
Backed out changeset 28c2e884d20a (bug 1578380)
Backed out changeset 373c4563e9fd (bug 1578380)
Backed out changeset 3fdbc241d63a (bug 1578380)
Backed out changeset 754865b2810f (bug 1578380)
Backed out changeset b80b7e186f02 (bug 1578380)
Backed out changeset 3a8abb5d7a43 (bug 1578380)
Backed out changeset 2b52c3d15b7b (bug 1578380)
Backed out changeset ca57727c3aad (bug 1578380)
2019-09-24 13:06:55 +03:00
Martin Stransky d9e67b0424 Bug 1578380 - [Wayland] Use WaylandDMABufSurface as ref-counted and store GLContext, r=jhorak
Depends on D46841

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

--HG--
extra : moz-landing-system : lando
2019-09-24 09:39:29 +00:00
Martin Stransky ae1cc485f3 Bug 1581748 - [Wayland] Fixed rendering of overlapping areas, r=jhorak
- Don't store whole buffer update information at mWholeWindowBufferDamage but use damage region instead.
- Check and remove overlapped images when they are stored at image cache.
- Remove CanDrawToWaylandBufferDirectly() as it's not very useful.

This commit depends on Bug 1580152 which needs to land first.

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

--HG--
extra : moz-landing-system : lando
2019-09-17 13:26:36 +00:00
Martin Stransky 4b928e7b91 Bug 1580152 - [Wayland] Fix rendering glitches on wayland , r=jhorak
- Recently we're missing some drawings as we disabled flushing cached images in frame callback. Let's enable it again and make sure we don't flush the drawings between Lock()/Commit() compositor calls which is controlled by mBufferCommitAllowed.

- When we draw directly to wl_buffer, flush all cached drawings we have or clear them if there's fullscreen update. It prevents potential rendering of cached images over unrelevant buffer content.

- Flush cached images when wl_buffer is detached by wayland compositor. It allows to paint delayed drawings and ensures they won't stay in the queue infinitely.

- Use mBufferPendingCommit to indicate that the WaylandBuffer contains updates from gecko which has not been submitted to wayland compositor yet. Allows delated commit handlers (frame callback, delayed commit and when wl_buffer is detached) to send WaylandBuffer content to wayland compositor.

- Record time of last finished commit to mLastCommitTime and throws warning when wayland compositor does not release wl_buffer in 200ms.

- Use wl_display_sync() to synchronize wl_display events. Wait for events from wl_display until all pending events are processed before we start drawing at WindowSurfaceWayland::Lock(). There may wl_buffer release event waiting which releases wl_buffer for rendering.

- Don't use XMost()/YMost() to get drawing area size.

- Remove mDisplayThreadMessageLoop as it's no longer used.

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

--HG--
extra : moz-landing-system : lando
2019-09-17 12:34:28 +00:00
Martin Stransky eee009c581 Bug 1579849 - [Wayland] Optimize cached rendering to wl_buffer for widget.wayland_cache_mode=1, r=jhorak
- When widget.wayland_cache_mode=1 use direct rendering to wl_buffer only when there isn't any
  cached rendering pending and we're updating one big piece of screen (video playback/scrolling etc..)

- Disable frame callback commits between WindowSurfaceWayland::Lock and WindowSurfaceWayland::Commit
  as the buffer can be updated by gecko compositor

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

--HG--
extra : moz-landing-system : lando
2019-09-11 15:32:48 +00:00
Martin Stransky 71d17fbe95 Bug 1579823 - [Wayland] remove __PRETTY_FUNCTION__ from wayland logs as it produces too long function names, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D45173

--HG--
extra : moz-landing-system : lando
2019-09-09 12:42:30 +00:00
Martin Stransky 6dbfafeb2f Bug 1579794 - [Wayland] Explicitly enable/disable direct rendering to wl_buffer, r=jhorak
Recently direct wl_buffer rendering is kept enabled until we have wl_buffer available which
produces rendering artifacts when screen damage rects overlaps.

Let's enable/disable it explicitly at every rendering cycle start to avoid
screen flickering.

Depends on D45166

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

--HG--
extra : moz-landing-system : lando
2019-09-09 13:04:26 +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 7a6c6dc9d7 Bug 1579794 - [Wayland] Copy pixel data for cached images, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D45165

--HG--
extra : moz-landing-system : lando
2019-09-10 08:09:57 +00:00
Martin Stransky 145616c1c1 Bug 1576904 [Wayland] Add WaylandDMABufSurface GL binding ability, r=jhorak
- Allow to create WaylandDMABufSurface with wl_buffer or EGLImage on top of it
- Disable dmabuf modifiers as they slow down the data upload
- Add ability to export/import WaylandDMABufSurface via. file descriptors

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

--HG--
extra : moz-landing-system : lando
2019-09-03 09:41:32 +00:00
Martin Stransky 7ec25f9853 Bug 1577024 - [Wayland] Enable experimental wayland backend modes by widget.wayland_cache_mode pref, r=jhorak
Image cache mode can be set by widget.wayland_cache_mode.

- widget.wayland_cache_mode = 0 (or missing):
  Cache and clip all drawings, default. It's slowest
  but also without any rendered artifacts.

- widget.wayland_cache_mode = 1:
  Cache drawing only when back buffer is missing. May produce
  some rendering artifacts and flickering when partial screen update
  is rendered.

- widget.wayland_cache_mode = 2:
  Don't cache anything, draw only when back buffer is available.
  Suitable for fullscreen content only like fullscreen video playback and
  may work well with dmabuf backend.

Differential Revision: https://phabricator.services.mozilla.com/D43681
2019-08-31 00:19:03 +03:00
Martin Stransky 89132239ea Bug 1574036 - [Wayland] Fix flickering during window resize, r=jhorak
Recently window resize on Wayland produces flickering/rendering artifacts because
window background is randomly cleared due to actual window size changes.
We recently query widget size and do clear/fullscreen update when the size changes.

To avoid that, get widget size once at WindowSurfaceWayland::Lock() and use it
until next WindowSurfaceWayland::Lock(). Also don't to switch wayland back buffers
until there's really fullscreen update from compositor.

This patch:

- Use mLockedScreenRect to store window size at WindowSurfaceWayland::Lock(). It's used
  to detect widget resize, when it happens throw away all cached painting and wait for
  full screen update.

- Use mBufferScreenRect to store size of wayland back buffer and pass it
  instead of actual widget size we used before this patch. This ensures all our
  drawing matches the buffer size.

- Rename aFullScreenUpdate to aCanSwitchBuffer at LockWaylandBuffer() to stress
  actual meaning - we can/can't switch back buffers for partial drawing and we need to
  wait until recent back buffer is released by compositor.

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

--HG--
extra : moz-landing-system : lando
2019-08-27 12:33:25 +00:00
Martin Stransky 6354d2287a Bug 1567434 - [Wayland] Don't use gtk_window_get_transient_for() to get parent toplevel window, r=jhorak
- gtk_window_get_transient_for() fails to return correct toplevel window as the toplevel window changes
when popup is moved in popup hierarchy. So store the toplevel given at nsWindow::Create() and
use it instead.

- Remove some redundat NS_WARNING() from wayland code
- Attach "moved-to-rect" signal handler to GdkWindow only once a update
  NativeMoveResizeWaylandPopupCallback() loging.
- Add more logging to Wayland popup related code.

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

--HG--
extra : moz-landing-system : lando
2019-08-05 10:37:21 +00:00
Brindusan Cristian c00617be71 Backed out 2 changesets (bug 1567434) for build bustages at nsWindow.cpp:3587:53. CLOSED TREE
Backed out changeset 10925a6df9b3 (bug 1567434)
Backed out changeset 1cd94e91245c (bug 1567434)
2019-08-05 12:23:04 +03:00
Martin Stransky 99f4b257a1 Bug 1567434 - [Wayland] Don't use gtk_window_get_transient_for() to get parent toplevel window, r=jhorak
- gtk_window_get_transient_for() fails to return correct toplevel window as the toplevel window changes
when popup is moved in popup hierarchy. So store the toplevel given at nsWindow::Create() and
use it instead.

- Remove some redundat NS_WARNING() from wayland code
- Attach "moved-to-rect" signal handler to GdkWindow only once a update
  NativeMoveResizeWaylandPopupCallback() loging.
- Add more logging to Wayland popup related code.

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

--HG--
extra : moz-landing-system : lando
2019-08-05 08:39:53 +00:00