#include <widget_instance.h>
#include <tzplatform_config.h>
#include <wayland-extension/tizen-extension-client-protocol.h>
+#include <unistd.h>
namespace Dali
{
DALI_TYPE_REGISTRATION_END()
+struct wl_buffer* preBuffer;
+
static void OnBufferChanged( struct tizen_remote_surface *surface, uint32_t type, struct wl_buffer *buffer,
int32_t img_file_fd, uint32_t img_file_size, uint32_t time, struct wl_array *keys, void *data)
{
tbm_surface_h tbmSurface = static_cast< tbm_surface_h >( wl_buffer_get_user_data( buffer ) );
widgetView->UpdateImageSource( tbmSurface );
}
+
+ if( preBuffer != NULL && tizen_remote_surface_get_version( surface ) >= TIZEN_REMOTE_SURFACE_RELEASE_SINCE_VERSION )
+ {
+ tizen_remote_surface_release( surface, preBuffer );
+ }
+
+ preBuffer = buffer;
+
+ close( img_file_fd );
}
static void OnBufferUpdated( struct tizen_remote_surface* surface, wl_buffer* buffer, uint32_t time, void* data )
tbm_surface_h tbmSurface = static_cast< tbm_surface_h >( wl_buffer_get_user_data( buffer ) );
widgetView->UpdateImageSource( tbmSurface );
}
+
+ if( preBuffer != NULL && tizen_remote_surface_get_version( surface ) >= TIZEN_REMOTE_SURFACE_RELEASE_SINCE_VERSION )
+ {
+ tizen_remote_surface_release( surface, preBuffer );
+ }
+
+ preBuffer = buffer;
}
static void OnSurfaceMissing( struct tizen_remote_surface* surface, void* data )