st-shadow: Ceil size before comparing with texture

A fractional resource scale would mean we never use the fast path for
creating the shadow, because we'd cast the int to a float before
comparing, which would never match.

Instead compare the expected texture size with the source texture, to
actually potentially trigger the fast path.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
This commit is contained in:
Jonas Ådahl 2017-10-26 11:15:46 +02:00
parent 6bc3300e5a
commit 5d4a804c90

View File

@ -444,8 +444,8 @@ _st_create_shadow_pipeline_from_actor (StShadow *shadow_spec,
if (!clutter_actor_get_resource_scale (actor, &resource_scale)) if (!clutter_actor_get_resource_scale (actor, &resource_scale))
return NULL; return NULL;
width *= resource_scale; width = ceilf (width * resource_scale);
height *= resource_scale; height = ceilf (height * resource_scale);
image = clutter_actor_get_content (actor); image = clutter_actor_get_content (actor);
if (image && CLUTTER_IS_IMAGE (image)) if (image && CLUTTER_IS_IMAGE (image))