e_comp_hwc: do not create backup_buffer if it exists 47/68147/1
authorSooChan Lim <sc1.lim@samsung.com>
Mon, 2 May 2016 12:52:52 +0000 (21:52 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 2 May 2016 12:56:34 +0000 (21:56 +0900)
The backup_buffer is only destroyed when the ec
which contains the backup_buffer commits the wl_buffer.
Until that, hwc_client keep the backup_buffer.

Change-Id: I319c96e30217aeee7e3c30ec5e2f0c9e732e2824

src/bin/e_comp_hwc.c

index d1f16f0e559192f03f476e8139d56067449d632d..7eeb32ea959d737bdde7442ee1f4f4c3a08683ba 100755 (executable)
@@ -774,34 +774,38 @@ _e_comp_hwc_renderer_deactivate(E_Comp_Hwc_Renderer *hwc_renderer)
    /* deactive */
    wayland_tbm_server_client_queue_deactivate(cqueue);
 
-   if (hwc_client->backup_buffer)
+   if (!hwc_client->backup_buffer)
      {
 #ifdef USE_DLOG_HWC
-        HWC_DLOG("hwc_client,%p The previous backup_buffer exists. destroy it.\n");
+        HWC_DLOG("hwc_client,%p create the backup_buffer.\n");
 #endif
-        _e_comp_hwc_client_destroy_backup_buffer(hwc_client->backup_buffer);
-     }
+        /* get the tsurface for setting the native surface with it
+          compositing is processed not calling e_comp_update_cb*/
+        hwc_client->buffer = e_pixmap_resource_get(ec->pixmap);
+        hwc_client->backup_buffer = _e_comp_hwc_client_create_backup_buffer(hwc_client);
+        hwc_client->activated = EINA_FALSE;
+        hwc_client->wait_for_commit = EINA_TRUE;
 
-   /* get the tsurface for setting the native surface with it
-      compositing is processed not calling e_comp_update_cb*/
-   hwc_client->buffer = e_pixmap_resource_get(ec->pixmap);
-   hwc_client->backup_buffer = _e_comp_hwc_client_create_backup_buffer(hwc_client);
-   hwc_client->activated = EINA_FALSE;
-   hwc_client->wait_for_commit = EINA_TRUE;
+        /* set the backup buffer resource to the pixmap */
+        e_pixmap_resource_set(ec->pixmap, hwc_client->backup_buffer);
 
-   /* set the backup buffer resource to the pixmap */
-   e_pixmap_resource_set(ec->pixmap, hwc_client->backup_buffer);
+        e_comp->nocomp = 0;
+        e_comp->nocomp_ec = NULL;
 
-   e_comp->nocomp = 0;
-   e_comp->nocomp_ec = NULL;
+        /* force update */
+        e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
+        e_comp_object_dirty(ec->frame);
+        e_comp_object_render(ec->frame);
 
-   /* force update */
-   e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
-   e_comp_object_dirty(ec->frame);
-   e_comp_object_render(ec->frame);
-
-   /* set the native surface with tbm type for compositing */
-   e_comp_object_native_surface_set(ec->frame, EINA_TRUE);
+        /* set the native surface with tbm type for compositing */
+        e_comp_object_native_surface_set(ec->frame, EINA_TRUE);
+     }
+   else
+     {
+#ifdef USE_DLOG_HWC
+        HWC_DLOG("hwc_client,%p dose not commit wl_buffer after the previous deactive.\n");
+#endif
+     }
 
 #ifdef USE_DLOG_HWC
    HWC_DLOG("hwc_client,%p deactivated\n", hwc_client);