1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 23:03:02 +08:00

Merge pull request #15488 from peppy/update-cached-buffered-container-usage

Update usages of `BufferedContainer` in line with framework changes
This commit is contained in:
Salman Ahmed 2021-11-06 11:09:42 +03:00 committed by GitHub
commit b85bdd6089
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 17 additions and 27 deletions

View File

@ -52,7 +52,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.1026.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2021.1026.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2021.1104.0" /> <PackageReference Include="ppy.osu.Framework.Android" Version="2021.1106.0" />
</ItemGroup> </ItemGroup>
<ItemGroup Label="Transitive Dependencies"> <ItemGroup Label="Transitive Dependencies">
<!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. --> <!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. -->

View File

@ -86,20 +86,18 @@ namespace osu.Game.Rulesets.Mania.Skinning.Default
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
InternalChild = foregroundBuffer = new BufferedContainer InternalChild = foregroundBuffer = new BufferedContainer(cachedFrameBuffer: true)
{ {
Blending = BlendingParameters.Additive, Blending = BlendingParameters.Additive,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
CacheDrawnFrameBuffer = true,
Children = new Drawable[] Children = new Drawable[]
{ {
new Box { RelativeSizeAxes = Axes.Both }, new Box { RelativeSizeAxes = Axes.Both },
subtractionBuffer = new BufferedContainer subtractionBuffer = new BufferedContainer(cachedFrameBuffer: true)
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
// This is needed because we're blending with another object // This is needed because we're blending with another object
BackgroundColour = Color4.White.Opacity(0), BackgroundColour = Color4.White.Opacity(0),
CacheDrawnFrameBuffer = true,
// The 'hole' is achieved by subtracting the result of this container with the parent // The 'hole' is achieved by subtracting the result of this container with the parent
Blending = new BlendingParameters { AlphaEquation = BlendingEquation.ReverseSubtract }, Blending = new BlendingParameters { AlphaEquation = BlendingEquation.ReverseSubtract },
Child = subtractionLayer = new CircularContainer Child = subtractionLayer = new CircularContainer

View File

@ -136,10 +136,9 @@ namespace osu.Game.Rulesets.Osu.Statistics
} }
} }
}, },
bufferedGrid = new BufferedContainer bufferedGrid = new BufferedContainer(cachedFrameBuffer: true)
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
CacheDrawnFrameBuffer = true,
BackgroundColour = Color4Extensions.FromHex("#202624").Opacity(0), BackgroundColour = Color4Extensions.FromHex("#202624").Opacity(0),
Child = pointGrid = new GridContainer Child = pointGrid = new GridContainer
{ {

View File

@ -58,10 +58,9 @@ namespace osu.Game.Graphics.Backgrounds
{ {
RemoveInternal(Sprite); RemoveInternal(Sprite);
AddInternal(bufferedContainer = new BufferedContainer AddInternal(bufferedContainer = new BufferedContainer(cachedFrameBuffer: true)
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
CacheDrawnFrameBuffer = true,
RedrawOnScale = false, RedrawOnScale = false,
Child = Sprite Child = Sprite
}); });

View File

@ -69,12 +69,11 @@ namespace osu.Game.Graphics.Sprites
Children = new Drawable[] Children = new Drawable[]
{ {
new BufferedContainer new BufferedContainer(cachedFrameBuffer: true)
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
BlurSigma = new Vector2(4), BlurSigma = new Vector2(4),
CacheDrawnFrameBuffer = true,
RedrawOnScale = false, RedrawOnScale = false,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Blending = BlendingParameters.Additive, Blending = BlendingParameters.Additive,

View File

@ -366,14 +366,13 @@ namespace osu.Game.Overlays
private readonly WorkingBeatmap beatmap; private readonly WorkingBeatmap beatmap;
public Background(WorkingBeatmap beatmap = null) public Background(WorkingBeatmap beatmap = null)
: base(cachedFrameBuffer: true)
{ {
this.beatmap = beatmap; this.beatmap = beatmap;
Depth = float.MaxValue; Depth = float.MaxValue;
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
CacheDrawnFrameBuffer = true;
Children = new Drawable[] Children = new Drawable[]
{ {
sprite = new Sprite sprite = new Sprite

View File

@ -393,6 +393,7 @@ namespace osu.Game.Screens.Menu
public class OutlineTriangle : BufferedContainer public class OutlineTriangle : BufferedContainer
{ {
public OutlineTriangle(bool outlineOnly, float size) public OutlineTriangle(bool outlineOnly, float size)
: base(cachedFrameBuffer: true)
{ {
Size = new Vector2(size); Size = new Vector2(size);
@ -414,7 +415,6 @@ namespace osu.Game.Screens.Menu
} }
Blending = BlendingParameters.Additive; Blending = BlendingParameters.Additive;
CacheDrawnFrameBuffer = true;
} }
} }
} }

View File

@ -32,9 +32,9 @@ namespace osu.Game.Screens.Play.Break
} }
public BlurredIcon() public BlurredIcon()
: base(cachedFrameBuffer: true)
{ {
RelativePositionAxes = Axes.X; RelativePositionAxes = Axes.X;
CacheDrawnFrameBuffer = true;
Child = icon = new SpriteIcon Child = icon = new SpriteIcon
{ {
Origin = Anchor.Centre, Origin = Anchor.Centre,

View File

@ -98,9 +98,8 @@ namespace osu.Game.Screens.Play
/// </summary> /// </summary>
protected virtual void RecreateGraph() protected virtual void RecreateGraph()
{ {
var newColumns = new BufferedContainer<Column> var newColumns = new BufferedContainer<Column>(cachedFrameBuffer: true)
{ {
CacheDrawnFrameBuffer = true,
RedrawOnScale = false, RedrawOnScale = false,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
}; };

View File

@ -51,13 +51,12 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
Font = OsuFont.Numeric.With(size: 76), Font = OsuFont.Numeric.With(size: 76),
UseFullGlyphHeight = false UseFullGlyphHeight = false
}, },
superFlash = new BufferedContainer superFlash = new BufferedContainer(cachedFrameBuffer: true)
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
BlurSigma = new Vector2(85), BlurSigma = new Vector2(85),
Size = new Vector2(600), Size = new Vector2(600),
CacheDrawnFrameBuffer = true,
Blending = BlendingParameters.Additive, Blending = BlendingParameters.Additive,
Alpha = 0, Alpha = 0,
Children = new[] Children = new[]
@ -71,14 +70,13 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
}, },
}, },
}, },
flash = new BufferedContainer flash = new BufferedContainer(cachedFrameBuffer: true)
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
BlurSigma = new Vector2(35), BlurSigma = new Vector2(35),
BypassAutoSizeAxes = Axes.Both, BypassAutoSizeAxes = Axes.Both,
Size = new Vector2(200), Size = new Vector2(200),
CacheDrawnFrameBuffer = true,
Blending = BlendingParameters.Additive, Blending = BlendingParameters.Additive,
Alpha = 0, Alpha = 0,
Scale = new Vector2(1.8f), Scale = new Vector2(1.8f),

View File

@ -27,9 +27,8 @@ namespace osu.Game.Screens.Select
{ {
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
InternalChild = new BufferedContainer InternalChild = new BufferedContainer(cachedFrameBuffer: true)
{ {
CacheDrawnFrameBuffer = true,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Children = new Drawable[] Children = new Drawable[]
{ {

View File

@ -15,8 +15,8 @@ namespace osu.Game.Screens.Select.Carousel
public class SetPanelBackground : BufferedContainer public class SetPanelBackground : BufferedContainer
{ {
public SetPanelBackground(WorkingBeatmap working) public SetPanelBackground(WorkingBeatmap working)
: base(cachedFrameBuffer: true)
{ {
CacheDrawnFrameBuffer = true;
RedrawOnScale = false; RedrawOnScale = false;
Children = new Drawable[] Children = new Drawable[]

View File

@ -36,7 +36,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Realm" Version="10.6.0" /> <PackageReference Include="Realm" Version="10.6.0" />
<PackageReference Include="ppy.osu.Framework" Version="2021.1104.0" /> <PackageReference Include="ppy.osu.Framework" Version="2021.1106.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.1026.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2021.1026.0" />
<PackageReference Include="Sentry" Version="3.10.0" /> <PackageReference Include="Sentry" Version="3.10.0" />
<PackageReference Include="SharpCompress" Version="0.30.0" /> <PackageReference Include="SharpCompress" Version="0.30.0" />

View File

@ -70,7 +70,7 @@
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
</ItemGroup> </ItemGroup>
<ItemGroup Label="Package References"> <ItemGroup Label="Package References">
<PackageReference Include="ppy.osu.Framework.iOS" Version="2021.1104.0" /> <PackageReference Include="ppy.osu.Framework.iOS" Version="2021.1106.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.1026.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2021.1026.0" />
</ItemGroup> </ItemGroup>
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net5.0 / net6.0) --> <!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net5.0 / net6.0) -->
@ -93,7 +93,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="ppy.osu.Framework" Version="2021.1104.0" /> <PackageReference Include="ppy.osu.Framework" Version="2021.1106.0" />
<PackageReference Include="SharpCompress" Version="0.30.0" /> <PackageReference Include="SharpCompress" Version="0.30.0" />
<PackageReference Include="NUnit" Version="3.13.2" /> <PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="SharpRaven" Version="2.4.0" /> <PackageReference Include="SharpRaven" Version="2.4.0" />