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:
Colin Walters
2009-05-13 14:06:24 -04:00
parent 10afe46195
commit d024dbd779
9 changed files with 702 additions and 231 deletions

View File

@ -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);
}
};