-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[metalperformanceshaders] Fix MPSImageLanczosScale base class change (#…
…3170) Sadly this creates a breaking change since the `ScaleTransform` property was re-introduced with an incorrect signature in the new base class `MPSImageScale` Unless someone has an idea how to avoid it (I don't see an option) then we'll have to document it in the 15.7 release notes. Also add missing _SetScaleTransform call and related unit tests
- Loading branch information
Showing
7 changed files
with
70 additions
and
19 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
56 changes: 56 additions & 0 deletions
56
tests/monotouch-test/MetalPerformanceShaders/ImageScaleTest.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,56 @@ | ||
#if !__WATCHOS__ | ||
|
||
using System; | ||
using Foundation; | ||
|
||
#if XAMCORE_2_0 | ||
using Metal; | ||
using MetalPerformanceShaders; | ||
#else | ||
using MonoTouch.Metal; | ||
using MonoTouch.MetalPerformanceShaders; | ||
#endif | ||
|
||
using NUnit.Framework; | ||
|
||
namespace MonoTouchFixtures.MetalPerformanceShaders { | ||
|
||
[TestFixture] | ||
public class ImageScaleTest { | ||
|
||
IMTLDevice device; | ||
|
||
[TestFixtureSetUp] | ||
public void Metal () | ||
{ | ||
TestRuntime.AssertXcodeVersion (9,0); | ||
|
||
device = MTLDevice.SystemDefault; | ||
// some older hardware won't have a default | ||
if (device == null) | ||
Assert.Inconclusive ("Metal is not supported"); | ||
} | ||
|
||
[Test] | ||
public void ScaleTransform () | ||
{ | ||
var st = new MPSScaleTransform () { | ||
ScaleX = 1, | ||
ScaleY = 2, | ||
TranslateX = 3, | ||
TranslateY = 4, | ||
}; | ||
using (var scale = new MPSImageScale (device)) { | ||
scale.ScaleTransform = st; | ||
// roundtrip with our (non generated) code | ||
var rt = scale.ScaleTransform.Value; | ||
Assert.That (rt.ScaleX, Is.EqualTo (st.ScaleX), "ScaleX"); | ||
Assert.That (rt.ScaleY, Is.EqualTo (st.ScaleY), "ScaleY"); | ||
Assert.That (rt.TranslateX, Is.EqualTo (st.TranslateX), "TranslateX"); | ||
Assert.That (rt.TranslateY, Is.EqualTo (st.TranslateY), "TranslateY"); | ||
} | ||
} | ||
} | ||
} | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.