mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 12:17:26 +08:00
Use LargeTextureStore for all online texture retrieval
Until now, many online textures were retrieved via the default texture store, which causes them to never be removed from GPU memory. It also has a performance overhead due to mipmap generation (which will be avoided via ppy/osu-framework#1885.
This commit is contained in:
parent
6c150c9ed7
commit
f149a66a4d
@ -108,7 +108,9 @@ namespace osu.Game
|
|||||||
|
|
||||||
dependencies.Cache(contextFactory = new DatabaseContextFactory(Host.Storage));
|
dependencies.Cache(contextFactory = new DatabaseContextFactory(Host.Storage));
|
||||||
|
|
||||||
dependencies.Cache(new LargeTextureStore(new TextureLoaderStore(new NamespacedResourceStore<byte[]>(Resources, @"Textures"))));
|
var largeStore = new LargeTextureStore(new TextureLoaderStore(new NamespacedResourceStore<byte[]>(Resources, @"Textures")));
|
||||||
|
largeStore.AddStore(new TextureLoaderStore(new OnlineStore()));
|
||||||
|
dependencies.Cache(largeStore);
|
||||||
|
|
||||||
dependencies.CacheAs(this);
|
dependencies.CacheAs(this);
|
||||||
dependencies.Cache(LocalConfig);
|
dependencies.Cache(LocalConfig);
|
||||||
|
@ -118,9 +118,9 @@ namespace osu.Game.Overlays.MedalSplash
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours, TextureStore textures)
|
private void load(OsuColour colours, TextureStore textures, LargeTextureStore largeTextures)
|
||||||
{
|
{
|
||||||
medalSprite.Texture = textures.Get(medal.ImageUrl);
|
medalSprite.Texture = largeTextures.Get(medal.ImageUrl);
|
||||||
medalGlow.Texture = textures.Get(@"MedalSplash/medal-glow");
|
medalGlow.Texture = textures.Get(@"MedalSplash/medal-glow");
|
||||||
description.Colour = colours.BlueLight;
|
description.Colour = colours.BlueLight;
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(TextureStore textures)
|
private void load(LargeTextureStore textures)
|
||||||
{
|
{
|
||||||
Child = new Sprite
|
Child = new Sprite
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,7 @@ namespace osu.Game.Overlays.Profile.Sections.Recent
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(TextureStore textures)
|
private void load(LargeTextureStore textures)
|
||||||
{
|
{
|
||||||
sprite.Texture = textures.Get(url);
|
sprite.Texture = textures.Get(url);
|
||||||
}
|
}
|
||||||
|
@ -368,7 +368,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(TextureStore textures)
|
private void load(LargeTextureStore textures)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(user.CoverUrl))
|
if (!string.IsNullOrEmpty(user.CoverUrl))
|
||||||
cover.Texture = textures.Get(user.CoverUrl);
|
cover.Texture = textures.Get(user.CoverUrl);
|
||||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Users
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(TextureStore textures)
|
private void load(LargeTextureStore textures)
|
||||||
{
|
{
|
||||||
if (textures == null)
|
if (textures == null)
|
||||||
throw new ArgumentNullException(nameof(textures));
|
throw new ArgumentNullException(nameof(textures));
|
||||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Users
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(TextureStore textures)
|
private void load(LargeTextureStore textures)
|
||||||
{
|
{
|
||||||
if (textures == null)
|
if (textures == null)
|
||||||
throw new ArgumentNullException(nameof(textures));
|
throw new ArgumentNullException(nameof(textures));
|
||||||
|
Loading…
Reference in New Issue
Block a user