Eina_Bool buffer_reuse;
Eina_Rectangle cursor_crop_dst;
+ Eina_Rectangle cursor_damage_rect;
int mouse_x;
int mouse_y;
dx, dy, dw, dh);
}
+static void
+_e_rdp_pixman_output_image_cusror_damage_area_get(E_Rdp_Output *output, Eina_Rectangle *rect)
+{
+ if (output->cursor_crop_dst.x == 0 && output->cursor_crop_dst.y == 0 &&
+ output->cursor_crop_dst.w == 0 && output->cursor_crop_dst.h == 0)
+ {
+ output->cursor_damage_rect.x = 0;
+ output->cursor_damage_rect.y = 0;
+ output->cursor_damage_rect.w = output->w;
+ output->cursor_damage_rect.h = output->h;
+ }
+ else
+ {
+ /* x axis */
+ if (output->cursor_crop_dst.x < rect->x)
+ {
+ output->cursor_damage_rect.x = output->cursor_crop_dst.x;
+ output->cursor_damage_rect.w = rect->x - output->cursor_crop_dst.x + rect->w;
+ }
+ else
+ {
+ output->cursor_damage_rect.x = rect->x;
+ output->cursor_damage_rect.w = output->cursor_crop_dst.x - rect->x + output->cursor_crop_dst.w;
+ }
+ if (output->cursor_damage_rect.x + output->cursor_damage_rect.w > output->w)
+ output->cursor_damage_rect.w = output->w - output->cursor_damage_rect.x;
+
+ /* y axis */
+ if (output->cursor_crop_dst.y < rect->y)
+ {
+ output->cursor_damage_rect.y = output->cursor_crop_dst.y;
+ output->cursor_damage_rect.h = rect->y - output->cursor_crop_dst.y + rect->h;
+ }
+ else
+ {
+ output->cursor_damage_rect.y = rect->y;
+ output->cursor_damage_rect.h = output->cursor_crop_dst.y - rect->y + output->cursor_crop_dst.h;
+ }
+ if (output->cursor_damage_rect.y + output->cursor_damage_rect.h > output->h)
+ output->cursor_damage_rect.h = output->h - output->cursor_damage_rect.y;
+ }
+}
+
static Eina_Bool
_e_rdp_pixman_output_image_composite_cursor(E_Rdp_Output *output, E_Hwc_Window *hwc_window, pixman_image_t *pix_surface, int pix_w, int pix_h, int primary_w, int primary_h)
{
output->mouse_x = hwc_window->current.info.dst_pos.x;
output->mouse_y = hwc_window->current.info.dst_pos.y;
+ _e_rdp_pixman_output_image_cusror_damage_area_get(output, &dst_crop);
output->cursor_crop_dst.x = dst_crop.x;
output->cursor_crop_dst.y = dst_crop.y;
output->cursor_crop_dst.w = dst_crop.w;
INF("pixman capture time: %.1f ms", (end_capture - start) * 1000);
#endif
- /* sends a full refresh */
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = output->w;
- box.y2 = output->h;
+ if (output->buffer_reuse)
+ {
+ box.x1 = output->cursor_damage_rect.x;
+ box.y1 = output->cursor_damage_rect.y;
+ box.x2 = output->cursor_damage_rect.x + output->cursor_damage_rect.w;
+ box.y2 = output->cursor_damage_rect.y + output->cursor_damage_rect.h;
+ }
+ else
+ {
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = output->w;
+ box.y2 = output->h;
+ }
+
pixman_region32_init_with_extents(&damage, &box);
wl_list_for_each_safe(rdp_peer, tmp, &output->peers, link)