Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to overwrite BufferedContainer's TextureShader and inherit from its DrawNode #6395

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions osu.Framework/Graphics/Containers/BufferedContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ public bool RedrawOnScale
/// </summary>
private long updateVersion;

public IShader TextureShader { get; private set; }
public IShader TextureShader { get; protected set; }

private IShader blurShader;

private readonly BufferedContainerDrawNodeSharedData sharedData;
protected readonly BufferedContainerDrawNodeSharedData SharedData;

/// <summary>
/// Constructs an empty buffered container.
Expand All @@ -257,7 +257,7 @@ public BufferedContainer(RenderBufferFormat[] formats = null, bool pixelSnapping
{
UsingCachedFrameBuffer = cachedFrameBuffer;

sharedData = new BufferedContainerDrawNodeSharedData(formats, pixelSnapping, !cachedFrameBuffer);
SharedData = new BufferedContainerDrawNodeSharedData(formats, pixelSnapping, !cachedFrameBuffer);

AddLayout(screenSpaceSizeBacking);
}
Expand All @@ -269,7 +269,7 @@ private void load(ShaderManager shaders)
blurShader = shaders.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.BLUR);
}

protected override DrawNode CreateDrawNode() => new BufferedContainerDrawNode(this, sharedData);
protected override DrawNode CreateDrawNode() => new BufferedContainerDrawNode(this, SharedData);

public override bool UpdateSubTreeMasking()
{
Expand Down Expand Up @@ -350,7 +350,7 @@ public BlendingParameters DrawEffectBlending
/// Creates a view which can be added to a container to display the content of this <see cref="BufferedContainer{T}"/>.
/// </summary>
/// <returns>The view.</returns>
public BufferedContainerView<T> CreateView() => new BufferedContainerView<T>(this, sharedData);
public BufferedContainerView<T> CreateView() => new BufferedContainerView<T>(this, SharedData);

public DrawColourInfo? FrameBufferDrawColour => base.DrawColourInfo;

Expand All @@ -371,7 +371,7 @@ protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);

sharedData.Dispose();
SharedData.Dispose();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace osu.Framework.Graphics.Containers
{
public partial class BufferedContainer<T>
{
private class BufferedContainerDrawNode : BufferedDrawNode, ICompositeDrawNode
protected class BufferedContainerDrawNode : BufferedDrawNode, ICompositeDrawNode
{
protected new BufferedContainer<T> Source => (BufferedContainer<T>)base.Source;

Expand Down Expand Up @@ -149,7 +149,7 @@ private record struct BlurParameters
}
}

private class BufferedContainerDrawNodeSharedData : BufferedDrawNodeSharedData
protected class BufferedContainerDrawNodeSharedData : BufferedDrawNodeSharedData
{
public BufferedContainerDrawNodeSharedData(RenderBufferFormat[] mainBufferFormats, bool pixelSnapping, bool clipToRootNode)
: base(2, mainBufferFormats, pixelSnapping, clipToRootNode)
Expand Down
Loading