From 2bdd96a1d88283987fe557936f6d133c718bd205 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Thu, 15 Aug 2024 21:53:53 +0900 Subject: [PATCH] Remove unnecessary boxing allocation --- osu.Framework/Graphics/BufferedDrawNode.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Framework/Graphics/BufferedDrawNode.cs b/osu.Framework/Graphics/BufferedDrawNode.cs index 7e9da554db..f250b96411 100644 --- a/osu.Framework/Graphics/BufferedDrawNode.cs +++ b/osu.Framework/Graphics/BufferedDrawNode.cs @@ -143,7 +143,7 @@ protected virtual void DrawContents(IRenderer renderer) /// /// The to bind. /// A token that must be disposed upon finishing use of . - protected IDisposable BindFrameBuffer(IFrameBuffer frameBuffer) + protected ValueInvokeOnDisposal BindFrameBuffer(IFrameBuffer frameBuffer) { // This setter will also take care of allocating a texture of appropriate size within the frame buffer. frameBuffer.Size = frameBufferSize; @@ -153,7 +153,7 @@ protected IDisposable BindFrameBuffer(IFrameBuffer frameBuffer) return new ValueInvokeOnDisposal(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