Remove PostPromotion event

`PostPromotion` is removed, as `IFontHandle.ImFontChanged` now does the job. It also removes the possibility that resources may get disposed while post promotion callback is in progress.

* `IFontHandle.ImFontChanged` is now called with a locked instance of the font.
* `IFontHandle.ImFontLocked`: Added `NewRef` to increase reference count.
This commit is contained in:
Soreepeong 2024-01-23 23:00:47 +09:00
parent fb8beb9370
commit 871deca6e9
17 changed files with 138 additions and 269 deletions

View file

@ -113,21 +113,4 @@ public static class FontAtlasBuildToolkitUtilities
action.Invoke((IFontAtlasBuildToolkitPostBuild)toolkit);
return toolkit;
}
/// <summary>
/// Invokes <paramref name="action"/>
/// if <see cref="IFontAtlasBuildToolkit.BuildStep"/> of <paramref name="toolkit"/>
/// is <see cref="FontAtlasBuildStep.PostPromotion"/>.
/// </summary>
/// <param name="toolkit">The toolkit.</param>
/// <param name="action">The action.</param>
/// <returns>toolkit, for method chaining.</returns>
public static IFontAtlasBuildToolkit OnPostPromotion(
this IFontAtlasBuildToolkit toolkit,
Action<IFontAtlasBuildToolkitPostPromotion> action)
{
if (toolkit.BuildStep is FontAtlasBuildStep.PostPromotion)
action.Invoke((IFontAtlasBuildToolkitPostPromotion)toolkit);
return toolkit;
}
}