if ((int)age != ob->prev_age) swap_mode = MODE_FULL;
ob->prev_age = age;
-
+
return swap_mode;
}
- if (ob->swap_mode == MODE_AUTO) return MODE_FULL;
return ob->swap_mode;
}
}
}
-static void
-_damage_rect_set(Outbuf *ob, int x, int y, int w, int h)
+void
+eng_outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage)
{
- int rects[4];
-
- if ((x == 0) && (y == 0) &&
- (((w == ob->gl_context->w) && (h == ob->gl_context->h)) ||
- ((h == ob->gl_context->w) && (w == ob->gl_context->h))))
- return;
+ if (glsym_eglSetDamageRegionKHR)
+ {
+ Tilebuf_Rect *tr;
+ int *rect, *rects, count;
- _convert_glcoords(rects, ob, x, y, w, h);
- glsym_eglSetDamageRegionKHR(ob->egl_disp, ob->egl_surface[0], rects, 1);
+ count = eina_inlist_count(EINA_INLIST_GET(damage));
+ rects = alloca(sizeof(int) * 4 * count);
+ rect = rects;
+ EINA_INLIST_FOREACH(damage, tr)
+ {
+ _convert_glcoords(rect, ob, tr->x, tr->y, tr->w, tr->h);
+ rect += 4;
+ }
+ glsym_eglSetDamageRegionKHR(ob->egl_disp, ob->egl_surface[0], rects, count);
+ }
}
void *
ob->gl_context->master_clip.y = y;
ob->gl_context->master_clip.w = w;
ob->gl_context->master_clip.h = h;
-
- if (glsym_eglSetDamageRegionKHR)
- _damage_rect_set(ob, x, y, w, h);
}
return ob->gl_context->def_surface;