queue flush when queue size is different from buffer size 39/119239/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 16 Mar 2017 06:12:31 +0000 (15:12 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Thu, 16 Mar 2017 06:14:47 +0000 (15:14 +0900)
Change-Id: I54f7d8f183f372367da6836e2bb02767eac319b8

src/wayland-tbm-client.c

index 3f36186..22cfeb0 100644 (file)
@@ -850,6 +850,7 @@ handle_tbm_queue_buffer_attached(void *data,
        struct wayland_tbm_surface_queue *queue_info =
                                (struct wayland_tbm_surface_queue *)data;
        struct wayland_tbm_buffer *buffer;
+       int width, height;
 
        WL_TBM_RETURN_IF_FAIL(wl_buffer != NULL);
 
@@ -871,6 +872,16 @@ handle_tbm_queue_buffer_attached(void *data,
 
        wl_list_insert(&queue_info->attach_bufs, &buffer->link);
 
+       width = tbm_surface_get_width(buffer->tbm_surface);
+       height = tbm_surface_get_height(buffer->tbm_surface);
+       if (queue_info->width != width || queue_info->height != height) {
+               if (queue_info->is_active) {
+                       queue_info->is_active = 0;
+
+                       _wayland_tbm_client_surface_queue_flush(queue_info);
+               }
+       }
+
 #ifdef DEBUG_TRACE
        WL_TBM_TRACE("pid:%d wl_buffer:%p tbm_surface:%p\n",
                        getpid(), buffer->wl_buffer, buffer->tbm_surface);