bufmgr: get the clients's app_name when the process is the root.
[platform/core/uifw/libtbm.git] / src / tbm_surface_internal.c
index c32b881..2fc3d8c 100644 (file)
@@ -2563,4 +2563,56 @@ tbm_surface_internal_capture_shm_buffer(void *ptr, int w, int h, int stride,
 
        return 1;
 }
+
+int
+tbm_surface_internal_set_damage(tbm_surface_h surface, int x, int y, int width, int height)
+{
+       struct _tbm_surface *surf;
+
+       _tbm_surface_mutex_lock();
+       _tbm_set_last_result(TBM_ERROR_NONE);
+
+       TBM_SURFACE_RETURN_VAL_IF_FAIL(width > 0, 0);
+       TBM_SURFACE_RETURN_VAL_IF_FAIL(height > 0, 0);
+       TBM_SURFACE_RETURN_VAL_IF_FAIL(_tbm_surface_internal_is_valid(surface), 0);
+
+       surf = (struct _tbm_surface *)surface;
+
+       surf->damage.x = x;
+       surf->damage.y = y;
+       surf->damage.width = width;
+       surf->damage.height = height;
+
+       TBM_TRACE_SURFACE_INTERNAL("tbm_surface(%p) x(%d) y(%d) width(%d) height(%d)\n",
+                                                       surface, x, y, width, height);
+
+       _tbm_surface_mutex_unlock();
+
+       return 1;
+}
+
+int
+tbm_surface_internal_get_damage(tbm_surface_h surface, int *x, int *y, int *width, int *height)
+{
+       struct _tbm_surface *surf;
+
+       _tbm_surface_mutex_lock();
+       _tbm_set_last_result(TBM_ERROR_NONE);
+
+       TBM_SURFACE_RETURN_VAL_IF_FAIL(_tbm_surface_internal_is_valid(surface), 0);
+
+       surf = (struct _tbm_surface *)surface;
+
+       if (x) *x = surf->damage.x;
+       if (y) *y = surf->damage.y;
+       if (width) *width = surf->damage.width;
+       if (height) *height = surf->damage.height;
+
+       TBM_TRACE_SURFACE_INTERNAL("tbm_surface(%p) x(%d) y(%d) width(%d) height(%d)\n",
+                                                       surface, surf->damage.x, surf->damage.y, surf->damage.width, surf->damage.height);
+
+       _tbm_surface_mutex_unlock();
+
+       return 1;
+}
 /*LCOV_EXCL_STOP*/