Skip to content

Commit

Permalink
Remove unnecessary boxing allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Aug 15, 2024
1 parent 7bb0e9e commit 2bdd96a
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 2bdd96a

Please sign in to comment.