Bug 582248 - Async loading of pixbufs and icon caching
Add a ShellTextureCache class which loads (and can cache) pixmap->texture conversions. This fixes a problem with the async code in ClutterTexture that it was lower priority than animations, and also ensures we're really only loading these pixbufs once in the icon case.
This commit is contained in:
@ -128,16 +128,7 @@ DocDisplayItem.prototype = {
|
||||
if (this._docInfo.get_mime_type() == null || this._docInfo.get_mime_type().indexOf("image/") != 0)
|
||||
return null;
|
||||
|
||||
let largePreviewPixbuf = Shell.create_pixbuf_from_image_file(this._docInfo.get_uri(), availableWidth, availableHeight);
|
||||
|
||||
if (largePreviewPixbuf == null)
|
||||
return null;
|
||||
|
||||
let largePreviewIcon = new Clutter.Texture();
|
||||
|
||||
Shell.clutter_texture_set_from_pixbuf(largePreviewIcon, largePreviewPixbuf);
|
||||
|
||||
return largePreviewIcon;
|
||||
return Shell.TextureCache.load_uri_sync(this._docInfo.get_uri(), availableWidth, availableHeight);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user