[gnome-shell] st-texture-cache: Load sliced contents with REQUEST_CONTENTENT_SIZE
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] st-texture-cache: Load sliced contents with REQUEST_CONTENTENT_SIZE
- Date: Fri, 1 Mar 2019 18:07:50 +0000 (UTC)
commit 2c17c186b8cd14592bb05e2ce4e4013ffbc63995
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date: Wed Feb 27 03:31:19 2019 +0100
st-texture-cache: Load sliced contents with REQUEST_CONTENTENT_SIZE
When loading an actor for a sliced image actor, we can now use the
REQUEST_CONTENT_SIZE request-mode for the actor since we the content image
has now a predictable size and thus we can be sure that the size will be applied
taking care of the resource scale.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
src/st/st-texture-cache.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index b84f3ffdc..90b85d0bd 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -1014,13 +1014,12 @@ load_from_pixbuf (GdkPixbuf *pixbuf,
{
g_autoptr(ClutterContent) image = NULL;
ClutterActor *actor;
- int width = gdk_pixbuf_get_width (pixbuf);
- int height = gdk_pixbuf_get_height (pixbuf);
image = pixbuf_to_st_content_image (pixbuf, -1, -1, paint_scale, resource_scale);
- actor = clutter_actor_new ();
- clutter_actor_set_size (actor, width, height);
+ actor = g_object_new (CLUTTER_TYPE_ACTOR,
+ "request-mode", CLUTTER_REQUEST_CONTENT_SIZE,
+ NULL);
clutter_actor_set_content (actor, image);
return actor;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]