-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #322 from andy840119/upgrade-package-to-the-latest
Upgrade package to the latest.
- Loading branch information
Showing
25 changed files
with
366 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) karaoke.dev <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Framework.Testing; | ||
|
||
namespace osu.Framework.Font.Tests.Visual; | ||
|
||
/// <summary> | ||
/// All the test scene with resource should inherit this class. | ||
/// </summary> | ||
public abstract partial class FrameworkTestScene : TestScene | ||
{ | ||
/// <summary> | ||
/// This runner will be created only if run the unit-test. | ||
/// </summary> | ||
/// <returns></returns> | ||
protected override ITestSceneTestRunner CreateRunner() => new FrameworkTestSceneTestRunner(); | ||
} |
18 changes: 18 additions & 0 deletions
18
osu.Framework.Font.Tests/Visual/FrameworkTestSceneTestRunner.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) karaoke.dev <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Framework.Allocation; | ||
using osu.Framework.IO.Stores; | ||
using osu.Framework.Testing; | ||
|
||
namespace osu.Framework.Font.Tests.Visual; | ||
|
||
public partial class FrameworkTestSceneTestRunner : TestSceneTestRunner | ||
{ | ||
[BackgroundDependencyLoader] | ||
private void load() | ||
{ | ||
Resources.AddStore(new NamespacedResourceStore<byte[]>(new DllResourceStore(typeof(FrameworkTestSceneTestRunner).Assembly), "Resources")); | ||
Resources.AddStore(new NamespacedResourceStore<byte[]>(new ShaderResourceStore(), "Resources")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
// Copyright (c) karaoke.dev <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System.Runtime.InteropServices; | ||
using osu.Framework.Graphics.Rendering; | ||
using osu.Framework.Graphics.Shaders.Types; | ||
using osuTK; | ||
|
||
namespace osu.Framework.Graphics.Shaders; | ||
|
@@ -11,9 +14,21 @@ public class PixelShader : InternalShader, IHasTextureSize, IHasInflationPercent | |
|
||
public Vector2 Size { get; set; } = new(5); | ||
|
||
public override void ApplyValue() | ||
private IUniformBuffer<PixelParameters>? pixelParametersBuffer; | ||
|
||
public override void ApplyValue(IRenderer renderer) | ||
{ | ||
pixelParametersBuffer ??= renderer.CreateUniformBuffer<PixelParameters>(); | ||
|
||
pixelParametersBuffer.Data = new PixelParameters { Size = Size }; | ||
|
||
BindUniformBlock("m_PixelParameters", pixelParametersBuffer); | ||
} | ||
|
||
[StructLayout(LayoutKind.Sequential, Pack = 1)] | ||
private record struct PixelParameters | ||
{ | ||
var size = Size; | ||
GetUniform<Vector2>(@"g_Size").UpdateValue(ref size); | ||
public UniformVector2 Size; | ||
private readonly UniformPadding8 pad1; | ||
} | ||
} |
Oops, something went wrong.