when not exist tbm surface backend function, return false 45/42845/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 8 Jun 2015 05:46:32 +0000 (14:46 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 3 Jul 2015 05:41:20 +0000 (14:41 +0900)
Change-Id: Ic4d986eb1063d3eb15c66c2d0d170f0268eb4fd4

src/tbm_surface_internal.c

index 8fb9cc4..061271d 100644 (file)
@@ -104,6 +104,9 @@ _tbm_surface_internal_query_size (tbm_surface_h surface)
     TBM_RETURN_VAL_IF_FAIL (surf->info.height > 0, 0);
     TBM_RETURN_VAL_IF_FAIL (surf->info.format > 0, 0);
 
+    if (!mgr->backend->surface_get_size)
+        return 0;
+
     size = mgr->backend->surface_get_size (surf, surf->info.width, surf->info.height, surf->info.format);
 
     return size;
@@ -124,6 +127,9 @@ _tbm_surface_internal_query_plane_data (tbm_surface_h surface, int plane_idx, ui
     TBM_RETURN_VAL_IF_FAIL (surf->info.height > 0, 0);
     TBM_RETURN_VAL_IF_FAIL (surf->info.format > 0, 0);
 
+    if (!mgr->backend->surface_get_plane_data)
+        return 0;
+
     ret = mgr->backend->surface_get_plane_data (surf, surf->info.width, surf->info.height, surf->info.format, plane_idx, size, offset, pitch);
     if (!ret)
         return 0;
@@ -146,6 +152,13 @@ tbm_surface_internal_query_supported_formats (uint32_t **formats, uint32_t *num)
     }
 
     mgr = g_surface_bufmgr;
+
+    if (!mgr->backend->surface_surpported_format)
+    {
+        _tbm_surface_mutex_unlock();
+        return 0;
+    }
+
     ret = mgr->backend->surface_supported_format (formats, num);
 
     _tbm_surface_mutex_unlock();