texture-cache: use scale factor to load sliced image

We need to use a GdkPixbufLoader instead of the straightforward
gdk_pixbuf_new_from_file(), since we want to load the image already
scaled if possible - e.g. if it's an SVG file.

https://bugzilla.gnome.org/show_bug.cgi?id=726907
This commit is contained in:
Cosimo Cecchi
2014-03-22 19:20:50 -07:00
parent b1e9873de5
commit 74d9b6c2bf
3 changed files with 46 additions and 9 deletions

View File

@ -21,7 +21,9 @@ const Animation = new Lang.Class({
this._isPlaying = false;
this._timeoutId = 0;
this._frame = 0;
this._animations = St.TextureCache.get_default().load_sliced_image (filename, width, height,
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
this._animations = St.TextureCache.get_default().load_sliced_image (filename, width, height, scaleFactor,
Lang.bind(this, this._animationsLoaded));
this.actor.set_child(this._animations);
},