[Tizen] Use environment variable for shadow scaling factor 73/314373/1 accepted/tizen/unified/20240712.160050 accepted/tizen/unified/dev/20240715.080533 accepted/tizen/unified/x/20240715.042527
authorsunghyun kim <scholb.kim@samsung.com>
Thu, 11 Jul 2024 02:15:06 +0000 (11:15 +0900)
committersunghyun kim <scholb.kim@samsung.com>
Thu, 11 Jul 2024 02:21:34 +0000 (11:21 +0900)
Change-Id: I8201ff134f9e34a118309ea2cf5bed3b3bbd20f5

src/cairo-image-surface.c

index bf8e262f7c7c1b3b94b30c389fc7387af29f0d10..7a79896c7f4849d750deb1f57a2ce8e7822718a0 100644 (file)
@@ -92,6 +92,7 @@ static unsigned long shadow_caches_size = 0;
 static cairo_recursive_mutex_t shadow_caches_mutex;
 static unsigned shadow_caches_mutex_depth = 0;
 static cairo_atomic_int_t shadow_caches_ref_count = 0;
+static float shadow_scaling_factor = 0.5f;
 
 static void
 _cairo_image_shadow_caches_init (void)
@@ -104,6 +105,16 @@ _cairo_image_shadow_caches_init (void)
     if (shadow_caches_ref_count == 1)
        cairo_list_init (&shadow_caches);
 
+    const char *env_value = getenv ("CUSTOM_SCALING_FACTOR");
+    if (env_value) {
+        float scaling_factor;
+        sscanf(env_value, "%f", &scaling_factor);
+        shadow_scaling_factor = scaling_factor;
+    }
+    else{
+        shadow_scaling_factor = 0.5f;
+    }
+
     CAIRO_MUTEX_UNLOCK (shadow_caches_mutex);
 }
 
@@ -1403,7 +1414,7 @@ _cairo_image_surface_shadow_surface (void *surface,
        else if (width > MAX_IMAGE_SHADOW_SIZE * 2)
            shadow_width = MAX_IMAGE_SHADOW_SIZE;
        else
-           shadow_width = width * 0.5;
+           shadow_width = width * shadow_scaling_factor;
     }
     else {
        if (width > MAX_IMAGE_SHADOW_SIZE)
@@ -1420,7 +1431,7 @@ _cairo_image_surface_shadow_surface (void *surface,
        else if (height > MAX_IMAGE_SHADOW_SIZE * 2)
            shadow_height = MAX_IMAGE_SHADOW_SIZE;
        else
-           shadow_height = height * 0.5;
+           shadow_height = height * shadow_scaling_factor;
     }
     else {
        if (height > MAX_IMAGE_SHADOW_SIZE)