Commit Graph

82 Commits

Author SHA1 Message Date
Isaac Freund 1477401acd screencopy: handle compositor not setting damage
Damage the full output if the compositor didn't submit damage but did
submit a buffer.
2020-12-06 17:11:46 +01:00
Simon Ser 4471a83ed0 screencopy: send failed when copying a DMA-BUF with a region
We don't support that yet.
2020-11-05 09:43:42 +01:00
Simon Ser 51fc7ddb29 screencopy: perform DMA-BUF copy on output commit 2020-11-05 09:43:42 +01:00
Simon Ser 2934a72920
screencopy: stop setting needs_frame flag
This is already done by wlr_output_schedule_frame (it calls
wlr_output_update_needs_frame).
2020-11-04 12:02:56 +01:00
Andri Yngvason 1d835f2035 screencopy: Use correct dmabuf to get y-inversion flag
Because wlr_renderer_blit_dmabuf() undoes y-inversion on the source
buffer, it is incorrect to pass the y-inversion flag of the source
buffer to the user.
2020-07-01 11:43:02 +02:00
Andri Yngvason cae533cad2 screencopy: Use correct constant for y-inversion 2020-06-13 15:39:49 +02:00
Andri Yngvason ea83957ecc screencopy: Implement copying into linux-dmabuf 2020-06-08 20:49:41 +02:00
Simon Ser 7516a98167 Gracefully handle inert wl_output resources
Closes: https://github.com/swaywm/wlroots/issues/2088
2020-03-29 20:57:28 +02:00
Simon Ser 5cde35923c Simplify globals implementation by removing destructors
Some globals are static and it doesn't make sense to destroy them before
the wl_display. For instance, wl_compositor should be created before the
display is started and shouldn't be destroyed.

For these globals, we can simplify the code by removing the destructor
and stop keeping track of wl_resources (these will be destroyed with the
wl_display by libwayland).
2019-11-25 09:01:46 -05:00
Simon Ser 16e5e9541b Add -Wmissing-prototypes
This requires functions without a prototype definition to be static.
This allows to detect dead code, export less symbols and put shared
functions in headers.
2019-11-20 02:05:03 +00:00
Andri Yngvason 61a6f2b928 screencopy: Implement damage reporting 2019-10-22 10:41:32 -04:00
Jason Francis 724b5e1b8d screencopy: send failed after output disconnect
This prevents screencopy applications from hanging because a failed
event never got sent when the output was disconnected or disabled after
the call to buffer().
2019-08-01 19:00:48 +03:00
Jason Francis ce3e413e83 screencopy: fix segfault on disabled output
Disconnecting or disabling an output between capture_output() and
ready() could cause either a NULL dereference or an incorrect
attach_render_locks count.
2019-08-01 19:00:48 +03:00
Simon Ser 6c659da98b output: introduce wlr_output_lock_attach_render
This allows screen shooters and screen grabbers to ensure rendering will be
used instead of direct scan-out.
2019-06-07 09:06:11 -04:00
Simon Ser 20690346c7 output: rename needs_commit to needs_frame
This new name makes more sense, since it is a request from the backend to get
a new frame. In the future a commit may not convey a new frame.
2019-04-23 14:34:30 -06:00
Simon Ser 31dcecbfa9 output: rename swap_buffers event to precommit
Also remove damage from the event data since it's no longer tied to commits.
2019-04-23 14:34:30 -06:00
Simon Ser 9a0f8a194c output: refactor backend API
This updates the backend part of the output API. This is mostly renaming:
make_current becomes attach_render and swap_buffers becomes commit.

This also fixes the RDP backend to support NULL damage.
2019-04-23 14:34:30 -06:00
Timidger 9af0c5338f
Standardize the wlr_box input paramaters
Fixes #1094
2018-12-21 13:56:10 -05:00
Ilia Bozhinov fb5691b6cc output: add wlr_output_preferred_read_format()
The read format is dependent on the output, so we first need to make it
current. This fixes a race condition in wlr-screencopy-v1 where a dmabuf
client would cause EGL_NO_SURFACE to be bound at the time when
screencopy needs to query for the preferred format, causing GL errors.
2018-11-24 10:54:25 +01:00
emersion 62d646f2b8
render/gles2: remove assumptions about supported formats
We were assuming GL_BGRA_EXT was always supported.

We now check that it's supported for rendering. We fail if it isn't because
this format is specified as "always supported" by the Wayland protocol.

We also check if it's supported for reading pixels. A new preferred_read_format
function returns the preferred format that can be used to read pixels. This is
used by the screencopy protocol.
2018-11-04 09:00:51 +01:00
emersion 928572c14d output: add wlr_output_set_hardware_cursors_enabled
And use it in screencopy.
2018-09-18 11:37:37 +02:00
Alexander Bakker 221d412824 Init the new destroy signals added by #1200 2018-08-27 18:21:36 +02:00
Alexander Bakker 20db29779e Add destroy signals to types that are destroyed by wl_display_destroy 2018-08-26 23:23:12 +02:00
emersion 935a3f2ebb screencopy: fix segfault when client supplies invalid buffer 2018-07-13 19:27:04 +01:00
Arvin Ignaci fad62a3e1c fix: handle 32 bit time_t (or smaller) 2018-07-09 14:45:19 +00:00
emersion dbb01cbcd0
screencopy: listen to buffer destroy 2018-06-30 22:18:04 +01:00
emersion 9aaa9ba477
screencopy: make frame resource inert after copy 2018-06-30 22:18:04 +01:00
emersion c421700f3d
screncopy: update protocol 2018-06-30 22:18:04 +01:00
emersion bf7560b7cd
screencopy: add capture_output_region support 2018-06-30 22:18:04 +01:00
emersion 2b9cbaddf3
screencopy: add support for frame flags 2018-06-30 22:18:03 +01:00
emersion bd8be19b79
screencopy: add presentation timestamp 2018-06-30 22:18:03 +01:00
emersion 73755ad348
screencopy-v1: add basic implementation 2018-06-30 22:17:59 +01:00