-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wpe_fdo_egl_exported_image: add destroy-notify callback support. #45
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,14 @@ | |
|
||
extern "C" { | ||
|
||
__attribute__((visibility("default"))) | ||
void | ||
wpe_fdo_egl_exported_image_set_destroy_notify(struct wpe_fdo_egl_exported_image* image, wpe_fdo_egl_exported_image_destroy_notify_t destroyNotify, void* destroyData) | ||
{ | ||
image->destroyNotify = destroyNotify; | ||
image->destroyData = destroyData; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't it make sense that if a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that makes sense. I'll update it to do that. |
||
} | ||
|
||
__attribute__((visibility("default"))) | ||
uint32_t | ||
wpe_fdo_egl_exported_image_get_width(struct wpe_fdo_egl_exported_image* image) | ||
|
@@ -56,6 +64,9 @@ wpe_fdo_egl_exported_image_get_egl_image(struct wpe_fdo_egl_exported_image* imag | |
void | ||
wpe_fdo_egl_exported_image_destroy(struct wpe_fdo_egl_exported_image* image) | ||
{ | ||
if (image->destroyNotify) | ||
image->destroyNotify(image->destroyData, image); | ||
|
||
assert(image->eglImage); | ||
WS::Instance::singleton().destroyImage(image->eglImage); | ||
wl_list_remove(&image->bufferDestroyListener.link); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could use an API documentation comment. If we the missing ones little by little with each PR we would incrementally tackle #27 — I wouldn't block merging this PR due to this, though 😉