diff --git a/clutter/clutter/clutter-blur-private.h b/clutter/clutter/clutter-blur-private.h index 111e9f6fc..7a47f737b 100644 --- a/clutter/clutter/clutter-blur-private.h +++ b/clutter/clutter/clutter-blur-private.h @@ -26,7 +26,7 @@ G_BEGIN_DECLS typedef struct _ClutterBlur ClutterBlur; ClutterBlur * clutter_blur_new (CoglTexture *texture, - float sigma); + float radius); void clutter_blur_apply (ClutterBlur *blur); diff --git a/clutter/clutter/clutter-blur.c b/clutter/clutter/clutter-blur.c index 2617e47c4..88dbc7809 100644 --- a/clutter/clutter/clutter-blur.c +++ b/clutter/clutter/clutter-blur.c @@ -342,7 +342,7 @@ clear_blur_pass (BlurPass *pass) */ ClutterBlur * clutter_blur_new (CoglTexture *texture, - float sigma) + float radius) { ClutterBlur *blur; unsigned int height; @@ -351,17 +351,19 @@ clutter_blur_new (CoglTexture *texture, BlurPass *vpass; g_return_val_if_fail (texture != NULL, NULL); - g_return_val_if_fail (sigma >= 0.0, NULL); + g_return_val_if_fail (radius >= 0.0, NULL); width = cogl_texture_get_width (texture); height = cogl_texture_get_height (texture); blur = g_new0 (ClutterBlur, 1); - blur->sigma = sigma; + blur->sigma = radius / 2.0; blur->source_texture = g_object_ref (texture); - blur->downscale_factor = calculate_downscale_factor (width, height, sigma); + blur->downscale_factor = calculate_downscale_factor (width, + height, + blur->sigma); - if (G_APPROX_VALUE (sigma, 0.0, FLT_EPSILON)) + if (G_APPROX_VALUE (blur->sigma, 0.0, FLT_EPSILON)) goto out; vpass = &blur->pass[VERTICAL]; diff --git a/clutter/clutter/clutter-paint-nodes.c b/clutter/clutter/clutter-paint-nodes.c index acbdfbef8..24b5f8bec 100644 --- a/clutter/clutter/clutter-paint-nodes.c +++ b/clutter/clutter/clutter-paint-nodes.c @@ -1492,7 +1492,7 @@ struct _ClutterBlurNode ClutterLayerNode parent_instance; ClutterBlur *blur; - unsigned int sigma; + unsigned int radius; }; G_DEFINE_TYPE (ClutterBlurNode, clutter_blur_node, CLUTTER_TYPE_LAYER_NODE) @@ -1539,7 +1539,7 @@ clutter_blur_node_init (ClutterBlurNode *blur_node) * clutter_blur_node_new: * @width width of the blur layer * @height: height of the blur layer - * @sigma: sigma value of the blur + * @radius: radius (in pixels) of the blur * * Creates a new #ClutterBlurNode. * @@ -1552,7 +1552,7 @@ clutter_blur_node_init (ClutterBlurNode *blur_node) ClutterPaintNode * clutter_blur_node_new (unsigned int width, unsigned int height, - float sigma) + float radius) { g_autoptr (CoglOffscreen) offscreen = NULL; g_autoptr (GError) error = NULL; @@ -1562,10 +1562,10 @@ clutter_blur_node_new (unsigned int width, CoglTexture *texture; ClutterBlur *blur; - g_return_val_if_fail (sigma >= 0.0, NULL); + g_return_val_if_fail (radius >= 0.0, NULL); blur_node = _clutter_paint_node_create (CLUTTER_TYPE_BLUR_NODE); - blur_node->sigma = sigma; + blur_node->radius = radius; context = clutter_backend_get_cogl_context (clutter_get_default_backend ()); texture = cogl_texture_2d_new_with_size (context, width, height); @@ -1580,7 +1580,7 @@ clutter_blur_node_new (unsigned int width, goto out; } - blur = clutter_blur_new (texture, sigma); + blur = clutter_blur_new (texture, radius); blur_node->blur = blur; if (!blur) diff --git a/clutter/clutter/clutter-paint-nodes.h b/clutter/clutter/clutter-paint-nodes.h index c63d85616..7e737f7c4 100644 --- a/clutter/clutter/clutter-paint-nodes.h +++ b/clutter/clutter/clutter-paint-nodes.h @@ -194,6 +194,6 @@ GType clutter_blur_node_get_type (void) G_GNUC_CONST; CLUTTER_EXPORT ClutterPaintNode * clutter_blur_node_new (unsigned int width, unsigned int height, - float sigma); + float radius); G_END_DECLS