mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Add comments on caching (#1829)
This commit is contained in:
parent
a1b8ff9141
commit
5365dd14d8
2 changed files with 17 additions and 3 deletions
|
|
@ -20,6 +20,8 @@ public interface ISharedImmediateTexture
|
|||
/// <returns>An instance of <see cref="IDalamudTextureWrap"/> that is guaranteed to be available for the current
|
||||
/// frame being drawn.</returns>
|
||||
/// <remarks>
|
||||
/// <para>Do not cache the result of this function across draw calls for different frames.
|
||||
/// <see cref="ISharedImmediateTexture"/>s may be cached, but the performance benefit will be minimal.</para>
|
||||
/// <para>Calling outside the main thread will fail.</para>
|
||||
/// <para>This function does not throw.</para>
|
||||
/// <para><see cref="IDisposable.Dispose"/> will be ignored.</para>
|
||||
|
|
@ -35,6 +37,8 @@ public interface ISharedImmediateTexture
|
|||
/// <returns>An instance of <see cref="IDalamudTextureWrap"/> that is guaranteed to be available for the current
|
||||
/// frame being drawn.</returns>
|
||||
/// <remarks>
|
||||
/// <para>Do not cache the result of this function across draw calls for different frames.
|
||||
/// <see cref="ISharedImmediateTexture"/>s may be cached, but the performance benefit will be minimal.</para>
|
||||
/// <para>Calling outside the main thread will fail.</para>
|
||||
/// <para>This function does not throw.</para>
|
||||
/// <para><see cref="IDisposable.Dispose"/> will be ignored.</para>
|
||||
|
|
@ -50,6 +54,8 @@ public interface ISharedImmediateTexture
|
|||
/// <returns><c>true</c> if <paramref name="texture"/> points to the loaded texture; <c>false</c> if the texture is
|
||||
/// still being loaded, or the load has failed.</returns>
|
||||
/// <remarks>
|
||||
/// <para>Do not cache the result of this function across draw calls for different frames.
|
||||
/// <see cref="ISharedImmediateTexture"/>s may be cached, but the performance benefit will be minimal.</para>
|
||||
/// <para>Calling outside the main thread will fail.</para>
|
||||
/// <para>This function does not throw.</para>
|
||||
/// <para><see cref="IDisposable.Dispose"/> on the returned <paramref name="texture"/> will be ignored.</para>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
|
@ -189,6 +189,7 @@ public interface ITextureProvider
|
|||
/// <remarks>
|
||||
/// <para>This function is under the effect of <see cref="ITextureSubstitutionProvider.GetSubstitutedPath"/>.</para>
|
||||
/// <para>This function does not throw exceptions.</para>
|
||||
/// <para>Caching the returned object is not recommended. Performance benefit will be minimal.</para>
|
||||
/// </remarks>
|
||||
ISharedImmediateTexture GetFromGameIcon(in GameIconLookup lookup);
|
||||
|
||||
|
|
@ -198,20 +199,27 @@ public interface ITextureProvider
|
|||
/// <remarks>
|
||||
/// <para>This function is under the effect of <see cref="ITextureSubstitutionProvider.GetSubstitutedPath"/>.</para>
|
||||
/// <para>This function does not throw exceptions.</para>
|
||||
/// <para>Caching the returned object is not recommended. Performance benefit will be minimal.</para>
|
||||
/// </remarks>
|
||||
ISharedImmediateTexture GetFromGame(string path);
|
||||
|
||||
/// <summary>Gets a shared texture corresponding to the given file on the filesystem.</summary>
|
||||
/// <param name="path">A path to a file on the filesystem.</param>
|
||||
/// <returns>The shared texture that you may use to obtain the loaded texture wrap and load states.</returns>
|
||||
/// <remarks><para>This function does not throw exceptions.</para></remarks>
|
||||
/// <remarks>
|
||||
/// <para>This function does not throw exceptions.</para>
|
||||
/// <para>Caching the returned object is not recommended. Performance benefit will be minimal.</para>
|
||||
/// </remarks>
|
||||
ISharedImmediateTexture GetFromFile(string path);
|
||||
|
||||
/// <summary>Gets a shared texture corresponding to the given file of the assembly manifest resources.</summary>
|
||||
/// <param name="assembly">The assembly containing manifest resources.</param>
|
||||
/// <param name="name">The case-sensitive name of the manifest resource being requested.</param>
|
||||
/// <returns>The shared texture that you may use to obtain the loaded texture wrap and load states.</returns>
|
||||
/// <remarks><para>This function does not throw exceptions.</para></remarks>
|
||||
/// <remarks>
|
||||
/// <para>This function does not throw exceptions.</para>
|
||||
/// <para>Caching the returned object is not recommended. Performance benefit will be minimal.</para>
|
||||
/// </remarks>
|
||||
ISharedImmediateTexture GetFromManifestResource(Assembly assembly, string name);
|
||||
|
||||
/// <summary>Get a path for a specific icon's .tex file.</summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue