return 0;
}
+static bool __is_circle(void)
+{
+ static bool initialized = false;
+ static bool shape_circle = false;
+ int r;
+
+ if (initialized)
+ return shape_circle;
+
+ r = system_info_get_platform_bool(KEY_SCREEN_SHAPE_CIRCLE,
+ &shape_circle);
+ if (r != SYSTEM_INFO_ERROR_NONE) {
+ _E("Failed to get system info");
+ return false;
+ }
+
+ initialized = true;
+ return shape_circle;
+}
+
static float __get_opr(void *source_data, int width, int height)
{
int *source;
unsigned int pixel_sum;
float opr;
float max_opr;
- bool shape_circle = false;
-
- system_info_get_platform_bool(KEY_SCREEN_SHAPE_CIRCLE, &shape_circle);
+ bool shape_circle = __is_circle();
source = source_data;
pos = width / 2;