Skip to content

Commit

Permalink
Merge pull request #6360 from smoogipoo/remove-boxing
Browse files Browse the repository at this point in the history
Remove unnecessary boxing allocation
  • Loading branch information
bdach authored Aug 19, 2024
2 parents 7bb0e9e + 2bdd96a commit 69fcbfe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions osu.Framework/Graphics/BufferedDrawNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ protected virtual void DrawContents(IRenderer renderer)
/// </summary>
/// <param name="frameBuffer">The <see cref="IFrameBuffer"/> to bind.</param>
/// <returns>A token that must be disposed upon finishing use of <paramref name="frameBuffer"/>.</returns>
protected IDisposable BindFrameBuffer(IFrameBuffer frameBuffer)
protected ValueInvokeOnDisposal<IFrameBuffer> BindFrameBuffer(IFrameBuffer frameBuffer)
{
// This setter will also take care of allocating a texture of appropriate size within the frame buffer.
frameBuffer.Size = frameBufferSize;
Expand All @@ -153,7 +153,7 @@ protected IDisposable BindFrameBuffer(IFrameBuffer frameBuffer)
return new ValueInvokeOnDisposal<IFrameBuffer>(frameBuffer, static b => b.Unbind());
}

private IDisposable establishFrameBufferViewport(IRenderer renderer)
private ValueInvokeOnDisposal<(BufferedDrawNode node, IRenderer renderer)> establishFrameBufferViewport(IRenderer renderer)
{
// Disable masking for generating the frame buffer since masking will be re-applied
// when actually drawing later on anyways. This allows more information to be captured
Expand Down

0 comments on commit 69fcbfe

Please sign in to comment.