#include <inttypes.h>
#include <sys/xattr.h>
-#define COMPOSITOR_VERSION 3
+#define COMPOSITOR_VERSION 4
E_API int E_EVENT_WAYLAND_GLOBAL_ADD = -1;
#include "session-recovery-server-protocol.h"
EINA_LIST_FREE(state->damages, dmg)
eina_rectangle_free(dmg);
+ EINA_LIST_FREE(state->buffer_damages, dmg)
+ eina_rectangle_free(dmg);
+
if (state->opaque) eina_tiler_free(state->opaque);
state->opaque = NULL;
if ((!e_comp->nocomp) && (ec->frame))
{
/* FIXME: workaround for bad wayland egl driver which doesn't send damage request */
- if (!eina_list_count(state->damages))
+ if (!eina_list_count(state->damages) && !eina_list_count(state->buffer_damages))
{
if ((ec->comp_data->buffer_ref.buffer) &&
(ec->comp_data->buffer_ref.buffer->type == E_COMP_WL_BUFFER_TYPE_NATIVE))
}
else
{
+ Eina_List *damages = NULL;
+
+ if (eina_list_count(state->buffer_damages))
+ {
+ damages = eina_list_clone(state->buffer_damages);
+ state->buffer_damages = eina_list_free(state->buffer_damages);
+ }
+
EINA_LIST_FREE(state->damages, dmg)
{
- Eina_Rectangle temp = {0,};
if (ec->comp_data->sub.data &&
(ec->comp_data->scaler.buffer_viewport.surface.width != -1 ||
ec->comp_data->scaler.buffer_viewport.buffer.src_width != wl_fixed_from_int(-1)))
{
+ Eina_Rectangle temp = {0,};
/* change to the buffer cordinate if subsurface */
_e_comp_wl_surface_to_buffer_rect(ec, dmg, &temp);
- dmg = &temp;
+ *dmg = temp;
}
+ damages = eina_list_append(damages, dmg);
+ }
+ EINA_LIST_FREE(damages, dmg)
+ {
/* not creating damage for ec that shows a underlay video */
if (state->buffer_viewport.changed ||
!e_comp->wl_comp_data->available_hw_accel.underlay ||
!buffer || buffer->type != E_COMP_WL_BUFFER_TYPE_VIDEO)
e_comp_object_damage(ec->frame, dmg->x, dmg->y, dmg->w, dmg->h);
- if (dmg != &temp)
- eina_rectangle_free(dmg);
+ eina_rectangle_free(dmg);
}
}
}
ec->comp_data->pending.buffer_viewport.changed = 1;
}
+static void
+_e_comp_wl_surface_cb_damage_buffer(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t x, int32_t y, int32_t w, int32_t h)
+{
+ E_Client *ec;
+ Eina_Rectangle *dmg = NULL;
+
+ if (!(ec = wl_resource_get_user_data(resource))) return;
+ if (e_object_is_del(E_OBJECT(ec))) return;
+
+ if (!(dmg = eina_rectangle_new(x, y, w, h))) return;
+
+ ec->comp_data->pending.buffer_damages =
+ eina_list_append(ec->comp_data->pending.buffer_damages, dmg);
+}
+
static const struct wl_surface_interface _e_surface_interface =
{
_e_comp_wl_surface_cb_destroy,
_e_comp_wl_surface_cb_input_region_set,
_e_comp_wl_surface_cb_commit,
_e_comp_wl_surface_cb_buffer_transform_set,
- _e_comp_wl_surface_cb_buffer_scale_set
+ _e_comp_wl_surface_cb_buffer_scale_set,
+ _e_comp_wl_surface_cb_damage_buffer,
};
static void
E_Comp_Client_Data *cdata;
E_Comp_Wl_Subsurf_Data *sdata;
struct wl_resource *cb;
- Eina_List *l;
+ Eina_List *l, *ll;
Eina_Iterator *itr;
Eina_Rectangle *rect;
EINA_LIST_FOREACH(cdata->pending.damages, l, rect)
eina_list_move(&sdata->cached.damages, &cdata->pending.damages, rect);
+ EINA_LIST_FOREACH_SAFE(cdata->pending.buffer_damages, l, ll, rect)
+ eina_list_move(&sdata->cached.buffer_damages, &cdata->pending.buffer_damages, rect);
+
if (cdata->pending.new_attach)
{
sdata->cached.new_attach = EINA_TRUE;