wayland-egl-tizen: add new API to set pre_commit callback. 56/311456/2
authorJoonbum Ko <joonbum.ko@samsung.com>
Tue, 21 May 2024 10:05:50 +0000 (19:05 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Thu, 27 Jun 2024 06:36:30 +0000 (15:36 +0900)
commit3d06027ce9fc682db85dce9a7de170aa1ca968e7
tree0e4b4980089d9e3170dba7794112f8de54069bd6
parent291cc2896fb8c2624de95cff2cffe07195a3712c
wayland-egl-tizen: add new API to set pre_commit callback.

 Set pre-commit callback with data to wl_egl_window.
  The registered callback function will be called with the data
 immedately before the frame's wl_surface_commit.
  The callback registered before calling eglSwapBuffers will be called
 at the time the swap requested buffer is attached.

 * Important *
 - Since the callback may be called from a separate thread that performs
  wl_surface_commit, protection is required if there is a critical section
  inside the callback function.
 - To avoid poor performance or complicated lifecycle issues,
  it is recommended that the behavior inside the callback function be concise.
 - This API should be called from one thread.
 - If it is called multiple times in a frame, the previously registered ones
  are overwritten.

* Callback Options *
 - ONCE : The registered callback and data are stored in the buffer requested
         for swap when calling eglSwapBuffers and then initialized.
          The callback function is called only once when the buffer requested
         for swap is committed, and is not called after that.
 - CONTINUOUS : Once the callback and data are registered, the callback function
         is called continuously until it is released.
          To release the callback, simply pass NULL to func.

Change-Id: Ic08c6dd1aeafe88d4059760f6bbffbd9d0da8c05
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/wayland-egl-tizen/wayland-egl-tizen-priv.h
src/wayland-egl-tizen/wayland-egl-tizen.c
src/wayland-egl-tizen/wayland-egl-tizen.h