pepper: Send frame callback done after finishing repaint
authorTaekyun Kim <tkq.kim@samsung.com>
Wed, 15 Jul 2015 10:47:22 +0000 (19:47 +0900)
committerTaekyun Kim <tkq.kim@samsung.com>
Thu, 16 Jul 2015 05:44:31 +0000 (14:44 +0900)
Change-Id: I9e0ce916c4e528b40f1fc20efaefe19f32939033

pepper/src/output.c
pepper/src/pepper-internal.h
pepper/src/surface.c

index 8fc1305..808c28c 100644 (file)
@@ -182,7 +182,12 @@ output_repaint(pepper_output_t *output)
     output->frame.pending = PEPPER_TRUE;
     output->frame.scheduled = PEPPER_FALSE;
 
-    /* TODO: Send frame done to the callback objects of this output. */
+    PEPPER_LIST_FOR_EACH(&output->view_list, l)
+    {
+        /* TODO: Output time stamp and presentation feedback. */
+        pepper_view_t *view = l->item;
+        pepper_surface_send_frame_callback_done(view->surface, 0);
+    }
 }
 
 static void
index d257308..fae6383 100644 (file)
@@ -160,6 +160,9 @@ pepper_surface_destroy(pepper_surface_t *surface);
 void
 pepper_surface_commit(pepper_surface_t *surface);
 
+void
+pepper_surface_send_frame_callback_done(pepper_surface_t *surface, uint32_t time);
+
 struct pepper_region
 {
     pepper_object_t         base;
index 7c0fe8c..d123133 100644 (file)
@@ -366,6 +366,7 @@ pepper_surface_commit(pepper_surface_t *surface)
         surface->buffer.y       += surface->pending.y;
 
         surface->pending.newly_attached = PEPPER_FALSE;
+        surface->pending.buffer = NULL;
 
         /* Attach to all outputs. */
         attach_surface_to_outputs(surface);
@@ -393,6 +394,18 @@ pepper_surface_commit(pepper_surface_t *surface)
     pepper_surface_schedule_repaint(surface);
 }
 
+void
+pepper_surface_send_frame_callback_done(pepper_surface_t *surface, uint32_t time)
+{
+    struct wl_resource *callback, *next;
+
+    wl_resource_for_each_safe(callback, next, &surface->frame_callbacks)
+    {
+        wl_callback_send_done(callback, time);
+        wl_resource_destroy(callback);
+    }
+}
+
 PEPPER_API const char *
 pepper_surface_get_role(pepper_surface_t *surface)
 {