#include <unistd.h>
#include "watch_control.h"
#include <aul.h>
-#include <efl_util.h>
#include <Elementary.h>
#include <system_info.h>
API int watch_manager_get_opr(float *opr)
{
Evas_Object *image;
- efl_util_screenshot_h screenshot;
tbm_surface_h surface;
tbm_surface_info_s info = { 0, };
+ Evas_Native_Surface *ns;
void *source_data;
int width = 0;
int height = 0;
evas_object_geometry_get(image, NULL, NULL, &width, &height);
_D("width(%d), height(%d)", width, height);
- screenshot = efl_util_screenshot_initialize(width, height);
- if (screenshot == NULL) {
- _E("Failed to initialize efl util screenshot - %d",
- get_last_result());
+ ns = evas_object_image_native_surface_get(image);
+ if (ns == NULL) {
+ _E("Failed to get evas native surface");
return -1;
}
- surface = efl_util_screenshot_take_tbm_surface(screenshot);
+ surface = (tbm_surface_h)ns->data.tbm.buffer;
if (surface == NULL) {
- _E("Failed to take tbm surface - %d", get_last_result());
- efl_util_screenshot_deinitialize(screenshot);
+ _E("tbm surface is NULL");
return -1;
}
ret = tbm_surface_map(surface, TBM_SURF_OPTION_READ, &info);
if (ret != TBM_SURFACE_ERROR_NONE) {
_E("Failed to map tbm surface - %d", ret);
- tbm_surface_destroy(surface);
- efl_util_screenshot_deinitialize(screenshot);
return -1;
}
if (source_data == NULL) {
_E("Failed to get source");
tbm_surface_unmap(surface);
- tbm_surface_destroy(surface);
- efl_util_screenshot_deinitialize(screenshot);
return -1;
}
*opr = __get_opr(source_data, width, height);
_D("On Pixel Ratio(%f)", *opr);
-
tbm_surface_unmap(surface);
- tbm_surface_destroy(surface);
- efl_util_screenshot_deinitialize(screenshot);
return 0;
}