summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/ecore_wl2_surface.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2018-01-25 17:01:23 -0600
committerDerek Foreman <derekf@osg.samsung.com>2018-01-26 15:53:59 -0600
commit1a5e307f7304ab998837fc2969a34811ccbec7c1 (patch)
tree701ed334d88c485ad789cd4a7fba975d43721d86 /src/lib/ecore_wl2/ecore_wl2_surface.c
parent7d81a16cdbb9a19748fad95cac54ac6022e607f0 (diff)
ecore_wl2: Add buffer_fit API and use it from surface code
This tries to resize the buffer's useable area to fit the specified size - this is possible if the stride of the buffer is larger than the current width.
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_surface.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_surface.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_surface.c b/src/lib/ecore_wl2/ecore_wl2_surface.c
index ae4e8099ae..bb0d87c4ae 100644
--- a/src/lib/ecore_wl2/ecore_wl2_surface.c
+++ b/src/lib/ecore_wl2/ecore_wl2_surface.c
@@ -38,14 +38,9 @@ _evas_dmabuf_surface_reconfigure(Ecore_Wl2_Surface *s, int w, int h, uint32_t fl
38 if ((!w) || (!h)) return; 38 if ((!w) || (!h)) return;
39 EINA_LIST_FOREACH_SAFE(s->buffers, l, tmp, b) 39 EINA_LIST_FOREACH_SAFE(s->buffers, l, tmp, b)
40 { 40 {
41 int stride = b->stride; 41 if (!force && ecore_wl2_buffer_fit(b, w, h))
42 continue;
42 43
43 /* If stride is a little bigger than width we still fit */
44 if (!force && (w >= b->w) && (w <= stride / 4) && (h == b->h))
45 {
46 b->w = w;
47 continue;
48 }
49 ecore_wl2_buffer_destroy(b); 44 ecore_wl2_buffer_destroy(b);
50 s->buffers = eina_list_remove_list(s->buffers, l); 45 s->buffers = eina_list_remove_list(s->buffers, l);
51 } 46 }