From dfb03d2ec594e6879833b8e4a166c6d84da1e8e4 Mon Sep 17 00:00:00 2001 From: Yoshi Askharoun Date: Sun, 11 Jul 2021 23:07:04 -0500 Subject: [PATCH] Simplified usages --- UIX.RenderApi.Skia/Map.cs | 24 +-- UIX.RenderApi.Skia/Map`2.cs | 6 +- .../Microsoft/Iris/Input/Cursor.cs | 36 ++-- .../Iris/Libraries/OS/RegistryKey.cs | 18 +- .../Microsoft/Iris/Library/InvariantString.cs | 40 ++--- .../Animation/AnimationInputProvider.cs | 6 +- .../Iris/Render/Animation/AnimationSystem.cs | 14 +- .../Iris/Render/Animation/AnimationTarget.cs | 8 +- .../Animation/ExternalAnimationInput.cs | 12 +- .../Render/Animation/KeyframeAnimation.cs | 74 ++++---- .../Render/Animation/ObjectAnimationInput.cs | 4 +- .../Microsoft/Iris/Render/AnimationEvent.cs | 6 +- .../Microsoft/Iris/Render/AnimationInput.cs | 4 +- .../Iris/Render/AnimationKeyframe.cs | 2 +- .../Iris/Render/AnimationTypeMask.cs | 50 +++--- .../Microsoft/Iris/Render/AxisAngle.cs | 2 +- .../Microsoft/Iris/Render/BlendElement.cs | 4 +- .../Iris/Render/BrightnessElement.cs | 6 +- .../Iris/Render/CapturedAnimationInput.cs | 4 +- .../Microsoft/Iris/Render/ColorElement.cs | 10 +- .../Microsoft/Iris/Render/ColorF.cs | 84 ++++----- .../Iris/Render/Common/ByteBuilder.cs | 22 +-- .../Microsoft/Iris/Render/Common/Debug2.cs | 84 ++++----- .../Iris/Render/Common/DeferredInvokeItem.cs | 4 +- .../Iris/Render/Common/ObjectCache.cs | 20 +-- .../Iris/Render/Common/ObjectCacheManager.cs | 2 +- .../Iris/Render/Common/RenderObject.cs | 2 +- .../Iris/Render/Common/ResourceTracker.cs | 2 +- .../Iris/Render/Common/SharedRenderObject.cs | 2 +- .../Iris/Render/Common/SharedResource.cs | 2 +- .../Iris/Render/Common/SharedResourceArray.cs | 8 +- .../Iris/Render/Common/SmartMap`1.cs | 12 +- .../Iris/Render/ComplexImageElement.cs | 12 +- .../Iris/Render/ConstantAnimationInput.cs | 32 ++-- .../Iris/Render/ContinuousAnimationInput.cs | 4 +- .../Microsoft/Iris/Render/ContrastElement.cs | 6 +- .../Microsoft/Iris/Render/CoordMap.cs | 12 +- .../Iris/Render/DesaturateElement.cs | 6 +- .../Iris/Render/DestinationElement.cs | 8 +- .../Microsoft/Iris/Render/DisplayMode.cs | 4 +- .../Iris/Render/EaseInInterpolation.cs | 4 +- .../Iris/Render/EaseOutInterpolation.cs | 4 +- .../Iris/Render/EdgeDetectionElement.cs | 4 +- .../Microsoft/Iris/Render/EffectElement.cs | 44 ++--- .../Microsoft/Iris/Render/EffectInput.cs | 2 +- .../Microsoft/Iris/Render/EffectLayer.cs | 12 +- .../Microsoft/Iris/Render/EffectOperation.cs | 2 +- .../Microsoft/Iris/Render/EmbossElement.cs | 6 +- .../Iris/Render/ExponentialInterpolation.cs | 2 +- .../Render/Extensions/CoordMapGenerator.cs | 8 +- .../Iris/Render/Extensions/DataTracker.cs | 4 +- .../Extensions/DebugCategoryEnabledSet.cs | 20 +-- .../Iris/Render/Extensions/DebugDefault.cs | 34 ++-- .../Iris/Render/Extensions/ImageCache.cs | 38 ++-- .../Iris/Render/Extensions/ImageCacheItem.cs | 28 +-- .../Iris/Render/Extensions/ImageCacheKey.cs | 2 +- .../Iris/Render/Extensions/ImageLoader.cs | 60 +++---- .../Render/Extensions/ImageRequirements.cs | 20 +-- .../Iris/Render/Extensions/ModuleManager.cs | 14 +- .../Render/Extensions/RegistryListener.cs | 6 +- .../Iris/Render/Extensions/SoundData.cs | 16 +- .../Iris/Render/Extensions/SoundLoader.cs | 2 +- .../Iris/Render/Extensions/eDebug.cs | 90 +++++----- .../Microsoft/Iris/Render/FormStyleInfo.cs | 2 +- .../Iris/Render/GaussianBlurElement.cs | 6 +- .../Render/Graphics/AncestorEnumerator.cs | 8 +- .../Microsoft/Iris/Render/Graphics/Camera.cs | 18 +- .../Iris/Render/Graphics/Dx9BlendElement.cs | 38 ++-- .../Render/Graphics/Dx9BrightnessElement.cs | 6 +- .../Iris/Render/Graphics/Dx9ColorElement.cs | 6 +- .../Render/Graphics/Dx9ComplexImageElement.cs | 36 ++-- .../Render/Graphics/Dx9ContrastElement.cs | 6 +- .../Render/Graphics/Dx9DesaturateElement.cs | 6 +- .../Render/Graphics/Dx9DestinationElement.cs | 26 +-- .../Graphics/Dx9EdgeDetectionElement.cs | 8 +- .../Iris/Render/Graphics/Dx9Effect.cs | 4 +- .../Iris/Render/Graphics/Dx9EffectBuilder.cs | 44 ++--- .../Iris/Render/Graphics/Dx9EffectManager.cs | 22 +-- .../Iris/Render/Graphics/Dx9EffectResource.cs | 44 ++--- .../Iris/Render/Graphics/Dx9EffectTemplate.cs | 10 +- .../Iris/Render/Graphics/Dx9EmbossElement.cs | 12 +- .../Render/Graphics/Dx9GaussianBlurElement.cs | 26 +-- .../Iris/Render/Graphics/Dx9GraphicsDevice.cs | 6 +- .../Iris/Render/Graphics/Dx9HSLElement.cs | 14 +- .../Iris/Render/Graphics/Dx9HSVElement.cs | 14 +- .../Iris/Render/Graphics/Dx9ImageElement.cs | 16 +- .../Render/Graphics/Dx9InterpolateElement.cs | 6 +- .../Render/Graphics/Dx9InvAlphaElement.cs | 2 +- .../Render/Graphics/Dx9InvColorElement.cs | 2 +- .../Iris/Render/Graphics/Dx9InvertElement.cs | 2 +- .../Render/Graphics/Dx9LightShaftElement.cs | 30 ++-- .../Render/Graphics/Dx9PointLight2DElement.cs | 26 +-- .../Iris/Render/Graphics/Dx9SepiaElement.cs | 18 +- .../Render/Graphics/Dx9SpotLight2DElement.cs | 38 ++-- .../Iris/Render/Graphics/Dx9VideoElement.cs | 8 +- .../Iris/Render/Graphics/DynamicBlock.cs | 6 +- .../Iris/Render/Graphics/DynamicBucket.cs | 26 +-- .../Iris/Render/Graphics/DynamicPool.cs | 62 +++---- .../Iris/Render/Graphics/DynamicPoolSet.cs | 8 +- .../Iris/Render/Graphics/DynamicRow.cs | 44 ++--- .../Microsoft/Iris/Render/Graphics/Effect.cs | 122 ++++++------- .../Iris/Render/Graphics/EffectProperty.cs | 18 +- .../Iris/Render/Graphics/EffectTemplate.cs | 10 +- .../Iris/Render/Graphics/GdiEffect.cs | 4 +- .../Iris/Render/Graphics/GdiEffectTemplate.cs | 4 +- .../Iris/Render/Graphics/GdiGraphicsDevice.cs | 10 +- .../Iris/Render/Graphics/Gradient.cs | 8 +- .../Iris/Render/Graphics/GraphicsDevice.cs | 36 ++-- .../Microsoft/Iris/Render/Graphics/Image.cs | 44 ++--- .../Iris/Render/Graphics/NtGraphicsDevice.cs | 20 +-- .../Render/Graphics/NullGraphicsDevice.cs | 8 +- .../Microsoft/Iris/Render/Graphics/Sprite.cs | 52 +++--- .../Microsoft/Iris/Render/Graphics/Surface.cs | 12 +- .../Iris/Render/Graphics/SurfaceManager.cs | 26 +-- .../Iris/Render/Graphics/SurfacePool.cs | 38 ++-- .../Iris/Render/Graphics/TreeNode.cs | 46 ++--- .../Render/Graphics/TreeNodeCollection.cs | 20 +-- .../Render/Graphics/TreeNodeEnumerator.cs | 6 +- .../Iris/Render/Graphics/VideoPool.cs | 4 +- .../Microsoft/Iris/Render/Graphics/Visual.cs | 170 +++++++++--------- .../Iris/Render/Graphics/VisualContainer.cs | 24 +-- .../Microsoft/Iris/Render/HSLElement.cs | 10 +- .../Microsoft/Iris/Render/HSVElement.cs | 10 +- .../Microsoft/Iris/Render/ImageElement.cs | 6 +- .../Iris/Render/Internal/DataCookie.cs | 2 +- .../Microsoft/Iris/Render/Internal/Display.cs | 18 +- .../Iris/Render/Internal/DisplayManager.cs | 50 +++--- .../Iris/Render/Internal/EventCookie.cs | 2 +- .../Iris/Render/Internal/HwndHostWindow.cs | 10 +- .../Iris/Render/Internal/InputSystem.cs | 20 +-- .../Iris/Render/Internal/KeyAllocator.cs | 2 +- .../Microsoft/Iris/Render/Internal/Math2.cs | 10 +- .../Iris/Render/Internal/ObjectTracker.cs | 14 +- .../Render/Internal/ObjectTrackerGroup.cs | 4 +- .../Iris/Render/Internal/RenderCaps.cs | 6 +- .../Iris/Render/Internal/RenderEngine.cs | 52 +++--- .../Iris/Render/Internal/RenderSession.cs | 76 ++++---- .../Iris/Render/Internal/RenderWindow.cs | 86 ++++----- .../Iris/Render/Internal/Win32Api.cs | 30 ++-- .../Iris/Render/InterpolateElement.cs | 6 +- .../Microsoft/Iris/Render/IrisEngineInfo.cs | 8 +- .../Microsoft/Iris/Render/Key.cs | 12 +- .../Iris/Render/LightShaftElement.cs | 24 +-- .../Iris/Render/LogarithmicInterpolation.cs | 2 +- .../Microsoft/Iris/Render/Point.cs | 2 +- .../Iris/Render/PointLight2DElement.cs | 6 +- .../Iris/Render/Protocol/BlobInfo.cs | 22 +-- .../Iris/Render/Protocol/ConnectionInfo.cs | 2 +- .../Iris/Render/Protocol/DataBuffer.cs | 16 +- .../Iris/Render/Protocol/DataBufferTracker.cs | 30 ++-- .../Iris/Render/Protocol/EngineApi.cs | 8 +- .../Iris/Render/Protocol/HandleGroup.cs | 54 +++--- .../Iris/Render/Protocol/HandleTable.cs | 22 +-- .../Iris/Render/Protocol/MarshalHelper.cs | 44 ++--- .../Microsoft/Iris/Render/Protocol/Memory.cs | 10 +- .../Iris/Render/Protocol/MessageHeap.cs | 32 ++-- .../Iris/Render/Protocol/MessagingSession.cs | 64 +++---- .../Iris/Render/Protocol/ObjectCache.cs | 18 +- .../Iris/Render/Protocol/RemoteObject.cs | 4 +- .../Iris/Render/Protocol/RenderPort.cs | 126 ++++++------- .../Splash/Desktop/LocalFormWindowCallback.cs | 54 +++--- .../Splash/Desktop/LocalInputCallback.cs | 6 +- .../Desktop/Nt/LocalDesktopManagerCallback.cs | 26 +-- .../Desktop/Nt/LocalHwndHostWindowCallback.cs | 4 +- .../Desktop/Nt/ProtocolSplashDesktopNt.cs | 2 +- .../Splash/Desktop/Nt/RemoteDesktopManager.cs | 6 +- .../Splash/Desktop/Nt/RemoteFormWindow.cs | 2 +- .../Splash/Desktop/Nt/RemoteHwndHostWindow.cs | 10 +- .../Splash/Desktop/ProtocolSplashDesktop.cs | 2 +- .../Splash/Desktop/RemoteFormWindowBase.cs | 62 +++---- .../Splash/Desktop/RemoteInputRouter.cs | 6 +- .../Xenon/ProtocolSplashDesktopXenon.cs | 2 +- .../Splash/Desktop/Xenon/RemoteFormWindow.cs | 2 +- .../Messaging/LocalDataBufferCallback.cs | 6 +- .../Messaging/LocalRenderPortCallback.cs | 14 +- .../Messaging/ProtocolSplashMessaging.cs | 2 +- .../Splash/Messaging/RemoteBroker.cs | 12 +- .../Splash/Messaging/RemoteContext.cs | 16 +- .../Splash/Messaging/RemoteContextRelay.cs | 10 +- .../Splash/Messaging/RemoteDataBuffer.cs | 2 +- .../Rendering/LocalAnimationCallback.cs | 6 +- .../Splash/Rendering/LocalDeviceCallback.cs | 22 +-- .../Rendering/LocalRenderCapsCallback.cs | 18 +- .../Rendering/LocalSoundBufferCallback.cs | 10 +- .../Rendering/LocalVideoPoolCallback.cs | 10 +- .../Rendering/Nt/ProtocolSplashRenderingNt.cs | 2 +- .../Splash/Rendering/Nt/RemoteGdiDevice.cs | 18 +- .../Splash/Rendering/Nt/RemoteGdiEffect.cs | 4 +- .../Splash/Rendering/Nt/RemoteGdiSprite.cs | 2 +- .../Splash/Rendering/Nt/RemoteNtDevice.cs | 12 +- .../Rendering/Nt/RemoteWinSoundDevice.cs | 2 +- .../Rendering/ProtocolSplashRendering.cs | 2 +- .../Splash/Rendering/RemoteAnimation.cs | 78 ++++---- .../Rendering/RemoteAnimationInputProvider.cs | 22 +-- .../Rendering/RemoteAnimationManager.cs | 8 +- .../Splash/Rendering/RemoteCamera.cs | 12 +- .../Splash/Rendering/RemoteDevice.cs | 14 +- .../Splash/Rendering/RemoteDx9Device.cs | 6 +- .../Splash/Rendering/RemoteDx9Effect.cs | 4 +- .../Rendering/RemoteDx9EffectResource.cs | 22 +-- .../Splash/Rendering/RemoteDx9Sprite.cs | 2 +- .../Rendering/RemoteDynamicSurfaceFactory.cs | 12 +- .../Splash/Rendering/RemoteEffect.cs | 16 +- .../Rendering/RemoteExternalAnimationInput.cs | 2 +- .../Splash/Rendering/RemoteGradient.cs | 10 +- .../Splash/Rendering/RemoteNullDevice.cs | 2 +- .../Splash/Rendering/RemoteRasterizer.cs | 4 +- .../Splash/Rendering/RemoteRenderCaps.cs | 4 +- .../Protocols/Splash/Rendering/RemoteSound.cs | 4 +- .../Splash/Rendering/RemoteSoundBuffer.cs | 2 +- .../Splash/Rendering/RemoteSoundDevice.cs | 8 +- .../Splash/Rendering/RemoteSprite.cs | 8 +- .../Splash/Rendering/RemoteSurface.cs | 16 +- .../Splash/Rendering/RemoteSurfacePool.cs | 10 +- .../Splash/Rendering/RemoteVideoPool.cs | 16 +- .../Splash/Rendering/RemoteVisual.cs | 32 ++-- .../Splash/Rendering/RemoteVisualContainer.cs | 4 +- .../Splash/Rendering/RemoteWaitCursor.cs | 12 +- .../Splash/Rendering/RemoteWindow.cs | 10 +- .../Xenon/ProtocolSplashRenderingXenon.cs | 2 +- .../Rendering/Xenon/RemoteXAudSoundDevice.cs | 6 +- .../Splash/Rendering/Xenon/RemoteXeDevice.cs | 2 +- .../Microsoft/Iris/Render/Quaternion.cs | 22 +-- .../Microsoft/Iris/Render/Rectangle.cs | 16 +- .../Microsoft/Iris/Render/RenderApi.cs | 8 +- .../Iris/Render/SCurveInterpolation.cs | 2 +- .../Microsoft/Iris/Render/SepiaElement.cs | 10 +- .../Microsoft/Iris/Render/Size.cs | 14 +- .../Iris/Render/Sound/Ds8SoundDevice.cs | 6 +- .../Microsoft/Iris/Render/Sound/Sound.cs | 16 +- .../Iris/Render/Sound/SoundBuffer.cs | 28 +-- .../Iris/Render/Sound/SoundDevice.cs | 4 +- .../Iris/Render/SpotLight2DElement.cs | 10 +- .../Microsoft/Iris/Render/TrackerBase.cs | 26 +-- .../Microsoft/Iris/Render/Vector2.cs | 8 +- .../Microsoft/Iris/Render/Vector3.cs | 8 +- .../Microsoft/Iris/Render/Vector4.cs | 8 +- .../Microsoft/Iris/Render/VideoElement.cs | 4 +- .../Microsoft/Iris/Render/VideoStream.cs | 32 ++-- .../System/Collections/Generic/HashHelpers.cs | 152 ++++++++-------- UIX.RenderApi.Skia/Vector.cs | 32 ++-- UIX.RenderApi.Skia/Vector`1.cs | 32 ++-- 242 files changed, 2240 insertions(+), 2240 deletions(-) diff --git a/UIX.RenderApi.Skia/Map.cs b/UIX.RenderApi.Skia/Map.cs index bab5b28..f5d1cb8 100644 --- a/UIX.RenderApi.Skia/Map.cs +++ b/UIX.RenderApi.Skia/Map.cs @@ -39,7 +39,7 @@ public class Map get { int entry = this.FindEntry(key); - return entry >= 0 ? this._entries[entry].value : (object)null; + return entry >= 0 ? this._entries[entry].value : null; } set => this.Insert(key, value, false); } @@ -52,7 +52,7 @@ public class Map return; for (int index = 0; index < this._buckets.Length; ++index) this._buckets[index] = -1; - Array.Clear((Array)this._entries, 0, this._count); + Array.Clear(_entries, 0, this._count); this._freeList = -1; this._count = 0; this._freeCount = 0; @@ -132,7 +132,7 @@ public class Map for (int index = 0; index < numArray.Length; ++index) numArray[index] = -1; Map.Entry[] entryArray = new Map.Entry[prime]; - Array.Copy((Array)this._entries, 0, (Array)entryArray, 0, this._count); + Array.Copy(_entries, 0, entryArray, 0, this._count); for (int index1 = 0; index1 < this._count; ++index1) { int index2 = entryArray[index1].hashCode % prime; @@ -160,8 +160,8 @@ public class Map this._entries[index2].next = this._entries[index3].next; this._entries[index3].hashCode = -1; this._entries[index3].next = this._freeList; - this._entries[index3].key = (object)null; - this._entries[index3].value = (object)null; + this._entries[index3].key = null; + this._entries[index3].value = null; this._freeList = index3; ++this._freeCount; ++this._version; @@ -181,7 +181,7 @@ public class Map value = this._entries[entry].value; return true; } - value = (object)null; + value = null; return false; } @@ -201,7 +201,7 @@ public class Map this._dictionary = dictionary; this._version = this._dictionary._version; this._index = 0; - this._current = new KeyValueEntry((object)null, (object)null); + this._current = new KeyValueEntry(null, null); } public bool MoveNext() @@ -218,7 +218,7 @@ public class Map } } this._index = this._dictionary._count + 1; - this._current = new KeyValueEntry((object)null, (object)null); + this._current = new KeyValueEntry(null, null); return false; } @@ -247,7 +247,7 @@ public class Map this._dictionary = dictionary; this._version = dictionary._version; this._index = 0; - this._currentKey = (object)null; + this._currentKey = null; } public bool MoveNext() @@ -264,7 +264,7 @@ public class Map } } this._index = this._dictionary._count + 1; - this._currentKey = (object)null; + this._currentKey = null; return false; } @@ -294,7 +294,7 @@ public class Map this._dictionary = dictionary; this._version = dictionary._version; this._index = 0; - this._currentValue = (object)null; + this._currentValue = null; } public bool MoveNext() @@ -311,7 +311,7 @@ public class Map } } this._index = this._dictionary._count + 1; - this._currentValue = (object)null; + this._currentValue = null; return false; } diff --git a/UIX.RenderApi.Skia/Map`2.cs b/UIX.RenderApi.Skia/Map`2.cs index 884a095..c03497d 100644 --- a/UIX.RenderApi.Skia/Map`2.cs +++ b/UIX.RenderApi.Skia/Map`2.cs @@ -52,7 +52,7 @@ public class Map return; for (int index = 0; index < this._buckets.Length; ++index) this._buckets[index] = -1; - Array.Clear((Array)this._entries, 0, this._count); + Array.Clear(_entries, 0, this._count); this._freeList = -1; this._count = 0; this._freeCount = 0; @@ -132,7 +132,7 @@ public class Map for (int index = 0; index < numArray.Length; ++index) numArray[index] = -1; Map.Entry[] entryArray = new Map.Entry[prime]; - Array.Copy((Array)this._entries, 0, (Array)entryArray, 0, this._count); + Array.Copy(_entries, 0, entryArray, 0, this._count); for (int index1 = 0; index1 < this._count; ++index1) { int index2 = entryArray[index1].hashCode % prime; @@ -185,7 +185,7 @@ public class Map return false; } - private bool KeyEquals(K x, K y) => x.Equals((object)y); + private bool KeyEquals(K x, K y) => x.Equals(y); private int GetKeyHashCode(K obj) => obj.GetHashCode(); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Input/Cursor.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Input/Cursor.cs index 6953757..ead6095 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Input/Cursor.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Input/Cursor.cs @@ -14,7 +14,7 @@ namespace Microsoft.Iris.Input public static readonly Cursor Arrow = new Cursor(32512, CursorID.Arrow); public static readonly Cursor AppStarting = new Cursor(32550, CursorID.AppStarting); public static readonly Cursor Crosshair = new Cursor(32515, CursorID.Crosshair); - public static readonly Cursor Default = Cursor.Arrow; + public static readonly Cursor Default = Arrow; public static readonly Cursor Hand = new Cursor(32649, CursorID.Hand); public static readonly Cursor Help = new Cursor(32651, CursorID.Help); public static readonly Cursor IBeam = new Cursor(32513, CursorID.IBeam); @@ -48,39 +48,39 @@ namespace Microsoft.Iris.Input switch (cursor) { case CursorID.Arrow: - return Cursor.Arrow; + return Arrow; case CursorID.Cancel: - return Cursor.Cancel; + return Cancel; case CursorID.Copy: - return Cursor.Copy; + return Copy; case CursorID.Crosshair: - return Cursor.Crosshair; + return Crosshair; case CursorID.IBeam: - return Cursor.IBeam; + return IBeam; case CursorID.Hand: - return Cursor.Hand; + return Hand; case CursorID.Move: - return Cursor.Move; + return Move; case CursorID.No: - return Cursor.No; + return No; case CursorID.None: - return Cursor.NullCursor; + return NullCursor; case CursorID.Size: - return Cursor.Size; + return Size; case CursorID.SizeNS: - return Cursor.SizeNS; + return SizeNS; case CursorID.SizeWE: - return Cursor.SizeWE; + return SizeWE; case CursorID.SizeNWSE: - return Cursor.SizeNWSE; + return SizeNWSE; case CursorID.SizeNESW: - return Cursor.SizeNESW; + return SizeNESW; case CursorID.UpArrow: - return Cursor.UpArrow; + return UpArrow; case CursorID.Wait: - return Cursor.WaitCursor; + return WaitCursor; default: - return (Cursor)null; + return null; } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Libraries/OS/RegistryKey.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Libraries/OS/RegistryKey.cs index 9b9b92b..2dbf1f0 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Libraries/OS/RegistryKey.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Libraries/OS/RegistryKey.cs @@ -22,25 +22,25 @@ namespace Microsoft.Iris.Libraries.OS ~RegistryKey() => this.Close(); - public static RegistryKey Open(IntPtr hive, string path) => RegistryKey.OpenWorker(hive, path); + public static RegistryKey Open(IntPtr hive, string path) => OpenWorker(hive, path); private static RegistryKey OpenWorker(IntPtr parentKey, string path) { - RegistryKey registryKey = (RegistryKey)null; + RegistryKey registryKey = null; IntPtr phkResult; if (Win32Api.RegOpenKeyExW(parentKey, path, 0, 131097, out phkResult) == 0) registryKey = new RegistryKey(phkResult); return registryKey; } - public RegistryKey OpenSubKey(string path) => RegistryKey.OpenWorker(this._hkey, path); + public RegistryKey OpenSubKey(string path) => OpenWorker(this._hkey, path); public bool ReadByte(string valueName, out byte value) { bool flag = false; - value = (byte)0; + value = 0; int num = 0; - if (this.ReadInt(valueName, out num) && num >= 0 && num <= (int)byte.MaxValue) + if (this.ReadInt(valueName, out num) && num >= 0 && num <= byte.MaxValue) { value = (byte)num; flag = true; @@ -79,17 +79,17 @@ namespace Microsoft.Iris.Libraries.OS public bool ReadString(string valueName, out string value) { bool flag = false; - value = (string)null; + value = null; int lpcbData = 0; int lpType; - if (Win32Api.RegQueryValueExW(this._hkey, valueName, IntPtr.Zero, out lpType, (char[])null, ref lpcbData) == 0 && lpType == 1) + if (Win32Api.RegQueryValueExW(this._hkey, valueName, IntPtr.Zero, out lpType, null, ref lpcbData) == 0 && lpType == 1) flag = this.ReadStringValueWorker(valueName, lpcbData, out value); return flag; } private bool ReadStringValueWorker(string valueName, int dataBytes, out string value) { - value = (string)null; + value = null; bool flag = false; int length = dataBytes / 2; char[] lpData = new char[length]; @@ -108,7 +108,7 @@ namespace Microsoft.Iris.Libraries.OS { Win32Api.RegCloseKey(this._hkey); this._hkey = IntPtr.Zero; - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Library/InvariantString.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Library/InvariantString.cs index 84a818b..b13247b 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Library/InvariantString.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Library/InvariantString.cs @@ -12,13 +12,13 @@ namespace Microsoft.Iris.Library { public static class InvariantString { - public static string Format(string format, object param) => string.Format((IFormatProvider)CultureInfo.InvariantCulture, format, param); + public static string Format(string format, object param) => string.Format(CultureInfo.InvariantCulture, format, param); public static string Format(string format, object[] param) => throw new Exception("Should never format with object array. Use one of the dedicated format methods"); - public static string Format(string format, object param1, object param2) => string.Format((IFormatProvider)CultureInfo.InvariantCulture, format, param1, param2); + public static string Format(string format, object param1, object param2) => string.Format(CultureInfo.InvariantCulture, format, param1, param2); - public static string Format(string format, object param1, object param2, object param3) => string.Format((IFormatProvider)CultureInfo.InvariantCulture, format, param1, param2, param3); + public static string Format(string format, object param1, object param2, object param3) => string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3); public static string Format( string format, @@ -27,7 +27,7 @@ namespace Microsoft.Iris.Library object param3, object param4) { - return string.Format((IFormatProvider)CultureInfo.InvariantCulture, format, param1, param2, param3, param4); + return string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3, param4); } public static string Format( @@ -38,7 +38,7 @@ namespace Microsoft.Iris.Library object param4, object param5) { - return string.Format((IFormatProvider)CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5); + return string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5); } public static string Format( @@ -50,7 +50,7 @@ namespace Microsoft.Iris.Library object param5, object param6) { - return string.Format((IFormatProvider)CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6); + return string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6); } public static string Format( @@ -63,7 +63,7 @@ namespace Microsoft.Iris.Library object param6, object param7) { - return string.Format((IFormatProvider)CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6, param7); + return string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6, param7); } public static string Format( @@ -77,7 +77,7 @@ namespace Microsoft.Iris.Library object param7, object param8) { - return string.Format((IFormatProvider)CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6, param7, param8); + return string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6, param7, param8); } public static string Format( @@ -92,7 +92,7 @@ namespace Microsoft.Iris.Library object param8, object param9) { - return string.Format((IFormatProvider)CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6, param7, param8, param9); + return string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6, param7, param8, param9); } public static string Format( @@ -108,7 +108,7 @@ namespace Microsoft.Iris.Library object param9, object param10) { - return string.Format((IFormatProvider)CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10); + return string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10); } public static string Format( @@ -125,7 +125,7 @@ namespace Microsoft.Iris.Library object param10, object param11) { - return string.Format((IFormatProvider)CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11); + return string.Format(CultureInfo.InvariantCulture, format, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11); } public static bool Equals(string leftName, string rightName) => string.Compare(leftName, rightName, StringComparison.Ordinal) == 0; @@ -140,11 +140,11 @@ namespace Microsoft.Iris.Library public static bool EndsWithI(string valueName, string suffixName) => valueName.EndsWith(suffixName, StringComparison.OrdinalIgnoreCase); - public static string ValueToString(ushort v, string formatName) => v.ToString(formatName, (IFormatProvider)CultureInfo.InvariantCulture); + public static string ValueToString(ushort v, string formatName) => v.ToString(formatName, CultureInfo.InvariantCulture); - public static IEqualityComparer OrdinalIgnoreCaseComparer => (IEqualityComparer)InvariantString.OrdinalIgnoreCaseStringComparer.Instance; + public static IEqualityComparer OrdinalIgnoreCaseComparer => OrdinalIgnoreCaseStringComparer.Instance; - public static IEqualityComparer OrdinalComparer => (IEqualityComparer)InvariantString.OrdinalStringComparer.Instance; + public static IEqualityComparer OrdinalComparer => OrdinalStringComparer.Instance; public class OrdinalStringComparer : IEqualityComparer { @@ -158,9 +158,9 @@ namespace Microsoft.Iris.Library { get { - if (InvariantString.OrdinalStringComparer._instance == null) - InvariantString.OrdinalStringComparer._instance = new InvariantString.OrdinalStringComparer(); - return InvariantString.OrdinalStringComparer._instance; + if (_instance == null) + _instance = new InvariantString.OrdinalStringComparer(); + return _instance; } } @@ -183,9 +183,9 @@ namespace Microsoft.Iris.Library { get { - if (InvariantString.OrdinalIgnoreCaseStringComparer._instance == null) - InvariantString.OrdinalIgnoreCaseStringComparer._instance = new InvariantString.OrdinalIgnoreCaseStringComparer(); - return InvariantString.OrdinalIgnoreCaseStringComparer._instance; + if (_instance == null) + _instance = new InvariantString.OrdinalIgnoreCaseStringComparer(); + return _instance; } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/AnimationInputProvider.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/AnimationInputProvider.cs index cc5c57e..878f78c 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/AnimationInputProvider.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/AnimationInputProvider.cs @@ -39,8 +39,8 @@ namespace Microsoft.Iris.Render.Animation { if (inDispose && this.m_remoteObject != null) this.m_remoteObject.Dispose(); - this.m_remoteObject = (RemoteAnimationInputProvider)null; - this.m_externalInput = (ExternalAnimationInput)null; + this.m_remoteObject = null; + this.m_externalInput = null; } finally { @@ -50,7 +50,7 @@ namespace Microsoft.Iris.Render.Animation RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteObject.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteObject = (RemoteAnimationInputProvider)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteObject = null; void IAnimationInputProvider.PublishFloat( string propertyName, diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/AnimationSystem.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/AnimationSystem.cs index 0c95718..a163712 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/AnimationSystem.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/AnimationSystem.cs @@ -26,7 +26,7 @@ namespace Microsoft.Iris.Render.Animation this.m_remoteObject = ownerSession.BuildRemoteAnimationManager(this); this.m_flSpeedAdjustment = 1f; this.m_backCompat = false; - this.RegisterUsage((object)ownerSession); + this.RegisterUsage(ownerSession); } protected override void Dispose(bool inDispose) @@ -35,8 +35,8 @@ namespace Microsoft.Iris.Render.Animation { if (inDispose && this.m_remoteObject != null) this.m_remoteObject.Dispose(); - this.m_ownerSession = (RenderSession)null; - this.m_remoteObject = (RemoteAnimationManager)null; + this.m_ownerSession = null; + this.m_remoteObject = null; } finally { @@ -60,7 +60,7 @@ namespace Microsoft.Iris.Render.Animation Debug2.Validate(initialValue != null, typeof(ArgumentNullException), nameof(initialValue)); KeyframeAnimation keyframeAnimation = new KeyframeAnimation(this, initialValue); keyframeAnimation.RegisterUsage(objUser); - return (IKeyframeAnimation)keyframeAnimation; + return keyframeAnimation; } IAnimationGroup IAnimationSystem.CreateAnimationGroup( @@ -69,7 +69,7 @@ namespace Microsoft.Iris.Render.Animation Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); AnimationGroup animationGroup = new AnimationGroup(this); animationGroup.RegisterUsage(objUser); - return (IAnimationGroup)animationGroup; + return animationGroup; } void IAnimationSystem.PulseTimeAdvance(int nAdvanceMs) => this.PulseTimeAdvance(nAdvanceMs); @@ -102,7 +102,7 @@ namespace Microsoft.Iris.Render.Animation object objUser, IAnimationPropertyMap propertyMap) { - return (IExternalAnimationInput)new ExternalAnimationInput(objUser, this.m_ownerSession, propertyMap); + return new ExternalAnimationInput(objUser, this.m_ownerSession, propertyMap); } void IAnimationSystem.PauseAnimations() => this.m_remoteObject.SendSetGlobalSpeedAdjustment(0.0f); @@ -113,7 +113,7 @@ namespace Microsoft.Iris.Render.Animation RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteObject.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteObject = (RemoteAnimationManager)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteObject = null; protected override void Invariant() { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/AnimationTarget.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/AnimationTarget.cs index 5fb09e1..7a60cf3 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/AnimationTarget.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/AnimationTarget.cs @@ -19,8 +19,8 @@ namespace Microsoft.Iris.Render.Animation internal AnimationTarget(IAnimatableObject targetObject, string targetPropertyName) { int propertyType = (int)targetObject.GetPropertyType(targetPropertyName); - targetObject.RegisterUsage((object)this); - this.m_targetId = Interlocked.Increment(ref AnimationTarget.s_targetIdSeed); + targetObject.RegisterUsage(this); + this.m_targetId = Interlocked.Increment(ref s_targetIdSeed); this.m_object = targetObject; this.m_property = targetPropertyName; } @@ -30,8 +30,8 @@ namespace Microsoft.Iris.Render.Animation try { if (fInDispose) - this.m_object.UnregisterUsage((object)this); - this.m_object = (IAnimatableObject)null; + this.m_object.UnregisterUsage(this); + this.m_object = null; } finally { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/ExternalAnimationInput.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/ExternalAnimationInput.cs index 7512d89..1d67e6c 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/ExternalAnimationInput.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/ExternalAnimationInput.cs @@ -33,7 +33,7 @@ namespace Microsoft.Iris.Render.Animation { Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); Debug2.Validate(propertyMap != null, typeof(ArgumentNullException), nameof(propertyMap)); - this.m_uniqueId = ExternalAnimationInput.s_uniqueIdSeed++; + this.m_uniqueId = s_uniqueIdSeed++; this.m_propertyMap = propertyMap; this.m_session = session; this.m_remoteObject = session.BuildRemoteExternalAnimationInput(this, this.m_uniqueId); @@ -46,9 +46,9 @@ namespace Microsoft.Iris.Render.Animation { if (inDispose && this.m_remoteObject != null) this.m_remoteObject.Dispose(); - this.m_remoteObject = (RemoteExternalAnimationInput)null; - this.m_propertyMap = (IAnimationPropertyMap)null; - this.m_session = (RenderSession)null; + this.m_remoteObject = null; + this.m_propertyMap = null; + this.m_session = null; } finally { @@ -63,7 +63,7 @@ namespace Microsoft.Iris.Render.Animation void IRenderHandleOwner.OnDisconnect() { this.m_uniqueId = 0U; - this.m_remoteObject = (RemoteExternalAnimationInput)null; + this.m_remoteObject = null; } RENDERHANDLE IAnimatableObject.GetObjectId() => this.m_remoteObject.RenderHandle; @@ -79,7 +79,7 @@ namespace Microsoft.Iris.Render.Animation IAnimationInputProvider IExternalAnimationInput.CreateProvider( object objUser) { - return (IAnimationInputProvider)new AnimationInputProvider(objUser, this.m_session, this); + return new AnimationInputProvider(objUser, this.m_session, this); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/KeyframeAnimation.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/KeyframeAnimation.cs index 41b70f8..5c83a76 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/KeyframeAnimation.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/KeyframeAnimation.cs @@ -39,18 +39,18 @@ namespace Microsoft.Iris.Render.Animation internal KeyframeAnimation(AnimationSystem owner, AnimationInput initialValue) { this.m_animationSystem = owner; - this.m_reference = (AnimationInput)null; - this.m_scale = (AnimationInput)null; + this.m_reference = null; + this.m_scale = null; this.m_animationType = initialValue.InputType; this.m_keyframeList = new Vector(); this.m_repeatCount = 0; this.m_autoReset = false; this.m_resetBehavior = AnimationResetBehavior.LeaveCurrent; - this.m_animationSystem.RegisterUsage((object)this); + this.m_animationSystem.RegisterUsage(this); this.m_remoteObject = owner.Session.BuildRemoteAnimation(this, this.m_animationType); if (this.m_animationSystem.BackCompat) return; - this.AddKeyframe(new AnimationKeyframe(0.0f, initialValue, (AnimationInterpolation)KeyframeAnimation.s_defaultInterpolation)); + this.AddKeyframe(new AnimationKeyframe(0.0f, initialValue, s_defaultInterpolation)); } protected override void Dispose(bool inDispose) @@ -64,18 +64,18 @@ namespace Microsoft.Iris.Render.Animation if (this.m_keyframeList != null) { foreach (AnimationKeyframe keyframe in this.m_keyframeList) - keyframe.Value.UnregisterUsage((object)this); + keyframe.Value.UnregisterUsage(this); this.m_keyframeList.Clear(); } if (this.m_remoteObject != null) this.m_remoteObject.Dispose(); - this.m_animationSystem.UnregisterUsage((object)this); + this.m_animationSystem.UnregisterUsage(this); } - this.m_remoteObject = (RemoteAnimation)null; - this.m_reference = (AnimationInput)null; - this.m_keyframeList = (Vector)null; - this.m_targetList = (Vector)null; - this.m_animationSystem = (AnimationSystem)null; + this.m_remoteObject = null; + this.m_reference = null; + this.m_keyframeList = null; + this.m_targetList = null; + this.m_animationSystem = null; } finally { @@ -146,7 +146,7 @@ namespace Microsoft.Iris.Render.Animation public override void InstantAdvance(float advanceTime) { - Debug2.Validate((double)advanceTime >= 0.0, typeof(ArgumentOutOfRangeException), nameof(advanceTime)); + Debug2.Validate(advanceTime >= 0.0, typeof(ArgumentOutOfRangeException), nameof(advanceTime)); this.m_remoteObject.SendInstantAdvance(advanceTime); } @@ -186,7 +186,7 @@ namespace Microsoft.Iris.Render.Animation internal void AddKeyframe(AnimationKeyframe keyframe) { - this.m_keyframeList.Add((object)keyframe); + this.m_keyframeList.Add(keyframe); this.m_remoteObject.SendAddKeyframe(this.m_keyframeList.Count - 1, keyframe.Time); this.SetKeyframe(this.m_keyframeList.Count - 1, keyframe, false); } @@ -207,19 +207,19 @@ namespace Microsoft.Iris.Render.Animation Debug2.Validate(keyframe != null, typeof(ArgumentNullException), nameof(keyframe)); Debug2.Validate(keyframeIndex >= 0 || keyframeIndex < this.m_keyframeList.Count, typeof(ArgumentOutOfRangeException), nameof(keyframeIndex)); if (keyframeIndex == 0 && !this.m_animationSystem.BackCompat) - Debug2.Validate((double)keyframe.Time == 0.0, typeof(ArgumentException), "Cannot change the time for keyframe 0"); + Debug2.Validate(keyframe.Time == 0.0, typeof(ArgumentException), "Cannot change the time for keyframe 0"); this.SetKeyframe(keyframeIndex, keyframe, true); } internal void SetKeyframe(int keyframeIndex, AnimationKeyframe keyframe, bool replaceKeyframe) { - keyframe.Value.RegisterUsage((object)this); + keyframe.Value.RegisterUsage(this); if (replaceKeyframe) { AnimationKeyframe keyframe1 = (AnimationKeyframe)this.m_keyframeList[keyframeIndex]; this.m_keyframeList.RemoveAt(keyframeIndex); - this.m_keyframeList.Insert(keyframeIndex, (object)keyframe); - keyframe1.Value.UnregisterUsage((object)this); + this.m_keyframeList.Insert(keyframeIndex, keyframe); + keyframe1.Value.UnregisterUsage(this); } this.m_remoteObject.SendSetKeyframeTime(keyframeIndex, keyframe.Time); this.SendInput(keyframeIndex, keyframe.Value); @@ -231,7 +231,7 @@ namespace Microsoft.Iris.Render.Animation string targetPropertyName) { Debug2.Validate(targetObject is IAnimatableObject, typeof(ArgumentException), nameof(targetObject)); - this.AddTarget((IAnimatableObject)targetObject, targetPropertyName, (string)null); + this.AddTarget((IAnimatableObject)targetObject, targetPropertyName, null); } void IKeyframeAnimation.AddTarget( @@ -254,14 +254,14 @@ namespace Microsoft.Iris.Render.Animation AnimationTarget target = new AnimationTarget(targetObject, targetPropertyName); AnimationTypeMask sourceMask = AnimationTypeMask.FromString(targetMaskSpec); if (!sourceMask.CanMapFromType(this.m_animationType)) - throw new ArgumentException(string.Format("Mask cannot be applied to a {0} animation", (object)this.m_animationType)); + throw new ArgumentException(string.Format("Mask cannot be applied to a {0} animation", m_animationType)); if (!sourceMask.CanMapToType(target.TargetPropertyType)) - throw new ArgumentException(string.Format("Mask cannot be applied to a property of type {0}", (object)target.TargetPropertyType)); + throw new ArgumentException(string.Format("Mask cannot be applied to a property of type {0}", target.TargetPropertyType)); uint propertyInfo = this.GeneratePropertyInfo(target.TargetPropertyType, sourceMask); this.m_remoteObject.SendAddTarget(target.TargetId, target.TargetObject.GetObjectId(), target.TargetObject.GetPropertyId(target.TargetPropertyName), propertyInfo); if (this.m_targetList == null) this.m_targetList = new Vector(); - this.m_targetList.Add((object)new KeyframeAnimation.AnimationTargetInfo(target, targetMaskSpec)); + this.m_targetList.Add(new KeyframeAnimation.AnimationTargetInfo(target, targetMaskSpec)); } void IKeyframeAnimation.RemoveTarget( @@ -271,7 +271,7 @@ namespace Microsoft.Iris.Render.Animation { Debug2.Validate(targetObject != null, typeof(ArgumentNullException), nameof(targetObject)); Debug2.Validate(targetPropertyName != null, typeof(ArgumentNullException), nameof(targetPropertyName)); - KeyframeAnimation.AnimationTargetInfo animationTargetInfo = (KeyframeAnimation.AnimationTargetInfo)null; + KeyframeAnimation.AnimationTargetInfo animationTargetInfo = null; if (this.m_targetList != null) { foreach (KeyframeAnimation.AnimationTargetInfo target in this.m_targetList) @@ -286,7 +286,7 @@ namespace Microsoft.Iris.Render.Animation if (animationTargetInfo == null) return; this.m_remoteObject.SendRemoveTarget(animationTargetInfo.Target.TargetId); - this.m_targetList.Remove((object)animationTargetInfo); + this.m_targetList.Remove(animationTargetInfo); animationTargetInfo.Target.Dispose(); } @@ -321,7 +321,7 @@ namespace Microsoft.Iris.Render.Animation AnimationEvent animationEvent) { Debug2.Validate(animationEvent != null, typeof(ArgumentNullException), nameof(animationEvent)); - Debug2.Validate((double)absoluteTime >= 0.0, typeof(ArgumentException), "absoluteTime value must be >= 0.0f"); + Debug2.Validate(absoluteTime >= 0.0, typeof(ArgumentException), "absoluteTime value must be >= 0.0f"); RENDERHANDLE targetObjectId = animationEvent.TargetObjectId; if (!(targetObjectId != RENDERHANDLE.NULL)) return; @@ -333,7 +333,7 @@ namespace Microsoft.Iris.Render.Animation AnimationEvent animationEvent) { Debug2.Validate(animationEvent != null, typeof(ArgumentNullException), nameof(animationEvent)); - Debug2.Validate((double)progress >= 0.0 && (double)progress <= 1.0, typeof(ArgumentException), "'progress' value must be between 0.0f and 1.0f"); + Debug2.Validate(progress >= 0.0 && progress <= 1.0, typeof(ArgumentException), "'progress' value must be between 0.0f and 1.0f"); RENDERHANDLE targetObjectId = animationEvent.TargetObjectId; if (!(targetObjectId != RENDERHANDLE.NULL)) return; @@ -369,18 +369,18 @@ namespace Microsoft.Iris.Render.Animation uint IAnimatableObject.GetPropertyId(string propertyName) { - if (string.Compare(propertyName, Microsoft.Iris.Render.Animation.Animation.OutputProperty, StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(propertyName, OutputProperty, StringComparison.OrdinalIgnoreCase) == 0) return 1; - Debug2.Validate(false, typeof(ArgumentException), (object)"Unsupported property: {0}", (object)propertyName); + Debug2.Validate(false, typeof(ArgumentException), "Unsupported property: {0}", propertyName); return 0; } AnimationInputType IAnimatableObject.GetPropertyType( string propertyName) { - if (string.Compare(propertyName, Microsoft.Iris.Render.Animation.Animation.OutputProperty, StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(propertyName, OutputProperty, StringComparison.OrdinalIgnoreCase) == 0) return this.Type; - Debug2.Validate(false, typeof(ArgumentException), (object)"Unsupported property: {0}", (object)propertyName); + Debug2.Validate(false, typeof(ArgumentException), "Unsupported property: {0}", propertyName); return AnimationInputType.Float; } @@ -388,23 +388,23 @@ namespace Microsoft.Iris.Render.Animation uint IActivatableObject.GetMethodId(string methodName) { - if (string.Compare(methodName, Microsoft.Iris.Render.Animation.Animation.PlayMethod, StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(methodName, PlayMethod, StringComparison.OrdinalIgnoreCase) == 0) return 1; - if (string.Compare(methodName, Microsoft.Iris.Render.Animation.Animation.PauseMethod, StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(methodName, PauseMethod, StringComparison.OrdinalIgnoreCase) == 0) return 2; - if (string.Compare(methodName, Microsoft.Iris.Render.Animation.Animation.ResetMethod, StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(methodName, ResetMethod, StringComparison.OrdinalIgnoreCase) == 0) return 3; - if (string.Compare(methodName, Microsoft.Iris.Render.Animation.Animation.FinishMethod, StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(methodName, FinishMethod, StringComparison.OrdinalIgnoreCase) == 0) return 4; - if (string.Compare(methodName, Microsoft.Iris.Render.Animation.Animation.NotifyMethod, StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(methodName, NotifyMethod, StringComparison.OrdinalIgnoreCase) == 0) return 5; - Debug2.Validate(false, typeof(ArgumentException), (object)"Unsupported method: {0}", (object)methodName); + Debug2.Validate(false, typeof(ArgumentException), "Unsupported method: {0}", methodName); return 0; } RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteObject.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteObject = (RemoteAnimation)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteObject = null; private void SendInput(int keyframeIndex, AnimationInput input) { @@ -542,7 +542,7 @@ namespace Microsoft.Iris.Render.Animation } } - private uint GeneratePropertyInfo(AnimationInputType sourceType, AnimationTypeMask sourceMask) => (uint)((int)(sourceType & (AnimationInputType.Vector4 | AnimationInputType.Quaternion)) << 19 | ((int)sourceMask.ChannelCount & 7) << 16 | (int)sourceMask.MaskCode & (int)ushort.MaxValue); + private uint GeneratePropertyInfo(AnimationInputType sourceType, AnimationTypeMask sourceMask) => (uint)((int)(sourceType & (AnimationInputType.Vector4 | AnimationInputType.Quaternion)) << 19 | ((int)sourceMask.ChannelCount & 7) << 16 | sourceMask.MaskCode & ushort.MaxValue); private enum KeyframeSlots { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/ObjectAnimationInput.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/ObjectAnimationInput.cs index 4007299..32567f5 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/ObjectAnimationInput.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Animation/ObjectAnimationInput.cs @@ -33,7 +33,7 @@ namespace Microsoft.Iris.Render.Animation Debug2.Validate(sourceAnimation is IAnimatableObject, typeof(ArgumentException), nameof(sourceAnimation)); AnimationTypeMask sourceMask = AnimationTypeMask.FromString(sourceMaskSpec); this.m_object = (IAnimatableObject)sourceAnimation; - this.m_propertyName = Microsoft.Iris.Render.Animation.Animation.OutputProperty; + this.m_propertyName = Animation.OutputProperty; this.CommonCreate(this.m_object.GetPropertyType(this.m_propertyName), sourceMask); } @@ -54,7 +54,7 @@ namespace Microsoft.Iris.Render.Animation bool flag = this.m_object.UsageCount == 1; this.m_object.UnregisterUsage(user); if (flag) - this.m_object = (IAnimatableObject)null; + this.m_object = null; base.UnregisterUsage(user); } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/AnimationEvent.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/AnimationEvent.cs index c382655..6c29196 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/AnimationEvent.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/AnimationEvent.cs @@ -31,14 +31,14 @@ namespace Microsoft.Iris.Render Debug2.Validate(eventTarget != null, typeof(ArgumentNullException), nameof(eventTarget)); Debug2.Validate(eventTarget is IActivatableObject, typeof(ArgumentException), nameof(eventTarget)); Debug2.Validate(eventMethodName != null, typeof(ArgumentNullException), nameof(eventMethodName)); - this.m_eventId = AnimationEvent.AllocateEventId(); + this.m_eventId = AllocateEventId(); this.m_eventTarget = (IActivatableObject)eventTarget; this.m_eventMethodName = eventMethodName; this.m_eventMethodArg = eventMethodArg; this.m_allowRepeat = false; } - ~AnimationEvent() => this.m_eventTarget = (IActivatableObject)null; + ~AnimationEvent() => this.m_eventTarget = null; internal uint EventId => this.m_eventId; @@ -60,6 +60,6 @@ namespace Microsoft.Iris.Render set => this.m_initialActivation = value; } - private static uint AllocateEventId() => (uint)AnimationEvent.s_eventIdSeed++; + private static uint AllocateEventId() => (uint)s_eventIdSeed++; } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/AnimationInput.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/AnimationInput.cs index bd5f2ea..fc76690 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/AnimationInput.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/AnimationInput.cs @@ -64,14 +64,14 @@ namespace Microsoft.Iris.Render { Debug2.Validate(left != null, typeof(ArgumentNullException), nameof(left)); Debug2.Validate(right != null, typeof(ArgumentNullException), nameof(right)); - return (AnimationInput)new BinaryOperation(BinaryOpCode.Add, left, right); + return new BinaryOperation(BinaryOpCode.Add, left, right); } public static AnimationInput operator *(AnimationInput left, AnimationInput right) { Debug2.Validate(left != null, typeof(ArgumentNullException), nameof(left)); Debug2.Validate(right != null, typeof(ArgumentNullException), nameof(right)); - return (AnimationInput)new BinaryOperation(BinaryOpCode.Multiply, left, right); + return new BinaryOperation(BinaryOpCode.Multiply, left, right); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/AnimationKeyframe.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/AnimationKeyframe.cs index 7ff7232..4b3f346 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/AnimationKeyframe.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/AnimationKeyframe.cs @@ -20,7 +20,7 @@ namespace Microsoft.Iris.Render AnimationInput value, AnimationInterpolation interpolation) { - Debug2.Validate((double)time >= 0.0, typeof(ArgumentException), "'time' must not be negative"); + Debug2.Validate(time >= 0.0, typeof(ArgumentException), "'time' must not be negative"); Debug2.Validate(value != null, typeof(ArgumentNullException), nameof(value)); Debug2.Validate(interpolation != null, typeof(ArgumentNullException), nameof(interpolation)); this.m_time = time; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/AnimationTypeMask.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/AnimationTypeMask.cs index caf8512..b545277 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/AnimationTypeMask.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/AnimationTypeMask.cs @@ -26,15 +26,15 @@ namespace Microsoft.Iris.Render public AnimationTypeMask(AnimationTypeChannel channel0) { - this.m_maskCode = (ushort)0; - this.m_channelCount = (byte)1; + this.m_maskCode = 0; + this.m_channelCount = 1; this[0] = channel0; } public AnimationTypeMask(AnimationTypeChannel channel0, AnimationTypeChannel channel1) { - this.m_maskCode = (ushort)0; - this.m_channelCount = (byte)2; + this.m_maskCode = 0; + this.m_channelCount = 2; this[0] = channel0; this[1] = channel1; } @@ -44,8 +44,8 @@ namespace Microsoft.Iris.Render AnimationTypeChannel channel1, AnimationTypeChannel channel2) { - this.m_maskCode = (ushort)0; - this.m_channelCount = (byte)3; + this.m_maskCode = 0; + this.m_channelCount = 3; this[0] = channel0; this[1] = channel1; this[2] = channel2; @@ -57,8 +57,8 @@ namespace Microsoft.Iris.Render AnimationTypeChannel channel2, AnimationTypeChannel channel3) { - this.m_maskCode = (ushort)0; - this.m_channelCount = (byte)4; + this.m_maskCode = 0; + this.m_channelCount = 4; this[0] = channel0; this[1] = channel1; this[2] = channel2; @@ -73,14 +73,14 @@ namespace Microsoft.Iris.Render internal ushort MaskCode => this.m_maskCode; - public uint ChannelCount => (uint)this.m_channelCount & 7U; + public uint ChannelCount => m_channelCount & 7U; public static AnimationTypeMask FromString(string maskSpec) { AnimationTypeMask animationTypeMask; if (string.IsNullOrEmpty(maskSpec)) { - animationTypeMask = AnimationTypeMask.Default; + animationTypeMask = Default; } else { @@ -91,42 +91,42 @@ namespace Microsoft.Iris.Render switch (maskSpec[index]) { case '0': - arrayList.Add((object)AnimationTypeChannel.O); + arrayList.Add(AnimationTypeChannel.O); break; case 'A': case 'a': - arrayList.Add((object)AnimationTypeChannel.W); + arrayList.Add(AnimationTypeChannel.W); break; case 'B': case 'b': - arrayList.Add((object)AnimationTypeChannel.Z); + arrayList.Add(AnimationTypeChannel.Z); break; case 'G': case 'g': - arrayList.Add((object)AnimationTypeChannel.Y); + arrayList.Add(AnimationTypeChannel.Y); break; case 'R': case 'r': - arrayList.Add((object)AnimationTypeChannel.X); + arrayList.Add(AnimationTypeChannel.X); break; case 'W': case 'w': - arrayList.Add((object)AnimationTypeChannel.W); + arrayList.Add(AnimationTypeChannel.W); break; case 'X': case 'x': - arrayList.Add((object)AnimationTypeChannel.X); + arrayList.Add(AnimationTypeChannel.X); break; case 'Y': case 'y': - arrayList.Add((object)AnimationTypeChannel.Y); + arrayList.Add(AnimationTypeChannel.Y); break; case 'Z': case 'z': - arrayList.Add((object)AnimationTypeChannel.Z); + arrayList.Add(AnimationTypeChannel.Z); break; default: - Debug2.Validate(false, typeof(ArgumentException), (object)"Invalid mask spec: {0}", (object)maskSpec[index]); + Debug2.Validate(false, typeof(ArgumentException), "Invalid mask spec: {0}", maskSpec[index]); break; } } @@ -146,14 +146,14 @@ namespace Microsoft.Iris.Render break; default: Debug2.Throw(false, "Too many channels in mask spec!"); - animationTypeMask = AnimationTypeMask.Default; + animationTypeMask = Default; break; } } return animationTypeMask; } - public override bool Equals(object obj) => obj is AnimationTypeMask animationTypeMask && (int)animationTypeMask.m_channelCount == (int)this.m_channelCount && (int)animationTypeMask.m_maskCode == (int)this.m_maskCode; + public override bool Equals(object obj) => obj is AnimationTypeMask animationTypeMask && animationTypeMask.m_channelCount == m_channelCount && animationTypeMask.m_maskCode == m_maskCode; public override int GetHashCode() => this.m_channelCount.GetHashCode() ^ this.m_maskCode.GetHashCode(); @@ -183,7 +183,7 @@ namespace Microsoft.Iris.Render } if (this.ChannelCount != 0U) { - for (int channelIndex = 0; (long)channelIndex < (long)this.ChannelCount; ++channelIndex) + for (int channelIndex = 0; channelIndex < ChannelCount; ++channelIndex) { if (this[channelIndex] > animationTypeChannel) flag = false; @@ -222,7 +222,7 @@ namespace Microsoft.Iris.Render private AnimationTypeChannel GetChannel(int channelIndex) { Debug2.Validate(channelIndex >= 0 && channelIndex <= 3, typeof(ArgumentOutOfRangeException), "Channel index must be between 0 and 3"); - return (AnimationTypeChannel)((int)this.m_maskCode >> channelIndex * 4 & 15); + return (AnimationTypeChannel)(m_maskCode >> channelIndex * 4 & 15); } private void SetChannel(int channelIndex, AnimationTypeChannel channel) @@ -231,7 +231,7 @@ namespace Microsoft.Iris.Render Debug2.Validate(channel >= AnimationTypeChannel.O && channel <= AnimationTypeChannel.W, typeof(ArgumentOutOfRangeException), nameof(channel)); int num1 = (int)channel << channelIndex * 4; int num2 = 15 << channelIndex * 4; - this.m_maskCode = (ushort)(((int)this.m_maskCode & ~num2 | num1 & num2) & (int)ushort.MaxValue); + this.m_maskCode = (ushort)((m_maskCode & ~num2 | num1 & num2) & ushort.MaxValue); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/AxisAngle.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/AxisAngle.cs index 9b82b71..79e1d9b 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/AxisAngle.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/AxisAngle.cs @@ -40,7 +40,7 @@ namespace Microsoft.Iris.Render public override bool Equals(object obj) => obj is AxisAngle axisAngle && this == axisAngle; - public static bool operator ==(AxisAngle left, AxisAngle right) => left.Axis == right.Axis && (double)left.Angle == (double)right.Angle; + public static bool operator ==(AxisAngle left, AxisAngle right) => left.Axis == right.Axis && left.Angle == (double)right.Angle; public static bool operator !=(AxisAngle left, AxisAngle right) => !(left == right); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/BlendElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/BlendElement.cs index af881ee..d963c06 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/BlendElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/BlendElement.cs @@ -79,8 +79,8 @@ namespace Microsoft.Iris.Render internal override void AddCacheKey(ByteBuilder cacheKey) { base.AddCacheKey(cacheKey); - this.GenerateClassCacheKey((byte)2, (byte)this.m_colorOperation, cacheKey); - this.GenerateClassCacheKey((byte)2, (byte)this.m_alphaOperation, cacheKey); + this.GenerateClassCacheKey(2, (byte)this.m_colorOperation, cacheKey); + this.GenerateClassCacheKey(2, (byte)this.m_alphaOperation, cacheKey); this.m_effectInput1.AddCacheKey(cacheKey); this.m_effectInput2.AddCacheKey(cacheKey); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/BrightnessElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/BrightnessElement.cs index 9690d72..93b9ff6 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/BrightnessElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/BrightnessElement.cs @@ -20,7 +20,7 @@ namespace Microsoft.Iris.Render : this() { Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); - Debug2.Validate((double)flBrightness >= -1.0 && (double)flBrightness <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Brightness is [-1..1]"); + Debug2.Validate(flBrightness >= -1.0 && flBrightness <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Brightness is [-1..1]"); this.m_flBrightness = flBrightness; this.m_stName = stName; } @@ -39,10 +39,10 @@ namespace Microsoft.Iris.Render Map dictionary, ref byte nNextUniqueID) { - return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Brightness", (byte)8, ref this.m_nBrightnessID, ref nNextUniqueID); + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Brightness", 8, ref this.m_nBrightnessID, ref nNextUniqueID); } - internal override bool Process(Map dictProperties) => this.GenerateProperty("Brightness", EffectPropertyType.Float, (object)this.m_flBrightness, this.m_nBrightnessID, dictProperties); + internal override bool Process(Map dictProperties) => this.GenerateProperty("Brightness", EffectPropertyType.Float, m_flBrightness, this.m_nBrightnessID, dictProperties); internal override void AddCacheKey(ByteBuilder cacheKey) { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/CapturedAnimationInput.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/CapturedAnimationInput.cs index 25ec490..a6d6651 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/CapturedAnimationInput.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/CapturedAnimationInput.cs @@ -13,7 +13,7 @@ namespace Microsoft.Iris.Render private bool m_refreshOnRepeat; public CapturedAnimationInput(IAnimatable sourceObject, string sourcePropertyName) - : this(sourceObject, sourcePropertyName, (string)null) + : this(sourceObject, sourcePropertyName, null) { } @@ -26,7 +26,7 @@ namespace Microsoft.Iris.Render } public CapturedAnimationInput(IAnimation sourceAnimation) - : this(sourceAnimation, (string)null) + : this(sourceAnimation, null) { } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/ColorElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/ColorElement.cs index 9dcd5e7..d2a9c77 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/ColorElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/ColorElement.cs @@ -24,12 +24,12 @@ namespace Microsoft.Iris.Render } public ColorElement(string stName) - : this(stName, ColorElement.DefaultColor) + : this(stName, DefaultColor) { } public ColorElement() - : this("", ColorElement.DefaultColor) + : this("", DefaultColor) { } @@ -41,16 +41,16 @@ namespace Microsoft.Iris.Render internal byte ColorID => this.m_nColorID; - internal static ColorF DefaultColor => ColorElement.s_defaultColor; + internal static ColorF DefaultColor => s_defaultColor; internal override int PreProcessProperties( Map dictionary, ref byte nNextUniqueID) { - return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Color", (byte)20, ref this.m_nColorID, ref nNextUniqueID); + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Color", 20, ref this.m_nColorID, ref nNextUniqueID); } - internal override bool Process(Map dictProperties) => this.GenerateProperty("Color", EffectPropertyType.Color, (object)this.m_clrColor, this.m_nColorID, dictProperties); + internal override bool Process(Map dictProperties) => this.GenerateProperty("Color", EffectPropertyType.Color, m_clrColor, this.m_nColorID, dictProperties); internal override void AddCacheKey(ByteBuilder cacheKey) { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/ColorF.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/ColorF.cs index c2ede17..57a6f46 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/ColorF.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/ColorF.cs @@ -22,7 +22,7 @@ namespace Microsoft.Iris.Render private float m_flG; private float m_flB; - public ColorF(int red, int green, int blue) => this = ColorF.FromArgb((int)byte.MaxValue, red, green, blue); + public ColorF(int red, int green, int blue) => this = FromArgb(byte.MaxValue, red, green, blue); public ColorF(float red, float green, float blue) { @@ -32,7 +32,7 @@ namespace Microsoft.Iris.Render this.m_flB = blue; } - public ColorF(int alpha, int red, int green, int blue) => this = ColorF.FromArgb(alpha, red, green, blue); + public ColorF(int alpha, int red, int green, int blue) => this = FromArgb(alpha, red, green, blue); public ColorF(float alpha, float red, float green, float blue) { @@ -68,46 +68,46 @@ namespace Microsoft.Iris.Render public uint PackedInt { - get => (uint)((int)ColorF.ChannelToByte(this.m_flA) << 24 | (int)ColorF.ChannelToByte(this.m_flR) << 16 | (int)ColorF.ChannelToByte(this.m_flG) << 8) | (uint)ColorF.ChannelToByte(this.m_flB); - set => this = ColorF.FromArgb(value); + get => (uint)(ChannelToByte(this.m_flA) << 24 | ChannelToByte(this.m_flR) << 16 | ChannelToByte(this.m_flG) << 8) | ChannelToByte(this.m_flB); + set => this = FromArgb(value); } private static float CheckByte(int value, string name) { - if (value < 0 || value > (int)byte.MaxValue) - throw new ArgumentException(string.Format("Invalid value ({0}) for {1} color channel. Expecting a value between 0 and 255.", (object)value, (object)name), name); - return (float)value / (float)byte.MaxValue; + if (value < 0 || value > byte.MaxValue) + throw new ArgumentException(string.Format("Invalid value ({0}) for {1} color channel. Expecting a value between 0 and 255.", value, name), name); + return value / (float)byte.MaxValue; } - private static byte ChannelToByte(float flChannel) => (byte)Math.Round((double)Math.Max(Math.Min(1f, flChannel), 0.0f) * (double)byte.MaxValue); + private static byte ChannelToByte(float flChannel) => (byte)Math.Round(Math.Max(Math.Min(1f, flChannel), 0.0f) * (double)byte.MaxValue); - private static uint MakeArgb(byte alpha, byte red, byte green, byte blue) => (uint)((int)red << 16 | (int)green << 8 | (int)blue | (int)alpha << 24); + private static uint MakeArgb(byte alpha, byte red, byte green, byte blue) => (uint)(red << 16 | green << 8 | blue | alpha << 24); - internal static ColorF FromCOLORREF(Win32Api.COLORREF cr) => ColorF.FromArgb(Win32Api.GetRValue(cr), Win32Api.GetGValue(cr), Win32Api.GetBValue(cr)); + internal static ColorF FromCOLORREF(Win32Api.COLORREF cr) => FromArgb(Win32Api.GetRValue(cr), Win32Api.GetGValue(cr), Win32Api.GetBValue(cr)); - public static ColorF FromArgb(uint argb) => new ColorF((int)(argb >> 24) & (int)byte.MaxValue, (int)(argb >> 16) & (int)byte.MaxValue, (int)(argb >> 8) & (int)byte.MaxValue, (int)argb & (int)byte.MaxValue); + public static ColorF FromArgb(uint argb) => new ColorF((int)(argb >> 24) & byte.MaxValue, (int)(argb >> 16) & byte.MaxValue, (int)(argb >> 8) & byte.MaxValue, (int)argb & byte.MaxValue); - public static ColorF FromArgb(int alpha, int red, int green, int blue) => new ColorF(ColorF.CheckByte(alpha, nameof(alpha)), ColorF.CheckByte(red, nameof(red)), ColorF.CheckByte(green, nameof(green)), ColorF.CheckByte(blue, nameof(blue))); + public static ColorF FromArgb(int alpha, int red, int green, int blue) => new ColorF(CheckByte(alpha, nameof(alpha)), CheckByte(red, nameof(red)), CheckByte(green, nameof(green)), CheckByte(blue, nameof(blue))); - public static ColorF FromArgb(int red, int green, int blue) => ColorF.FromArgb((int)byte.MaxValue, red, green, blue); + public static ColorF FromArgb(int red, int green, int blue) => FromArgb(byte.MaxValue, red, green, blue); - internal Win32Api.COLORREF ToCOLORREF() => Win32Api.RGB(ColorF.ChannelToByte(this.m_flR), ColorF.ChannelToByte(this.m_flG), ColorF.ChannelToByte(this.m_flB)); + internal Win32Api.COLORREF ToCOLORREF() => Win32Api.RGB(ChannelToByte(this.m_flR), ChannelToByte(this.m_flG), ChannelToByte(this.m_flB)); - internal Win32Api.COLORREF ToCOLORREF2() => Win32Api.ARGB(ColorF.ChannelToByte(this.m_flA), ColorF.ChannelToByte(this.m_flR), ColorF.ChannelToByte(this.m_flG), ColorF.ChannelToByte(this.m_flB)); + internal Win32Api.COLORREF ToCOLORREF2() => Win32Api.ARGB(ChannelToByte(this.m_flA), ChannelToByte(this.m_flR), ChannelToByte(this.m_flG), ChannelToByte(this.m_flB)); internal float GetValue() { float num1 = this.m_flR; float num2 = this.m_flR; - if ((double)this.m_flG > (double)num1) + if (m_flG > (double)num1) num1 = this.m_flG; - if ((double)this.m_flB > (double)num1) + if (m_flB > (double)num1) num1 = this.m_flB; - if ((double)this.m_flG < (double)num2) + if (m_flG < (double)num2) num2 = this.m_flG; - if ((double)this.m_flB < (double)num2) + if (m_flB < (double)num2) num2 = this.m_flB; - return (float)(((double)num1 + (double)num2) / 2.0); + return (float)((num1 + (double)num2) / 2.0); } internal float GetHue() @@ -117,23 +117,23 @@ namespace Microsoft.Iris.Render float num1 = 0.0f; float num2 = this.m_flR; float num3 = this.m_flR; - if ((double)this.m_flG > (double)num2) + if (m_flG > (double)num2) num2 = this.m_flG; - if ((double)this.m_flB > (double)num2) + if (m_flB > (double)num2) num2 = this.m_flB; - if ((double)this.m_flG < (double)num3) + if (m_flG < (double)num3) num3 = this.m_flG; - if ((double)this.m_flB < (double)num3) + if (m_flB < (double)num3) num3 = this.m_flB; float num4 = num2 - num3; - if ((double)this.m_flR == (double)num2) + if (m_flR == (double)num2) num1 = (this.m_flG - this.m_flB) / num4; - else if ((double)this.m_flG == (double)num2) - num1 = (float)(2.0 + ((double)this.m_flB - (double)this.m_flR) / (double)num4); - else if ((double)this.m_flB == (double)num2) - num1 = (float)(4.0 + ((double)this.m_flR - (double)this.m_flG) / (double)num4); + else if (m_flG == (double)num2) + num1 = (float)(2.0 + (m_flB - (double)this.m_flR) / num4); + else if (m_flB == (double)num2) + num1 = (float)(4.0 + (m_flR - (double)this.m_flG) / num4); float num5 = num1 * 60f; - if ((double)num5 < 0.0) + if (num5 < 0.0) num5 += 360f; return num5; } @@ -143,16 +143,16 @@ namespace Microsoft.Iris.Render float num = 0.0f; float flValue1 = this.m_flR; float flValue2 = this.m_flR; - if ((double)this.m_flG > (double)flValue1) + if (m_flG > (double)flValue1) flValue1 = this.m_flG; - if ((double)this.m_flB > (double)flValue1) + if (m_flB > (double)flValue1) flValue1 = this.m_flB; - if ((double)this.m_flG < (double)flValue2) + if (m_flG < (double)flValue2) flValue2 = this.m_flG; - if ((double)this.m_flB < (double)flValue2) + if (m_flB < (double)flValue2) flValue2 = this.m_flB; if (!Math2.WithinEpsilon(flValue1, flValue2)) - num = ((double)flValue1 + (double)flValue2) / 2.0 > 0.5 ? (float)(((double)flValue1 - (double)flValue2) / (2.0 - (double)flValue1 - (double)flValue2)) : (float)(((double)flValue1 - (double)flValue2) / ((double)flValue1 + (double)flValue2)); + num = (flValue1 + (double)flValue2) / 2.0 > 0.5 ? (float)((flValue1 - (double)flValue2) / (2.0 - flValue1 - flValue2)) : (float)((flValue1 - (double)flValue2) / (flValue1 + (double)flValue2)); return num; } @@ -162,17 +162,17 @@ namespace Microsoft.Iris.Render float flSaturation, float flValue) { - Debug2.Validate((double)flHue >= 0.0 && (double)flHue < 360.0, typeof(ArgumentOutOfRangeException), nameof(flHue)); - Debug2.Validate((double)flSaturation >= 0.0 && (double)flSaturation <= 1.0, typeof(ArgumentOutOfRangeException), nameof(flSaturation)); - Debug2.Validate((double)flValue >= 0.0 && (double)flValue <= 1.0, typeof(ArgumentOutOfRangeException), nameof(flValue)); + Debug2.Validate(flHue >= 0.0 && flHue < 360.0, typeof(ArgumentOutOfRangeException), nameof(flHue)); + Debug2.Validate(flSaturation >= 0.0 && flSaturation <= 1.0, typeof(ArgumentOutOfRangeException), nameof(flSaturation)); + Debug2.Validate(flValue >= 0.0 && flValue <= 1.0, typeof(ArgumentOutOfRangeException), nameof(flValue)); if (Math2.WithinEpsilon(flSaturation, 0.0f)) return new ColorF(flAlpha, flValue, flValue, flValue); float num1 = flHue / 60f; - int num2 = (int)Math.Floor((double)num1) % 6; - float num3 = num1 - (float)num2; + int num2 = (int)Math.Floor(num1) % 6; + float num3 = num1 - num2; float num4 = flValue * (1f - flSaturation); - float num5 = flValue * (float)(1.0 - (double)num3 * (double)flSaturation); - float num6 = flValue * (float)(1.0 - (1.0 - (double)num3) * (double)flSaturation); + float num5 = flValue * (float)(1.0 - num3 * (double)flSaturation); + float num6 = flValue * (float)(1.0 - (1.0 - num3) * flSaturation); switch (num2) { case 0: diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/ByteBuilder.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/ByteBuilder.cs index a534495..60b2749 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/ByteBuilder.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/ByteBuilder.cs @@ -19,7 +19,7 @@ namespace Microsoft.Iris.Render.Common { this.m_data = new byte[nMaxSize]; this.m_nCurrentIndex = 0; - this.m_nHashCode = (byte)0; + this.m_nHashCode = 0; } internal int Capacity => this.m_data.Length; @@ -34,31 +34,31 @@ namespace Microsoft.Iris.Render.Common internal unsafe void AppendInt(int nData) { - Marshal.Copy(new IntPtr((void*)&nData), this.m_data, this.m_nCurrentIndex, 4); + Marshal.Copy(new IntPtr(&nData), this.m_data, this.m_nCurrentIndex, 4); this.m_nCurrentIndex += 4; } internal unsafe void AppendFloat(float fData) { - Marshal.Copy(new IntPtr((void*)&fData), this.m_data, this.m_nCurrentIndex, 4); + Marshal.Copy(new IntPtr(&fData), this.m_data, this.m_nCurrentIndex, 4); this.m_nCurrentIndex += 4; } internal unsafe void AppendVector(Vector2 vData) { - Marshal.Copy(new IntPtr((void*)&vData), this.m_data, this.m_nCurrentIndex, sizeof(Vector2)); + Marshal.Copy(new IntPtr(&vData), this.m_data, this.m_nCurrentIndex, sizeof(Vector2)); this.m_nCurrentIndex += 8; } internal unsafe void AppendVector(Vector3 vData) { - Marshal.Copy(new IntPtr((void*)&vData), this.m_data, this.m_nCurrentIndex, sizeof(Vector3)); + Marshal.Copy(new IntPtr(&vData), this.m_data, this.m_nCurrentIndex, sizeof(Vector3)); this.m_nCurrentIndex += 12; } internal unsafe void AppendVector(Vector4 vData) { - Marshal.Copy(new IntPtr((void*)&vData), this.m_data, this.m_nCurrentIndex, sizeof(Vector4)); + Marshal.Copy(new IntPtr(&vData), this.m_data, this.m_nCurrentIndex, sizeof(Vector4)); this.m_nCurrentIndex += 16; } @@ -66,13 +66,13 @@ namespace Microsoft.Iris.Render.Common public override int GetHashCode() { - if (this.m_nHashCode != (byte)0) - return (int)this.m_nHashCode; + if (this.m_nHashCode != 0) + return m_nHashCode; int num = 0; for (int index = 0; index < this.m_nCurrentIndex; ++index) - num += (int)this.m_data[index]; + num += this.m_data[index]; this.m_nHashCode = (byte)num; - return (int)this.m_nHashCode; + return m_nHashCode; } public override bool Equals(object obj) @@ -82,7 +82,7 @@ namespace Microsoft.Iris.Render.Common return false; for (int index = 0; index < this.Size; ++index) { - if ((int)this.m_data[index] != (int)byteBuilder.m_data[index]) + if (this.m_data[index] != byteBuilder.m_data[index]) return false; } return true; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/Debug2.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/Debug2.cs index b677828..e318118 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/Debug2.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/Debug2.cs @@ -16,56 +16,56 @@ namespace Microsoft.Iris.Render.Common internal static IDebug Module { - get => Debug2.s_debug; - set => Debug2.s_debug = value; + get => s_debug; + set => s_debug = value; } [Conditional("DEBUG")] internal static void Enter(string stBlock) { - if (Debug2.s_debug == null) + if (s_debug == null) return; - Debug2.s_debug.Enter(stBlock); + s_debug.Enter(stBlock); } [Conditional("DEBUG")] internal static void Leave(string stBlock) { - if (Debug2.s_debug == null) + if (s_debug == null) return; - Debug2.s_debug.Leave(stBlock); + s_debug.Leave(stBlock); } [Conditional("DEBUG")] internal static void Assert(bool condition, string stMessage) { - if (condition || Debug2.s_debug == null) + if (condition || s_debug == null) return; - Debug2.s_debug.Assert(condition, stMessage); + s_debug.Assert(condition, stMessage); } [Conditional("DEBUG")] internal static void Assert(bool condition, string format, object arg1) { - if (condition || Debug2.s_debug == null) + if (condition || s_debug == null) return; - Debug2.s_debug.Assert(condition, string.Format(format, arg1)); + s_debug.Assert(condition, string.Format(format, arg1)); } [Conditional("DEBUG")] internal static void Assert(bool condition, string format, object arg1, object arg2) { - if (condition || Debug2.s_debug == null) + if (condition || s_debug == null) return; - Debug2.s_debug.Assert(condition, string.Format(format, arg1, arg2)); + s_debug.Assert(condition, string.Format(format, arg1, arg2)); } internal static void Throw(bool condition, string format) { if (!condition) { - if (Debug2.s_debug != null) - Debug2.s_debug.Throw(condition, format); + if (s_debug != null) + s_debug.Throw(condition, format); throw new InvalidOperationException(format); } } @@ -74,9 +74,9 @@ namespace Microsoft.Iris.Render.Common { if (!condition) { - if (Debug2.s_debug != null) - Debug2.s_debug.Throw(condition, string.Format(format, arg1)); - throw new InvalidOperationException(string.Format((IFormatProvider)CultureInfo.InvariantCulture, format, arg1)); + if (s_debug != null) + s_debug.Throw(condition, string.Format(format, arg1)); + throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, format, arg1)); } } @@ -103,17 +103,17 @@ namespace Microsoft.Iris.Render.Common [Conditional("DEBUG")] internal static void Write(DebugCategory category, int verbosityLevel, string message) { - if (!Debug2.IsCategoryEnabled(category, verbosityLevel)) + if (!IsCategoryEnabled(category, verbosityLevel)) return; - Debug2.s_debug.Write(category, verbosityLevel, message); + s_debug.Write(category, verbosityLevel, message); } [Conditional("DEBUG")] internal static void WriteLine(DebugCategory category, int verbosityLevel, string format) { - if (!Debug2.IsCategoryEnabled(category, verbosityLevel)) + if (!IsCategoryEnabled(category, verbosityLevel)) return; - Debug2.s_debug.WriteLine(category, verbosityLevel, format); + s_debug.WriteLine(category, verbosityLevel, format); } [Conditional("DEBUG")] @@ -123,9 +123,9 @@ namespace Microsoft.Iris.Render.Common string format, object arg1) { - if (!Debug2.IsCategoryEnabled(category, verbosityLevel)) + if (!IsCategoryEnabled(category, verbosityLevel)) return; - Debug2.s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1)); + s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1)); } [Conditional("DEBUG")] @@ -136,9 +136,9 @@ namespace Microsoft.Iris.Render.Common object arg1, object arg2) { - if (!Debug2.IsCategoryEnabled(category, verbosityLevel)) + if (!IsCategoryEnabled(category, verbosityLevel)) return; - Debug2.s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2)); + s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2)); } [Conditional("DEBUG")] @@ -150,9 +150,9 @@ namespace Microsoft.Iris.Render.Common object arg2, object arg3) { - if (!Debug2.IsCategoryEnabled(category, verbosityLevel)) + if (!IsCategoryEnabled(category, verbosityLevel)) return; - Debug2.s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3)); + s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3)); } [Conditional("DEBUG")] @@ -165,9 +165,9 @@ namespace Microsoft.Iris.Render.Common object arg3, object arg4) { - if (!Debug2.IsCategoryEnabled(category, verbosityLevel)) + if (!IsCategoryEnabled(category, verbosityLevel)) return; - Debug2.s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4)); + s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4)); } [Conditional("DEBUG")] @@ -181,9 +181,9 @@ namespace Microsoft.Iris.Render.Common object arg4, object arg5) { - if (!Debug2.IsCategoryEnabled(category, verbosityLevel)) + if (!IsCategoryEnabled(category, verbosityLevel)) return; - Debug2.s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4, arg5)); + s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4, arg5)); } [Conditional("DEBUG")] @@ -198,9 +198,9 @@ namespace Microsoft.Iris.Render.Common object arg5, object arg6) { - if (!Debug2.IsCategoryEnabled(category, verbosityLevel)) + if (!IsCategoryEnabled(category, verbosityLevel)) return; - Debug2.s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6)); + s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6)); } [Conditional("DEBUG")] @@ -216,25 +216,25 @@ namespace Microsoft.Iris.Render.Common object arg6, object arg7) { - if (!Debug2.IsCategoryEnabled(category, verbosityLevel)) + if (!IsCategoryEnabled(category, verbosityLevel)) return; - Debug2.s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7)); + s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7)); } [Conditional("DEBUG")] internal static void Indent(DebugCategory category, int verbosityLevel) { - if (!Debug2.IsCategoryEnabled(category, verbosityLevel)) + if (!IsCategoryEnabled(category, verbosityLevel)) return; - Debug2.s_debug.Indent(category, verbosityLevel); + s_debug.Indent(category, verbosityLevel); } [Conditional("DEBUG")] internal static void Unindent(DebugCategory category, int verbosityLevel) { - if (!Debug2.IsCategoryEnabled(category, verbosityLevel)) + if (!IsCategoryEnabled(category, verbosityLevel)) return; - Debug2.s_debug.Unindent(category, verbosityLevel); + s_debug.Unindent(category, verbosityLevel); } [Conditional("DEBUG")] @@ -254,7 +254,7 @@ namespace Microsoft.Iris.Render.Common string format, object arg1) { - if (!Debug2.IsCategoryEnabled(category, verbosityLevel)) + if (!IsCategoryEnabled(category, verbosityLevel)) ; } @@ -266,7 +266,7 @@ namespace Microsoft.Iris.Render.Common object arg1, object arg2) { - if (!Debug2.IsCategoryEnabled(category, verbosityLevel)) + if (!IsCategoryEnabled(category, verbosityLevel)) ; } @@ -275,7 +275,7 @@ namespace Microsoft.Iris.Render.Common { } - internal static bool IsCategoryEnabled(DebugCategory category, int verbosityLevel) => Debug2.s_debug != null && Debug2.s_debug.IsCategoryEnabled(category, verbosityLevel); + internal static bool IsCategoryEnabled(DebugCategory category, int verbosityLevel) => s_debug != null && s_debug.IsCategoryEnabled(category, verbosityLevel); internal static void DumpException(Debug2.ExceptionType exceptionType, Exception e) { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/DeferredInvokeItem.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/DeferredInvokeItem.cs index 2bce161..22489e9 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/DeferredInvokeItem.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/DeferredInvokeItem.cs @@ -21,7 +21,7 @@ namespace Microsoft.Iris.Render.Common this.m_owner = owner; if (this.m_owner == null) return; - this.m_owner.RegisterUsage((object)this); + this.m_owner.RegisterUsage(this); } public void Dispatch() @@ -29,7 +29,7 @@ namespace Microsoft.Iris.Render.Common ((DeferredHandler)this.m_method)(this.m_args); if (this.m_owner == null) return; - this.m_owner.UnregisterUsage((object)this); + this.m_owner.UnregisterUsage(this); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/ObjectCache.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/ObjectCache.cs index 7ff3f37..b42d24b 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/ObjectCache.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/ObjectCache.cs @@ -36,11 +36,11 @@ namespace Microsoft.Iris.Render.Common { foreach (CachedRenderObject listObject in this.m_listObjects) { - listObject.Cache = (ObjectCache)null; - listObject.UnregisterUsage((object)this); + listObject.Cache = null; + listObject.UnregisterUsage(this); } } - this.m_listObjects = (Vector)null; + this.m_listObjects = null; } finally { @@ -54,7 +54,7 @@ namespace Microsoft.Iris.Render.Common { if (this.m_listObjects.Count < this.m_listObjects.Capacity) { - obj.RegisterUsage((object)this); + obj.RegisterUsage(this); this.m_listObjects.Add(obj); return true; } @@ -71,19 +71,19 @@ namespace Microsoft.Iris.Render.Common CachedRenderObject listObject = this.m_listObjects[index]; this.m_listObjects.RemoveAt(index); listObject.RegisterUsage(objUser); - listObject.UnregisterUsage((object)this); + listObject.UnregisterUsage(this); return listObject; } ++this.m_cCacheMisses; - return (CachedRenderObject)null; + return null; } internal void RemoveAll() { foreach (CachedRenderObject listObject in this.m_listObjects) { - listObject.Cache = (ObjectCache)null; - listObject.UnregisterUsage((object)this); + listObject.Cache = null; + listObject.UnregisterUsage(this); } this.m_listObjects.Clear(); } @@ -102,8 +102,8 @@ namespace Microsoft.Iris.Render.Common for (int index = this.m_listObjects.Count - 1; index >= num; --index) { CachedRenderObject listObject = this.m_listObjects[index]; - listObject.Cache = (ObjectCache)null; - listObject.UnregisterUsage((object)this); + listObject.Cache = null; + listObject.UnregisterUsage(this); this.m_listObjects.RemoveAt(index); } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/ObjectCacheManager.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/ObjectCacheManager.cs index bf9cc1b..5eb62c0 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/ObjectCacheManager.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/ObjectCacheManager.cs @@ -43,7 +43,7 @@ namespace Microsoft.Iris.Render.Common { if (this.m_fPendingUpdateCache || this.m_listCaches.Count <= 0) return; - this.m_sesion.DeferredInvoke((Delegate)this.m_cbUpdateCache, (object)null, DeferredInvokePriority.Idle, new TimeSpan(0, 0, 5)); + this.m_sesion.DeferredInvoke(m_cbUpdateCache, null, DeferredInvokePriority.Idle, new TimeSpan(0, 0, 5)); this.m_fPendingUpdateCache = true; } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/RenderObject.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/RenderObject.cs index 625b651..87a1b86 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/RenderObject.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/RenderObject.cs @@ -27,7 +27,7 @@ namespace Microsoft.Iris.Render.Common if (this.m_fObjectDisposed) return; this.Dispose(true); - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); } protected virtual void Dispose(bool fInDispose) => this.m_fObjectDisposed = true; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/ResourceTracker.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/ResourceTracker.cs index 3a58d2b..bd7e152 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/ResourceTracker.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/ResourceTracker.cs @@ -33,7 +33,7 @@ namespace Microsoft.Iris.Render.Common --this.m_cUsers; if (this.m_cUsers != 0) return; - this.m_uLastUsage = ResourceTracker.s_uNextUsage++; + this.m_uLastUsage = s_uNextUsage++; this.NotifyUsageChange(false); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/SharedRenderObject.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/SharedRenderObject.cs index 85ca69b..4f7a332 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/SharedRenderObject.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/SharedRenderObject.cs @@ -22,7 +22,7 @@ namespace Microsoft.Iris.Render.Common private void Dispose() { this.Dispose(true); - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); } protected virtual void Dispose(bool fInDispose) diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/SharedResource.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/SharedResource.cs index aa67645..405895e 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/SharedResource.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/SharedResource.cs @@ -48,7 +48,7 @@ namespace Microsoft.Iris.Render.Common this.m_resourceTracker.RemoveActiveUser(oUser); if (this.m_resourceTracker.InUse) return; - this.m_resourceTracker = (ResourceTracker)null; + this.m_resourceTracker = null; } protected abstract void OnUsageChange(bool fUsed); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/SharedResourceArray.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/SharedResourceArray.cs index 8230446..0724b73 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/SharedResourceArray.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/SharedResourceArray.cs @@ -13,14 +13,14 @@ namespace Microsoft.Iris.Render.Common private SharedResource[] m_rgResources; internal SharedResourceArray(SharedResource resource) - : base((RenderSession)null) + : base(null) { this.m_rgResources = new SharedResource[1]; this.m_rgResources[0] = resource; } internal SharedResourceArray(SharedResource[] rgResources) - : base((RenderSession)null) + : base(null) => this.m_rgResources = rgResources; protected override void OnUsageChange(bool fUsed) @@ -30,9 +30,9 @@ namespace Microsoft.Iris.Render.Common if (this.m_rgResources[index] != null) { if (fUsed) - this.m_rgResources[index].AddActiveUser((object)this); + this.m_rgResources[index].AddActiveUser(this); else - this.m_rgResources[index].RemoveActiveUser((object)this); + this.m_rgResources[index].RemoveActiveUser(this); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/SmartMap`1.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/SmartMap`1.cs index 78659e2..b706cbf 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/SmartMap`1.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/SmartMap`1.cs @@ -31,7 +31,7 @@ namespace Microsoft.Iris.Render.Common { foreach (SmartMap.Entry entry in this.m_entryList) { - if (entry.oData.Equals((object)desired)) + if (entry.oData.Equals(desired)) { key = entry.key; return true; @@ -121,8 +121,8 @@ namespace Microsoft.Iris.Render.Common { int length = this.m_entryList.Length; entryArray = new SmartMap.Entry[length + 1]; - Array.Copy((Array)this.m_entryList, (Array)entryArray, slotIndex); - Array.Copy((Array)this.m_entryList, slotIndex, (Array)entryArray, slotIndex + 1, length - slotIndex); + Array.Copy(m_entryList, entryArray, slotIndex); + Array.Copy(m_entryList, slotIndex, entryArray, slotIndex + 1, length - slotIndex); } this.m_entryList = entryArray; this.m_entryList[slotIndex].key = key; @@ -135,12 +135,12 @@ namespace Microsoft.Iris.Render.Common if (length > 0) { SmartMap.Entry[] entryArray = new SmartMap.Entry[length - 1]; - Array.Copy((Array)this.m_entryList, (Array)entryArray, slotIndex); - Array.Copy((Array)this.m_entryList, slotIndex + 1, (Array)entryArray, slotIndex, length - (slotIndex + 1)); + Array.Copy(m_entryList, entryArray, slotIndex); + Array.Copy(m_entryList, slotIndex + 1, entryArray, slotIndex, length - (slotIndex + 1)); this.m_entryList = entryArray; } else - this.m_entryList = (SmartMap.Entry[])null; + this.m_entryList = null; } private struct Entry diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/ComplexImageElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/ComplexImageElement.cs index 1ae42df..c104e42 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/ComplexImageElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/ComplexImageElement.cs @@ -42,7 +42,7 @@ namespace Microsoft.Iris.Render this.m_modeMinFilter = ftrMinification; this.m_modeMagFilter = ftrMagnification; this.m_idxCoordinateMap = idxCoordinateMap; - this.m_idxImageIndex = (byte)0; + this.m_idxImageIndex = 0; this.Image = imgSource; } @@ -57,7 +57,7 @@ namespace Microsoft.Iris.Render Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentNullException), nameof(stName)); Debug2.Validate(imgSource != null, typeof(ArgumentNullException), nameof(imgSource)); Debug2.Validate(imgSource.Length > 0, typeof(ArgumentException), "ImgSource"); - Debug2.Validate(imgSource.Length > (int)idxImageIndex, typeof(ArgumentOutOfRangeException), nameof(idxImageIndex)); + Debug2.Validate(imgSource.Length > idxImageIndex, typeof(ArgumentOutOfRangeException), nameof(idxImageIndex)); this.m_typeInput = EffectInputType.ComplexImage; this.m_stName = stName; this.m_modeMinFilter = ftrMinification; @@ -69,7 +69,7 @@ namespace Microsoft.Iris.Render public IImage Image { - get => this.m_rgImages == null || this.m_rgImages.Length < 1 ? (IImage)null : this.m_rgImages[0]; + get => this.m_rgImages == null || this.m_rgImages.Length < 1 ? null : this.m_rgImages[0]; set { this.m_rgImages = new IImage[1]; @@ -125,7 +125,7 @@ namespace Microsoft.Iris.Render Map dictionary, ref byte nNextUniqueID) { - int num = base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "MinFilter", (byte)5, ref this.m_nMinFilterID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "MagFilter", (byte)5, ref this.m_nMagFilterID, ref nNextUniqueID); + int num = base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "MinFilter", 5, ref this.m_nMinFilterID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "MagFilter", 5, ref this.m_nMagFilterID, ref nNextUniqueID); this.AddEffectProperty(dictionary, "CoordinateMapIndex"); this.m_nCoordinateMapID = nNextUniqueID++; this.AddEffectProperty(dictionary, "Image"); @@ -137,12 +137,12 @@ namespace Microsoft.Iris.Render internal override bool Process(Map dictProperties) { - if (!this.GenerateProperty("MinFilter", EffectPropertyType.Integer, (object)(int)this.MinFilter, this.m_nMinFilterID, dictProperties) || !this.GenerateProperty("MagFilter", EffectPropertyType.Integer, (object)(int)this.MagFilter, this.m_nMagFilterID, dictProperties) || (!this.GenerateProperty("CoordinateMapIndex", EffectPropertyType.Integer, (object)(int)this.CoordinateMapIndex, this.m_nCoordinateMapID, dictProperties) || !this.GenerateProperty("ImageIndex", EffectPropertyType.Integer, (object)(int)this.ImageIndex, this.m_nImageIndexID, dictProperties))) + if (!this.GenerateProperty("MinFilter", EffectPropertyType.Integer, (int)this.MinFilter, this.m_nMinFilterID, dictProperties) || !this.GenerateProperty("MagFilter", EffectPropertyType.Integer, (int)this.MagFilter, this.m_nMagFilterID, dictProperties) || (!this.GenerateProperty("CoordinateMapIndex", EffectPropertyType.Integer, (int)this.CoordinateMapIndex, this.m_nCoordinateMapID, dictProperties) || !this.GenerateProperty("ImageIndex", EffectPropertyType.Integer, (int)this.ImageIndex, this.m_nImageIndexID, dictProperties))) return false; SharedResource[] rgResources = new SharedResource[this.m_rgImages.Length]; for (int index = 0; index < this.m_rgImages.Length; ++index) rgResources[index] = (SharedResource)this.m_rgImages[index]; - return this.GenerateProperty("Image", EffectPropertyType.ImageArray, (object)new SharedResourceArray(rgResources), this.m_nImageID, dictProperties); + return this.GenerateProperty("Image", EffectPropertyType.ImageArray, new SharedResourceArray(rgResources), this.m_nImageID, dictProperties); } internal override void AddCacheKey(ByteBuilder cacheKey) diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/ConstantAnimationInput.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/ConstantAnimationInput.cs index 3c0715a..3cd9398 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/ConstantAnimationInput.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/ConstantAnimationInput.cs @@ -13,7 +13,7 @@ namespace Microsoft.Iris.Render private object m_inputValue; public ConstantAnimationInput(float sourceValue) - : this(sourceValue, (string)null) + : this(sourceValue, null) { } @@ -21,11 +21,11 @@ namespace Microsoft.Iris.Render { AnimationTypeMask animationTypeMask = AnimationTypeMask.FromString(sourceMaskSpec); this.CommonCreate(AnimationInputType.Float, animationTypeMask); - this.m_inputValue = this.ApplyMask(animationTypeMask, (object)sourceValue); + this.m_inputValue = this.ApplyMask(animationTypeMask, sourceValue); } public ConstantAnimationInput(Vector2 sourceValue) - : this(sourceValue, (string)null) + : this(sourceValue, null) { } @@ -33,11 +33,11 @@ namespace Microsoft.Iris.Render { AnimationTypeMask animationTypeMask = AnimationTypeMask.FromString(sourceMaskSpec); this.CommonCreate(AnimationInputType.Vector2, animationTypeMask); - this.m_inputValue = this.ApplyMask(animationTypeMask, (object)sourceValue); + this.m_inputValue = this.ApplyMask(animationTypeMask, sourceValue); } public ConstantAnimationInput(Vector3 sourceValue) - : this(sourceValue, (string)null) + : this(sourceValue, null) { } @@ -45,11 +45,11 @@ namespace Microsoft.Iris.Render { AnimationTypeMask animationTypeMask = AnimationTypeMask.FromString(sourceMaskSpec); this.CommonCreate(AnimationInputType.Vector3, animationTypeMask); - this.m_inputValue = this.ApplyMask(animationTypeMask, (object)sourceValue); + this.m_inputValue = this.ApplyMask(animationTypeMask, sourceValue); } public ConstantAnimationInput(Vector4 sourceValue) - : this(sourceValue, (string)null) + : this(sourceValue, null) { } @@ -57,11 +57,11 @@ namespace Microsoft.Iris.Render { AnimationTypeMask animationTypeMask = AnimationTypeMask.FromString(sourceMaskSpec); this.CommonCreate(AnimationInputType.Vector4, animationTypeMask); - this.m_inputValue = this.ApplyMask(animationTypeMask, (object)sourceValue); + this.m_inputValue = this.ApplyMask(animationTypeMask, sourceValue); } public ConstantAnimationInput(Quaternion sourceValue) - : this(sourceValue, (string)null) + : this(sourceValue, null) { } @@ -69,14 +69,14 @@ namespace Microsoft.Iris.Render { AnimationTypeMask animationTypeMask = AnimationTypeMask.FromString(sourceMaskSpec); this.CommonCreate(AnimationInputType.Quaternion, animationTypeMask); - this.m_inputValue = this.ApplyMask(animationTypeMask, (object)sourceValue); + this.m_inputValue = this.ApplyMask(animationTypeMask, sourceValue); } internal object RawValue => this.m_inputValue; private object ApplyMask(AnimationTypeMask mask, object value) { - object obj = (object)null; + object obj = null; if (mask.ChannelCount == 0U) { obj = value; @@ -117,23 +117,23 @@ namespace Microsoft.Iris.Render numArray[3] = quaternion.W; break; default: - Debug2.Throw(false, "Unsupported type: {0}", (object)value.GetType()); + Debug2.Throw(false, "Unsupported type: {0}", value.GetType()); break; } switch (mask.ChannelCount) { case 1: - obj = (object)(float)(mask[0] == AnimationTypeChannel.O ? 0.0 : (double)numArray[(int)(mask[0] - 1)]); + obj = (float)(mask[0] == AnimationTypeChannel.O ? 0.0 : numArray[(int)(mask[0] - 1)]); break; case 2: - obj = (object)new Vector2() + obj = new Vector2() { X = (mask[0] == AnimationTypeChannel.O ? 0.0f : numArray[(int)(mask[0] - 1)]), Y = (mask[1] == AnimationTypeChannel.O ? 0.0f : numArray[(int)(mask[1] - 1)]) }; break; case 3: - obj = (object)new Vector3() + obj = new Vector3() { X = (mask[0] == AnimationTypeChannel.O ? 0.0f : numArray[(int)(mask[0] - 1)]), Y = (mask[1] == AnimationTypeChannel.O ? 0.0f : numArray[(int)(mask[1] - 1)]), @@ -141,7 +141,7 @@ namespace Microsoft.Iris.Render }; break; case 4: - obj = (object)new Vector4() + obj = new Vector4() { X = (mask[0] == AnimationTypeChannel.O ? 0.0f : numArray[(int)(mask[0] - 1)]), Y = (mask[1] == AnimationTypeChannel.O ? 0.0f : numArray[(int)(mask[1] - 1)]), diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/ContinuousAnimationInput.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/ContinuousAnimationInput.cs index ce98981..82c663b 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/ContinuousAnimationInput.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/ContinuousAnimationInput.cs @@ -11,7 +11,7 @@ namespace Microsoft.Iris.Render public sealed class ContinuousAnimationInput : ObjectAnimationInput { public ContinuousAnimationInput(IAnimatable sourceObject, string sourcePropertyName) - : this(sourceObject, sourcePropertyName, (string)null) + : this(sourceObject, sourcePropertyName, null) { } @@ -24,7 +24,7 @@ namespace Microsoft.Iris.Render } public ContinuousAnimationInput(IAnimation sourceAnimation) - : this(sourceAnimation, (string)null) + : this(sourceAnimation, null) { } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/ContrastElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/ContrastElement.cs index 05a835d..6730d34 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/ContrastElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/ContrastElement.cs @@ -20,7 +20,7 @@ namespace Microsoft.Iris.Render : this() { Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); - Debug2.Validate((double)flConstrastAdjust >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Contrast [0..)"); + Debug2.Validate(flConstrastAdjust >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Contrast [0..)"); this.m_flContrast = flConstrastAdjust; this.m_stName = stName; } @@ -39,10 +39,10 @@ namespace Microsoft.Iris.Render Map dictionary, ref byte nNextUniqueID) { - return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Contrast", (byte)8, ref this.m_nContrastID, ref nNextUniqueID); + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Contrast", 8, ref this.m_nContrastID, ref nNextUniqueID); } - internal override bool Process(Map dictProperties) => this.GenerateProperty("Contrast", EffectPropertyType.Float, (object)this.m_flContrast, this.m_nContrastID, dictProperties); + internal override bool Process(Map dictProperties) => this.GenerateProperty("Contrast", EffectPropertyType.Float, m_flContrast, this.m_nContrastID, dictProperties); internal override void AddCacheKey(ByteBuilder cacheKey) { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/CoordMap.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/CoordMap.cs index 8460ae9..03da016 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/CoordMap.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/CoordMap.cs @@ -18,16 +18,16 @@ namespace Microsoft.Iris.Render public void AddValue(float flPosition, float flValue, Orientation or) { - Debug2.Validate((double)flPosition >= 0.0, typeof(ArgumentOutOfRangeException), "flPosition cannot be less than 0.0f"); - Debug2.Validate((double)flValue >= 0.0, typeof(ArgumentOutOfRangeException), "flValue cannot be less than 0.0f"); - Debug2.Validate((double)flPosition <= 1.0, typeof(ArgumentOutOfRangeException), "flPosition cannot exceed 1.0f"); - Debug2.Validate((double)flValue <= 1.0, typeof(ArgumentOutOfRangeException), "flValue cannot exceed 1.0f"); + Debug2.Validate(flPosition >= 0.0, typeof(ArgumentOutOfRangeException), "flPosition cannot be less than 0.0f"); + Debug2.Validate(flValue >= 0.0, typeof(ArgumentOutOfRangeException), "flValue cannot be less than 0.0f"); + Debug2.Validate(flPosition <= 1.0, typeof(ArgumentOutOfRangeException), "flPosition cannot exceed 1.0f"); + Debug2.Validate(flValue <= 1.0, typeof(ArgumentOutOfRangeException), "flValue cannot exceed 1.0f"); foreach (CoordMap.CoordMapSample alMap in this.m_alMaps) { if (or == alMap.Orientation) - Debug2.Validate((double)flPosition != (double)alMap.flPosition, typeof(ArgumentException), "CoordMap cannot have two entries with the same flPosition and the same Orientation"); + Debug2.Validate(flPosition != (double)alMap.flPosition, typeof(ArgumentException), "CoordMap cannot have two entries with the same flPosition and the same Orientation"); } - this.m_alMaps.Add((object)new CoordMap.CoordMapSample(flPosition, flValue, or)); + this.m_alMaps.Add(new CoordMap.CoordMapSample(flPosition, flValue, or)); } public void Clear() => this.m_alMaps.Clear(); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/DesaturateElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/DesaturateElement.cs index dd28a64..9286fd9 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/DesaturateElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/DesaturateElement.cs @@ -20,7 +20,7 @@ namespace Microsoft.Iris.Render : this() { Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); - Debug2.Validate((double)flDesaturate >= 0.0 && (double)flDesaturate <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for desaturate is [0,1]"); + Debug2.Validate(flDesaturate >= 0.0 && flDesaturate <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for desaturate is [0,1]"); this.m_flDesaturate = flDesaturate; this.m_stName = stName; } @@ -39,10 +39,10 @@ namespace Microsoft.Iris.Render Map dictionary, ref byte nNextUniqueID) { - return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Desaturate", (byte)8, ref this.m_nDesaturateID, ref nNextUniqueID); + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Desaturate", 8, ref this.m_nDesaturateID, ref nNextUniqueID); } - internal override bool Process(Map dictProperties) => this.GenerateProperty("Desaturate", EffectPropertyType.Float, (object)this.m_flDesaturate, this.m_nDesaturateID, dictProperties); + internal override bool Process(Map dictProperties) => this.GenerateProperty("Desaturate", EffectPropertyType.Float, m_flDesaturate, this.m_nDesaturateID, dictProperties); internal override void AddCacheKey(ByteBuilder cacheKey) { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/DestinationElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/DestinationElement.cs index a1987e3..df94062 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/DestinationElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/DestinationElement.cs @@ -28,7 +28,7 @@ namespace Microsoft.Iris.Render public DestinationElement(float flDownsample) { - Debug2.Validate((double)flDownsample >= 0.0 && (double)flDownsample <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for downsample is [0,1]"); + Debug2.Validate(flDownsample >= 0.0 && flDownsample <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for downsample is [0,1]"); this.m_stName = "Destination"; this.m_typeInput = EffectInputType.Destination; this.m_flDownsample = flDownsample; @@ -61,15 +61,15 @@ namespace Microsoft.Iris.Render this.m_nDestinationID = nNextUniqueID++; this.AddEffectProperty(dictionary, "Downsample"); this.m_nDownsampleID = nNextUniqueID++; - return num + this.PreProcessProperty(dictionary, "UVOffset", (byte)12, ref this.m_nUVOffsetID, ref nNextUniqueID); + return num + this.PreProcessProperty(dictionary, "UVOffset", 12, ref this.m_nUVOffsetID, ref nNextUniqueID); } internal override bool Process(Map dictProperties) { - if (!this.GenerateProperty("Destination", EffectPropertyType.Image, (object)null, this.m_nDestinationID, dictProperties)) + if (!this.GenerateProperty("Destination", EffectPropertyType.Image, null, this.m_nDestinationID, dictProperties)) return false; dictProperties[this.GeneratePropertyPath("Destination")].IsDynamic = true; - return this.GenerateProperty("Downsample", EffectPropertyType.Float, (object)this.m_flDownsample, this.m_nDownsampleID, dictProperties) && this.GenerateProperty("UVOffset", EffectPropertyType.Vector2, (object)this.m_UVOffset, this.m_nUVOffsetID, dictProperties); + return this.GenerateProperty("Downsample", EffectPropertyType.Float, m_flDownsample, this.m_nDownsampleID, dictProperties) && this.GenerateProperty("UVOffset", EffectPropertyType.Vector2, m_UVOffset, this.m_nUVOffsetID, dictProperties); } internal override void AddCacheKey(ByteBuilder cacheKey) diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/DisplayMode.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/DisplayMode.cs index a56c58e..80c5315 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/DisplayMode.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/DisplayMode.cs @@ -122,12 +122,12 @@ namespace Microsoft.Iris.Render public class RenderModeComparer : IComparer { - public int Compare(DisplayMode dmA, DisplayMode dmB) => DisplayMode.CompareRenderModes(dmA, dmB); + public int Compare(DisplayMode dmA, DisplayMode dmB) => CompareRenderModes(dmA, dmB); } public class SimilarModeComparer : IComparer { - public int Compare(DisplayMode dmA, DisplayMode dmB) => DisplayMode.CompareSimilarModes(dmA, dmB); + public int Compare(DisplayMode dmA, DisplayMode dmB) => CompareSimilarModes(dmA, dmB); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/EaseInInterpolation.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/EaseInInterpolation.cs index f05f0a5..28c6232 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/EaseInInterpolation.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/EaseInInterpolation.cs @@ -16,8 +16,8 @@ namespace Microsoft.Iris.Render public EaseInInterpolation(float weight, float handle) { - Debug2.Validate((double)weight > 0.0, typeof(ArgumentOutOfRangeException), nameof(weight)); - Debug2.Validate((double)handle > 0.0 && (double)handle < 1.0, typeof(ArgumentOutOfRangeException), nameof(handle)); + Debug2.Validate(weight > 0.0, typeof(ArgumentOutOfRangeException), nameof(weight)); + Debug2.Validate(handle > 0.0 && handle < 1.0, typeof(ArgumentOutOfRangeException), nameof(handle)); this.m_weight = weight; this.m_handle = handle; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/EaseOutInterpolation.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/EaseOutInterpolation.cs index c4e43f7..dd3c3ce 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/EaseOutInterpolation.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/EaseOutInterpolation.cs @@ -16,8 +16,8 @@ namespace Microsoft.Iris.Render public EaseOutInterpolation(float weight, float handle) { - Debug2.Validate((double)weight > 0.0, typeof(ArgumentOutOfRangeException), nameof(weight)); - Debug2.Validate((double)handle > 0.0 && (double)handle < 1.0, typeof(ArgumentOutOfRangeException), nameof(handle)); + Debug2.Validate(weight > 0.0, typeof(ArgumentOutOfRangeException), nameof(weight)); + Debug2.Validate(handle > 0.0 && handle < 1.0, typeof(ArgumentOutOfRangeException), nameof(handle)); this.m_weight = weight; this.m_handle = handle; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/EdgeDetectionElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/EdgeDetectionElement.cs index 8d5e784..3c374f9 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/EdgeDetectionElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/EdgeDetectionElement.cs @@ -38,10 +38,10 @@ namespace Microsoft.Iris.Render Map dictionary, ref byte nNextUniqueID) { - return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "EdgeLimit", (byte)8, ref this.m_nEdgeLimitID, ref nNextUniqueID); + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "EdgeLimit", 8, ref this.m_nEdgeLimitID, ref nNextUniqueID); } - internal override bool Process(Map dictProperties) => this.GenerateProperty("EdgeLimit", EffectPropertyType.Float, (object)this.m_flEdgeLimit, this.m_nEdgeLimitID, dictProperties); + internal override bool Process(Map dictProperties) => this.GenerateProperty("EdgeLimit", EffectPropertyType.Float, m_flEdgeLimit, this.m_nEdgeLimitID, dictProperties); internal override void AddCacheKey(ByteBuilder cacheKey) { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/EffectElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/EffectElement.cs index a0fea21..650ba35 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/EffectElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/EffectElement.cs @@ -41,7 +41,7 @@ namespace Microsoft.Iris.Render internal void GenerateClassCacheKey(byte nClass, byte nOperation, ByteBuilder cacheKey) { - cacheKey.AppendByte((byte)3); + cacheKey.AppendByte(3); cacheKey.AppendByte(nClass); cacheKey.AppendByte(nOperation); } @@ -54,9 +54,9 @@ namespace Microsoft.Iris.Render { if (this.IsDynamicProperty(stProp)) return; - cacheKey.AppendByte((byte)5); - cacheKey.AppendByte((byte)3); - cacheKey.AppendByte((byte)9); + cacheKey.AppendByte(5); + cacheKey.AppendByte(3); + cacheKey.AppendByte(9); cacheKey.AppendByte(nPropertyId); cacheKey.AppendByte(nValue); } @@ -69,9 +69,9 @@ namespace Microsoft.Iris.Render { if (this.IsDynamicProperty(stPropName)) return; - cacheKey.AppendByte((byte)8); - cacheKey.AppendByte((byte)3); - cacheKey.AppendByte((byte)0); + cacheKey.AppendByte(8); + cacheKey.AppendByte(3); + cacheKey.AppendByte(0); cacheKey.AppendByte(nPropertyId); cacheKey.AppendInt(nValue); } @@ -84,9 +84,9 @@ namespace Microsoft.Iris.Render { if (this.IsDynamicProperty(stPropName)) return; - cacheKey.AppendByte((byte)8); - cacheKey.AppendByte((byte)3); - cacheKey.AppendByte((byte)1); + cacheKey.AppendByte(8); + cacheKey.AppendByte(3); + cacheKey.AppendByte(1); cacheKey.AppendByte(nPropertyId); cacheKey.AppendFloat(fValue); } @@ -99,9 +99,9 @@ namespace Microsoft.Iris.Render { if (this.IsDynamicProperty(stPropName)) return; - cacheKey.AppendByte((byte)12); - cacheKey.AppendByte((byte)3); - cacheKey.AppendByte((byte)2); + cacheKey.AppendByte(12); + cacheKey.AppendByte(3); + cacheKey.AppendByte(2); cacheKey.AppendByte(nPropertyId); cacheKey.AppendVector(vValue); } @@ -114,9 +114,9 @@ namespace Microsoft.Iris.Render { if (this.IsDynamicProperty(stPropName)) return; - cacheKey.AppendByte((byte)16); - cacheKey.AppendByte((byte)3); - cacheKey.AppendByte((byte)3); + cacheKey.AppendByte(16); + cacheKey.AppendByte(3); + cacheKey.AppendByte(3); cacheKey.AppendByte(nPropertyId); cacheKey.AppendVector(vValue); } @@ -129,14 +129,14 @@ namespace Microsoft.Iris.Render { if (this.IsDynamicProperty(stPropName)) return; - cacheKey.AppendByte((byte)16); - cacheKey.AppendByte((byte)3); - cacheKey.AppendByte((byte)4); + cacheKey.AppendByte(16); + cacheKey.AppendByte(3); + cacheKey.AppendByte(4); cacheKey.AppendByte(nPropertyId); cacheKey.AppendVector(vValue); } - protected string GeneratePropertyPath(string stPropertyName) => string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0}.{1}", (object)this.m_stName, (object)stPropertyName); + protected string GeneratePropertyPath(string stPropertyName) => string.Format(CultureInfo.InvariantCulture, "{0}.{1}", m_stName, stPropertyName); internal bool GenerateProperty( string stName, @@ -175,7 +175,7 @@ namespace Microsoft.Iris.Render { string propertyPath = this.GeneratePropertyPath(stProp); if (!dictionary.ContainsKey(propertyPath)) - dictionary.Add(propertyPath, (EffectProperty)null); + dictionary.Add(propertyPath, null); this.MarkDynamicProperty(stProp); } @@ -201,7 +201,7 @@ namespace Microsoft.Iris.Render if (this.VerifyDynamicProperty(dictionary, stProperty)) nPropertyId = nNextUniqueID++; else - num = (int)nPropSize; + num = nPropSize; return num; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/EffectInput.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/EffectInput.cs index 36ce541..1ad010d 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/EffectInput.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/EffectInput.cs @@ -14,6 +14,6 @@ namespace Microsoft.Iris.Render internal EffectInputType Type => this.m_typeInput; - internal override void AddCacheKey(ByteBuilder cacheKey) => this.GenerateClassCacheKey((byte)0, (byte)this.m_typeInput, cacheKey); + internal override void AddCacheKey(ByteBuilder cacheKey) => this.GenerateClassCacheKey(0, (byte)this.m_typeInput, cacheKey); } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/EffectLayer.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/EffectLayer.cs index 33f5e2a..bb7fe9f 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/EffectLayer.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/EffectLayer.cs @@ -23,7 +23,7 @@ namespace Microsoft.Iris.Render Debug2.Validate(inputElement != null, typeof(ArgumentNullException), nameof(inputElement)); Debug2.Validate(listOperations != null, typeof(ArgumentNullException), nameof(listOperations)); this.m_input = inputElement; - this.m_listOperations = (IList)listOperations; + this.m_listOperations = listOperations; } public EffectLayer(EffectInput inputElement, EffectOperation efoOperation) @@ -32,8 +32,8 @@ namespace Microsoft.Iris.Render Debug2.Validate(inputElement != null, typeof(ArgumentNullException), nameof(inputElement)); Debug2.Validate(efoOperation != null, typeof(ArgumentNullException), nameof(efoOperation)); this.m_input = inputElement; - this.m_listOperations = (IList)new List(1); - this.m_listOperations.Add((object)efoOperation); + this.m_listOperations = new List(1); + this.m_listOperations.Add(efoOperation); } public EffectLayer() => this.m_typeInput = EffectInputType.Layer; @@ -54,7 +54,7 @@ namespace Microsoft.Iris.Render { if (!this.m_input.Process(dictProperties)) return false; - foreach (EffectElement listOperation in (IEnumerable)this.m_listOperations) + foreach (EffectElement listOperation in m_listOperations) { if (!listOperation.Process(dictProperties)) return false; @@ -67,7 +67,7 @@ namespace Microsoft.Iris.Render ref byte nNextUniqueID) { int num = base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.m_input.PreProcessProperties(dictionary, ref nNextUniqueID); - foreach (EffectOperation listOperation in (IEnumerable)this.m_listOperations) + foreach (EffectOperation listOperation in m_listOperations) num += listOperation.PreProcessProperties(dictionary, ref nNextUniqueID); return num; } @@ -76,7 +76,7 @@ namespace Microsoft.Iris.Render { base.AddCacheKey(cacheKey); this.m_input.AddCacheKey(cacheKey); - foreach (EffectElement listOperation in (IEnumerable)this.m_listOperations) + foreach (EffectElement listOperation in m_listOperations) listOperation.AddCacheKey(cacheKey); } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/EffectOperation.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/EffectOperation.cs index 074de83..9e59aac 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/EffectOperation.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/EffectOperation.cs @@ -15,7 +15,7 @@ namespace Microsoft.Iris.Render internal EffectOperationType Type => this.m_typeOperation; - internal override void AddCacheKey(ByteBuilder cacheKey) => this.GenerateClassCacheKey((byte)1, (byte)this.Type, cacheKey); + internal override void AddCacheKey(ByteBuilder cacheKey) => this.GenerateClassCacheKey(1, (byte)this.Type, cacheKey); internal override int PreProcessProperties( Map dictionary, diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/EmbossElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/EmbossElement.cs index 5ecec5b..ec5ec43 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/EmbossElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/EmbossElement.cs @@ -23,7 +23,7 @@ namespace Microsoft.Iris.Render : this() { Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); - Debug2.Validate((double)flGrayLevel >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for GrayLevel is >= 0"); + Debug2.Validate(flGrayLevel >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for GrayLevel is >= 0"); this.m_stName = stName; this.m_direction = direction; this.m_flGrayLevel = flGrayLevel; @@ -51,10 +51,10 @@ namespace Microsoft.Iris.Render Map dictionary, ref byte nNextUniqueID) { - return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Direction", (byte)5, ref this.m_nDirectionID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "GrayLevel", (byte)8, ref this.m_nGrayLevelID, ref nNextUniqueID); + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Direction", 5, ref this.m_nDirectionID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "GrayLevel", 8, ref this.m_nGrayLevelID, ref nNextUniqueID); } - internal override bool Process(Map dictProperties) => this.GenerateProperty("Direction", EffectPropertyType.Integer, (object)this.m_direction, this.m_nDirectionID, dictProperties) && this.GenerateProperty("GrayLevel", EffectPropertyType.Float, (object)this.m_flGrayLevel, this.m_nGrayLevelID, dictProperties); + internal override bool Process(Map dictProperties) => this.GenerateProperty("Direction", EffectPropertyType.Integer, m_direction, this.m_nDirectionID, dictProperties) && this.GenerateProperty("GrayLevel", EffectPropertyType.Float, m_flGrayLevel, this.m_nGrayLevelID, dictProperties); internal override void AddCacheKey(ByteBuilder cacheKey) { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/ExponentialInterpolation.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/ExponentialInterpolation.cs index ebee993..36ce32c 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/ExponentialInterpolation.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/ExponentialInterpolation.cs @@ -15,7 +15,7 @@ namespace Microsoft.Iris.Render public ExponentialInterpolation(float weight) { - Debug2.Validate((double)weight > 0.0, typeof(ArgumentOutOfRangeException), "'weight' must be > 0"); + Debug2.Validate(weight > 0.0, typeof(ArgumentOutOfRangeException), "'weight' must be > 0"); this.m_weight = weight; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/CoordMapGenerator.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/CoordMapGenerator.cs index 54a7514..a4d7846 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/CoordMapGenerator.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/CoordMapGenerator.cs @@ -16,10 +16,10 @@ namespace Microsoft.Iris.Render.Extensions Debug2.Validate(rect.Right <= sizeImage.Width, typeof(ArgumentOutOfRangeException), "Desired rect cannot extend beyond the image width"); Debug2.Validate(rect.Bottom <= sizeImage.Height, typeof(ArgumentOutOfRangeException), "Desired rect cannot extend beyond the image height"); CoordMap coordMap = new CoordMap(); - float flValue1 = (float)rect.Left / (float)sizeImage.Width; - float flValue2 = (float)rect.Right / (float)sizeImage.Width; - float flValue3 = (float)rect.Top / (float)sizeImage.Height; - float flValue4 = (float)rect.Bottom / (float)sizeImage.Height; + float flValue1 = rect.Left / (float)sizeImage.Width; + float flValue2 = rect.Right / (float)sizeImage.Width; + float flValue3 = rect.Top / (float)sizeImage.Height; + float flValue4 = rect.Bottom / (float)sizeImage.Height; coordMap.AddValue(0.0f, flValue1, Orientation.Horizontal); coordMap.AddValue(1f, flValue2, Orientation.Horizontal); coordMap.AddValue(0.0f, flValue3, Orientation.Vertical); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/DataTracker.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/DataTracker.cs index bc5f7b7..5ffa566 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/DataTracker.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/DataTracker.cs @@ -36,8 +36,8 @@ namespace Microsoft.Iris.Render.Extensions { foreach (IDisposable disposable in this.m_dictData.Values) disposable.Dispose(); - this.m_dictData = (Map)null; - GC.SuppressFinalize((object)this); + this.m_dictData = null; + GC.SuppressFinalize(this); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/DebugCategoryEnabledSet.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/DebugCategoryEnabledSet.cs index 8641b67..37efd10 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/DebugCategoryEnabledSet.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/DebugCategoryEnabledSet.cs @@ -19,7 +19,7 @@ namespace Microsoft.Iris.Render.Extensions { this.m_arbCache = new byte[38]; for (int index = 0; index < this.m_arbCache.Length; ++index) - this.m_arbCache[index] = (byte)0; + this.m_arbCache[index] = 0; this.m_registryHelper = registryHelper; this.m_invalidCache = true; } @@ -39,16 +39,16 @@ namespace Microsoft.Iris.Render.Extensions public void SetLevel(DebugCategory cat, byte bValue) { - if ((int)this.m_arbCache[(int)cat] == (int)bValue) + if (this.m_arbCache[(int)cat] == bValue) return; - DebugCategoryEnabledSet.SetExternalDebugLevel(cat, bValue); + SetExternalDebugLevel(cat, bValue); this.m_arbCache[(int)cat] = bValue; } public void SetLevel(DebugCategory cat, bool fValue) { byte bValue = fValue ? (byte)1 : (byte)0; - if (bValue != (byte)0 && (int)bValue <= (int)this.GetLevel(cat)) + if (bValue != 0 && bValue <= this.GetLevel(cat)) return; this.SetLevel(cat, bValue); } @@ -60,14 +60,14 @@ namespace Microsoft.Iris.Render.Extensions for (int index = 0; index < this.m_arbCache.Length; ++index) { DebugCategory cat = (DebugCategory)index; - byte externalDebugLevel = DebugCategoryEnabledSet.GetExternalDebugLevel(cat); + byte externalDebugLevel = GetExternalDebugLevel(cat); byte level = externalDebugLevel; byte bValue; if (this.m_registryHelper.ReadValuesFromRegistry && this.ReadDebugCategoryValueFromRegistry(cat, out bValue)) level = bValue; - if ((int)externalDebugLevel != (int)level) - DebugCategoryEnabledSet.SetExternalDebugLevel(cat, level); - if ((int)this.m_arbCache[index] != (int)level) + if (externalDebugLevel != level) + SetExternalDebugLevel(cat, level); + if (this.m_arbCache[index] != level) this.m_arbCache[index] = level; } this.m_invalidCache = false; @@ -88,11 +88,11 @@ namespace Microsoft.Iris.Render.Extensions private bool ReadDebugCategoryValueFromRegistry(DebugCategory cat, out byte bValue) => this.m_registryHelper.ReadValueFromRegistry(cat.ToString(), out bValue); - private static byte GetExternalDebugLevel(DebugCategory cat) => DebugCategoryEnabledSet.IsExternalCategory(cat) ? eDebugApi.DebugGetCategoryLevel(cat) : (byte)0; + private static byte GetExternalDebugLevel(DebugCategory cat) => IsExternalCategory(cat) ? eDebugApi.DebugGetCategoryLevel(cat) : (byte)0; private static void SetExternalDebugLevel(DebugCategory cat, byte level) { - if (!DebugCategoryEnabledSet.IsExternalCategory(cat)) + if (!IsExternalCategory(cat)) return; eDebugApi.DebugSetCategoryLevel(cat, level); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/DebugDefault.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/DebugDefault.cs index 9cda37a..e8a02f0 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/DebugDefault.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/DebugDefault.cs @@ -24,39 +24,39 @@ namespace Microsoft.Iris.Render.Extensions if (this.m_eDebug == null) return; this.m_eDebug.Dispose(); - this.m_eDebug = (eDebug)null; + this.m_eDebug = null; } public static Stack CurrentContextStack { get { - Stack stack = (Stack)null; - DebugDefault.s_contextLock.AcquireReaderLock(-1); + Stack stack = null; + s_contextLock.AcquireReaderLock(-1); try { - stack = DebugDefault.s_contextDict[Thread.CurrentThread]; + stack = s_contextDict[Thread.CurrentThread]; } finally { - DebugDefault.s_contextLock.ReleaseReaderLock(); + s_contextLock.ReleaseReaderLock(); } if (stack == null) { - DebugDefault.s_contextLock.AcquireWriterLock(-1); + s_contextLock.AcquireWriterLock(-1); try { - stack = DebugDefault.s_contextDict[Thread.CurrentThread]; + stack = s_contextDict[Thread.CurrentThread]; if (stack == null) { stack = new Stack(); - stack.Push((object)""); - DebugDefault.s_contextDict[Thread.CurrentThread] = stack; + stack.Push(""); + s_contextDict[Thread.CurrentThread] = stack; } } finally { - DebugDefault.s_contextLock.ReleaseWriterLock(); + s_contextLock.ReleaseWriterLock(); } } return stack; @@ -67,27 +67,27 @@ namespace Microsoft.Iris.Render.Extensions { if (context == null) context = ""; - DebugDefault.CurrentContextStack.Push((object)context); - this.m_eDebug.WriteLinePrefix = string.Format((IFormatProvider)CultureInfo.InvariantCulture, "[{0}]", (object)context); + CurrentContextStack.Push(context); + this.m_eDebug.WriteLinePrefix = string.Format(CultureInfo.InvariantCulture, "[{0}]", context); } void IDebug.Leave(string context) { - Stack currentContextStack = DebugDefault.CurrentContextStack; + Stack currentContextStack = CurrentContextStack; this.m_eDebug.Assert(currentContextStack.Count > 0, "Context stack is empty"); if (currentContextStack.Count > 0) - this.m_eDebug.WriteLinePrefix = string.Format((IFormatProvider)CultureInfo.InvariantCulture, "[{0}]", (object)(string)currentContextStack.Peek()); + this.m_eDebug.WriteLinePrefix = string.Format(CultureInfo.InvariantCulture, "[{0}]", (string)currentContextStack.Peek()); else - this.m_eDebug.WriteLinePrefix = (string)null; + this.m_eDebug.WriteLinePrefix = null; } void IDebug.Assert(bool condition, string message) => this.m_eDebug.Assert(condition, message); void IDebug.Throw(bool condition, string message) => this.m_eDebug.Prompt(condition, message, typeof(InvalidOperationException)); - void IDebug.Write(DebugCategory category, int level, string message) => this.m_eDebug.Write(category, (byte)level, (object)message); + void IDebug.Write(DebugCategory category, int level, string message) => this.m_eDebug.Write(category, (byte)level, message); - void IDebug.WriteLine(DebugCategory category, int level, string message) => this.m_eDebug.WriteLine(category, (byte)level, (object)message); + void IDebug.WriteLine(DebugCategory category, int level, string message) => this.m_eDebug.WriteLine(category, (byte)level, message); void IDebug.Indent(DebugCategory category, int level) => this.m_eDebug.Indent(category, (byte)level); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageCache.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageCache.cs index 7150329..09bd50a 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageCache.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageCache.cs @@ -13,10 +13,10 @@ namespace Microsoft.Iris.Render.Extensions { public class ImageCache : IDisposable { - private static readonly ImageCache.ObjectTest s_testCulling = new ImageCache.ObjectTest(ImageCache.CullingTest); - private static readonly ImageCache.ObjectTest s_testDisposeAll = new ImageCache.ObjectTest(ImageCache.DisposeAllTest); - private static readonly ImageCache.ObjectTest s_testObject = new ImageCache.ObjectTest(ImageCache.SpecificObjectTest); - private static readonly ImageCache.ObjectTest s_testDropImages = new ImageCache.ObjectTest(ImageCache.DropImageTest); + private static readonly ImageCache.ObjectTest s_testCulling = new ImageCache.ObjectTest(CullingTest); + private static readonly ImageCache.ObjectTest s_testDisposeAll = new ImageCache.ObjectTest(DisposeAllTest); + private static readonly ImageCache.ObjectTest s_testObject = new ImageCache.ObjectTest(SpecificObjectTest); + private static readonly ImageCache.ObjectTest s_testDropImages = new ImageCache.ObjectTest(DropImageTest); private Map m_objectsTable; private Vector m_lruList; private bool m_fObjectDisposed; @@ -49,7 +49,7 @@ namespace Microsoft.Iris.Render.Extensions if (this.m_fObjectDisposed) return; this.Dispose(true); - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); } private void Dispose(bool fInDispose) @@ -68,13 +68,13 @@ namespace Microsoft.Iris.Render.Extensions public void DisposeAllObjects() { this.m_numItemsInCache = 0; - this.RemoveObjects(ImageCache.s_testDisposeAll, (object)this); + this.RemoveObjects(s_testDisposeAll, this); } public void PrepareToShutdown() { this.m_numItemsInCache = 0; - this.RemoveObjects(ImageCache.s_testDropImages, (object)this); + this.RemoveObjects(s_testDropImages, this); this.m_fCleanupPending = false; this.m_fShuttingDown = true; } @@ -103,29 +103,29 @@ namespace Microsoft.Iris.Render.Extensions Debug2.Validate(item.ImageCacheOwner == null, typeof(InvalidOperationException), "The given item is already part of a cache! double-add detected."); if (this.m_objectsTable == null) this.SetupObjectTable(); - this.m_objectsTable[(object)key] = (object)item; + this.m_objectsTable[key] = item; this.m_lruList.Insert(0, new ImageCache.ImageCacheEntry(key, item)); item.ImageCacheOwner = this; this.ScheduleScavenge(); } - public void RemoveData(ImageCacheKey key) => ((ImageCacheItem)this.Find((object)key))?.RemoveData(); + public void RemoveData(ImageCacheKey key) => ((ImageCacheItem)this.Find(key))?.RemoveData(); - public void RemoveItem(ImageCacheItem item) => this.RemoveObjects(ImageCache.s_testObject, (object)item); + public void RemoveItem(ImageCacheItem item) => this.RemoveObjects(s_testObject, item); public void RemoveObjects(ImageCache.ObjectTest test, object paramObject) { if (this.m_objectsTable == null) return; - ArrayList arrayList = (ArrayList)null; + ArrayList arrayList = null; foreach (ImageCache.ImageCacheEntry lru in this.m_lruList) { ImageCacheItem imageCacheItem = lru.item; - if (test((object)imageCacheItem, paramObject)) + if (test(imageCacheItem, paramObject)) { if (arrayList == null) arrayList = new ArrayList(); - arrayList.Add((object)lru); + arrayList.Add(lru); } } if (arrayList == null) @@ -133,15 +133,15 @@ namespace Microsoft.Iris.Render.Extensions foreach (ImageCache.ImageCacheEntry imageCacheEntry in arrayList) { this.m_lruList.Remove(imageCacheEntry); - this.m_objectsTable.Remove((object)imageCacheEntry.key); - imageCacheEntry.item.ImageCacheOwner = (ImageCache)null; + this.m_objectsTable.Remove(imageCacheEntry.key); + imageCacheEntry.item.ImageCacheOwner = null; imageCacheEntry.item.Dispose(); } } public ImageCacheItem Lookup(ImageCacheKey key) { - ImageCacheItem imageCacheItem = (ImageCacheItem)this.Find((object)key); + ImageCacheItem imageCacheItem = (ImageCacheItem)this.Find(key); if (imageCacheItem == null) this.ScheduleScavenge(); return imageCacheItem; @@ -153,7 +153,7 @@ namespace Microsoft.Iris.Render.Extensions this.m_numItemsInCache = 0; this.m_fUseCutoffTime = !this.m_tsCullingKeepTime.Equals(TimeSpan.Zero); this.m_dtCullingCutoff = DateTime.UtcNow - this.m_tsCullingKeepTime; - this.RemoveObjects(ImageCache.s_testCulling, (object)this); + this.RemoveObjects(s_testCulling, this); this.m_fCleanupPending = false; } @@ -172,7 +172,7 @@ namespace Microsoft.Iris.Render.Extensions private object Find(object key) { - object obj = (object)null; + object obj = null; if (this.m_objectsTable != null) this.m_objectsTable.TryGetValue(key, out obj); return obj; @@ -263,7 +263,7 @@ namespace Microsoft.Iris.Render.Extensions if (lru.MatchItem(item)) return lru; } - return (ImageCache.ImageCacheEntry)null; + return null; } public delegate bool ObjectTest(object subjectObject, object paramObject); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageCacheItem.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageCacheItem.cs index a9de9b5..4540ed6 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageCacheItem.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageCacheItem.cs @@ -58,7 +58,7 @@ namespace Microsoft.Iris.Render.Extensions protected ImageCacheItem(IRenderSession renderSession, string identifier) { this.m_stIdentifier = identifier; - this.m_image = renderSession.CreateImage((object)this, this.m_stIdentifier, new ContentNotifyHandler(this.ReloadImage)); + this.m_image = renderSession.CreateImage(this, this.m_stIdentifier, new ContentNotifyHandler(this.ReloadImage)); this.UpdateLastUsedTime(); } @@ -67,7 +67,7 @@ namespace Microsoft.Iris.Render.Extensions public void Dispose() { this.Dispose(true); - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); } private void Dispose(bool fInDispose) @@ -81,13 +81,13 @@ namespace Microsoft.Iris.Render.Extensions { if (this.m_image != null) { - this.m_image.UnregisterUsage((object)this); - this.m_image = (IImage)null; + this.m_image.UnregisterUsage(this); + this.m_image = null; } if (this.m_info != null) { this.m_info.Dispose(); - this.m_info = (BitmapInformation)null; + this.m_info = null; } this.m_fObjectDisposed = true; } @@ -96,8 +96,8 @@ namespace Microsoft.Iris.Render.Extensions { if (this.m_image == null) return; - this.m_image.UnregisterUsage((object)this); - this.m_image = (IImage)null; + this.m_image.UnregisterUsage(this); + this.m_image = null; } public int UsageCount => this.m_countUsers; @@ -140,9 +140,9 @@ namespace Microsoft.Iris.Render.Extensions { if (this.m_prevLoadInfos == null) this.m_prevLoadInfos = new ArrayList(); - this.m_prevLoadInfos.Add((object)this.m_info); + this.m_prevLoadInfos.Add(m_info); this.m_size = Size.Zero; - this.m_info = (BitmapInformation)null; + this.m_info = null; } else { @@ -150,7 +150,7 @@ namespace Microsoft.Iris.Render.Extensions if (this.m_info == null) return; this.m_info.Dispose(); - this.m_info = (BitmapInformation)null; + this.m_info = null; } } @@ -211,14 +211,14 @@ namespace Microsoft.Iris.Render.Extensions if (this.m_info != null) { this.m_info.Dispose(); - this.m_info = (BitmapInformation)null; + this.m_info = null; } if (this.m_prevLoadInfos != null) { foreach (BitmapInformation prevLoadInfo in this.m_prevLoadInfos) prevLoadInfo?.Dispose(); this.m_prevLoadInfos.Clear(); - this.m_prevLoadInfos = (ArrayList)null; + this.m_prevLoadInfos = null; } } this.UpdateLastUsedTime(); @@ -237,7 +237,7 @@ namespace Microsoft.Iris.Render.Extensions protected virtual bool DoImageLoad() { - BitmapInformation bitmapInfo = (BitmapInformation)null; + BitmapInformation bitmapInfo = null; bool flag = false; if (this.m_image != null) flag = !(this.m_buffer == IntPtr.Zero) ? ImageLoader.FromBuffer(this.m_image, this.m_buffer, (int)this.m_length, this.m_req.MaximumSize, this.m_req.Flippable, this.m_req.AntialiasEdges, this.m_req.BorderWidth, this.m_req.BorderColor, out bitmapInfo) : ImageLoader.FromFile(this.m_image, this.m_image.Identifier, this.m_req.MaximumSize, this.m_req.Flippable, this.m_req.AntialiasEdges, this.m_req.BorderWidth, this.m_req.BorderColor, out bitmapInfo); @@ -262,7 +262,7 @@ namespace Microsoft.Iris.Render.Extensions protected void UpdateLastUsedTime() { this.AssertValidState(); - if (!(DateTime.UtcNow - this.m_dtLastUsed > ImageCacheItem.s_tsUpdateThreshhold)) + if (!(DateTime.UtcNow - this.m_dtLastUsed > s_tsUpdateThreshhold)) return; this.m_dtLastUsed = DateTime.UtcNow; if (this.m_owner == null) diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageCacheKey.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageCacheKey.cs index da630bd..bccf8f9 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageCacheKey.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageCacheKey.cs @@ -27,7 +27,7 @@ namespace Microsoft.Iris.Render.Extensions public override bool Equals(object obj) { - if (object.ReferenceEquals((object)this, obj)) + if (ReferenceEquals(this, obj)) return true; return obj is ImageCacheKey imageCacheKey && this.m_stIdentifier.Equals(imageCacheKey.m_stIdentifier) && (this.m_sizeMaxPxl == imageCacheKey.m_sizeMaxPxl && this.m_fFlippable == imageCacheKey.m_fFlippable) && this.m_fAntialiasEdges == imageCacheKey.m_fAntialiasEdges; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageLoader.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageLoader.cs index a3e9515..7e3e052 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageLoader.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageLoader.cs @@ -16,7 +16,7 @@ namespace Microsoft.Iris.Render.Extensions public static bool LoadHeader(IntPtr rgData, int length, out ImageHeader header) { ImageRequirements req = new ImageRequirements(); - return ImageLoader.LoadHeader(rgData, length, req, out header); + return LoadHeader(rgData, length, req, out header); } public static bool LoadHeader( @@ -69,7 +69,7 @@ namespace Microsoft.Iris.Render.Extensions BitmapInformation bitmapInformation = new BitmapInformation(); if (!ExtensionsApi.SpBitmapLoadFile(filename, req, nOptions, out bitmapInformation.hBitmap, out bitmapInformation.imageInfo).IsSuccess()) { - bitmapInfo = (BitmapInformation)null; + bitmapInfo = null; return false; } bool flag = image.LoadContent(SurfaceFormatInfo.ToImageFormat(bitmapInformation.imageInfo.Header.nFormat), bitmapInformation.imageInfo.Header.sizeActualPxl, bitmapInformation.imageInfo.Header.nStride, bitmapInformation.imageInfo.Data.rgData); @@ -79,7 +79,7 @@ namespace Microsoft.Iris.Render.Extensions } else { - bitmapInfo = (BitmapInformation)null; + bitmapInfo = null; bitmapInformation.Dispose(); } return flag; @@ -106,7 +106,7 @@ namespace Microsoft.Iris.Render.Extensions Win32Api.HINSTANCE hinst = ModuleManager.Instance.LoadModule(moduleName); if (hinst == Win32Api.HINSTANCE.NULL) { - bitmapInfo = (BitmapInformation)null; + bitmapInfo = null; return false; } ExtensionsApi.BitmapOptions nOptions = ExtensionsApi.BitmapOptions.Decode; @@ -115,7 +115,7 @@ namespace Microsoft.Iris.Render.Extensions BitmapInformation bitmapInformation = new BitmapInformation(); if (!ExtensionsApi.SpBitmapLoadResource(hinst, resourceID, 10, req, nOptions, out bitmapInformation.hBitmap, out bitmapInformation.imageInfo).IsSuccess()) { - bitmapInfo = (BitmapInformation)null; + bitmapInfo = null; return false; } bool flag = image.LoadContent(SurfaceFormatInfo.ToImageFormat(bitmapInformation.imageInfo.Header.nFormat), bitmapInformation.imageInfo.Header.sizeActualPxl, bitmapInformation.imageInfo.Header.nStride, bitmapInformation.imageInfo.Data.rgData); @@ -125,7 +125,7 @@ namespace Microsoft.Iris.Render.Extensions } else { - bitmapInfo = (BitmapInformation)null; + bitmapInfo = null; bitmapInformation.Dispose(); } return flag; @@ -156,7 +156,7 @@ namespace Microsoft.Iris.Render.Extensions BitmapInformation bitmapInformation = new BitmapInformation(); if (!ExtensionsApi.SpBitmapLoadBuffer(buffer, (uint)length, req, nOptions, out bitmapInformation.hBitmap, out bitmapInformation.imageInfo).IsSuccess()) { - bitmapInfo = (BitmapInformation)null; + bitmapInfo = null; return false; } bool flag = image.LoadContent(SurfaceFormatInfo.ToImageFormat(bitmapInformation.imageInfo.Header.nFormat), bitmapInformation.imageInfo.Header.sizeActualPxl, bitmapInformation.imageInfo.Header.nStride, bitmapInformation.imageInfo.Data.rgData); @@ -166,7 +166,7 @@ namespace Microsoft.Iris.Render.Extensions } else { - bitmapInfo = (BitmapInformation)null; + bitmapInfo = null; bitmapInformation.Dispose(); } return flag; @@ -200,7 +200,7 @@ namespace Microsoft.Iris.Render.Extensions BitmapInformation bitmapInformation = new BitmapInformation(); if (!ExtensionsApi.SpBitmapLoadRaw(imageSize, stride, format, buffer, req, nOptions, out bitmapInformation.hBitmap, out bitmapInformation.imageInfo).IsSuccess()) { - bitmapInfo = (BitmapInformation)null; + bitmapInfo = null; return false; } bool flag = image.LoadContent(SurfaceFormatInfo.ToImageFormat(bitmapInformation.imageInfo.Header.nFormat), bitmapInformation.imageInfo.Header.sizeActualPxl, bitmapInformation.imageInfo.Header.nStride, bitmapInformation.imageInfo.Data.rgData); @@ -210,7 +210,7 @@ namespace Microsoft.Iris.Render.Extensions } else { - bitmapInfo = (BitmapInformation)null; + bitmapInfo = null; bitmapInformation.Dispose(); } return flag; @@ -228,8 +228,8 @@ namespace Microsoft.Iris.Render.Extensions Debug2.Validate(sizeImage.Width > 0 && sizeImage.Height > 0, typeof(ArgumentException), "Image size must be valid"); Debug2.Validate(horizontalRamp != null || verticalRamp != null, typeof(ArgumentException), "Must provide at least one ramp"); Debug2.Validate(format == ImageFormat.X8R8G8B8 || format == ImageFormat.A8R8G8B8 || format == ImageFormat.A8, typeof(ArgumentException), "Image format not supported"); - ImageLoader.ValidateRamp(verticalRamp); - ImageLoader.ValidateRamp(horizontalRamp); + ValidateRamp(verticalRamp); + ValidateRamp(horizontalRamp); SurfaceFormat nFormat = SurfaceFormatInfo.FromImageFormat(format); int num1 = SurfaceFormatInfo.GetBitsPerPixel(nFormat) / 8; int num2 = sizeImage.Width * num1; @@ -241,8 +241,8 @@ namespace Microsoft.Iris.Render.Extensions ColorF colorF1 = new ColorF(0, 0, 0, 0); if (verticalRamp != null) { - float flValue = sizeImage.Height > 1 ? (float)index / (float)(sizeImage.Height - 1) : 0.0f; - colorF1 = ImageLoader.SampleGradient(verticalRamp, flValue); + float flValue = sizeImage.Height > 1 ? index / (float)(sizeImage.Height - 1) : 0.0f; + colorF1 = SampleGradient(verticalRamp, flValue); colorF1.Clamp(); } int num4 = 0; @@ -252,26 +252,26 @@ namespace Microsoft.Iris.Render.Extensions ColorF colorF2 = colorF1; if (horizontalRamp != null) { - float flValue = sizeImage.Width > 1 ? (float)num4 / (float)(sizeImage.Width - 1) : 0.0f; - colorF2 += ImageLoader.SampleGradient(horizontalRamp, flValue); + float flValue = sizeImage.Width > 1 ? num4 / (float)(sizeImage.Width - 1) : 0.0f; + colorF2 += SampleGradient(horizontalRamp, flValue); colorF2.Clamp(); } switch (nFormat) { case SurfaceFormat.A8: - numArray[num3 + num5] = (byte)((double)colorF2.A * (double)byte.MaxValue); + numArray[num3 + num5] = (byte)(colorF2.A * (double)byte.MaxValue); break; case SurfaceFormat.RGB32: - numArray[num3 + num5] = (byte)((double)colorF2.B * (double)byte.MaxValue); - numArray[num3 + num5 + 1] = (byte)((double)colorF2.G * (double)byte.MaxValue); - numArray[num3 + num5 + 2] = (byte)((double)colorF2.R * (double)byte.MaxValue); + numArray[num3 + num5] = (byte)(colorF2.B * (double)byte.MaxValue); + numArray[num3 + num5 + 1] = (byte)(colorF2.G * (double)byte.MaxValue); + numArray[num3 + num5 + 2] = (byte)(colorF2.R * (double)byte.MaxValue); numArray[num3 + num5 + 3] = byte.MaxValue; break; case SurfaceFormat.ARGB32: - numArray[num3 + num5] = (byte)((double)colorF2.B * (double)byte.MaxValue); - numArray[num3 + num5 + 1] = (byte)((double)colorF2.G * (double)byte.MaxValue); - numArray[num3 + num5 + 2] = (byte)((double)colorF2.R * (double)byte.MaxValue); - numArray[num3 + num5 + 3] = (byte)((double)colorF2.A * (double)byte.MaxValue); + numArray[num3 + num5] = (byte)(colorF2.B * (double)byte.MaxValue); + numArray[num3 + num5 + 1] = (byte)(colorF2.G * (double)byte.MaxValue); + numArray[num3 + num5 + 2] = (byte)(colorF2.R * (double)byte.MaxValue); + numArray[num3 + num5 + 3] = (byte)(colorF2.A * (double)byte.MaxValue); break; default: Debug2.Throw(false, "Unsupported format type"); @@ -292,7 +292,7 @@ namespace Microsoft.Iris.Render.Extensions nFormat = nFormat } }, - gcData = GCHandle.Alloc((object)numArray, GCHandleType.Pinned) + gcData = GCHandle.Alloc(numArray, GCHandleType.Pinned) }; gradientInformation.imageInfo.Data.rgData = gradientInformation.gcData.AddrOfPinnedObject(); bool flag = image.LoadContent(SurfaceFormatInfo.ToImageFormat(gradientInformation.imageInfo.Header.nFormat), gradientInformation.imageInfo.Header.sizeActualPxl, gradientInformation.imageInfo.Header.nStride, gradientInformation.imageInfo.Data.rgData); @@ -302,7 +302,7 @@ namespace Microsoft.Iris.Render.Extensions } else { - gradientInfo = (GradientInformation)null; + gradientInfo = null; ((IDisposable)gradientInformation).Dispose(); } return flag; @@ -320,11 +320,11 @@ namespace Microsoft.Iris.Render.Extensions { rampValue1 = rampValues[index++]; } - while (index < rampValues.Length && (double)flValue > (double)rampValues[index].position); + while (index < rampValues.Length && flValue > (double)rampValues[index].position); if (rampValues.Length <= index) return rampValue1.value; ImageLoader.GradientValue rampValue2 = rampValues[index]; - float num = (float)(((double)flValue - (double)rampValue1.position) / ((double)rampValue2.position - (double)rampValue1.position)); + float num = (float)((flValue - (double)rampValue1.position) / (rampValue2.position - (double)rampValue1.position)); return rampValue1.value * (1f - num) + rampValue2.value * num; } @@ -336,8 +336,8 @@ namespace Microsoft.Iris.Render.Extensions float num = 0.0f; for (int index = 0; index < rampValues.Length; ++index) { - Debug2.Validate((double)rampValues[index].position >= (double)num, typeof(ArgumentException), "Gradient ramp values must be monotomically increasing"); - Debug2.Validate((double)rampValues[index].position >= 0.0 && (double)rampValues[index].position <= 1.0, typeof(ArgumentException), "Gradient ramp values must be [0, 1]"); + Debug2.Validate(rampValues[index].position >= (double)num, typeof(ArgumentException), "Gradient ramp values must be monotomically increasing"); + Debug2.Validate(rampValues[index].position >= 0.0 && rampValues[index].position <= 1.0, typeof(ArgumentException), "Gradient ramp values must be [0, 1]"); num = rampValues[index].position; } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageRequirements.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageRequirements.cs index 626784d..e063a64 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageRequirements.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ImageRequirements.cs @@ -25,21 +25,21 @@ namespace Microsoft.Iris.Render.Extensions { this.m_sizeMaximumPxl = value; if (this.m_sizeMaximumPxl.IsZero) - this.m_nMask &= ~ImageRequirements.Fields.MaximumSize; + this.m_nMask &= ~Fields.MaximumSize; else - this.m_nMask |= ImageRequirements.Fields.MaximumSize; + this.m_nMask |= Fields.MaximumSize; } } public bool Flippable { - get => (this.m_nMask & ImageRequirements.Fields.Flippable) != ImageRequirements.Fields.None; + get => (this.m_nMask & Fields.Flippable) != Fields.None; set { if (value) - this.m_nMask |= ImageRequirements.Fields.Flippable; + this.m_nMask |= Fields.Flippable; else - this.m_nMask &= ~ImageRequirements.Fields.Flippable; + this.m_nMask &= ~Fields.Flippable; } } @@ -50,9 +50,9 @@ namespace Microsoft.Iris.Render.Extensions { this.m_nBorderPxl = value; if (this.m_nBorderPxl > 0) - this.m_nMask |= ImageRequirements.Fields.Border; + this.m_nMask |= Fields.Border; else - this.m_nMask &= ~ImageRequirements.Fields.Border; + this.m_nMask &= ~Fields.Border; } } @@ -64,13 +64,13 @@ namespace Microsoft.Iris.Render.Extensions public bool AntialiasEdges { - get => (this.m_nMask & ImageRequirements.Fields.AntialiasEdges) != ImageRequirements.Fields.None; + get => (this.m_nMask & Fields.AntialiasEdges) != Fields.None; set { if (value) - this.m_nMask |= ImageRequirements.Fields.AntialiasEdges; + this.m_nMask |= Fields.AntialiasEdges; else - this.m_nMask &= ~ImageRequirements.Fields.AntialiasEdges; + this.m_nMask &= ~Fields.AntialiasEdges; } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ModuleManager.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ModuleManager.cs index bcd4326..be271a4 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ModuleManager.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/ModuleManager.cs @@ -22,16 +22,16 @@ namespace Microsoft.Iris.Render.Extensions Map.ValueCollection.Enumerator enumerator = this.m_dictModules.Values.GetEnumerator(); while (enumerator.MoveNext()) Win32Api.FreeLibrary(enumerator.Current); - this.m_dictModules = (Map)null; + this.m_dictModules = null; } public static ModuleManager Instance { get { - if (ModuleManager.s_singleton == null) - ModuleManager.s_singleton = new ModuleManager(); - return ModuleManager.s_singleton; + if (s_singleton == null) + s_singleton = new ModuleManager(); + return s_singleton; } } @@ -47,7 +47,7 @@ namespace Microsoft.Iris.Render.Extensions else { hinstance = Win32Api.LoadLibraryEx(stModuleName, Win32Api.HANDLE.NULL, 2U); - Debug2.Validate(hinstance != Win32Api.HINSTANCE.NULL, typeof(ArgumentException), (object)"Failed to load module {0}", (object)stModuleName); + Debug2.Validate(hinstance != Win32Api.HINSTANCE.NULL, typeof(ArgumentException), "Failed to load module {0}", stModuleName); this.m_dictModules[stModuleName] = hinstance; } return hinstance; @@ -60,9 +60,9 @@ namespace Microsoft.Iris.Render.Extensions out int resourceSize) { IntPtr resource = Win32Api.FindResource(hInstance.h, resourceId, new IntPtr(10)); - Debug2.Validate(resource != IntPtr.Zero, typeof(ArgumentException), string.Format("Unable to find resource {0} in the module", (object)resourceId)); + Debug2.Validate(resource != IntPtr.Zero, typeof(ArgumentException), string.Format("Unable to find resource {0} in the module", resourceId)); IntPtr i = Win32Api.LoadResource(hInstance.h, resource); - Debug2.Validate(i != IntPtr.Zero, typeof(ArgumentException), string.Format("Unable to load resource {0} from the module", (object)resourceId)); + Debug2.Validate(i != IntPtr.Zero, typeof(ArgumentException), string.Format("Unable to load resource {0} from the module", resourceId)); IntPtr num1 = Win32Api.LockResource(i); Debug2.Validate(num1 != IntPtr.Zero, typeof(InvalidOperationException), "Failed to aquire pointer to resource data"); int num2 = Win32Api.SizeofResource(hInstance.h, resource); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/RegistryListener.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/RegistryListener.cs index 6a2c225..944fcef 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/RegistryListener.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/RegistryListener.cs @@ -68,10 +68,10 @@ namespace Microsoft.Iris.Render.Extensions this.m_hkey = IntPtr.Zero; if (Win32Api.RegOpenKeyExW(Win32Api.HKEY_CURRENT_USER, this.m_stRegKey, 0, 16, out this.m_hkey) != 0) return; - this.m_hRegEvent = Win32Api.CreateEvent(IntPtr.Zero, false, false, (string)null); + this.m_hRegEvent = Win32Api.CreateEvent(IntPtr.Zero, false, false, null); int num = Win32Api.RegNotifyChangeKeyValue(this.m_hkey, true, 15, this.m_hRegEvent, true); if (num != 0) - throw new Exception(string.Format((IFormatProvider)CultureInfo.InvariantCulture, "Unable to register key change handler: {0} (due to error {1})", (object)this.m_stRegKey, (object)num)); + throw new Exception(string.Format(CultureInfo.InvariantCulture, "Unable to register key change handler: {0} (due to error {1})", m_stRegKey, num)); IntPtr phNewWaitObject; if (Win32Api.RegisterWaitForSingleObject(out phNewWaitObject, this.m_hRegEvent.h, this.m_RegistryChangeCallback, IntPtr.Zero, uint.MaxValue, 4U) == 0) { @@ -110,7 +110,7 @@ namespace Microsoft.Iris.Render.Extensions this.StopListeningForRegistryChangeNotifications(); if (this.RegistryChanged == null) return; - this.RegistryChanged((object)this, EventArgs.Empty); + this.RegistryChanged(this, EventArgs.Empty); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/SoundData.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/SoundData.cs index 32ab758..5e71758 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/SoundData.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/SoundData.cs @@ -33,7 +33,7 @@ namespace Microsoft.Iris.Render.Extensions public void Dispose() { - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); this.Dispose(true); } @@ -46,13 +46,13 @@ namespace Microsoft.Iris.Render.Extensions SoundDataFormat ISoundData.Format => SoundDataFormat.PCM; - uint ISoundData.ChannelCount => (uint)this.m_soundInfo.Header.nChannels; + uint ISoundData.ChannelCount => m_soundInfo.Header.nChannels; uint ISoundData.SampleRate => this.m_soundInfo.Header.nSamplesPerSec; - uint ISoundData.SampleSize => (uint)this.m_soundInfo.Header.wBitsPerSample; + uint ISoundData.SampleSize => m_soundInfo.Header.wBitsPerSample; - uint ISoundData.SampleCount => (uint)((ulong)this.m_soundInfo.Header.cbDataSize / (ulong)((int)this.m_soundInfo.Header.wBitsPerSample / 8)); + uint ISoundData.SampleCount => (uint)(m_soundInfo.Header.cbDataSize / (ulong)(m_soundInfo.Header.wBitsPerSample / 8)); IntPtr ISoundData.AcquireContent() { @@ -70,10 +70,10 @@ namespace Microsoft.Iris.Render.Extensions ExtensionsApi.SoundInformation soundDataInfo; SoundLoader.FromResource(this.m_moduleName, this.m_resourceId, out soundDataHandle, out soundDataInfo); Debug2.Validate(soundDataInfo.Data.rgData != IntPtr.Zero, typeof(InvalidOperationException), "Failed to load data and no exception was thrown"); - Debug2.Validate(soundDataInfo.Header.wFormatTag == (ushort)1, typeof(ArgumentException), "Only PCM sound data is currently supported"); - Debug2.Validate(soundDataInfo.Header.nChannels >= (ushort)1 && soundDataInfo.Header.nChannels <= (ushort)2, typeof(ArgumentException), "Only mono/stereo sound data is currently supported"); - Debug2.Validate(soundDataInfo.Header.wBitsPerSample == (ushort)8 || soundDataInfo.Header.wBitsPerSample == (ushort)16, typeof(ArgumentException), "Only 8bps/16bps sound data is currently supported"); - Debug2.Validate((uint)((ulong)soundDataInfo.Header.cbDataSize / (ulong)((int)soundDataInfo.Header.wBitsPerSample / 8)) % (uint)soundDataInfo.Header.nChannels == 0U, typeof(ArgumentException), "Insufficient sample data"); + Debug2.Validate(soundDataInfo.Header.wFormatTag == 1, typeof(ArgumentException), "Only PCM sound data is currently supported"); + Debug2.Validate(soundDataInfo.Header.nChannels >= 1 && soundDataInfo.Header.nChannels <= 2, typeof(ArgumentException), "Only mono/stereo sound data is currently supported"); + Debug2.Validate(soundDataInfo.Header.wBitsPerSample == 8 || soundDataInfo.Header.wBitsPerSample == 16, typeof(ArgumentException), "Only 8bps/16bps sound data is currently supported"); + Debug2.Validate((uint)(soundDataInfo.Header.cbDataSize / (ulong)(soundDataInfo.Header.wBitsPerSample / 8)) % soundDataInfo.Header.nChannels == 0U, typeof(ArgumentException), "Insufficient sample data"); this.m_soundHandle = soundDataHandle; this.m_soundInfo = soundDataInfo; this.m_hasContent = true; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/SoundLoader.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/SoundLoader.cs index 241d1f6..20c2270 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/SoundLoader.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/SoundLoader.cs @@ -24,7 +24,7 @@ namespace Microsoft.Iris.Render.Extensions IntPtr resourceData; int resourceSize; ModuleManager.Instance.LoadResource(hInstance, resourceId, out resourceData, out resourceSize); - SoundLoader.FromMemory(resourceData, resourceSize, out soundDataHandle, out soundDataInfo); + FromMemory(resourceData, resourceSize, out soundDataHandle, out soundDataInfo); } public static void FromMemory( diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/eDebug.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/eDebug.cs index 60f52e6..735a565 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/eDebug.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Extensions/eDebug.cs @@ -39,7 +39,7 @@ namespace Microsoft.Iris.Render.Extensions this.m_stackIndentStrings = new Stack(); this.m_dtStart = DateTime.UtcNow; this.m_fShowCategories = true; - this.m_bTraceLevelAdjustment = (byte)0; + this.m_bTraceLevelAdjustment = 0; } internal void Dispose() @@ -56,31 +56,31 @@ namespace Microsoft.Iris.Render.Extensions public void Assert(bool fCondition) { - if (!this.Assert(fCondition, "false", 2, (StackTrace)null)) + if (!this.Assert(fCondition, "false", 2, null)) return; - eDebug.Break(); + Break(); } public void Assert(bool fCondition, string stMessage) { - if (!this.Assert(fCondition, stMessage, 2, (StackTrace)null)) + if (!this.Assert(fCondition, stMessage, 2, null)) return; - eDebug.Break(); + Break(); } public void Assert(bool fCondition, string stMessage, StackTrace stack) { if (!this.Assert(fCondition, stMessage, 0, stack)) return; - eDebug.Break(); + Break(); } public void Assert(Type type, object obj, string stMessage) { this.Prompt(type != null, "must pass a valid type", typeof(ArgumentNullException)); - if (!this.Assert(type.IsInstanceOfType(obj), stMessage, 2, (StackTrace)null)) + if (!this.Assert(type.IsInstanceOfType(obj), stMessage, 2, null)) return; - eDebug.Break(); + Break(); } private bool Assert(bool fCondition, string stMessage, int cIgnoreFrames, StackTrace stack) @@ -92,13 +92,13 @@ namespace Microsoft.Iris.Render.Extensions return this.DisplayStackTrace("Iris Assert", stMessage, stack, cIgnoreFrames); } - public void Prompt(string stMessage) => this.Prompt(false, stMessage, (Type)null, (object)null, 1); + public void Prompt(string stMessage) => this.Prompt(false, stMessage, null, null, 1); - public void Prompt(string stMessage, Type type) => this.Prompt(false, stMessage, type, (object)null, 1); + public void Prompt(string stMessage, Type type) => this.Prompt(false, stMessage, type, null, 1); - public void Prompt(bool fCondition, string stMessage) => this.Prompt(fCondition, stMessage, (Type)null, (object)null, 1); + public void Prompt(bool fCondition, string stMessage) => this.Prompt(fCondition, stMessage, null, null, 1); - public void Prompt(bool fCondition, string stMessage, Type type) => this.Prompt(fCondition, stMessage, type, (object)null, 1); + public void Prompt(bool fCondition, string stMessage, Type type) => this.Prompt(fCondition, stMessage, type, null, 1); public void Prompt(bool fCondition, string stMessage, Type type, object objSubject) => this.Prompt(fCondition, stMessage, type, objSubject, 1); @@ -113,11 +113,11 @@ namespace Microsoft.Iris.Render.Extensions { StackTrace trace = new StackTrace(true); if (this.DisplayStackTrace("Iris API Validation Error (Application error)", stMessage, trace, cIgnoreFrames + 1)) - eDebug.Break(); + Break(); Exception exception; if (type == null) { - exception = (Exception)new ArgumentException(stMessage); + exception = new ArgumentException(stMessage); } else { @@ -125,11 +125,11 @@ namespace Microsoft.Iris.Render.Extensions if (objSubject != null) objArray = new object[2] { - (object) stMessage, + stMessage, objSubject }; else - objArray = new object[1] { (object)stMessage }; + objArray = new object[1] { stMessage }; exception = (Exception)Activator.CreateInstance(type, objArray); } throw exception; @@ -152,7 +152,7 @@ namespace Microsoft.Iris.Render.Extensions { this.Prompt(list != null, "Must have valid list", typeof(ArgumentNullException)); this.Prompt(typeExpected != null, "Must have valid Type", typeof(ArgumentNullException)); - foreach (object obj in (IEnumerable)list) + foreach (object obj in list) this.Prompt(obj != null && typeExpected.IsAssignableFrom(obj.GetType()), "List should only contain {0}.", typeExpected); } @@ -188,14 +188,14 @@ namespace Microsoft.Iris.Render.Extensions { if (!this.IsCategoryEnabled(cat)) return; - this.WriteWorker(cat, (object)stMessage); + this.WriteWorker(cat, stMessage); } public void WriteLine(DebugCategory cat, string stMessage) { if (!this.IsCategoryEnabled(cat)) return; - this.WriteLineWorker(cat, (object)stMessage); + this.WriteLineWorker(cat, stMessage); } public bool TimedWriteLines @@ -282,7 +282,7 @@ namespace Microsoft.Iris.Render.Extensions } } - public void Indent(DebugCategory cat) => this.Indent(cat, (byte)1); + public void Indent(DebugCategory cat) => this.Indent(cat, 1); public void Indent(DebugCategory cat, byte bLevel) { @@ -291,7 +291,7 @@ namespace Microsoft.Iris.Render.Extensions this.Indent(); } - public void Unindent(DebugCategory cat) => this.Unindent(cat, (byte)1); + public void Unindent(DebugCategory cat) => this.Unindent(cat, 1); public void Unindent(DebugCategory cat, byte bLevel) { @@ -312,9 +312,9 @@ namespace Microsoft.Iris.Render.Extensions } } - public void OpenBrace(DebugCategory cat) => this.OpenBrace(cat, (string)null); + public void OpenBrace(DebugCategory cat) => this.OpenBrace(cat, null); - public void OpenBrace(DebugCategory cat, string stComment) => this.OpenBrace(cat, (byte)1, stComment); + public void OpenBrace(DebugCategory cat, string stComment) => this.OpenBrace(cat, 1, stComment); public void OpenBrace(DebugCategory cat, byte bLevel, string stComment) { @@ -323,23 +323,23 @@ namespace Microsoft.Iris.Render.Extensions if (this.m_fOpenBracePending) this.FlushBraces(); if (stComment != null) - this.WriteLineWorker(cat, (object)stComment); + this.WriteLineWorker(cat, stComment); if (!this.m_fAlwaysShowBraces) { this.m_fOpenBracePending = true; this.m_pendingBraceCategory = cat; - this.m_pendingBraceComment = (string)null; + this.m_pendingBraceComment = null; } else { - this.WriteLineWorker(cat, (object)"{"); + this.WriteLineWorker(cat, "{"); this.Indent(); } } - public void DeferOpenBrace(DebugCategory cat) => this.DeferOpenBrace(cat, (string)null); + public void DeferOpenBrace(DebugCategory cat) => this.DeferOpenBrace(cat, null); - public void DeferOpenBrace(DebugCategory cat, string stComment) => this.DeferOpenBrace(cat, (byte)1, stComment); + public void DeferOpenBrace(DebugCategory cat, string stComment) => this.DeferOpenBrace(cat, 1, stComment); public void DeferOpenBrace(DebugCategory cat, byte bLevel, string stComment) { @@ -363,7 +363,7 @@ namespace Microsoft.Iris.Render.Extensions this.m_fAlwaysShowBraces = alwaysShowBraces; } - public void CloseBrace(DebugCategory cat) => this.CloseBrace(cat, (byte)1); + public void CloseBrace(DebugCategory cat) => this.CloseBrace(cat, 1); public void CloseBrace(DebugCategory cat, byte bLevel) { @@ -372,12 +372,12 @@ namespace Microsoft.Iris.Render.Extensions if (this.m_fOpenBracePending && cat == this.m_pendingBraceCategory) { this.m_fOpenBracePending = false; - this.m_pendingBraceComment = (string)null; + this.m_pendingBraceComment = null; } else { this.Unindent(); - this.WriteLineWorker(cat, (object)"}"); + this.WriteLineWorker(cat, "}"); } } @@ -440,11 +440,11 @@ namespace Microsoft.Iris.Render.Extensions stringBuilder.Append("\t"); } string str = stringBuilder.ToString(); - this.OpenBrace(DebugCategory.Failure, string.Format("Assert: {0}", (object)stMessage)); - this.WriteLine(DebugCategory.Failure, string.Format("Filename: {0}", (object)filename)); - this.WriteLine(DebugCategory.Failure, string.Format("Line: {0}", (object)fileLineNumber)); + this.OpenBrace(DebugCategory.Failure, string.Format("Assert: {0}", stMessage)); + this.WriteLine(DebugCategory.Failure, string.Format("Filename: {0}", filename)); + this.WriteLine(DebugCategory.Failure, string.Format("Line: {0}", fileLineNumber)); this.OpenBrace(DebugCategory.Failure, string.Format("Stack trace:")); - this.WriteLine(DebugCategory.Failure, string.Format("Frame\tFile Name\tMethod Name\tAssembly", (object)fileLineNumber)); + this.WriteLine(DebugCategory.Failure, string.Format("Frame\tFile Name\tMethod Name\tAssembly", fileLineNumber)); this.WriteLine(DebugCategory.Failure, str); this.CloseBrace(DebugCategory.Failure); this.CloseBrace(DebugCategory.Failure); @@ -455,7 +455,7 @@ namespace Microsoft.Iris.Render.Extensions private void WriteWorker(DebugCategory cat, object oValue) { - string str1 = (string)null; + string str1 = null; if (oValue != null) str1 = oValue.ToString(); this.m_stPendingWrite += str1; @@ -469,15 +469,15 @@ namespace Microsoft.Iris.Render.Extensions { string str2 = this.m_stPendingWrite.Substring(0, length1); string str3 = this.m_stPendingWrite.Substring(length1 + 1, length2); - this.m_stPendingWrite = (string)null; - this.WriteLineWorker(cat, (object)str2); + this.m_stPendingWrite = null; + this.WriteLineWorker(cat, str2); this.m_stPendingWrite = str3; } else { string str2 = this.m_stPendingWrite.Substring(0, this.m_stPendingWrite.Length - 1); - this.m_stPendingWrite = (string)null; - this.WriteLineWorker(cat, (object)str2); + this.m_stPendingWrite = null; + this.WriteLineWorker(cat, str2); } } @@ -485,10 +485,10 @@ namespace Microsoft.Iris.Render.Extensions { if (this.m_fOpenBracePending) this.FlushBraces(); - string str1 = (string)null; + string str1 = null; if (this.ShowCategories) { - str1 = string.Format("[{0}] ", (object)cat); + str1 = string.Format("[{0}] ", cat); int length = str1.Length; if (this.m_nMaxCategoryLength > length) str1 = str1.PadLeft(this.m_nMaxCategoryLength); @@ -496,19 +496,19 @@ namespace Microsoft.Iris.Render.Extensions this.m_nMaxCategoryLength = length; } string str2 = this.m_stPendingWrite + oValue; - this.m_stPendingWrite = (string)null; + this.m_stPendingWrite = null; string str3 = str2; char[] chArray = new char[1] { '\n' }; foreach (string str4 in str3.Split(chArray)) { string lpOutputString = this.WriteLinePrefix + str1 + this.CurrentIndentString + str4 + "\n"; if (this.TimedWriteLines) - lpOutputString = this.PrefixCurrentTime((object)lpOutputString); + lpOutputString = this.PrefixCurrentTime(lpOutputString); Win32Api.OutputDebugString(lpOutputString); } } - private void Indent() => this.m_stackIndentStrings.Push((object)(this.CurrentIndentString + this.m_stIndent)); + private void Indent() => this.m_stackIndentStrings.Push(this.CurrentIndentString + this.m_stIndent); private void Unindent() { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/FormStyleInfo.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/FormStyleInfo.cs index 81fbf13..9080ca1 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/FormStyleInfo.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/FormStyleInfo.cs @@ -21,7 +21,7 @@ namespace Microsoft.Iris.Render public override int GetHashCode() => (int)this.uStyleRestored ^ (int)this.uExStyleRestored; - public static bool operator ==(FormStyleInfo fsi1, FormStyleInfo fsi2) => fsi1.Equals((object)fsi2); + public static bool operator ==(FormStyleInfo fsi1, FormStyleInfo fsi2) => fsi1.Equals(fsi2); public static bool operator !=(FormStyleInfo fsi1, FormStyleInfo fsi2) => !(fsi1 == fsi2); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/GaussianBlurElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/GaussianBlurElement.cs index bbfde0b..2f37f0b 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/GaussianBlurElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/GaussianBlurElement.cs @@ -24,7 +24,7 @@ namespace Microsoft.Iris.Render public GaussianBlurElement(GaussianBlurMode blurMode, int nKernalRadius, float flBluriness) { - Debug2.Validate((double)flBluriness > 0.0 && (double)flBluriness <= 6.0, typeof(ArgumentOutOfRangeException), "Valid range for Bluriness is (0,6]"); + Debug2.Validate(flBluriness > 0.0 && flBluriness <= 6.0, typeof(ArgumentOutOfRangeException), "Valid range for Bluriness is (0,6]"); Debug2.Validate(nKernalRadius >= 1 && nKernalRadius <= 6, typeof(ArgumentOutOfRangeException), "Valid range for KernelRadius is [1,6]"); this.m_blurMode = blurMode; this.m_nKernelRadius = nKernalRadius; @@ -61,7 +61,7 @@ namespace Microsoft.Iris.Render get => this.m_flBluriness; set { - Debug2.Validate((double)value > 0.0 && (double)value <= 6.0, typeof(ArgumentOutOfRangeException), "Valid range for Bluriness is (0,6]"); + Debug2.Validate(value > 0.0 && value <= 6.0, typeof(ArgumentOutOfRangeException), "Valid range for Bluriness is (0,6]"); this.m_flBluriness = value; } } @@ -70,7 +70,7 @@ namespace Microsoft.Iris.Render Map dictionary, ref byte nNextUniqueID) { - return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Mode", (byte)5, ref this.m_nModeID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "KernelRadius", (byte)5, ref this.m_nKernelRadiusID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Bluriness", (byte)8, ref this.m_nBlurinessID, ref nNextUniqueID); + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Mode", 5, ref this.m_nModeID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "KernelRadius", 5, ref this.m_nKernelRadiusID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Bluriness", 8, ref this.m_nBlurinessID, ref nNextUniqueID); } internal override void AddCacheKey(ByteBuilder cacheKey) diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/AncestorEnumerator.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/AncestorEnumerator.cs index 78ecb2f..e5efd52 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/AncestorEnumerator.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/AncestorEnumerator.cs @@ -17,21 +17,21 @@ namespace Microsoft.Iris.Render.Graphics internal AncestorEnumerator(TreeNode nodeStart) { this.m_nodeStart = nodeStart; - this.m_nodeCurrent = (TreeNode)null; + this.m_nodeCurrent = null; this.m_nodeNext = this.m_nodeStart; } - object IEnumerator.Current => (object)this.m_nodeCurrent; + object IEnumerator.Current => m_nodeCurrent; public TreeNode Current => this.m_nodeCurrent; - IEnumerator IEnumerable.GetEnumerator() => (IEnumerator)this; + IEnumerator IEnumerable.GetEnumerator() => this; public AncestorEnumerator GetEnumerator() => this; public void Reset() { - this.m_nodeCurrent = (TreeNode)null; + this.m_nodeCurrent = null; this.m_nodeNext = this.m_nodeStart; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Camera.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Camera.cs index d139c4e..6872b60 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Camera.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Camera.cs @@ -53,7 +53,7 @@ namespace Microsoft.Iris.Render.Graphics if (!fInDispose || this.m_remoteCamera == null) return; this.m_remoteCamera.Dispose(); - this.m_remoteCamera = (RemoteCamera)null; + this.m_remoteCamera = null; } finally { @@ -63,7 +63,7 @@ namespace Microsoft.Iris.Render.Graphics RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteCamera.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteCamera = (RemoteCamera)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteCamera = null; internal RemoteCamera RemoteStub => this.m_remoteCamera; @@ -129,7 +129,7 @@ namespace Microsoft.Iris.Render.Graphics private void SetZn(float flZn) { - if ((double)this.m_flZn == (double)flZn) + if (m_flZn == (double)flZn) return; this.m_flZn = flZn; if (!this.m_session.IsValid || !this.m_remoteCamera.IsValid) @@ -151,13 +151,13 @@ namespace Microsoft.Iris.Render.Graphics uint IAnimatableObject.GetPropertyId(string propertyName) { - if (propertyName == Camera.EyeProperty) + if (propertyName == EyeProperty) return 1; - if (propertyName == Camera.AtProperty) + if (propertyName == AtProperty) return 2; - if (propertyName == Camera.UpProperty) + if (propertyName == UpProperty) return 3; - if (propertyName == Camera.ZnProperty) + if (propertyName == ZnProperty) return 4; Debug2.Validate(false, typeof(ArgumentException), "Unsupported property"); return 0; @@ -166,9 +166,9 @@ namespace Microsoft.Iris.Render.Graphics AnimationInputType IAnimatableObject.GetPropertyType( string propertyName) { - if (propertyName == Camera.EyeProperty || propertyName == Camera.AtProperty || propertyName == Camera.UpProperty) + if (propertyName == EyeProperty || propertyName == AtProperty || propertyName == UpProperty) return AnimationInputType.Vector3; - if (propertyName == Camera.ZnProperty) + if (propertyName == ZnProperty) return AnimationInputType.Float; Debug2.Validate(false, typeof(ArgumentException), "Unsupported property"); return AnimationInputType.Float; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9BlendElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9BlendElement.cs index 983c4da..90c8367 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9BlendElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9BlendElement.cs @@ -18,69 +18,69 @@ namespace Microsoft.Iris.Render.Graphics ref Dx9EffectBuilder effectBuilder) { effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Vector4, efiBlend.Name); - string str1 = (string)null; + string str1 = null; switch (efiBlend.ColorOperation) { case ColorOperation.Add: - str1 = InvariantString.Format(" // Blend the RGB - result\r\n float4 {0};\r\n {0}.rgb = {1}.rgb + {2}.rgb;\r\n", (object)effectBuilder.PixelShaderOutput, (object)stBlendOutput1, (object)stBlendOutput2); + str1 = InvariantString.Format(" // Blend the RGB - result\r\n float4 {0};\r\n {0}.rgb = {1}.rgb + {2}.rgb;\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); break; case ColorOperation.Subtract: - str1 = InvariantString.Format(" // Blend the RGB - result\r\n float4 {0};\r\n {0}.rgb = float3(abs({1}.rgb - {2}.rgb));\r\n", (object)effectBuilder.PixelShaderOutput, (object)stBlendOutput1, (object)stBlendOutput2); + str1 = InvariantString.Format(" // Blend the RGB - result\r\n float4 {0};\r\n {0}.rgb = float3(abs({1}.rgb - {2}.rgb));\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); break; case ColorOperation.Multiply: - str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = {1}.rgb * {2}.rgb;\r\n", (object)effectBuilder.PixelShaderOutput, (object)stBlendOutput1, (object)stBlendOutput2); + str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = {1}.rgb * {2}.rgb;\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); break; case ColorOperation.Lighten: - str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = max({1}.rgb, {2}.rgb);\r\n", (object)effectBuilder.PixelShaderOutput, (object)stBlendOutput1, (object)stBlendOutput2); + str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = max({1}.rgb, {2}.rgb);\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); break; case ColorOperation.Darken: - str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = min({1}.rgb, {2}.rgb);\r\n", (object)effectBuilder.PixelShaderOutput, (object)stBlendOutput1, (object)stBlendOutput2); + str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = min({1}.rgb, {2}.rgb);\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); break; case ColorOperation.ColorDodge: - str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = {1}.rgb / (1 - {2}.rgb);\r\n", (object)effectBuilder.PixelShaderOutput, (object)stBlendOutput1, (object)stBlendOutput2); + str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = {1}.rgb / (1 - {2}.rgb);\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); break; case ColorOperation.ColorBurn: - str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = 1 - ((1 - {1}.rgb) / {2}.rgb);\r\n", (object)effectBuilder.PixelShaderOutput, (object)stBlendOutput1, (object)stBlendOutput2); + str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = 1 - ((1 - {1}.rgb) / {2}.rgb);\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); break; case ColorOperation.Screen: - str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = 1 - ((1 - {1}.rgb) * (1 - {2}.rgb));\r\n", (object)effectBuilder.PixelShaderOutput, (object)stBlendOutput1, (object)stBlendOutput2); + str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = 1 - ((1 - {1}.rgb) * (1 - {2}.rgb));\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); break; case ColorOperation.Overlay: string localVariable1 = effectBuilder.GenerateLocalVariable(Dx9VariableType.Float, "trueClause"); - str1 = InvariantString.Format(" // Blend the RGB result\r\n float3 {3} = ceil({1}.rgb - 0.5);\r\n float4 {0};\r\n {0}.rgb = {3}.rgb * (1 - (1 - 2 * ({1}.rgb - 0.5)) * (1 - {2}.rgb)) \r\n + (1 - {3}.rgb) * (2 * {1}.rgb * {2}.rgb);\r\n", (object)effectBuilder.PixelShaderOutput, (object)stBlendOutput1, (object)stBlendOutput2, (object)localVariable1); + str1 = InvariantString.Format(" // Blend the RGB result\r\n float3 {3} = ceil({1}.rgb - 0.5);\r\n float4 {0};\r\n {0}.rgb = {3}.rgb * (1 - (1 - 2 * ({1}.rgb - 0.5)) * (1 - {2}.rgb)) \r\n + (1 - {3}.rgb) * (2 * {1}.rgb * {2}.rgb);\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2, localVariable1); break; case ColorOperation.SoftLight: string localVariable2 = effectBuilder.GenerateLocalVariable(Dx9VariableType.Float, "trueClause"); - str1 = InvariantString.Format(" // Blend the RGB result\r\n float3 {3} = ceil({2}.rgb - 0.5);\r\n float4 {0};\r\n {0}.rgb = {3}.rgb * (1 - (2 * (1 - (({1}.rgb / 2) + 0.25)) * (1 - {2}.rgb)))\r\n + (1 - {3}.rgb) * (2 * ({1}.rgb / 2 + 0.25) * {2}.rgb);\r\n", (object)effectBuilder.PixelShaderOutput, (object)stBlendOutput1, (object)stBlendOutput2, (object)localVariable2); + str1 = InvariantString.Format(" // Blend the RGB result\r\n float3 {3} = ceil({2}.rgb - 0.5);\r\n float4 {0};\r\n {0}.rgb = {3}.rgb * (1 - (2 * (1 - (({1}.rgb / 2) + 0.25)) * (1 - {2}.rgb)))\r\n + (1 - {3}.rgb) * (2 * ({1}.rgb / 2 + 0.25) * {2}.rgb);\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2, localVariable2); break; case ColorOperation.HardLight: string localVariable3 = effectBuilder.GenerateLocalVariable(Dx9VariableType.Float, "trueClause"); - str1 = InvariantString.Format(" // Blend the RGB result\r\n float3 {3} = ceil({2}.rgb - 0.5);\r\n float4 {0};\r\n {0}.rgb = {3}.rgb * (1 - (1 - 2 * ({2}.rgb - 0.5)) * (1 - {1}.rgb)) \r\n + (1 - {3}.rgb) * (2 * {1}.rgb * {2}.rgb);\r\n", (object)effectBuilder.PixelShaderOutput, (object)stBlendOutput1, (object)stBlendOutput2, (object)localVariable3); + str1 = InvariantString.Format(" // Blend the RGB result\r\n float3 {3} = ceil({2}.rgb - 0.5);\r\n float4 {0};\r\n {0}.rgb = {3}.rgb * (1 - (1 - 2 * ({2}.rgb - 0.5)) * (1 - {1}.rgb)) \r\n + (1 - {3}.rgb) * (2 * {1}.rgb * {2}.rgb);\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2, localVariable3); break; case ColorOperation.LinearBurn: - str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = {1}.rgb + {2}.rgb - 1;\r\n", (object)effectBuilder.PixelShaderOutput, (object)stBlendOutput1, (object)stBlendOutput2); + str1 = InvariantString.Format(" // Blend the RGB result\r\n float4 {0};\r\n {0}.rgb = {1}.rgb + {2}.rgb - 1;\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); break; default: Debug2.Throw(false, "Unknown color blend operation"); break; } - string str2 = (string)null; + string str2 = null; switch (efiBlend.AlphaOperation) { case AlphaOperation.Add: - str2 = InvariantString.Format(" // Blend the Alpha result\r\n {0}.a = {1}.a + {2}.a;\r\n\r\n", (object)effectBuilder.PixelShaderOutput, (object)stBlendOutput1, (object)stBlendOutput2); + str2 = InvariantString.Format(" // Blend the Alpha result\r\n {0}.a = {1}.a + {2}.a;\r\n\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); break; case AlphaOperation.Subtract: - str2 = InvariantString.Format(" // Blend the Alpha result\r\n {0}.a = {1}.a - {2}.a;\r\n\r\n", (object)effectBuilder.PixelShaderOutput, (object)stBlendOutput1, (object)stBlendOutput2); + str2 = InvariantString.Format(" // Blend the Alpha result\r\n {0}.a = {1}.a - {2}.a;\r\n\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); break; case AlphaOperation.Multiply: - str2 = InvariantString.Format(" // Blend the Alpha result\r\n {0}.a = {1}.a * {2}.a;\r\n\r\n", (object)effectBuilder.PixelShaderOutput, (object)stBlendOutput1, (object)stBlendOutput2); + str2 = InvariantString.Format(" // Blend the Alpha result\r\n {0}.a = {1}.a * {2}.a;\r\n\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1, stBlendOutput2); break; case AlphaOperation.Source1: - str2 = InvariantString.Format(" // Blend the Alpha result\r\n {0}.a = {1}.a;\r\n\r\n", (object)effectBuilder.PixelShaderOutput, (object)stBlendOutput1); + str2 = InvariantString.Format(" // Blend the Alpha result\r\n {0}.a = {1}.a;\r\n\r\n", effectBuilder.PixelShaderOutput, stBlendOutput1); break; case AlphaOperation.Source2: - str2 = InvariantString.Format(" // Blend the Alpha result\r\n {0}.a = {1}.a;\r\n\r\n", (object)effectBuilder.PixelShaderOutput, (object)stBlendOutput2); + str2 = InvariantString.Format(" // Blend the Alpha result\r\n {0}.a = {1}.a;\r\n\r\n", effectBuilder.PixelShaderOutput, stBlendOutput2); break; default: Debug2.Throw(false, "Unknown alpha blend operation"); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9BrightnessElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9BrightnessElement.cs index 7393a1c..0f6d396 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9BrightnessElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9BrightnessElement.cs @@ -16,14 +16,14 @@ namespace Microsoft.Iris.Render.Graphics { VariableInfo variableInfo = new VariableInfo() { - ID = (int)efoBrightness.BrightnessID, + ID = efoBrightness.BrightnessID, Type = Dx9VariableType.Float, IsDynamic = efoBrightness.IsDynamicProperty("Brightness") }; variableInfo.Name = variableInfo.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo.Type, efoBrightness.Name) : effectBuilder.GenerateGlobalConstant(variableInfo.Type, efoBrightness.Name); - variableInfo.DefaultValue = (object)efoBrightness.Brightness; + variableInfo.DefaultValue = efoBrightness.Brightness; effectBuilder.AddPropertyVariable(variableInfo); - effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // adjust brightness based on input\r\n {0}.rgb += float3({1}, {1}, {1});\r\n }}\r\n", (object)effectBuilder.PixelShaderOutput, (object)variableInfo.Name)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // adjust brightness based on input\r\n {0}.rgb += float3({1}, {1}, {1});\r\n }}\r\n", effectBuilder.PixelShaderOutput, variableInfo.Name)); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9ColorElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9ColorElement.cs index dd4cb14..ff6af80 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9ColorElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9ColorElement.cs @@ -14,16 +14,16 @@ namespace Microsoft.Iris.Render.Graphics { VariableInfo variableInfo = new VariableInfo() { - ID = (int)efiColor.ColorID, + ID = efiColor.ColorID, Type = Dx9VariableType.Vector4, IsDynamic = efiColor.IsDynamicProperty("Color") }; variableInfo.Name = variableInfo.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo.Type, efiColor.Name) : effectBuilder.GenerateGlobalConstant(variableInfo.Type, efiColor.Name); - variableInfo.DefaultValue = (object)efiColor.Color.ToVector4(); + variableInfo.DefaultValue = efiColor.Color.ToVector4(); effectBuilder.AddPropertyVariable(variableInfo); string name = variableInfo.Name; effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Vector4, efiColor.Name); - effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the color\r\n float4 {0} = {1};\r\n\r\n", (object)effectBuilder.PixelShaderOutput, (object)name)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the color\r\n float4 {0} = {1};\r\n\r\n", effectBuilder.PixelShaderOutput, name)); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9ComplexImageElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9ComplexImageElement.cs index a7a40a3..a793366 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9ComplexImageElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9ComplexImageElement.cs @@ -14,53 +14,53 @@ namespace Microsoft.Iris.Render.Graphics { VariableInfo variableInfo1 = new VariableInfo() { - ID = (int)efiImage.MinFilterID, + ID = efiImage.MinFilterID, Type = Dx9VariableType.Integer, IsDynamic = efiImage.IsDynamicProperty("MinFilter") }; variableInfo1.Name = variableInfo1.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo1.Type, efiImage.Name + "MinFilter") : effectBuilder.GenerateGlobalConstant(variableInfo1.Type, efiImage.Name + "MinFilter"); - variableInfo1.DefaultValue = (object)(int)efiImage.MinFilter; + variableInfo1.DefaultValue = (int)efiImage.MinFilter; effectBuilder.AddPropertyVariable(variableInfo1); string name1 = variableInfo1.Name; VariableInfo variableInfo2 = new VariableInfo() { - ID = (int)efiImage.MagFilterID, + ID = efiImage.MagFilterID, Type = Dx9VariableType.Integer, IsDynamic = efiImage.IsDynamicProperty("MagFilter") }; variableInfo2.Name = variableInfo2.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo2.Type, efiImage.Name + "MagFilter") : effectBuilder.GenerateGlobalConstant(variableInfo2.Type, efiImage.Name + "MagFilter"); - variableInfo2.DefaultValue = (object)(int)efiImage.MagFilter; + variableInfo2.DefaultValue = (int)efiImage.MagFilter; effectBuilder.AddPropertyVariable(variableInfo2); string name2 = variableInfo2.Name; effectBuilder.AddPropertyVariable(new VariableInfo() { - ID = (int)efiImage.CoordinateMapIndexID, + ID = efiImage.CoordinateMapIndexID, Type = Dx9VariableType.Integer, IsDynamic = efiImage.IsDynamicProperty("CoordinateMapIndex"), - Name = (string)null, - DefaultValue = (object)(int)efiImage.CoordinateMapIndex + Name = null, + DefaultValue = (int)efiImage.CoordinateMapIndex }); Dx9TextureInfo dx9TextureInfo = effectBuilder.AllocateTexture(); TextureVariableInfo textureVariableInfo = new TextureVariableInfo(); - textureVariableInfo.ID = (int)efiImage.ImageID; + textureVariableInfo.ID = efiImage.ImageID; textureVariableInfo.Type = Dx9VariableType.Texture; textureVariableInfo.Name = effectBuilder.GenerateGlobalVariable(textureVariableInfo.Type, efiImage.Name); - textureVariableInfo.DefaultValue = (object)efiImage.Image; + textureVariableInfo.DefaultValue = efiImage.Image; textureVariableInfo.SamplerName = dx9TextureInfo.Sampler; - textureVariableInfo.MinFilter = InvariantString.Format("<{0}>", (object)name1); - textureVariableInfo.MagFilter = InvariantString.Format("<{0}>", (object)name2); - textureVariableInfo.CoordinateMapID = (int)efiImage.CoordinateMapIndexID; - textureVariableInfo.ImageIndexID = (int)efiImage.ImageIndexID; - effectBuilder.AddPropertyVariable((VariableInfo)textureVariableInfo); + textureVariableInfo.MinFilter = InvariantString.Format("<{0}>", name1); + textureVariableInfo.MagFilter = InvariantString.Format("<{0}>", name2); + textureVariableInfo.CoordinateMapID = efiImage.CoordinateMapIndexID; + textureVariableInfo.ImageIndexID = efiImage.ImageIndexID; + effectBuilder.AddPropertyVariable(textureVariableInfo); effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Vector4, efiImage.Name); - effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the image\r\n float4 {0} = tex2D({1}, {2});\r\n\r\n", (object)effectBuilder.PixelShaderOutput, (object)dx9TextureInfo.Sampler, (object)dx9TextureInfo.TexCoordInput)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the image\r\n float4 {0} = tex2D({1}, {2});\r\n\r\n", effectBuilder.PixelShaderOutput, dx9TextureInfo.Sampler, dx9TextureInfo.TexCoordInput)); effectBuilder.AddPropertyVariable(new VariableInfo() { - ID = (int)efiImage.ImageIndexID, + ID = efiImage.ImageIndexID, Type = Dx9VariableType.Integer, IsDynamic = efiImage.IsDynamicProperty("ImageIndex"), - Name = (string)null, - DefaultValue = (object)(int)efiImage.ImageIndex + Name = null, + DefaultValue = (int)efiImage.ImageIndex }); } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9ContrastElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9ContrastElement.cs index 1170204..80d56eb 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9ContrastElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9ContrastElement.cs @@ -14,14 +14,14 @@ namespace Microsoft.Iris.Render.Graphics { VariableInfo variableInfo = new VariableInfo() { - ID = (int)efoContrast.ContrastID, + ID = efoContrast.ContrastID, Type = Dx9VariableType.Float, IsDynamic = efoContrast.IsDynamicProperty("Contrast") }; variableInfo.Name = variableInfo.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo.Type, efoContrast.Name) : effectBuilder.GenerateGlobalConstant(variableInfo.Type, efoContrast.Name); - variableInfo.DefaultValue = (object)efoContrast.Contrast; + variableInfo.DefaultValue = efoContrast.Contrast; effectBuilder.AddPropertyVariable(variableInfo); - effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // apply the gain factor \r\n {0}.rgb -= float3(0.5f, 0.5f, 0.5f)\r\n; {0}.rgb *= float3({1}, {1}, {1});\r\n {0}.rgb += float3(0.5f, 0.5f, 0.5f)\r\n; }}\r\n", (object)effectBuilder.PixelShaderOutput, (object)variableInfo.Name)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // apply the gain factor \r\n {0}.rgb -= float3(0.5f, 0.5f, 0.5f)\r\n; {0}.rgb *= float3({1}, {1}, {1});\r\n {0}.rgb += float3(0.5f, 0.5f, 0.5f)\r\n; }}\r\n", effectBuilder.PixelShaderOutput, variableInfo.Name)); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9DesaturateElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9DesaturateElement.cs index 3b2fd95..082a1d9 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9DesaturateElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9DesaturateElement.cs @@ -16,15 +16,15 @@ namespace Microsoft.Iris.Render.Graphics { VariableInfo variableInfo = new VariableInfo() { - ID = (int)efoDesaturate.DesaturateID, + ID = efoDesaturate.DesaturateID, Type = Dx9VariableType.Float, - DefaultValue = (object)efoDesaturate.Desaturate, + DefaultValue = efoDesaturate.Desaturate, IsDynamic = efoDesaturate.IsDynamicProperty("Desaturate") }; variableInfo.Name = variableInfo.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo.Type, efoDesaturate.Name) : effectBuilder.GenerateGlobalConstant(variableInfo.Type, efoDesaturate.Name); effectBuilder.AddPropertyVariable(variableInfo); string name = variableInfo.Name; - effectBuilder.EmitPixelFragment(InvariantString.Format(" // Desaturate the value\r\n {{\r\n float3 vGray = {{.15, .55, .30}};\r\n float fLuminance = dot({0}.rgb, vGray);\r\n {0}.rgb = lerp({0}.rgb, fLuminance.rrr, {1});\r\n\r\n }}\r\n", (object)effectBuilder.PixelShaderOutput, (object)name)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Desaturate the value\r\n {{\r\n float3 vGray = {{.15, .55, .30}};\r\n float fLuminance = dot({0}.rgb, vGray);\r\n {0}.rgb = lerp({0}.rgb, fLuminance.rrr, {1});\r\n\r\n }}\r\n", effectBuilder.PixelShaderOutput, name)); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9DestinationElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9DestinationElement.cs index 2eb35b7..d4de93b 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9DestinationElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9DestinationElement.cs @@ -15,42 +15,42 @@ namespace Microsoft.Iris.Render.Graphics ref Dx9EffectBuilder effectBuilder) { Dx9TextureInfo textureInfo = effectBuilder.AllocateTexture(); - effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.SampleBackbuffer, (object)(int)efiDestination.DownsampleID); - effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.DisablePerspectiveCorrection, (object)null); - effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexelSize, (object)null); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.SampleBackbuffer, (int)efiDestination.DownsampleID); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.DisablePerspectiveCorrection, null); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexelSize, null); TextureVariableInfo textureVariableInfo = new TextureVariableInfo(); - textureVariableInfo.ID = (int)efiDestination.DestinationID; + textureVariableInfo.ID = efiDestination.DestinationID; textureVariableInfo.Type = Dx9VariableType.Texture; textureVariableInfo.Name = effectBuilder.GenerateGlobalVariable(textureVariableInfo.Type, efiDestination.Name); - textureVariableInfo.DefaultValue = (object)null; + textureVariableInfo.DefaultValue = null; textureVariableInfo.SamplerName = textureInfo.Sampler; textureVariableInfo.MinFilter = "Linear"; textureVariableInfo.MagFilter = "Linear"; textureVariableInfo.CoordinateMapID = -1; textureVariableInfo.ImageIndexID = -1; - effectBuilder.AddPropertyVariable((VariableInfo)textureVariableInfo); + effectBuilder.AddPropertyVariable(textureVariableInfo); effectBuilder.AddPropertyVariable(new VariableInfo() { - ID = (int)efiDestination.DownsampleID, + ID = efiDestination.DownsampleID, Type = Dx9VariableType.Float, IsDynamic = efiDestination.IsDynamicProperty("Downsample"), - Name = (string)null, - DefaultValue = (object)efiDestination.Downsample + Name = null, + DefaultValue = efiDestination.Downsample }); VariableInfo variableInfo = new VariableInfo() { - ID = (int)efiDestination.UVOffsetID, + ID = efiDestination.UVOffsetID, Type = Dx9VariableType.Vector2, IsDynamic = efiDestination.IsDynamicProperty("UVOffset") }; variableInfo.Name = variableInfo.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo.Type, "UVOffset") : effectBuilder.GenerateGlobalConstant(variableInfo.Type, "UVOffset"); - variableInfo.DefaultValue = (object)efiDestination.UVOffset; + variableInfo.DefaultValue = efiDestination.UVOffset; effectBuilder.AddPropertyVariable(variableInfo); effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Texture, efiDestination.Name); if (variableInfo.IsDynamic || !efiDestination.UVOffset.IsApproximate(Vector2.Zero)) - effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the image\r\n float4 {0} = tex2D({1}, {2} + float2({3}.x * {4}.x, {3}.y * {4}.y));\r\n\r\n", (object)effectBuilder.PixelShaderOutput, (object)textureInfo.Sampler, (object)textureInfo.TexCoordInput, (object)textureInfo.TexelSize, (object)variableInfo.Name)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the image\r\n float4 {0} = tex2D({1}, {2} + float2({3}.x * {4}.x, {3}.y * {4}.y));\r\n\r\n", effectBuilder.PixelShaderOutput, textureInfo.Sampler, textureInfo.TexCoordInput, textureInfo.TexelSize, variableInfo.Name)); else - effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the image\r\n float4 {0} = tex2D({1}, {2});\r\n\r\n", (object)effectBuilder.PixelShaderOutput, (object)textureInfo.Sampler, (object)textureInfo.TexCoordInput)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the image\r\n float4 {0} = tex2D({1}, {2});\r\n\r\n", effectBuilder.PixelShaderOutput, textureInfo.Sampler, textureInfo.TexCoordInput)); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EdgeDetectionElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EdgeDetectionElement.cs index 69211b6..11c47d9 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EdgeDetectionElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EdgeDetectionElement.cs @@ -15,17 +15,17 @@ namespace Microsoft.Iris.Render.Graphics ref Dx9EffectBuilder effectBuilder) { Dx9TextureInfo textureInfo = effectBuilder.GetTextureInfo(effectBuilder.ImageCount - 1); - effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexelSize, (object)null); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexelSize, null); VariableInfo variableInfo = new VariableInfo() { - ID = (int)efoEdgeDetection.EdgeLimitID, + ID = efoEdgeDetection.EdgeLimitID, Type = Dx9VariableType.Float, IsDynamic = efoEdgeDetection.IsDynamicProperty("EdgeLimit") }; variableInfo.Name = variableInfo.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo.Type, efoEdgeDetection.Name) : effectBuilder.GenerateGlobalConstant(variableInfo.Type, efoEdgeDetection.Name); - variableInfo.DefaultValue = (object)efoEdgeDetection.EdgeLimit; + variableInfo.DefaultValue = efoEdgeDetection.EdgeLimit; effectBuilder.AddPropertyVariable(variableInfo); - effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // Sample neightbour pixel\r\n float4 vBottomPixel = tex2D({1}, {2} + float2(0.0f, {3}.y));\r\n float currentAvg = {0}.r + {0}.g + {0}.b;\r\n currentAvg = currentAvg / 3.0f;\r\n float bottomAvg = vBottomPixel.r + vBottomPixel.g + vBottomPixel.b;\r\n bottomAvg = bottomAvg / 3.0f;\r\n float diff = abs(currentAvg - bottomAvg);\r\n // change color into black or white depending on what the delta is\r\n if (diff < {4})\r\n {{\r\n {0}.rgb = 1.0f;\r\n }}\r\n else\r\n {{\r\n {0}.rgb = 0.0f;\r\n }}\r\n }}\r\n\r\n", (object)effectBuilder.PixelShaderOutput, (object)textureInfo.Sampler, (object)textureInfo.TexCoordInput, (object)textureInfo.TexelSize, (object)variableInfo.Name)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // Sample neightbour pixel\r\n float4 vBottomPixel = tex2D({1}, {2} + float2(0.0f, {3}.y));\r\n float currentAvg = {0}.r + {0}.g + {0}.b;\r\n currentAvg = currentAvg / 3.0f;\r\n float bottomAvg = vBottomPixel.r + vBottomPixel.g + vBottomPixel.b;\r\n bottomAvg = bottomAvg / 3.0f;\r\n float diff = abs(currentAvg - bottomAvg);\r\n // change color into black or white depending on what the delta is\r\n if (diff < {4})\r\n {{\r\n {0}.rgb = 1.0f;\r\n }}\r\n else\r\n {{\r\n {0}.rgb = 0.0f;\r\n }}\r\n }}\r\n\r\n", effectBuilder.PixelShaderOutput, textureInfo.Sampler, textureInfo.TexCoordInput, textureInfo.TexelSize, variableInfo.Name)); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9Effect.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9Effect.cs index 0bc3fc3..8ee7932 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9Effect.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9Effect.cs @@ -11,8 +11,8 @@ namespace Microsoft.Iris.Render.Graphics internal class Dx9Effect : Effect { internal Dx9Effect(Dx9EffectTemplate effectTemplate) - : base((EffectTemplate)effectTemplate) - => this.m_remoteEffect = (Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteEffect)this.m_effectTemplate.Session.BuildRemoteDx9Effect(this); + : base(effectTemplate) + => this.m_remoteEffect = this.m_effectTemplate.Session.BuildRemoteDx9Effect(this); internal Dx9EffectManager EffectManager => ((Dx9GraphicsDevice)this.m_effectTemplate.Device).EffectManager; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EffectBuilder.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EffectBuilder.cs index f1bcbb8..4303218 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EffectBuilder.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EffectBuilder.cs @@ -116,18 +116,18 @@ namespace Microsoft.Iris.Render.Graphics } else stringBuilder.Append("Temp"); - return stringBuilder.ToString() + (object)this.m_nUniqueVariableID++; + return stringBuilder.ToString() + this.m_nUniqueVariableID++; } internal void Clear() { - this.m_stPixelOutput = (string)null; + this.m_stPixelOutput = null; this.m_nUniqueVariableID = 0; this.m_nRequirements = 0; - this.m_sbPixelShader = (StringBuilder)null; - this.m_sbVertexShader = (StringBuilder)null; - this.m_sbDeclarations = (StringBuilder)null; - this.m_sbEffect = (StringBuilder)null; + this.m_sbPixelShader = null; + this.m_sbVertexShader = null; + this.m_sbDeclarations = null; + this.m_sbEffect = null; if (this.m_alPropertyVariables != null) this.m_alPropertyVariables.Clear(); if (this.m_alGlobalVariables != null) @@ -181,8 +181,8 @@ namespace Microsoft.Iris.Render.Graphics { ImageIndex = this.ImageCount }; - dx9TextureInfo.TexCoordInput = InvariantString.Format("{0}{1}", (object)"vTexCoord", (object)dx9TextureInfo.ImageIndex); - dx9TextureInfo.Sampler = InvariantString.Format("{0}{1}", (object)"Sampler", (object)dx9TextureInfo.ImageIndex); + dx9TextureInfo.TexCoordInput = InvariantString.Format("{0}{1}", "vTexCoord", dx9TextureInfo.ImageIndex); + dx9TextureInfo.Sampler = InvariantString.Format("{0}{1}", "Sampler", dx9TextureInfo.ImageIndex); dx9TextureInfo.DownsamplePropertyID = -1; if (this.m_alTextureInfos == null) this.m_alTextureInfos = new Vector(); @@ -201,7 +201,7 @@ namespace Microsoft.Iris.Render.Graphics case Dx9TextureRequirements.TexelSize: if (textureInfo.TexelSize != null) break; - string stName1 = InvariantString.Format("{0}{1}", (object)"TexelSize", (object)textureInfo.ImageIndex); + string stName1 = InvariantString.Format("{0}{1}", "TexelSize", textureInfo.ImageIndex); VariableInfo variableInfo1 = new VariableInfo() { IsDynamic = true, @@ -209,7 +209,7 @@ namespace Microsoft.Iris.Render.Graphics Type = Dx9VariableType.Vector2 }; variableInfo1.Name = this.GenerateGlobalVariable(variableInfo1.Type, stName1); - variableInfo1.DefaultValue = (object)new Vector2(0.0f, 0.0f); + variableInfo1.DefaultValue = new Vector2(0.0f, 0.0f); this.AddGlobalVariable(variableInfo1); textureInfo.TexelSize = variableInfo1.Name; break; @@ -219,7 +219,7 @@ namespace Microsoft.Iris.Render.Graphics case Dx9TextureRequirements.TexUVSize: if (textureInfo.TexUVSize != null) break; - string stName2 = InvariantString.Format("{0}{1}", (object)"TexUVSize", (object)textureInfo.ImageIndex); + string stName2 = InvariantString.Format("{0}{1}", "TexUVSize", textureInfo.ImageIndex); VariableInfo variableInfo2 = new VariableInfo() { IsDynamic = true, @@ -227,14 +227,14 @@ namespace Microsoft.Iris.Render.Graphics Type = Dx9VariableType.Vector2 }; variableInfo2.Name = this.GenerateGlobalVariable(variableInfo2.Type, stName2); - variableInfo2.DefaultValue = (object)new Vector2(0.0f, 0.0f); + variableInfo2.DefaultValue = new Vector2(0.0f, 0.0f); this.AddGlobalVariable(variableInfo2); textureInfo.TexUVSize = variableInfo2.Name; break; case Dx9TextureRequirements.TexUVRefPoint: if (textureInfo.TexUVRefPoint != null) break; - string stName3 = InvariantString.Format("{0}{1}", (object)"TexUVRefPoint", (object)textureInfo.ImageIndex); + string stName3 = InvariantString.Format("{0}{1}", "TexUVRefPoint", textureInfo.ImageIndex); VariableInfo variableInfo3 = new VariableInfo() { IsDynamic = true, @@ -242,7 +242,7 @@ namespace Microsoft.Iris.Render.Graphics Type = Dx9VariableType.Vector2 }; variableInfo3.Name = this.GenerateGlobalVariable(variableInfo3.Type, stName3); - variableInfo3.DefaultValue = (object)new Vector2(0.0f, 0.0f); + variableInfo3.DefaultValue = new Vector2(0.0f, 0.0f); this.AddGlobalVariable(variableInfo3); textureInfo.TexUVRefPoint = variableInfo3.Name; break; @@ -269,7 +269,7 @@ namespace Microsoft.Iris.Render.Graphics return ""; StringBuilder stringBuilder = new StringBuilder(); for (int index = 0; index < this.m_alIncludes.Count; ++index) - stringBuilder.AppendFormat("#include {0}\r\n", (object)this.m_alIncludes[index]); + stringBuilder.AppendFormat("#include {0}\r\n", this.m_alIncludes[index]); return stringBuilder.ToString(); } } @@ -304,7 +304,7 @@ namespace Microsoft.Iris.Render.Graphics this.m_sbDeclarations.Append("struct PS_OUTPUT\r\n{\r\n float4 Color : COLOR; // Object space position\r\n};\r\n\r\n"); this.m_sbDeclarations.Append("struct VS_INPUT\r\n{\r\n float4 ObjPos : POSITION; // Object space position\r\n float4 Color : COLOR; // Vertex color\r\n"); for (int index = 0; index < this.ImageCount; ++index) - this.m_sbDeclarations.AppendFormat(" float2 TexCoord{0} : TEXCOORD{0}; // Texture {0} UV coordinates\r\n", (object)index); + this.m_sbDeclarations.AppendFormat(" float2 TexCoord{0} : TEXCOORD{0}; // Texture {0} UV coordinates\r\n", index); this.m_sbDeclarations.Append("};\r\n\r\n"); this.m_sbDeclarations.Append("struct VS_OUTPUT\r\n{\r\n float4 ProjPos : POSITION; // Projected space position\r\n float4 Color : COLOR; // Vertex color\r\n"); if (Bits.TestFlag(this.m_nRequirements, 1)) @@ -312,9 +312,9 @@ namespace Microsoft.Iris.Render.Graphics for (int index = 0; index < this.ImageCount; ++index) { if (Bits.TestFlag(this.m_alTextureInfos[index].Requirements, 16)) - this.m_sbDeclarations.AppendFormat(" float3 TexCoord{0} : TEXCOORD{0}; // Texture {0} UVW coordinates\r\n", (object)index); + this.m_sbDeclarations.AppendFormat(" float3 TexCoord{0} : TEXCOORD{0}; // Texture {0} UVW coordinates\r\n", index); else - this.m_sbDeclarations.AppendFormat(" float2 TexCoord{0} : TEXCOORD{0}; // Texture {0} UV coordinates\r\n", (object)index); + this.m_sbDeclarations.AppendFormat(" float2 TexCoord{0} : TEXCOORD{0}; // Texture {0} UV coordinates\r\n", index); } this.m_sbDeclarations.Append("};\r\n\r\n"); } @@ -333,9 +333,9 @@ namespace Microsoft.Iris.Render.Graphics for (int index = 0; index < this.ImageCount; ++index) { if (Bits.TestFlag(this.m_alTextureInfos[index].Requirements, 16)) - this.m_sbVertexShader.AppendFormat(" Output.TexCoord{0} = float3(Input.TexCoord{0}.x * Output.ProjPos.w, Input.TexCoord{0}.y * Output.ProjPos.w, Output.ProjPos.w);\r\n", (object)index); + this.m_sbVertexShader.AppendFormat(" Output.TexCoord{0} = float3(Input.TexCoord{0}.x * Output.ProjPos.w, Input.TexCoord{0}.y * Output.ProjPos.w, Output.ProjPos.w);\r\n", index); else - this.m_sbVertexShader.AppendFormat(" Output.TexCoord{0} = Input.TexCoord{0};\r\n", (object)index); + this.m_sbVertexShader.AppendFormat(" Output.TexCoord{0} = Input.TexCoord{0};\r\n", index); } } return this.m_sbVertexShader.ToString(); @@ -348,9 +348,9 @@ namespace Microsoft.Iris.Render.Graphics { Dx9TextureInfo alTextureInfo = this.m_alTextureInfos[index]; if (Bits.TestFlag(alTextureInfo.Requirements, 16)) - stringBuilder.AppendFormat(" float2 {0} = Input.TexCoord{1}.xy / Input.TexCoord{1}.z;\r\n", (object)alTextureInfo.TexCoordInput, (object)index); + stringBuilder.AppendFormat(" float2 {0} = Input.TexCoord{1}.xy / Input.TexCoord{1}.z;\r\n", alTextureInfo.TexCoordInput, index); else - stringBuilder.AppendFormat(" float2 {0} = Input.TexCoord{1};\r\n", (object)alTextureInfo.TexCoordInput, (object)index); + stringBuilder.AppendFormat(" float2 {0} = Input.TexCoord{1};\r\n", alTextureInfo.TexCoordInput, index); } stringBuilder.Append("\r\n"); stringBuilder.Append(this.m_sbPixelShader.ToString()); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EffectManager.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EffectManager.cs index 4c58769..e962ea9 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EffectManager.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EffectManager.cs @@ -36,8 +36,8 @@ namespace Microsoft.Iris.Render.Graphics return; Map.ValueCollection.Enumerator enumerator = this.m_mapEffectCache.Values.GetEnumerator(); while (enumerator.MoveNext()) - enumerator.Current?.UnregisterUsage((object)this); - this.m_mapEffectCache = (Map)null; + enumerator.Current?.UnregisterUsage(this); + this.m_mapEffectCache = null; } finally { @@ -53,11 +53,11 @@ namespace Microsoft.Iris.Render.Graphics { if (this.m_mapEffectCache == null) { - resource = (Dx9EffectResource)null; + resource = null; return false; } bool flag = this.m_mapEffectCache.ContainsKey(cacheKey); - resource = !flag ? (Dx9EffectResource)null : this.m_mapEffectCache[cacheKey]; + resource = !flag ? null : this.m_mapEffectCache[cacheKey]; return flag; } @@ -77,18 +77,18 @@ namespace Microsoft.Iris.Render.Graphics int nPropCacheSize, out Dx9EffectResource dxEffectResource) { - Dx9EffectResource resource = (Dx9EffectResource)null; + Dx9EffectResource resource = null; ByteBuilder byteBuilder = new ByteBuilder(nPropCacheSize); element.AddCacheKey(byteBuilder); if (!this.CacheLookup(byteBuilder, out resource)) { resource = new Dx9EffectResource(this.m_session, stName, this); - resource.RegisterUsage((object)this); + resource.RegisterUsage(this); if (!resource.Create(element)) { - resource.UnregisterUsage((object)this); - dxEffectResource = (Dx9EffectResource)null; - this.AddCachedEffect(byteBuilder, (Dx9EffectResource)null); + resource.UnregisterUsage(this); + dxEffectResource = null; + this.AddCachedEffect(byteBuilder, null); return false; } this.AddCachedEffect(byteBuilder, resource); @@ -107,7 +107,7 @@ namespace Microsoft.Iris.Render.Graphics if (keyValueEntry.Value != null) { if (keyValueEntry.Value.UsageCount == 1) - keyValueEntry.Value.UnregisterUsage((object)this); + keyValueEntry.Value.UnregisterUsage(this); else map.Add(keyValueEntry.Key, keyValueEntry.Value); } @@ -122,7 +122,7 @@ namespace Microsoft.Iris.Render.Graphics { if (this.m_fPendingCacheUpdate || this.m_mapEffectCache.Count < 50) return; - this.m_session.DeferredInvoke((Delegate)this.m_cbUpdateCache, (object)null, DeferredInvokePriority.Idle, new TimeSpan(0, 0, 5)); + this.m_session.DeferredInvoke(m_cbUpdateCache, null, DeferredInvokePriority.Idle, new TimeSpan(0, 0, 5)); this.m_fPendingCacheUpdate = true; } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EffectResource.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EffectResource.cs index dac75b3..c5a4c5c 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EffectResource.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EffectResource.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris.Render.Graphics this.m_session = session; this.m_stName = stName; this.m_effectManager = effectManager; - this.m_tracker = MessagingSession.Current.CreateDataBufferTracker((object)this); + this.m_tracker = MessagingSession.Current.CreateDataBufferTracker(this); } protected override void Dispose(bool fInDispose) @@ -48,8 +48,8 @@ namespace Microsoft.Iris.Render.Graphics if (this.m_remoteEffect != null) this.m_remoteEffect.Dispose(); } - this.m_tracker = (DataBufferTracker)null; - this.m_remoteEffect = (RemoteDx9EffectResource)null; + this.m_tracker = null; + this.m_remoteEffect = null; } finally { @@ -67,7 +67,7 @@ namespace Microsoft.Iris.Render.Graphics RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteEffect.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteEffect = (RemoteDx9EffectResource)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteEffect = null; internal bool Create(EffectInput element) { @@ -111,7 +111,7 @@ namespace Microsoft.Iris.Render.Graphics nBlobSize = 0U; try { - EngineApi.IFC(EngineApi.SpDx9CompileEffect(effectBuilder.EffectDefinition, (string)null, out pErrorString, out pErrorBuffer, out pEffectBlob, out nBlobSize, out pBlobBuffer)); + EngineApi.IFC(EngineApi.SpDx9CompileEffect(effectBuilder.EffectDefinition, null, out pErrorString, out pErrorBuffer, out pEffectBlob, out nBlobSize, out pBlobBuffer)); flag = true; } catch (Exception ex) @@ -134,7 +134,7 @@ namespace Microsoft.Iris.Render.Graphics uint nBlobSize) { DataBuffer dataBuffer = this.m_session.BuildDataBuffer(pEffectBlob, nBlobSize); - this.m_tracker.Track(dataBuffer, new DataBufferTracker.CleanupEventHandler(Dx9EffectResource.OnReleaseLocalData), (object)pBlobBuffer); + this.m_tracker.Track(dataBuffer, new DataBufferTracker.CleanupEventHandler(OnReleaseLocalData), pBlobBuffer); dataBuffer.Commit(); this.m_remoteEffect = this.m_session.BuildRemoteDx9EffectResource(this, this.m_effectManager.Device, dataBuffer); Vector propertyVariables = effectBuilder.PropertyVariables; @@ -212,47 +212,47 @@ namespace Microsoft.Iris.Render.Graphics case Dx9VariableType.Integer: if (variableInfo.IsDynamic) { - effectBuilder.EmitEffectFragment(InvariantString.Format("{0} {1};\r\n", (object)effectBuilder.ConvertToString(variableInfo.Type), (object)variableInfo.Name)); + effectBuilder.EmitEffectFragment(InvariantString.Format("{0} {1};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name)); continue; } - effectBuilder.EmitEffectFragment(InvariantString.Format("static const {0} {1} = {2};\r\n", (object)effectBuilder.ConvertToString(variableInfo.Type), (object)variableInfo.Name, (object)(int)variableInfo.DefaultValue)); + effectBuilder.EmitEffectFragment(InvariantString.Format("static const {0} {1} = {2};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name, (int)variableInfo.DefaultValue)); continue; case Dx9VariableType.Float: if (variableInfo.IsDynamic) { - effectBuilder.EmitEffectFragment(InvariantString.Format("{0} {1};\r\n", (object)effectBuilder.ConvertToString(variableInfo.Type), (object)variableInfo.Name)); + effectBuilder.EmitEffectFragment(InvariantString.Format("{0} {1};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name)); continue; } - effectBuilder.EmitEffectFragment(InvariantString.Format("static const {0} {1} = {2};\r\n", (object)effectBuilder.ConvertToString(variableInfo.Type), (object)variableInfo.Name, (object)(float)variableInfo.DefaultValue)); + effectBuilder.EmitEffectFragment(InvariantString.Format("static const {0} {1} = {2};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name, (float)variableInfo.DefaultValue)); continue; case Dx9VariableType.Vector2: if (variableInfo.IsDynamic) { - effectBuilder.EmitEffectFragment(InvariantString.Format("{0} {1};\r\n", (object)effectBuilder.ConvertToString(variableInfo.Type), (object)variableInfo.Name)); + effectBuilder.EmitEffectFragment(InvariantString.Format("{0} {1};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name)); continue; } - effectBuilder.EmitEffectFragment(InvariantString.Format("static const {0} {1} = {2};\r\n", (object)effectBuilder.ConvertToString(variableInfo.Type), (object)variableInfo.Name, (object)((Vector2)variableInfo.DefaultValue).ToDxShaderString())); + effectBuilder.EmitEffectFragment(InvariantString.Format("static const {0} {1} = {2};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name, ((Vector2)variableInfo.DefaultValue).ToDxShaderString())); continue; case Dx9VariableType.Vector3: if (variableInfo.IsDynamic) { - effectBuilder.EmitEffectFragment(InvariantString.Format("{0} {1};\r\n", (object)effectBuilder.ConvertToString(variableInfo.Type), (object)variableInfo.Name)); + effectBuilder.EmitEffectFragment(InvariantString.Format("{0} {1};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name)); continue; } - effectBuilder.EmitEffectFragment(InvariantString.Format("static const {0} {1} = {2};\r\n", (object)effectBuilder.ConvertToString(variableInfo.Type), (object)variableInfo.Name, (object)((Vector3)variableInfo.DefaultValue).ToDxShaderString())); + effectBuilder.EmitEffectFragment(InvariantString.Format("static const {0} {1} = {2};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name, ((Vector3)variableInfo.DefaultValue).ToDxShaderString())); continue; case Dx9VariableType.Vector4: if (variableInfo.IsDynamic) { - effectBuilder.EmitEffectFragment(InvariantString.Format("{0} {1};\r\n", (object)effectBuilder.ConvertToString(variableInfo.Type), (object)variableInfo.Name)); + effectBuilder.EmitEffectFragment(InvariantString.Format("{0} {1};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name)); continue; } - effectBuilder.EmitEffectFragment(InvariantString.Format("static const {0} {1} = {2};\r\n", (object)effectBuilder.ConvertToString(variableInfo.Type), (object)variableInfo.Name, (object)((Vector4)variableInfo.DefaultValue).ToDxShaderString())); + effectBuilder.EmitEffectFragment(InvariantString.Format("static const {0} {1} = {2};\r\n", effectBuilder.ConvertToString(variableInfo.Type), variableInfo.Name, ((Vector4)variableInfo.DefaultValue).ToDxShaderString())); continue; case Dx9VariableType.Texture: TextureVariableInfo textureVariableInfo = (TextureVariableInfo)variableInfo; - effectBuilder.EmitEffectFragment(InvariantString.Format("\r\n{0} {1};\r\n", (object)effectBuilder.ConvertToString(textureVariableInfo.Type), (object)textureVariableInfo.Name)); - effectBuilder.EmitEffectFragment(InvariantString.Format("sampler {0} = \r\n sampler_state\r\n {{\r\n Texture = <{1}>;\r\n MinFilter = {2};\r\n MagFilter = {3};\r\n AddressU = Clamp;\r\n AddressV = Clamp;\r\n }};\r\n\r\n", (object)textureVariableInfo.SamplerName, (object)textureVariableInfo.Name, (object)textureVariableInfo.MinFilter, (object)textureVariableInfo.MagFilter)); + effectBuilder.EmitEffectFragment(InvariantString.Format("\r\n{0} {1};\r\n", effectBuilder.ConvertToString(textureVariableInfo.Type), textureVariableInfo.Name)); + effectBuilder.EmitEffectFragment(InvariantString.Format("sampler {0} = \r\n sampler_state\r\n {{\r\n Texture = <{1}>;\r\n MinFilter = {2};\r\n MagFilter = {3};\r\n AddressU = Clamp;\r\n AddressV = Clamp;\r\n }};\r\n\r\n", textureVariableInfo.SamplerName, textureVariableInfo.Name, textureVariableInfo.MinFilter, textureVariableInfo.MagFilter)); continue; default: continue; @@ -267,11 +267,11 @@ namespace Microsoft.Iris.Render.Graphics protected void EmitShaders(Dx9EffectBuilder effectBuilder) { effectBuilder.EmitEffectFragment(effectBuilder.ShaderDeclarations); - effectBuilder.EmitEffectFragment(InvariantString.Format("VS_OUTPUT {0}(VS_INPUT Input)\r\n{{\r\n VS_OUTPUT Output;\r\n\r\n{1}\r\n return Output;\r\n}}\r\n\r\n", (object)Dx9EffectResource.k_stVertexShaderName, (object)effectBuilder.VertexShader)); - effectBuilder.EmitEffectFragment(InvariantString.Format("PS_OUTPUT {0}(VS_OUTPUT Input)\r\n{{\r\n PS_OUTPUT Output;\r\n\r\n{1} // Include Vertex color contribution\r\n Output.Color = {2} * Input.Color;\r\n\r\n // Return the final result\r\n return Output;\r\n}}\r\n\r\n", (object)Dx9EffectResource.k_stPixelShaderName, (object)effectBuilder.PixelShader, (object)effectBuilder.PixelShaderOutput)); + effectBuilder.EmitEffectFragment(InvariantString.Format("VS_OUTPUT {0}(VS_INPUT Input)\r\n{{\r\n VS_OUTPUT Output;\r\n\r\n{1}\r\n return Output;\r\n}}\r\n\r\n", k_stVertexShaderName, effectBuilder.VertexShader)); + effectBuilder.EmitEffectFragment(InvariantString.Format("PS_OUTPUT {0}(VS_OUTPUT Input)\r\n{{\r\n PS_OUTPUT Output;\r\n\r\n{1} // Include Vertex color contribution\r\n Output.Color = {2} * Input.Color;\r\n\r\n // Return the final result\r\n return Output;\r\n}}\r\n\r\n", k_stPixelShaderName, effectBuilder.PixelShader, effectBuilder.PixelShaderOutput)); } - protected void EmitTechnique(Dx9EffectBuilder effectBuilder) => effectBuilder.EmitEffectFragment(InvariantString.Format("technique GeneratedTechnique\r\n{{\r\n pass P0\r\n {{\r\n // Shaders\r\n PixelShader = compile {0} {1}();\r\n VertexShader = compile {2} {3}();\r\n }}\r\n}}\r\n", (object)this.PixelShaderVersion, (object)Dx9EffectResource.k_stPixelShaderName, (object)this.VertexShaderVersion, (object)Dx9EffectResource.k_stVertexShaderName)); + protected void EmitTechnique(Dx9EffectBuilder effectBuilder) => effectBuilder.EmitEffectFragment(InvariantString.Format("technique GeneratedTechnique\r\n{{\r\n pass P0\r\n {{\r\n // Shaders\r\n PixelShader = compile {0} {1}();\r\n VertexShader = compile {2} {3}();\r\n }}\r\n}}\r\n", PixelShaderVersion, k_stPixelShaderName, VertexShaderVersion, k_stVertexShaderName)); private void GenerateEffect(Dx9EffectBuilder effectBuilder) { @@ -337,7 +337,7 @@ namespace Microsoft.Iris.Render.Graphics return false; if (eflCurrent.Operations != null) { - foreach (EffectOperation operation in (IEnumerable)eflCurrent.Operations) + foreach (EffectOperation operation in eflCurrent.Operations) { switch (operation.Type) { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EffectTemplate.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EffectTemplate.cs index 1658e0a..763d83b 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EffectTemplate.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EffectTemplate.cs @@ -25,8 +25,8 @@ namespace Microsoft.Iris.Render.Graphics { if (!fInDispose || this.m_effectResource == null) return; - this.m_effectResource.UnregisterUsage((object)this); - this.m_effectResource = (Dx9EffectResource)null; + this.m_effectResource.UnregisterUsage(this); + this.m_effectResource = null; } finally { @@ -59,7 +59,7 @@ namespace Microsoft.Iris.Render.Graphics public override IEffect CreateInstance(object objUser) { Debug2.Validate(this.m_fBuilt, typeof(InvalidOperationException), "Cannot create instance if the template is not built"); - Dx9Effect dx9Effect = (Dx9Effect)null; + Dx9Effect dx9Effect = null; if (this.m_cache != null) dx9Effect = (Dx9Effect)this.m_cache.Remove(objUser); if (dx9Effect == null) @@ -69,7 +69,7 @@ namespace Microsoft.Iris.Render.Graphics dx9Effect.RegisterUsage(objUser); dx9Effect.RemoteEffect(); } - return (IEffect)dx9Effect; + return dx9Effect; } private bool ProcessEffectElement( @@ -79,7 +79,7 @@ namespace Microsoft.Iris.Render.Graphics { if (!(this.m_graphicsDevice as Dx9GraphicsDevice).EffectManager.CreateEffectResource(this.m_stName, element, nPropCacheSize, out this.m_effectResource)) return false; - this.m_effectResource.RegisterUsage((object)this); + this.m_effectResource.RegisterUsage(this); foreach (KeyValueEntry allProp in allProps) { EffectProperty effectProperty = allProp.Value; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EmbossElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EmbossElement.cs index 546437a..9f2e939 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EmbossElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9EmbossElement.cs @@ -13,26 +13,26 @@ namespace Microsoft.Iris.Render.Graphics internal static void Generate(EmbossElement efoEmboss, ref Dx9EffectBuilder effectBuilder) { Dx9TextureInfo textureInfo = effectBuilder.GetTextureInfo(effectBuilder.ImageCount - 1); - effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexelSize, (object)null); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexelSize, null); VariableInfo variableInfo1 = new VariableInfo() { - ID = (int)efoEmboss.DirectionID, + ID = efoEmboss.DirectionID, Type = Dx9VariableType.Integer, IsDynamic = efoEmboss.IsDynamicProperty("Direction") }; variableInfo1.Name = variableInfo1.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo1.Type, efoEmboss.Name + "Direction") : effectBuilder.GenerateGlobalConstant(variableInfo1.Type, efoEmboss.Name + "Direction"); - variableInfo1.DefaultValue = (object)efoEmboss.Direction; + variableInfo1.DefaultValue = efoEmboss.Direction; effectBuilder.AddPropertyVariable(variableInfo1); VariableInfo variableInfo2 = new VariableInfo() { - ID = (int)efoEmboss.GrayLevelID, + ID = efoEmboss.GrayLevelID, Type = Dx9VariableType.Float, IsDynamic = efoEmboss.IsDynamicProperty("GrayLevel") }; variableInfo2.Name = variableInfo2.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo2.Type, efoEmboss.Name + "GrayLevel") : effectBuilder.GenerateGlobalConstant(variableInfo2.Type, efoEmboss.Name + "GrayLevel"); - variableInfo2.DefaultValue = (object)efoEmboss.GrayLevel; + variableInfo2.DefaultValue = efoEmboss.GrayLevel; effectBuilder.AddPropertyVariable(variableInfo2); - effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // Sample neightbour pixel\r\n float4 vNeightbourPixel;\r\n if ({5} == 0)\r\n {{\r\n vNeightbourPixel = tex2D({1}, {2} + float2(-{3}.x, -{3}.y));\r\n }}\r\n else\r\n {{\r\n vNeightbourPixel = tex2D({1}, {2} + float2(+{3}.x, +{3}.y));\r\n }}\r\n float4 vDiff = {0} - vNeightbourPixel;\r\n float maxDiffColor = vDiff.r;\r\n if (abs(vDiff.g) > abs(maxDiffColor))\r\n {{\r\n maxDiffColor = vDiff.g;\r\n }}\r\n if (abs(vDiff.b) > abs(maxDiffColor))\r\n {{\r\n maxDiffColor = vDiff.b;\r\n }}\r\n maxDiffColor += {4};\r\n float minGray = min(maxDiffColor, 1.0f);\r\n float grayLevel = max(minGray, 0.0f);\r\n {0}.rgb = grayLevel;\r\n }}\r\n\r\n", (object)effectBuilder.PixelShaderOutput, (object)textureInfo.Sampler, (object)textureInfo.TexCoordInput, (object)textureInfo.TexelSize, (object)variableInfo2.Name, (object)variableInfo1.Name)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // Sample neightbour pixel\r\n float4 vNeightbourPixel;\r\n if ({5} == 0)\r\n {{\r\n vNeightbourPixel = tex2D({1}, {2} + float2(-{3}.x, -{3}.y));\r\n }}\r\n else\r\n {{\r\n vNeightbourPixel = tex2D({1}, {2} + float2(+{3}.x, +{3}.y));\r\n }}\r\n float4 vDiff = {0} - vNeightbourPixel;\r\n float maxDiffColor = vDiff.r;\r\n if (abs(vDiff.g) > abs(maxDiffColor))\r\n {{\r\n maxDiffColor = vDiff.g;\r\n }}\r\n if (abs(vDiff.b) > abs(maxDiffColor))\r\n {{\r\n maxDiffColor = vDiff.b;\r\n }}\r\n maxDiffColor += {4};\r\n float minGray = min(maxDiffColor, 1.0f);\r\n float grayLevel = max(minGray, 0.0f);\r\n {0}.rgb = grayLevel;\r\n }}\r\n\r\n", effectBuilder.PixelShaderOutput, textureInfo.Sampler, textureInfo.TexCoordInput, textureInfo.TexelSize, variableInfo2.Name, variableInfo1.Name)); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9GaussianBlurElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9GaussianBlurElement.cs index e819ef1..385b647 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9GaussianBlurElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9GaussianBlurElement.cs @@ -23,7 +23,7 @@ namespace Microsoft.Iris.Render.Graphics double num4 = Math.Sqrt(2.0 * Math.PI) * flDeviation; for (int index = 0; index < num1; ++index) { - double num5 = (double)(index - nKernelRadius); + double num5 = index - nKernelRadius; double num6 = Math.Exp(-(num5 * num5) / num3); arKernel[index] = num6 / num4; num2 += arKernel[index]; @@ -49,8 +49,8 @@ namespace Microsoft.Iris.Render.Graphics { for (int index2 = 0; index2 < num2; ++index2) { - double num6 = (double)(index2 - nKernelRadius); - double num7 = (double)(index1 - nKernelRadius); + double num6 = index2 - nKernelRadius; + double num7 = index1 - nKernelRadius; double num8 = Math.Exp(-(num6 * num6 + num7 * num7) / num4); arKernel[index2, index1] = num8 / num5; num1 += arKernel[index2, index1]; @@ -66,13 +66,13 @@ namespace Microsoft.Iris.Render.Graphics internal static void Generate(GaussianBlurElement efoBlur, ref Dx9EffectBuilder effectBuilder) { Dx9TextureInfo textureInfo = effectBuilder.GetTextureInfo(effectBuilder.ImageCount - 1); - effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexelSize, (object)null); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexelSize, null); switch (efoBlur.Mode) { case GaussianBlurMode.Normal: int length1 = 1 + efoBlur.KernelRadius * 2; double[,] arKernel1 = new double[length1, length1]; - Dx9GaussianBlurElement.GenerateWeights2D(efoBlur.KernelRadius, (double)efoBlur.Bluriness, arKernel1); + GenerateWeights2D(efoBlur.KernelRadius, efoBlur.Bluriness, arKernel1); effectBuilder.EmitPixelFragment(" {\r\n // Gaussian filter\r\n float4 vBlur = 0;\r\n"); for (int index1 = 0; index1 < length1; ++index1) { @@ -81,31 +81,31 @@ namespace Microsoft.Iris.Render.Graphics int num1 = index2 - efoBlur.KernelRadius; int num2 = index1 - efoBlur.KernelRadius; if (num1 == 0 && num2 == 0) - effectBuilder.EmitPixelFragment(InvariantString.Format(" vBlur += {0} * {1};\r\n", (object)effectBuilder.PixelShaderOutput, (object)arKernel1[index2, index1])); + effectBuilder.EmitPixelFragment(InvariantString.Format(" vBlur += {0} * {1};\r\n", effectBuilder.PixelShaderOutput, arKernel1[index2, index1])); else - effectBuilder.EmitPixelFragment(InvariantString.Format(" vBlur += tex2D({0}, {1} + float2({2}.x * {3}, {2}.y * {4})) * {5};\r\n", (object)textureInfo.Sampler, (object)textureInfo.TexCoordInput, (object)textureInfo.TexelSize, (object)num1, (object)num2, (object)arKernel1[index2, index1])); + effectBuilder.EmitPixelFragment(InvariantString.Format(" vBlur += tex2D({0}, {1} + float2({2}.x * {3}, {2}.y * {4})) * {5};\r\n", textureInfo.Sampler, textureInfo.TexCoordInput, textureInfo.TexelSize, num1, num2, arKernel1[index2, index1])); } } - effectBuilder.EmitPixelFragment(InvariantString.Format(" {0} = vBlur;\r\n }}\r\n\r\n", (object)effectBuilder.PixelShaderOutput)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {0} = vBlur;\r\n }}\r\n\r\n", effectBuilder.PixelShaderOutput)); break; case GaussianBlurMode.Horizontal: case GaussianBlurMode.Vertical: bool flag = efoBlur.Mode == GaussianBlurMode.Horizontal; int length2 = 1 + efoBlur.KernelRadius * 2; double[] arKernel2 = new double[length2]; - Dx9GaussianBlurElement.GenerateWeights1D(efoBlur.KernelRadius, (double)efoBlur.Bluriness, arKernel2); + GenerateWeights1D(efoBlur.KernelRadius, efoBlur.Bluriness, arKernel2); effectBuilder.EmitPixelFragment(" {\r\n // Gaussian filter\r\n float4 vBlur = 0;\r\n"); for (int index = 0; index < length2; ++index) { int num = index - efoBlur.KernelRadius; if (num == 0) - effectBuilder.EmitPixelFragment(InvariantString.Format(" vBlur += {0} * {1};\r\n", (object)effectBuilder.PixelShaderOutput, (object)arKernel2[index])); + effectBuilder.EmitPixelFragment(InvariantString.Format(" vBlur += {0} * {1};\r\n", effectBuilder.PixelShaderOutput, arKernel2[index])); else if (flag) - effectBuilder.EmitPixelFragment(InvariantString.Format(" vBlur += tex2D({0}, {1} + float2({2}.x * {3}, 0)) * {4};\r\n", (object)textureInfo.Sampler, (object)textureInfo.TexCoordInput, (object)textureInfo.TexelSize, (object)num, (object)arKernel2[index])); + effectBuilder.EmitPixelFragment(InvariantString.Format(" vBlur += tex2D({0}, {1} + float2({2}.x * {3}, 0)) * {4};\r\n", textureInfo.Sampler, textureInfo.TexCoordInput, textureInfo.TexelSize, num, arKernel2[index])); else - effectBuilder.EmitPixelFragment(InvariantString.Format(" vBlur += tex2D({0}, {1} + float2(0, {2}.y * {3})) * {4};\r\n", (object)textureInfo.Sampler, (object)textureInfo.TexCoordInput, (object)textureInfo.TexelSize, (object)num, (object)arKernel2[index])); + effectBuilder.EmitPixelFragment(InvariantString.Format(" vBlur += tex2D({0}, {1} + float2(0, {2}.y * {3})) * {4};\r\n", textureInfo.Sampler, textureInfo.TexCoordInput, textureInfo.TexelSize, num, arKernel2[index])); } - effectBuilder.EmitPixelFragment(InvariantString.Format(" {0} = vBlur;\r\n }}\r\n\r\n", (object)effectBuilder.PixelShaderOutput)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {0} = vBlur;\r\n }}\r\n\r\n", effectBuilder.PixelShaderOutput)); break; default: Debug2.Validate(false, typeof(InvalidOperationException), "Unknown blur mode"); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9GraphicsDevice.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9GraphicsDevice.cs index dba9f3f..edc3f10 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9GraphicsDevice.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9GraphicsDevice.cs @@ -25,7 +25,7 @@ namespace Microsoft.Iris.Render.Graphics if (this.m_renderingQuality != GraphicsRenderingQuality.MinQuality) { Dx9GraphicsDevice.PixelShaderProfileType pixelShaderProfile = (Dx9GraphicsDevice.PixelShaderProfileType)this.m_graphicsCaps.PixelShaderProfile; - if ((byte)this.m_graphicsCaps.VertexShaderProfile < (byte)1 || pixelShaderProfile < Dx9GraphicsDevice.PixelShaderProfileType.PS_2_0) + if ((byte)this.m_graphicsCaps.VertexShaderProfile < 1 || pixelShaderProfile < PixelShaderProfileType.PS_2_0) this.m_renderingQuality = GraphicsRenderingQuality.MinQuality; } this.m_sizeGutterPxl = new Size(1, 1); @@ -39,7 +39,7 @@ namespace Microsoft.Iris.Render.Graphics if (!fInDispose || this.m_effectManager == null) return; this.m_effectManager.Dispose(); - this.m_effectManager = (Dx9EffectManager)null; + this.m_effectManager = null; } finally { @@ -103,7 +103,7 @@ namespace Microsoft.Iris.Render.Graphics public override bool CanPlayAnimationType(AnimationInputType type) => true; - internal override EffectTemplate CreateEffectTemplate(string stName) => (EffectTemplate)new Dx9EffectTemplate(this.m_session, (GraphicsDevice)this, stName); + internal override EffectTemplate CreateEffectTemplate(string stName) => new Dx9EffectTemplate(this.m_session, this, stName); private enum PixelShaderProfileType : byte { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9HSLElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9HSLElement.cs index 286f093..e3953ee 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9HSLElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9HSLElement.cs @@ -15,32 +15,32 @@ namespace Microsoft.Iris.Render.Graphics effectBuilder.EmitIncludesFragment("\"HSL.fx\""); VariableInfo variableInfo1 = new VariableInfo() { - ID = (int)efoHSL.HueID, + ID = efoHSL.HueID, Type = Dx9VariableType.Float, IsDynamic = efoHSL.IsDynamicProperty("Hue") }; variableInfo1.Name = variableInfo1.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo1.Type, efoHSL.Name + "Hue") : effectBuilder.GenerateGlobalConstant(variableInfo1.Type, efoHSL.Name + "Hue"); - variableInfo1.DefaultValue = (object)efoHSL.Hue; + variableInfo1.DefaultValue = efoHSL.Hue; effectBuilder.AddPropertyVariable(variableInfo1); VariableInfo variableInfo2 = new VariableInfo() { - ID = (int)efoHSL.SaturationID, + ID = efoHSL.SaturationID, Type = Dx9VariableType.Float, IsDynamic = efoHSL.IsDynamicProperty("Saturation") }; variableInfo2.Name = variableInfo2.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo2.Type, efoHSL.Name + "Saturation") : effectBuilder.GenerateGlobalConstant(variableInfo2.Type, efoHSL.Name + "Saturation"); - variableInfo2.DefaultValue = (object)efoHSL.Saturation; + variableInfo2.DefaultValue = efoHSL.Saturation; effectBuilder.AddPropertyVariable(variableInfo2); VariableInfo variableInfo3 = new VariableInfo() { - ID = (int)efoHSL.LightnessID, + ID = efoHSL.LightnessID, Type = Dx9VariableType.Float, IsDynamic = efoHSL.IsDynamicProperty("Lightness") }; variableInfo3.Name = variableInfo3.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo3.Type, efoHSL.Name + "Lightness") : effectBuilder.GenerateGlobalConstant(variableInfo3.Type, efoHSL.Name + "Lightness"); - variableInfo3.DefaultValue = (object)efoHSL.Lightness; + variableInfo3.DefaultValue = efoHSL.Lightness; effectBuilder.AddPropertyVariable(variableInfo3); - effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // convert to HSL color space\r\n float3 fHSL = RGBToHSL({0});\r\n\r\n // adjust Hue, Sat and Luma\r\n fHSL *= float3({1}, {2}, {3});\r\n fHSL = saturate(fHSL);\r\n\r\n // convert back to RGB space\r\n float3 fBackToRGB = HSLToRGB(fHSL);\r\n {0}.rgb = fBackToRGB;\r\n }}\r\n", (object)effectBuilder.PixelShaderOutput, (object)variableInfo1.Name, (object)variableInfo2.Name, (object)variableInfo3.Name)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // convert to HSL color space\r\n float3 fHSL = RGBToHSL({0});\r\n\r\n // adjust Hue, Sat and Luma\r\n fHSL *= float3({1}, {2}, {3});\r\n fHSL = saturate(fHSL);\r\n\r\n // convert back to RGB space\r\n float3 fBackToRGB = HSLToRGB(fHSL);\r\n {0}.rgb = fBackToRGB;\r\n }}\r\n", effectBuilder.PixelShaderOutput, variableInfo1.Name, variableInfo2.Name, variableInfo3.Name)); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9HSVElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9HSVElement.cs index f57ac3e..c916143 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9HSVElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9HSVElement.cs @@ -15,32 +15,32 @@ namespace Microsoft.Iris.Render.Graphics effectBuilder.EmitIncludesFragment("\"HSV.fx\""); VariableInfo variableInfo1 = new VariableInfo() { - ID = (int)efoHSV.HueID, + ID = efoHSV.HueID, Type = Dx9VariableType.Float, IsDynamic = efoHSV.IsDynamicProperty("Hue") }; variableInfo1.Name = variableInfo1.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo1.Type, efoHSV.Name + "Hue") : effectBuilder.GenerateGlobalConstant(variableInfo1.Type, efoHSV.Name + "Hue"); - variableInfo1.DefaultValue = (object)efoHSV.Hue; + variableInfo1.DefaultValue = efoHSV.Hue; effectBuilder.AddPropertyVariable(variableInfo1); VariableInfo variableInfo2 = new VariableInfo() { - ID = (int)efoHSV.SaturationID, + ID = efoHSV.SaturationID, Type = Dx9VariableType.Float, IsDynamic = efoHSV.IsDynamicProperty("Saturation") }; variableInfo2.Name = variableInfo2.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo2.Type, efoHSV.Name + "Saturation") : effectBuilder.GenerateGlobalConstant(variableInfo2.Type, efoHSV.Name + "Saturation"); - variableInfo2.DefaultValue = (object)efoHSV.Saturation; + variableInfo2.DefaultValue = efoHSV.Saturation; effectBuilder.AddPropertyVariable(variableInfo2); VariableInfo variableInfo3 = new VariableInfo() { - ID = (int)efoHSV.ValueID, + ID = efoHSV.ValueID, Type = Dx9VariableType.Float, IsDynamic = efoHSV.IsDynamicProperty("Value") }; variableInfo3.Name = variableInfo3.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo3.Type, efoHSV.Name + "Value") : effectBuilder.GenerateGlobalConstant(variableInfo3.Type, efoHSV.Name + "Value"); - variableInfo3.DefaultValue = (object)efoHSV.Value; + variableInfo3.DefaultValue = efoHSV.Value; effectBuilder.AddPropertyVariable(variableInfo3); - effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // convert to HSV color space\r\n float3 fHSV = RGBToHSV({0});\r\n\r\n // adjust Hue, Sat and Value\r\n fHSV *= float3(1.0f, {2}, {3});\r\n fHSV[0] += {0};\r\n fHSV = saturate(fHSV);\r\n\r\n // convert back to RGB space\r\n float3 fBackToRGB = HSVToRGB(fHSV);\r\n {0}.rgb = fBackToRGB;\r\n }}\r\n", (object)effectBuilder.PixelShaderOutput, (object)variableInfo1.Name, (object)variableInfo2.Name, (object)variableInfo3.Name)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n // convert to HSV color space\r\n float3 fHSV = RGBToHSV({0});\r\n\r\n // adjust Hue, Sat and Value\r\n fHSV *= float3(1.0f, {2}, {3});\r\n fHSV[0] += {0};\r\n fHSV = saturate(fHSV);\r\n\r\n // convert back to RGB space\r\n float3 fBackToRGB = HSVToRGB(fHSV);\r\n {0}.rgb = fBackToRGB;\r\n }}\r\n", effectBuilder.PixelShaderOutput, variableInfo1.Name, variableInfo2.Name, variableInfo3.Name)); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9ImageElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9ImageElement.cs index 482c350..6d9c65f 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9ImageElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9ImageElement.cs @@ -13,32 +13,32 @@ namespace Microsoft.Iris.Render.Graphics internal static void Generate(ImageElement efiImage, ref Dx9EffectBuilder effectBuilder) { Dx9TextureInfo textureInfo = effectBuilder.AllocateTexture(); - effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexelSize, (object)null); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexelSize, null); TextureVariableInfo textureVariableInfo = new TextureVariableInfo(); - textureVariableInfo.ID = (int)efiImage.ImageID; + textureVariableInfo.ID = efiImage.ImageID; textureVariableInfo.Type = Dx9VariableType.Texture; textureVariableInfo.Name = effectBuilder.GenerateGlobalVariable(textureVariableInfo.Type, efiImage.Name); - textureVariableInfo.DefaultValue = (object)efiImage.Image; + textureVariableInfo.DefaultValue = efiImage.Image; textureVariableInfo.SamplerName = textureInfo.Sampler; textureVariableInfo.MinFilter = "Linear"; textureVariableInfo.MagFilter = "Linear"; textureVariableInfo.CoordinateMapID = -1; textureVariableInfo.ImageIndexID = -1; - effectBuilder.AddPropertyVariable((VariableInfo)textureVariableInfo); + effectBuilder.AddPropertyVariable(textureVariableInfo); VariableInfo variableInfo = new VariableInfo() { - ID = (int)efiImage.UVOffsetID, + ID = efiImage.UVOffsetID, Type = Dx9VariableType.Vector2, IsDynamic = efiImage.IsDynamicProperty("UVOffset") }; variableInfo.Name = variableInfo.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo.Type, "UVOffset") : effectBuilder.GenerateGlobalConstant(variableInfo.Type, "UVOffset"); - variableInfo.DefaultValue = (object)efiImage.UVOffset; + variableInfo.DefaultValue = efiImage.UVOffset; effectBuilder.AddPropertyVariable(variableInfo); effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Vector4, efiImage.Name); if (variableInfo.IsDynamic || !efiImage.UVOffset.IsApproximate(Vector2.Zero)) - effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the image\r\n float4 {0} = tex2D({1}, {2} + float2({3}.x * {4}.x, {3}.y * {4}.y));\r\n\r\n", (object)effectBuilder.PixelShaderOutput, (object)textureInfo.Sampler, (object)textureInfo.TexCoordInput, (object)textureInfo.TexelSize, (object)variableInfo.Name)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the image\r\n float4 {0} = tex2D({1}, {2} + float2({3}.x * {4}.x, {3}.y * {4}.y));\r\n\r\n", effectBuilder.PixelShaderOutput, textureInfo.Sampler, textureInfo.TexCoordInput, textureInfo.TexelSize, variableInfo.Name)); else - effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the image\r\n float4 {0} = tex2D({1}, {2});\r\n\r\n", (object)effectBuilder.PixelShaderOutput, (object)textureInfo.Sampler, (object)textureInfo.TexCoordInput)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the image\r\n float4 {0} = tex2D({1}, {2});\r\n\r\n", effectBuilder.PixelShaderOutput, textureInfo.Sampler, textureInfo.TexCoordInput)); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9InterpolateElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9InterpolateElement.cs index 640bd86..f7415c7 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9InterpolateElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9InterpolateElement.cs @@ -18,15 +18,15 @@ namespace Microsoft.Iris.Render.Graphics { VariableInfo variableInfo = new VariableInfo() { - ID = (int)efiInterpolate.ValueID, + ID = efiInterpolate.ValueID, Type = Dx9VariableType.Float, IsDynamic = efiInterpolate.IsDynamicProperty("Value") }; variableInfo.Name = variableInfo.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo.Type, efiInterpolate.Name) : effectBuilder.GenerateGlobalConstant(variableInfo.Type, efiInterpolate.Name); - variableInfo.DefaultValue = (object)efiInterpolate.Value; + variableInfo.DefaultValue = efiInterpolate.Value; effectBuilder.AddPropertyVariable(variableInfo); effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Vector4, efiInterpolate.Name); - effectBuilder.EmitPixelFragment(InvariantString.Format(" // Interpolate the result\r\n float4 {0} = lerp({1}, {2}, {3});\r\n\r\n", (object)effectBuilder.PixelShaderOutput, (object)stSource1, (object)stSource2, (object)variableInfo.Name)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Interpolate the result\r\n float4 {0} = lerp({1}, {2}, {3});\r\n\r\n", effectBuilder.PixelShaderOutput, stSource1, stSource2, variableInfo.Name)); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9InvAlphaElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9InvAlphaElement.cs index af43e38..f2d78ea 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9InvAlphaElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9InvAlphaElement.cs @@ -13,7 +13,7 @@ namespace Microsoft.Iris.Render.Graphics internal static void Generate(EffectOperation efo, ref Dx9EffectBuilder effectBuilder) { string localVariable = effectBuilder.GenerateLocalVariable(Dx9VariableType.Float, "InvAlpha"); - effectBuilder.EmitPixelFragment(InvariantString.Format(" // Invert the alpha value\r\n float {1} = 1.0 - {0}.a;\r\n {0}.a = {1};\r\n\r\n", (object)effectBuilder.PixelShaderOutput, (object)localVariable)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Invert the alpha value\r\n float {1} = 1.0 - {0}.a;\r\n {0}.a = {1};\r\n\r\n", effectBuilder.PixelShaderOutput, localVariable)); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9InvColorElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9InvColorElement.cs index dc43d91..69dad67 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9InvColorElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9InvColorElement.cs @@ -10,6 +10,6 @@ namespace Microsoft.Iris.Render.Graphics { internal class Dx9InvColorElement { - internal static void Generate(EffectOperation efo, ref Dx9EffectBuilder effectBuilder) => effectBuilder.EmitPixelFragment(InvariantString.Format(" // Invert the color value\r\n {0}.rgb = float3(1.0-{0}.r, 1.0-{0}.g, 1.0-{0}.b);\r\n\r\n", (object)effectBuilder.PixelShaderOutput)); + internal static void Generate(EffectOperation efo, ref Dx9EffectBuilder effectBuilder) => effectBuilder.EmitPixelFragment(InvariantString.Format(" // Invert the color value\r\n {0}.rgb = float3(1.0-{0}.r, 1.0-{0}.g, 1.0-{0}.b);\r\n\r\n", effectBuilder.PixelShaderOutput)); } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9InvertElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9InvertElement.cs index be8156d..7a7c242 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9InvertElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9InvertElement.cs @@ -10,6 +10,6 @@ namespace Microsoft.Iris.Render.Graphics { internal class Dx9InvertElement { - internal static void Generate(InvertElement efoInvert, ref Dx9EffectBuilder effectBuilder) => effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n {0}.rgb = 1.0f - {0}.rgb;\r\n }}\r\n", (object)effectBuilder.PixelShaderOutput)); + internal static void Generate(InvertElement efoInvert, ref Dx9EffectBuilder effectBuilder) => effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n {0}.rgb = 1.0f - {0}.rgb;\r\n }}\r\n", effectBuilder.PixelShaderOutput)); } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9LightShaftElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9LightShaftElement.cs index 5a2c475..8356676 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9LightShaftElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9LightShaftElement.cs @@ -15,63 +15,63 @@ namespace Microsoft.Iris.Render.Graphics ref Dx9EffectBuilder effectBuilder) { Dx9TextureInfo textureInfo = effectBuilder.GetTextureInfo(effectBuilder.ImageCount - 1); - effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexUVSize, (object)null); - effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexUVRefPoint, (object)null); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexUVSize, null); + effectBuilder.AddRequirement(textureInfo, Dx9TextureRequirements.TexUVRefPoint, null); VariableInfo variableInfo1 = new VariableInfo() { - ID = (int)efoLightShaft.PositionID, + ID = efoLightShaft.PositionID, Type = Dx9VariableType.Vector3, IsDynamic = efoLightShaft.IsDynamicProperty("Position") }; variableInfo1.Name = variableInfo1.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo1.Type, efoLightShaft.Name + "Position") : effectBuilder.GenerateGlobalConstant(variableInfo1.Type, efoLightShaft.Name + "Position"); - variableInfo1.DefaultValue = (object)efoLightShaft.Position; + variableInfo1.DefaultValue = efoLightShaft.Position; effectBuilder.AddPropertyVariable(variableInfo1); VariableInfo variableInfo2 = new VariableInfo() { - ID = (int)efoLightShaft.DecayID, + ID = efoLightShaft.DecayID, Type = Dx9VariableType.Float, IsDynamic = efoLightShaft.IsDynamicProperty("Decay") }; variableInfo2.Name = variableInfo2.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo2.Type, efoLightShaft.Name + "Decay") : effectBuilder.GenerateGlobalConstant(variableInfo2.Type, efoLightShaft.Name + "Decay"); - variableInfo2.DefaultValue = (object)efoLightShaft.Decay; + variableInfo2.DefaultValue = efoLightShaft.Decay; effectBuilder.AddPropertyVariable(variableInfo2); VariableInfo variableInfo3 = new VariableInfo() { - ID = (int)efoLightShaft.DensityID, + ID = efoLightShaft.DensityID, Type = Dx9VariableType.Float, IsDynamic = efoLightShaft.IsDynamicProperty("Density") }; variableInfo3.Name = variableInfo3.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo3.Type, efoLightShaft.Name + "Density") : effectBuilder.GenerateGlobalConstant(variableInfo3.Type, efoLightShaft.Name + "Density"); - variableInfo3.DefaultValue = (object)efoLightShaft.Density; + variableInfo3.DefaultValue = efoLightShaft.Density; effectBuilder.AddPropertyVariable(variableInfo3); VariableInfo variableInfo4 = new VariableInfo() { - ID = (int)efoLightShaft.FallOffID, + ID = efoLightShaft.FallOffID, Type = Dx9VariableType.Float, IsDynamic = efoLightShaft.IsDynamicProperty("FallOff") }; variableInfo4.Name = variableInfo4.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo4.Type, efoLightShaft.Name + "FallOff") : effectBuilder.GenerateGlobalConstant(variableInfo4.Type, efoLightShaft.Name + "FallOff"); - variableInfo4.DefaultValue = (object)efoLightShaft.FallOff; + variableInfo4.DefaultValue = efoLightShaft.FallOff; effectBuilder.AddPropertyVariable(variableInfo4); VariableInfo variableInfo5 = new VariableInfo() { - ID = (int)efoLightShaft.IntensityID, + ID = efoLightShaft.IntensityID, Type = Dx9VariableType.Float, IsDynamic = efoLightShaft.IsDynamicProperty("Intensity") }; variableInfo5.Name = variableInfo5.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo5.Type, efoLightShaft.Name + "Intensity") : effectBuilder.GenerateGlobalConstant(variableInfo5.Type, efoLightShaft.Name + "Intensity"); - variableInfo5.DefaultValue = (object)efoLightShaft.Intensity; + variableInfo5.DefaultValue = efoLightShaft.Intensity; effectBuilder.AddPropertyVariable(variableInfo5); VariableInfo variableInfo6 = new VariableInfo() { - ID = (int)efoLightShaft.WeightID, + ID = efoLightShaft.WeightID, Type = Dx9VariableType.Float, IsDynamic = efoLightShaft.IsDynamicProperty("Weight") }; variableInfo6.Name = variableInfo6.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo6.Type, efoLightShaft.Name + "Weight") : effectBuilder.GenerateGlobalConstant(variableInfo6.Type, efoLightShaft.Name + "Weight"); - variableInfo6.DefaultValue = (object)efoLightShaft.Weight; + variableInfo6.DefaultValue = efoLightShaft.Weight; effectBuilder.AddPropertyVariable(variableInfo6); - effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n float2 diff = {2} - ({4} + {3}.xy * {5});\r\n float2 rayStep = diff / 15 * {6};\r\n float4 color = tex2D({1}, {2});\r\n float fadeFactor = 1.0f;\r\n for (int i=0; i<15; i++)\r\n {{\r\n {2} -= rayStep;\r\n float4 sample = tex2D({1}, {2});\r\n sample *= fadeFactor * {7};\r\n color += sample;\r\n fadeFactor *= {8};\r\n }}\r\n color.rgb *= {9};\r\n {0} = color * ({10} - length(diff));\r\n }}\r\n", (object)effectBuilder.PixelShaderOutput, (object)textureInfo.Sampler, (object)textureInfo.TexCoordInput, (object)variableInfo1.Name, (object)textureInfo.TexUVRefPoint, (object)textureInfo.TexUVSize, (object)variableInfo3.Name, (object)variableInfo6.Name, (object)variableInfo2.Name, (object)variableInfo5.Name, (object)variableInfo4.Name)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n float2 diff = {2} - ({4} + {3}.xy * {5});\r\n float2 rayStep = diff / 15 * {6};\r\n float4 color = tex2D({1}, {2});\r\n float fadeFactor = 1.0f;\r\n for (int i=0; i<15; i++)\r\n {{\r\n {2} -= rayStep;\r\n float4 sample = tex2D({1}, {2});\r\n sample *= fadeFactor * {7};\r\n color += sample;\r\n fadeFactor *= {8};\r\n }}\r\n color.rgb *= {9};\r\n {0} = color * ({10} - length(diff));\r\n }}\r\n", effectBuilder.PixelShaderOutput, textureInfo.Sampler, textureInfo.TexCoordInput, variableInfo1.Name, textureInfo.TexUVRefPoint, textureInfo.TexUVSize, variableInfo3.Name, variableInfo6.Name, variableInfo2.Name, variableInfo5.Name, variableInfo4.Name)); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9PointLight2DElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9PointLight2DElement.cs index 7f56f2b..62ce49a 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9PointLight2DElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9PointLight2DElement.cs @@ -16,56 +16,56 @@ namespace Microsoft.Iris.Render.Graphics { VariableInfo variableInfo1 = new VariableInfo() { - ID = (int)efiPointLight2D.PositionID, + ID = efiPointLight2D.PositionID, Type = Dx9VariableType.Vector3, IsDynamic = efiPointLight2D.IsDynamicProperty("Position") }; variableInfo1.Name = variableInfo1.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo1.Type, "Position") : effectBuilder.GenerateGlobalConstant(variableInfo1.Type, "Position"); - variableInfo1.DefaultValue = (object)efiPointLight2D.Position; + variableInfo1.DefaultValue = efiPointLight2D.Position; effectBuilder.AddPropertyVariable(variableInfo1); VariableInfo variableInfo2 = new VariableInfo() { - ID = (int)efiPointLight2D.RadiusID, + ID = efiPointLight2D.RadiusID, Type = Dx9VariableType.Float, IsDynamic = efiPointLight2D.IsDynamicProperty("Radius") }; variableInfo2.Name = variableInfo2.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo2.Type, "Radius") : effectBuilder.GenerateGlobalConstant(variableInfo2.Type, "Radius"); - variableInfo2.DefaultValue = (object)efiPointLight2D.Radius; + variableInfo2.DefaultValue = efiPointLight2D.Radius; effectBuilder.AddPropertyVariable(variableInfo2); VariableInfo variableInfo3 = new VariableInfo() { - ID = (int)efiPointLight2D.LightColorID, + ID = efiPointLight2D.LightColorID, Type = Dx9VariableType.Vector4, IsDynamic = efiPointLight2D.IsDynamicProperty("LightColor") }; variableInfo3.Name = variableInfo3.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo3.Type, "LightColor") : effectBuilder.GenerateGlobalConstant(variableInfo3.Type, "LightColor"); - variableInfo3.DefaultValue = (object)efiPointLight2D.LightColor.ToVector4(); + variableInfo3.DefaultValue = efiPointLight2D.LightColor.ToVector4(); effectBuilder.AddPropertyVariable(variableInfo3); VariableInfo variableInfo4 = new VariableInfo() { - ID = (int)efiPointLight2D.AmbientColorID, + ID = efiPointLight2D.AmbientColorID, Type = Dx9VariableType.Vector4, IsDynamic = efiPointLight2D.IsDynamicProperty("AmbientColor") }; variableInfo4.Name = variableInfo4.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo4.Type, "AmbientColor") : effectBuilder.GenerateGlobalConstant(variableInfo4.Type, "AmbientColor"); - variableInfo4.DefaultValue = (object)efiPointLight2D.AmbientColor.ToVector4(); + variableInfo4.DefaultValue = efiPointLight2D.AmbientColor.ToVector4(); effectBuilder.AddPropertyVariable(variableInfo4); VariableInfo variableInfo5 = new VariableInfo() { - ID = (int)efiPointLight2D.AttenuationID, + ID = efiPointLight2D.AttenuationID, Type = Dx9VariableType.Vector3, IsDynamic = efiPointLight2D.IsDynamicProperty("Attenuation") }; variableInfo5.Name = variableInfo5.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo5.Type, "Attenuation") : effectBuilder.GenerateGlobalConstant(variableInfo5.Type, "Attenuation"); - variableInfo5.DefaultValue = (object)efiPointLight2D.Attenuation; + variableInfo5.DefaultValue = efiPointLight2D.Attenuation; effectBuilder.AddPropertyVariable(variableInfo5); effectBuilder.AddRequirement(EffectRequirements.ViewPosition); effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Vector4, efiPointLight2D.Name); - string str = InvariantString.Format(" float4 {0} = {3};\r\n {{\r\n float2 vPositionDelta = {1}.xy - Input.ViewPos.xy;\r\n float flDist = length(vPositionDelta);\r\n float flFalloff = saturate({2} / ({4}.x + flDist*{4}.y + flDist*flDist*{4}.z));\r\n {0} *= flFalloff;\r\n", (object)effectBuilder.PixelShaderOutput, (object)variableInfo1.Name, (object)variableInfo2.Name, (object)variableInfo3.Name, (object)variableInfo5.Name); + string str = InvariantString.Format(" float4 {0} = {3};\r\n {{\r\n float2 vPositionDelta = {1}.xy - Input.ViewPos.xy;\r\n float flDist = length(vPositionDelta);\r\n float flFalloff = saturate({2} / ({4}.x + flDist*{4}.y + flDist*flDist*{4}.z));\r\n {0} *= flFalloff;\r\n", effectBuilder.PixelShaderOutput, variableInfo1.Name, variableInfo2.Name, variableInfo3.Name, variableInfo5.Name); if (variableInfo4.IsDynamic || !efiPointLight2D.AmbientColor.ToVector4().IsApproximate(Vector4.Zero)) - effectBuilder.EmitPixelFragment(InvariantString.Format("{0} {1} += {2};\r\n }}\r\n", (object)str, (object)effectBuilder.PixelShaderOutput, (object)variableInfo4.Name)); + effectBuilder.EmitPixelFragment(InvariantString.Format("{0} {1} += {2};\r\n }}\r\n", str, effectBuilder.PixelShaderOutput, variableInfo4.Name)); else - effectBuilder.EmitPixelFragment(InvariantString.Format("{0} }}\r\n", (object)str)); + effectBuilder.EmitPixelFragment(InvariantString.Format("{0} }}\r\n", str)); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9SepiaElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9SepiaElement.cs index 4cda1fc..445ab5d 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9SepiaElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9SepiaElement.cs @@ -14,41 +14,41 @@ namespace Microsoft.Iris.Render.Graphics { VariableInfo variableInfo1 = new VariableInfo() { - ID = (int)efoSepia.LightColorID, + ID = efoSepia.LightColorID, Type = Dx9VariableType.Vector4, IsDynamic = efoSepia.IsDynamicProperty("LightColor") }; variableInfo1.Name = variableInfo1.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo1.Type, efoSepia.Name + "LightColor") : effectBuilder.GenerateGlobalConstant(variableInfo1.Type, efoSepia.Name + "LightColor"); - variableInfo1.DefaultValue = (object)efoSepia.LightColor.ToVector4(); + variableInfo1.DefaultValue = efoSepia.LightColor.ToVector4(); effectBuilder.AddPropertyVariable(variableInfo1); VariableInfo variableInfo2 = new VariableInfo() { - ID = (int)efoSepia.DarkColorID, + ID = efoSepia.DarkColorID, Type = Dx9VariableType.Vector4, IsDynamic = efoSepia.IsDynamicProperty("DarkColor") }; variableInfo2.Name = variableInfo2.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo2.Type, efoSepia.Name + "DarkColor") : effectBuilder.GenerateGlobalConstant(variableInfo2.Type, efoSepia.Name + "DarkColor"); - variableInfo2.DefaultValue = (object)efoSepia.DarkColor.ToVector4(); + variableInfo2.DefaultValue = efoSepia.DarkColor.ToVector4(); effectBuilder.AddPropertyVariable(variableInfo2); VariableInfo variableInfo3 = new VariableInfo() { - ID = (int)efoSepia.DesaturateID, + ID = efoSepia.DesaturateID, Type = Dx9VariableType.Float, IsDynamic = efoSepia.IsDynamicProperty("Desaturate") }; variableInfo3.Name = variableInfo3.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo3.Type, efoSepia.Name + "Desaturate") : effectBuilder.GenerateGlobalConstant(variableInfo3.Type, efoSepia.Name + "Desaturate"); - variableInfo3.DefaultValue = (object)efoSepia.Desaturate; + variableInfo3.DefaultValue = efoSepia.Desaturate; effectBuilder.AddPropertyVariable(variableInfo3); VariableInfo variableInfo4 = new VariableInfo() { - ID = (int)efoSepia.ToneID, + ID = efoSepia.ToneID, Type = Dx9VariableType.Float, IsDynamic = efoSepia.IsDynamicProperty("Tone") }; variableInfo4.Name = variableInfo4.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo4.Type, efoSepia.Name + "Tone") : effectBuilder.GenerateGlobalConstant(variableInfo4.Type, efoSepia.Name + "Tone"); - variableInfo4.DefaultValue = (object)efoSepia.Tone; + variableInfo4.DefaultValue = efoSepia.Tone; effectBuilder.AddPropertyVariable(variableInfo4); - effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n {0}.rgb *= {1}.rgb;\r\n float3 grayer = float3(0.3f, 0.59f, 0.11f);\r\n float gray = dot({0}.rgb, grayer);\r\n float3 muted = lerp({0}.rgb, gray.xxx, {3});\r\n float3 sepia = lerp({2}.rgb, {1}.rgb, gray);\r\n {0}.rgb = lerp(muted, sepia, {4});\r\n }}\r\n", (object)effectBuilder.PixelShaderOutput, (object)variableInfo1.Name, (object)variableInfo2.Name, (object)variableInfo3.Name, (object)variableInfo4.Name)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" {{\r\n {0}.rgb *= {1}.rgb;\r\n float3 grayer = float3(0.3f, 0.59f, 0.11f);\r\n float gray = dot({0}.rgb, grayer);\r\n float3 muted = lerp({0}.rgb, gray.xxx, {3});\r\n float3 sepia = lerp({2}.rgb, {1}.rgb, gray);\r\n {0}.rgb = lerp(muted, sepia, {4});\r\n }}\r\n", effectBuilder.PixelShaderOutput, variableInfo1.Name, variableInfo2.Name, variableInfo3.Name, variableInfo4.Name)); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9SpotLight2DElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9SpotLight2DElement.cs index 5e77acb..1825406 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9SpotLight2DElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9SpotLight2DElement.cs @@ -16,83 +16,83 @@ namespace Microsoft.Iris.Render.Graphics { VariableInfo variableInfo1 = new VariableInfo() { - ID = (int)efiSpotlight2D.PositionID, + ID = efiSpotlight2D.PositionID, Type = Dx9VariableType.Vector3, IsDynamic = efiSpotlight2D.IsDynamicProperty("Position") }; variableInfo1.Name = variableInfo1.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo1.Type, "Position") : effectBuilder.GenerateGlobalConstant(variableInfo1.Type, "Position"); - variableInfo1.DefaultValue = (object)efiSpotlight2D.Position; + variableInfo1.DefaultValue = efiSpotlight2D.Position; effectBuilder.AddPropertyVariable(variableInfo1); VariableInfo variableInfo2 = new VariableInfo() { - ID = (int)efiSpotlight2D.DirectionAngleID, + ID = efiSpotlight2D.DirectionAngleID, Type = Dx9VariableType.Float, IsDynamic = efiSpotlight2D.IsDynamicProperty("DirectionAngle") }; variableInfo2.Name = variableInfo2.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo2.Type, "DirectionAngle") : effectBuilder.GenerateGlobalConstant(variableInfo2.Type, "DirectionAngle"); - variableInfo2.DefaultValue = (object)efiSpotlight2D.DirectionAngle; + variableInfo2.DefaultValue = efiSpotlight2D.DirectionAngle; effectBuilder.AddPropertyVariable(variableInfo2); VariableInfo variableInfo3 = new VariableInfo() { - ID = (int)efiSpotlight2D.LightColorID, + ID = efiSpotlight2D.LightColorID, Type = Dx9VariableType.Vector4, IsDynamic = efiSpotlight2D.IsDynamicProperty("LightColor") }; variableInfo3.Name = variableInfo3.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo3.Type, "LightColor") : effectBuilder.GenerateGlobalConstant(variableInfo3.Type, "LightColor"); - variableInfo3.DefaultValue = (object)efiSpotlight2D.LightColor.ToVector4(); + variableInfo3.DefaultValue = efiSpotlight2D.LightColor.ToVector4(); effectBuilder.AddPropertyVariable(variableInfo3); VariableInfo variableInfo4 = new VariableInfo() { - ID = (int)efiSpotlight2D.AmbientColorID, + ID = efiSpotlight2D.AmbientColorID, Type = Dx9VariableType.Vector4, IsDynamic = efiSpotlight2D.IsDynamicProperty("AmbientColor") }; variableInfo4.Name = variableInfo4.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo4.Type, "AmbientColor") : effectBuilder.GenerateGlobalConstant(variableInfo4.Type, "AmbientColor"); - variableInfo4.DefaultValue = (object)efiSpotlight2D.AmbientColor.ToVector4(); + variableInfo4.DefaultValue = efiSpotlight2D.AmbientColor.ToVector4(); effectBuilder.AddPropertyVariable(variableInfo4); VariableInfo variableInfo5 = new VariableInfo() { - ID = (int)efiSpotlight2D.InnerConeAngleID, + ID = efiSpotlight2D.InnerConeAngleID, Type = Dx9VariableType.Float, IsDynamic = efiSpotlight2D.IsDynamicProperty("InnerConeAngle") }; variableInfo5.Name = variableInfo5.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo5.Type, "InnerConeAngle") : effectBuilder.GenerateGlobalConstant(variableInfo5.Type, "InnerConeAngle"); - variableInfo5.DefaultValue = (object)efiSpotlight2D.InnerConeAngle; + variableInfo5.DefaultValue = efiSpotlight2D.InnerConeAngle; effectBuilder.AddPropertyVariable(variableInfo5); VariableInfo variableInfo6 = new VariableInfo() { - ID = (int)efiSpotlight2D.OuterConeAngleID, + ID = efiSpotlight2D.OuterConeAngleID, Type = Dx9VariableType.Float, IsDynamic = efiSpotlight2D.IsDynamicProperty("OuterConeAngle") }; variableInfo6.Name = variableInfo6.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo6.Type, "OuterConeAngle") : effectBuilder.GenerateGlobalConstant(variableInfo6.Type, "OuterConeAngle"); - variableInfo6.DefaultValue = (object)efiSpotlight2D.OuterConeAngle; + variableInfo6.DefaultValue = efiSpotlight2D.OuterConeAngle; effectBuilder.AddPropertyVariable(variableInfo6); VariableInfo variableInfo7 = new VariableInfo() { - ID = (int)efiSpotlight2D.IntensityID, + ID = efiSpotlight2D.IntensityID, Type = Dx9VariableType.Float, IsDynamic = efiSpotlight2D.IsDynamicProperty("Intensity") }; variableInfo7.Name = variableInfo7.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo7.Type, "Intensity") : effectBuilder.GenerateGlobalConstant(variableInfo7.Type, "Intensity"); - variableInfo7.DefaultValue = (object)efiSpotlight2D.Intensity; + variableInfo7.DefaultValue = efiSpotlight2D.Intensity; effectBuilder.AddPropertyVariable(variableInfo7); VariableInfo variableInfo8 = new VariableInfo() { - ID = (int)efiSpotlight2D.AttenuationID, + ID = efiSpotlight2D.AttenuationID, Type = Dx9VariableType.Vector3, IsDynamic = efiSpotlight2D.IsDynamicProperty("Attenuation") }; variableInfo8.Name = variableInfo8.IsDynamic ? effectBuilder.GenerateGlobalVariable(variableInfo8.Type, "Attenuation") : effectBuilder.GenerateGlobalConstant(variableInfo8.Type, "Attenuation"); - variableInfo8.DefaultValue = (object)efiSpotlight2D.Attenuation; + variableInfo8.DefaultValue = efiSpotlight2D.Attenuation; effectBuilder.AddPropertyVariable(variableInfo8); effectBuilder.AddRequirement(EffectRequirements.ViewPosition); effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Vector4, efiSpotlight2D.Name); - string str = InvariantString.Format(" float4 {0} = {3};\r\n {{\r\n // Compute the direction of the spotlight and the distance from the current pixel\r\n // 0.0001 prevents div by zero while using smoothstep interpolation\r\n float flCosOuterCone = cos(radians(({4}+{5}+0.0001)/2.0f));\r\n float flCosInnerCone = cos(radians({4}/2.0f));\r\n float flDirectionAngle = radians({2});\r\n float2 vLightDir = {{cos(flDirectionAngle), -sin(flDirectionAngle)}};\r\n float2 vLightPosition = {1}.xy - vLightDir;\r\n float2 vPositionDelta = Input.ViewPos.xy - vLightPosition;\r\n\r\n // Compute the cone region, attenuation and falloff\r\n float flDist = length(vPositionDelta);\r\n float flFalloff = {6} / ({7}.x + flDist*{7}.y + flDist*flDist*{7}.z);\r\n float flCone = dot(normalize(vPositionDelta), vLightDir);\r\n\r\n {0} *= smoothstep(flCosOuterCone, flCosInnerCone, flCone) * flFalloff;\r\n", (object)effectBuilder.PixelShaderOutput, (object)variableInfo1.Name, (object)variableInfo2.Name, (object)variableInfo3.Name, (object)variableInfo5.Name, (object)variableInfo6.Name, (object)variableInfo7.Name, (object)variableInfo8.Name); + string str = InvariantString.Format(" float4 {0} = {3};\r\n {{\r\n // Compute the direction of the spotlight and the distance from the current pixel\r\n // 0.0001 prevents div by zero while using smoothstep interpolation\r\n float flCosOuterCone = cos(radians(({4}+{5}+0.0001)/2.0f));\r\n float flCosInnerCone = cos(radians({4}/2.0f));\r\n float flDirectionAngle = radians({2});\r\n float2 vLightDir = {{cos(flDirectionAngle), -sin(flDirectionAngle)}};\r\n float2 vLightPosition = {1}.xy - vLightDir;\r\n float2 vPositionDelta = Input.ViewPos.xy - vLightPosition;\r\n\r\n // Compute the cone region, attenuation and falloff\r\n float flDist = length(vPositionDelta);\r\n float flFalloff = {6} / ({7}.x + flDist*{7}.y + flDist*flDist*{7}.z);\r\n float flCone = dot(normalize(vPositionDelta), vLightDir);\r\n\r\n {0} *= smoothstep(flCosOuterCone, flCosInnerCone, flCone) * flFalloff;\r\n", effectBuilder.PixelShaderOutput, variableInfo1.Name, variableInfo2.Name, variableInfo3.Name, variableInfo5.Name, variableInfo6.Name, variableInfo7.Name, variableInfo8.Name); if (variableInfo4.IsDynamic || !efiSpotlight2D.AmbientColor.ToVector4().IsApproximate(Vector4.Zero)) - effectBuilder.EmitPixelFragment(InvariantString.Format("{0} {1} += {2};\r\n }}\r\n", (object)str, (object)effectBuilder.PixelShaderOutput, (object)variableInfo4.Name)); + effectBuilder.EmitPixelFragment(InvariantString.Format("{0} {1} += {2};\r\n }}\r\n", str, effectBuilder.PixelShaderOutput, variableInfo4.Name)); else - effectBuilder.EmitPixelFragment(InvariantString.Format("{0} }}\r\n", (object)str)); + effectBuilder.EmitPixelFragment(InvariantString.Format("{0} }}\r\n", str)); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9VideoElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9VideoElement.cs index b97c92d..8bc1f48 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9VideoElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Dx9VideoElement.cs @@ -14,18 +14,18 @@ namespace Microsoft.Iris.Render.Graphics { Dx9TextureInfo dx9TextureInfo = effectBuilder.AllocateTexture(); TextureVariableInfo textureVariableInfo = new TextureVariableInfo(); - textureVariableInfo.ID = (int)efiVideo.VideoStreamID; + textureVariableInfo.ID = efiVideo.VideoStreamID; textureVariableInfo.Type = Dx9VariableType.Texture; textureVariableInfo.Name = effectBuilder.GenerateGlobalVariable(textureVariableInfo.Type, efiVideo.Name); - textureVariableInfo.DefaultValue = (object)efiVideo.VideoStream; + textureVariableInfo.DefaultValue = efiVideo.VideoStream; textureVariableInfo.SamplerName = dx9TextureInfo.Sampler; textureVariableInfo.MinFilter = "Linear"; textureVariableInfo.MagFilter = "Linear"; textureVariableInfo.CoordinateMapID = -1; textureVariableInfo.ImageIndexID = -1; - effectBuilder.AddPropertyVariable((VariableInfo)textureVariableInfo); + effectBuilder.AddPropertyVariable(textureVariableInfo); effectBuilder.PixelShaderOutput = effectBuilder.GenerateLocalVariable(Dx9VariableType.Vector4, efiVideo.Name); - effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the surface\r\n float4 {0} = tex2D({1}, {2});\r\n\r\n", (object)effectBuilder.PixelShaderOutput, (object)dx9TextureInfo.Sampler, (object)dx9TextureInfo.TexCoordInput)); + effectBuilder.EmitPixelFragment(InvariantString.Format(" // Load the surface\r\n float4 {0} = tex2D({1}, {2});\r\n\r\n", effectBuilder.PixelShaderOutput, dx9TextureInfo.Sampler, dx9TextureInfo.TexCoordInput)); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicBlock.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicBlock.cs index 5a04b32..54bf784 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicBlock.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicBlock.cs @@ -49,13 +49,13 @@ namespace Microsoft.Iris.Render.Graphics public void Dispose() { - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); this.Dispose(true); } private void Dispose(bool fInDispose) { - this.m_surface = (Surface)null; + this.m_surface = null; if (!fInDispose) return; this.m_rowOwner.NotifyBlockDestroyed(this); @@ -106,7 +106,7 @@ namespace Microsoft.Iris.Render.Graphics case SurfacePoolAllocationResult.Requested: case SurfacePoolAllocationResult.Immoveable: remoteStub.SendRemapLocation(this.m_rcLocationPxl); - alReloadContent.Add((object)surface); + alReloadContent.Add(surface); break; } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicBucket.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicBucket.cs index 53f134e..abe4179 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicBucket.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicBucket.cs @@ -34,8 +34,8 @@ namespace Microsoft.Iris.Render.Graphics bool fRotated, PoolAllocMethod allocMethod) { - ArrayList alReloadContent = (ArrayList)null; - DynamicRow dynamicRow = (DynamicRow)null; + ArrayList alReloadContent = null; + DynamicRow dynamicRow = null; switch (allocMethod) { case PoolAllocMethod.Available: @@ -48,7 +48,7 @@ namespace Microsoft.Iris.Render.Graphics dynamicRow = this.m_poolOwner.CreateRow(alReloadContent, this, surfaceOwner, sizeRequestPxl, allocMethod); if (dynamicRow != null) { - this.m_alRows.Add((object)dynamicRow); + this.m_alRows.Add(dynamicRow); break; } break; @@ -66,7 +66,7 @@ namespace Microsoft.Iris.Render.Graphics { if (this.m_fCompacting) return; - this.NotifyEmptyWorker(this.m_alRows.IndexOf((object)rowEmpty)); + this.NotifyEmptyWorker(this.m_alRows.IndexOf(rowEmpty)); } private void NotifyEmptyWorker(int idxRow) @@ -87,7 +87,7 @@ namespace Microsoft.Iris.Render.Graphics if (nRequestedWidth <= alRow.LargestFree) return alRow; } - return (DynamicRow)null; + return null; } private DynamicRow ScavengeForAvailableSpace( @@ -97,7 +97,7 @@ namespace Microsoft.Iris.Render.Graphics uint uAvgTimestampsNoCompact; uint uAvgTimestampsWithCompact; object objResultOfSpeculation = this.m_poolOwner.SpeculateScavengeRows(this.RowHeight, this, out uAvgTimestampsNoCompact, out uAvgTimestampsWithCompact); - DynamicRow dynamicRow = (DynamicRow)null; + DynamicRow dynamicRow = null; if (uAvgTimestampsNoCompact == uint.MaxValue) dynamicRow = this.ScavengeLocalRows(alReloadContent, sizeRequested.Width); if (uAvgTimestampsNoCompact != uint.MaxValue || uAvgTimestampsWithCompact != uint.MaxValue) @@ -112,11 +112,11 @@ namespace Microsoft.Iris.Render.Graphics private DynamicRow ScavengeLocalRows(ArrayList alReloadContent, int nRequestedWidth) { - DynamicRow dynamicRow1 = (DynamicRow)null; - object obj1 = (object)null; + DynamicRow dynamicRow1 = null; + object obj1 = null; uint num1 = uint.MaxValue; - DynamicRow dynamicRow2 = (DynamicRow)null; - object obj2 = (object)null; + DynamicRow dynamicRow2 = null; + object obj2 = null; uint num2 = uint.MaxValue; for (int index = 0; index < this.m_alRows.Count; ++index) { @@ -145,9 +145,9 @@ namespace Microsoft.Iris.Render.Graphics objResultOfPotentialCalculation = obj2; } if (dynamicRow3 != null && !dynamicRow3.FinishScavengeBlocks(alReloadContent, nRequestedWidth, objResultOfPotentialCalculation)) - dynamicRow3 = (DynamicRow)null; - if (dynamicRow3 != null && !this.m_alRows.Contains((object)dynamicRow3)) - dynamicRow3 = (DynamicRow)null; + dynamicRow3 = null; + if (dynamicRow3 != null && !this.m_alRows.Contains(dynamicRow3)) + dynamicRow3 = null; return dynamicRow3; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicPool.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicPool.cs index d75ee1c..7c84c32 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicPool.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicPool.cs @@ -43,10 +43,10 @@ namespace Microsoft.Iris.Render.Graphics { foreach (DynamicRow alRow in this.m_alRows) alRow.Dispose(); - this.m_alBuckets = (ArrayList)null; - this.m_alRows = (ArrayList)null; + this.m_alBuckets = null; + this.m_alRows = null; this.m_poolSurface.Dispose(); - this.m_poolSurface = (SurfacePool)null; + this.m_poolSurface = null; } internal SurfacePool SurfacePool => this.m_poolSurface; @@ -89,7 +89,7 @@ namespace Microsoft.Iris.Render.Graphics { int height = this.m_sizeTotalPxl.Height; } - DynamicBucket dynamicBucket = (DynamicBucket)null; + DynamicBucket dynamicBucket = null; for (int index = 0; index < this.m_alBuckets.Count; ++index) { DynamicBucket alBucket = (DynamicBucket)this.m_alBuckets[index]; @@ -102,7 +102,7 @@ namespace Microsoft.Iris.Render.Graphics if (dynamicBucket == null) { dynamicBucket = new DynamicBucket(this, nHeightPxl); - this.m_alBuckets.Add((object)dynamicBucket); + this.m_alBuckets.Add(dynamicBucket); } return dynamicBucket.CreateSurface(surfaceOwner, sizeRequestPxl, sizeContentPxl, sizeGutter, fRotated, allocMethod); } @@ -120,11 +120,11 @@ namespace Microsoft.Iris.Render.Graphics if (alItems.Count <= 0) return; idxInsert = -1; - IDynamicBlock dynamicBlock1 = (IDynamicBlock)null; + IDynamicBlock dynamicBlock1 = null; int index = 0; while (index <= alItems.Count) { - IDynamicBlock dynamicBlock2 = (IDynamicBlock)null; + IDynamicBlock dynamicBlock2 = null; int num2; if (index < alItems.Count) { @@ -159,7 +159,7 @@ namespace Microsoft.Iris.Render.Graphics { num1 = 0; num2 = 0; - IDynamicBlock dynamicBlock1 = (IDynamicBlock)null; + IDynamicBlock dynamicBlock1 = null; int index = 0; while (index <= alItems.Count) { @@ -172,7 +172,7 @@ namespace Microsoft.Iris.Render.Graphics } else { - dynamicBlock2 = (IDynamicBlock)null; + dynamicBlock2 = null; num3 = nTotalPxl; } if (dynamicBlock1 != null) @@ -198,7 +198,7 @@ namespace Microsoft.Iris.Render.Graphics if (alItems.Count <= 0) return; int num1 = 0; - IDynamicBlock dynamicBlock1 = (IDynamicBlock)null; + IDynamicBlock dynamicBlock1 = null; int index = 0; while (index <= alItems.Count) { @@ -211,7 +211,7 @@ namespace Microsoft.Iris.Render.Graphics } else { - dynamicBlock2 = (IDynamicBlock)null; + dynamicBlock2 = null; num2 = nTotalPxl; } if (dynamicBlock1 != null) @@ -244,15 +244,15 @@ namespace Microsoft.Iris.Render.Graphics this.FullCompact(alReloadContent); break; } - DynamicRow dynamicRow = (DynamicRow)null; + DynamicRow dynamicRow = null; if (rowHeight <= this.m_nLargestFreePxl) { int idxInsert; int nOffsetNewPxl; - DynamicPool.FindInsertionPoint(this.m_alRows, this.m_sizeTotalPxl.Height, rowHeight, out idxInsert, out nOffsetNewPxl); + FindInsertionPoint(this.m_alRows, this.m_sizeTotalPxl.Height, rowHeight, out idxInsert, out nOffsetNewPxl); dynamicRow = new DynamicRow(bktOwner, rowHeight, nOffsetNewPxl); - this.m_alRows.Insert(idxInsert, (object)dynamicRow); - DynamicPool.RecomputeAvailable(this.m_alRows, this.m_sizeTotalPxl.Height, out this.m_nLargestFreePxl, out this.m_nTotalFreePxl); + this.m_alRows.Insert(idxInsert, dynamicRow); + RecomputeAvailable(this.m_alRows, this.m_sizeTotalPxl.Height, out this.m_nLargestFreePxl, out this.m_nTotalFreePxl); } return dynamicRow; } @@ -268,13 +268,13 @@ namespace Microsoft.Iris.Render.Graphics if (nRequestedHeight <= this.m_nLargestFreePxl) { uAvgTimestampsNoCompact = 0U; - return (object)null; + return null; } int count = this.m_alRows.Count; int length = 0; DynamicRow[] dynamicRowArray = new DynamicRow[count]; int num1 = 0; - DynamicRow dynamicRow1 = (DynamicRow)null; + DynamicRow dynamicRow1 = null; uint num2 = uint.MaxValue; for (int index = 0; index < count; ++index) { @@ -306,16 +306,16 @@ namespace Microsoft.Iris.Render.Graphics if (dynamicRow1 != null) { uAvgTimestampsNoCompact = num2; - return (object)dynamicRow1; + return dynamicRow1; } if (nRequestedHeight <= this.m_nTotalFreePxl) { uAvgTimestampsWithCompact = 0U; - return (object)null; + return null; } if (nRequestedHeight > num1 + this.m_nTotalFreePxl) - return (object)null; - Array.Sort((Array)dynamicRowArray, 0, length, (IComparer)this); + return null; + Array.Sort(dynamicRowArray, 0, length, this); int nTotalFreePxl = this.m_nTotalFreePxl; int num5 = 0; ulong num6 = 0; @@ -323,14 +323,14 @@ namespace Microsoft.Iris.Render.Graphics { DynamicRow dynamicRow2 = dynamicRowArray[num5++]; nTotalFreePxl += dynamicRow2.StorageSize.Height; - num6 += (ulong)dynamicRow2.LastAvgAge; + num6 += dynamicRow2.LastAvgAge; if (nTotalFreePxl >= nRequestedHeight) break; } uAvgTimestampsWithCompact = (uint)(num6 / (ulong)num5); while (num5 < length) - dynamicRowArray[num5++] = (DynamicRow)null; - return (object)dynamicRowArray; + dynamicRowArray[num5++] = null; + return dynamicRowArray; } internal bool FinishScavengeRows( @@ -377,8 +377,8 @@ namespace Microsoft.Iris.Render.Graphics public void NotifyEmpty(DynamicRow rowEmpty) { - this.m_alRows.Remove((object)rowEmpty); - DynamicPool.RecomputeAvailable(this.m_alRows, this.m_sizeTotalPxl.Height, out this.m_nLargestFreePxl, out this.m_nTotalFreePxl); + this.m_alRows.Remove(rowEmpty); + RecomputeAvailable(this.m_alRows, this.m_sizeTotalPxl.Height, out this.m_nLargestFreePxl, out this.m_nTotalFreePxl); } public void NotifyEmpty(DynamicBucket bktEmpty) @@ -394,16 +394,16 @@ namespace Microsoft.Iris.Render.Graphics internal IList ExtractAllSurfaces() { if (this.m_poolSurface == null) - return (IList)null; + return null; IList allSurfaces = this.m_poolSurface.AllSurfaces; if (allSurfaces == null) - return (IList)null; - foreach (Surface surCur in (IEnumerable)allSurfaces) + return null; + foreach (Surface surCur in allSurfaces) SurfacePool.RemapSurface(surCur, new SurfacePool(this.m_device, surCur.ContentSize, SurfaceFormat.ARGB32) { DestroyWhenEmpty = true }); - this.m_poolSurface = (SurfacePool)null; + this.m_poolSurface = null; this.m_alBuckets = new ArrayList(); this.m_alRows = new ArrayList(); return allSurfaces; @@ -483,7 +483,7 @@ namespace Microsoft.Iris.Render.Graphics ; foreach (DynamicRow alRow in this.m_alRows) { - foreach (DynamicBlock block in (IEnumerable)alRow.Blocks) + foreach (DynamicBlock block in alRow.Blocks) ; } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicPoolSet.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicPoolSet.cs index 6b97c4e..684aa86 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicPoolSet.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicPoolSet.cs @@ -34,8 +34,8 @@ namespace Microsoft.Iris.Render.Graphics foreach (DynamicPool alPool in this.m_alPools) alPool.Dispose(); } - this.m_alPools = (ArrayList)null; - this.m_device = (GraphicsDevice)null; + this.m_alPools = null; + this.m_device = null; } finally { @@ -56,7 +56,7 @@ namespace Microsoft.Iris.Render.Graphics poolSurface.DestroyWhenEmpty = false; poolSurface.RemoteStub.SendSetPriority(-10); DynamicPool dynamicPool = new DynamicPool(poolSurface, nMinHeightPxl, nMaxHeightPxl); - this.m_alPools.Add((object)dynamicPool); + this.m_alPools.Add(dynamicPool); return dynamicPool; } @@ -71,7 +71,7 @@ namespace Microsoft.Iris.Render.Graphics { Debug2.Validate(surfaceOwner != null, typeof(ArgumentNullException), "Must provide valid surface owner"); Debug2.Validate(sizeContentPxl.Width > 0 && sizeContentPxl.Height > 0, typeof(ArgumentOutOfRangeException), "Must provide positive area for surface"); - Surface surface = (Surface)null; + Surface surface = null; for (int index1 = 0; index1 < this.m_alPools.Count; ++index1) { for (int index2 = (int)minAllocMethod; (PoolAllocMethod)index2 <= maxAllocMethod; ++index2) diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicRow.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicRow.cs index a8564de..1336198 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicRow.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/DynamicRow.cs @@ -32,10 +32,10 @@ namespace Microsoft.Iris.Render.Graphics public void Dispose() { this.m_bktOwner.AssertOwningThread(); - this.m_bktOwner = (DynamicBucket)null; + this.m_bktOwner = null; foreach (DynamicBlock alBlock in this.m_alBlocks) alBlock.Dispose(); - this.m_alBlocks = (ArrayList)null; + this.m_alBlocks = null; } public int NearEdge => this.m_nOffsetYPxl; @@ -50,7 +50,7 @@ namespace Microsoft.Iris.Render.Graphics public DynamicBucket Bucket => this.m_bktOwner; - public ICollection Blocks => (ICollection)this.m_alBlocks; + public ICollection Blocks => m_alBlocks; internal bool IsEmpty => this.m_alBlocks.Count == 0; @@ -72,8 +72,8 @@ namespace Microsoft.Iris.Render.Graphics DynamicPool.FindInsertionPoint(this.m_alBlocks, this.m_sizeRowPxl.Width, sizeRequestPxl.Width, out idxInsert, out nOffsetNewPxl); DynamicBlock dynamicBlock = new DynamicBlock(this, new Rectangle(new Point(nOffsetNewPxl, this.m_nOffsetYPxl), sizeRequestPxl), sizeContentPxl, sizeGutter, fRotated); Surface surface = dynamicBlock.Create(surfaceOwner); - surface.RegisterUsage((object)this.DynamicPool.SurfacePool); - this.m_alBlocks.Insert(idxInsert, (object)dynamicBlock); + surface.RegisterUsage(DynamicPool.SurfacePool); + this.m_alBlocks.Insert(idxInsert, dynamicBlock); this.RecomputeAvailable(); return surface; } @@ -90,7 +90,7 @@ namespace Microsoft.Iris.Render.Graphics this.m_uLastAvgAge = uint.MaxValue; return; } - num += (ulong)surface.LastUsage; + num += surface.LastUsage; } this.m_uLastAvgAge = (uint)(num / (ulong)count); } @@ -105,13 +105,13 @@ namespace Microsoft.Iris.Render.Graphics if (nRequestedWidth <= this.m_nLargestFreePxl) { uAvgTimestampsNoCompact = 0U; - return (object)null; + return null; } int count = this.m_alBlocks.Count; int length = 0; DynamicBlock[] dynamicBlockArray = new DynamicBlock[count]; int num1 = 0; - DynamicBlock dynamicBlock1 = (DynamicBlock)null; + DynamicBlock dynamicBlock1 = null; uint num2 = uint.MaxValue; for (int index = 0; index < count; ++index) { @@ -140,16 +140,16 @@ namespace Microsoft.Iris.Render.Graphics if (dynamicBlock1 != null) { uAvgTimestampsNoCompact = num2; - return (object)dynamicBlock1; + return dynamicBlock1; } if (nRequestedWidth <= this.m_nTotalFreePxl) { uAvgTimestampsWithCompact = 0U; - return (object)null; + return null; } if (nRequestedWidth > num1 + this.m_nTotalFreePxl) - return (object)null; - Array.Sort((Array)dynamicBlockArray, 0, length, (IComparer)this); + return null; + Array.Sort(dynamicBlockArray, 0, length, this); int nTotalFreePxl = this.m_nTotalFreePxl; int num5 = 0; ulong num6 = 0; @@ -157,14 +157,14 @@ namespace Microsoft.Iris.Render.Graphics { DynamicBlock dynamicBlock2 = dynamicBlockArray[num5++]; nTotalFreePxl += dynamicBlock2.StorageSize.Width; - num6 += (ulong)dynamicBlock2.Surface.LastUsage; + num6 += dynamicBlock2.Surface.LastUsage; if (nTotalFreePxl >= nRequestedWidth) break; } uAvgTimestampsWithCompact = (uint)(num6 / (ulong)num5); while (num5 < length) - dynamicBlockArray[num5++] = (DynamicBlock)null; - return (object)dynamicBlockArray; + dynamicBlockArray[num5++] = null; + return dynamicBlockArray; } internal bool FinishScavengeBlocks( @@ -223,7 +223,7 @@ namespace Microsoft.Iris.Render.Graphics private void CollectDeadBlockSurface(DynamicBlock blk, Surface sur) { - sur.UnregisterUsage((object)this.DynamicPool.SurfacePool); + sur.UnregisterUsage(DynamicPool.SurfacePool); blk.Dispose(); } @@ -231,7 +231,7 @@ namespace Microsoft.Iris.Render.Graphics { if (this.m_alBlocks.Count <= 0) return; - DynamicBlock dynamicBlock = (DynamicBlock)null; + DynamicBlock dynamicBlock = null; try { if (fCompactToRight) @@ -285,7 +285,7 @@ namespace Microsoft.Iris.Render.Graphics { int index = fCompactToRight ? rowSrc.m_alBlocks.Count - 1 : 0; DynamicBlock alBlock = (DynamicBlock)rowSrc.m_alBlocks[index]; - if (!DynamicRow.MoveBlockToEnd(alReloadContent, alBlock, rowDest, rowSrc, fCompactToRight)) + if (!MoveBlockToEnd(alReloadContent, alBlock, rowDest, rowSrc, fCompactToRight)) { flag = false; break; @@ -322,10 +322,10 @@ namespace Microsoft.Iris.Render.Graphics try { if (fCompactToRight) - rowDest.m_alBlocks.Insert(0, (object)blkMove); + rowDest.m_alBlocks.Insert(0, blkMove); else - rowDest.m_alBlocks.Add((object)blkMove); - int index = rowSrc.m_alBlocks.IndexOf((object)blkMove); + rowDest.m_alBlocks.Add(blkMove); + int index = rowSrc.m_alBlocks.IndexOf(blkMove); rowSrc.m_alBlocks.RemoveAt(index); if (fCompactToRight) x -= num1; @@ -369,7 +369,7 @@ namespace Microsoft.Iris.Render.Graphics { if (this.m_bktOwner == null) return; - this.m_alBlocks.RemoveAt(this.m_alBlocks.IndexOf((object)blkRemove)); + this.m_alBlocks.RemoveAt(this.m_alBlocks.IndexOf(blkRemove)); this.RecomputeAvailable(); if (this.m_nLargestFreePxl != this.m_sizeRowPxl.Width) return; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Effect.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Effect.cs index 94273c8..d186a8b 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Effect.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Effect.cs @@ -28,7 +28,7 @@ namespace Microsoft.Iris.Render.Graphics internal Effect(EffectTemplate effectTemplate) { this.m_effectTemplate = effectTemplate; - this.m_effectTemplate.RegisterUsage((object)this); + this.m_effectTemplate.RegisterUsage(this); } protected override void Dispose(bool fInDispose) @@ -58,10 +58,10 @@ namespace Microsoft.Iris.Render.Graphics effectProperty.Dispose(); } } - this.m_effectTemplate.UnregisterUsage((object)this); - this.m_effectTemplate = (EffectTemplate)null; - this.m_propertyCache = (Vector)null; - this.m_remoteEffect = (Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteEffect)null; + this.m_effectTemplate.UnregisterUsage(this); + this.m_effectTemplate = null; + this.m_propertyCache = null; + this.m_remoteEffect = null; } finally { @@ -69,7 +69,7 @@ namespace Microsoft.Iris.Render.Graphics } } - void IRenderHandleOwner.OnDisconnect() => this.m_remoteEffect = (Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteEffect)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteEffect = null; internal Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteEffect RemoteStub => this.m_remoteEffect; @@ -77,7 +77,7 @@ namespace Microsoft.Iris.Render.Graphics public string Name => this.m_effectTemplate.Name; - public IEffectTemplate Template => (IEffectTemplate)this.m_effectTemplate; + public IEffectTemplate Template => m_effectTemplate; void IEffect.SetProperty(string stPropertyName, int nValue) => this.SetProperty(stPropertyName, nValue); @@ -105,7 +105,7 @@ namespace Microsoft.Iris.Render.Graphics Map dynamicProperties = this.m_effectTemplate.DynamicProperties; if (dynamicProperties.ContainsKey(propertyName)) return this.GenerateAnimationPropertyId(dynamicProperties[propertyName]); - Debug2.Validate(false, typeof(ArgumentException), (object)"Unsupported property: ", (object)propertyName); + Debug2.Validate(false, typeof(ArgumentException), "Unsupported property: ", propertyName); return 0; } @@ -116,7 +116,7 @@ namespace Microsoft.Iris.Render.Graphics Map dynamicProperties = this.m_effectTemplate.DynamicProperties; if (dynamicProperties.ContainsKey(propertyName)) return this.MapEffectPropertyTypeToAnimationType(dynamicProperties[propertyName]); - Debug2.Validate(false, typeof(ArgumentException), (object)"Unsupported property: ", (object)propertyName); + Debug2.Validate(false, typeof(ArgumentException), "Unsupported property: ", propertyName); return AnimationInputType.Float; } @@ -124,9 +124,9 @@ namespace Microsoft.Iris.Render.Graphics { uint num1 = 7; uint num2 = 16777215; - Debug2.Validate((effectProperty.Type & (EffectPropertyType)~(int)num1) == EffectPropertyType.Integer, typeof(ArgumentException), (object)"Unsupported effect property type: {0}", (object)effectProperty.Type); - Debug2.Validate(((int)effectProperty.ID & ~(int)num2) == 0, typeof(ArgumentException), "Only 24-bits of effect property IDs are supported"); - return (uint)(effectProperty.Type & (EffectPropertyType)num1) << 28 | (uint)effectProperty.ID & num2; + Debug2.Validate((effectProperty.Type & (EffectPropertyType)~(int)num1) == EffectPropertyType.Integer, typeof(ArgumentException), "Unsupported effect property type: {0}", effectProperty.Type); + Debug2.Validate((effectProperty.ID & ~(int)num2) == 0, typeof(ArgumentException), "Only 24-bits of effect property IDs are supported"); + return (uint)(effectProperty.Type & (EffectPropertyType)num1) << 28 | effectProperty.ID & num2; } private AnimationInputType MapEffectPropertyTypeToAnimationType( @@ -152,7 +152,7 @@ namespace Microsoft.Iris.Render.Graphics animationInputType = AnimationInputType.Vector4; break; default: - Debug2.Throw(false, "{0} is not supported as animatable property", (object)effectProperty.Type); + Debug2.Throw(false, "{0} is not supported as animatable property", effectProperty.Type); animationInputType = AnimationInputType.Float; break; } @@ -214,7 +214,7 @@ namespace Microsoft.Iris.Render.Graphics Debug2.Validate(propertyFromCache.Type == EffectPropertyType.Image || propertyFromCache.Type == EffectPropertyType.ImageArray, typeof(InvalidOperationException), "Invalid property type"); if (propertyFromCache.Type == EffectPropertyType.Image) { - if (propertyFromCache.HasIdenticalValue((object)image)) + if (propertyFromCache.HasIdenticalValue(image)) return; this.SetSharedResourceProperty(propertyFromCache, image); } @@ -222,7 +222,7 @@ namespace Microsoft.Iris.Render.Graphics { if (propertyFromCache.Value != null && (Image)((SharedResourceArray)propertyFromCache.Value).Resources[0] == image) return; - this.SetSharedResourceProperty(propertyFromCache, new SharedResourceArray((SharedResource)image)); + this.SetSharedResourceProperty(propertyFromCache, new SharedResourceArray(image)); } } @@ -237,15 +237,15 @@ namespace Microsoft.Iris.Render.Graphics for (int index = 0; index < images.Length; ++index) rgResources[index] = (SharedResource)images[index]; SharedResourceArray oValue = new SharedResourceArray(rgResources); - oValue.RegisterUsage((object)this); - if (propertyFromCache.HasIdenticalValue((object)oValue)) + oValue.RegisterUsage(this); + if (propertyFromCache.HasIdenticalValue(oValue)) { - oValue.UnregisterUsage((object)this); + oValue.UnregisterUsage(this); } else { this.SetSharedResourceProperty(propertyFromCache, oValue); - oValue.UnregisterUsage((object)this); + oValue.UnregisterUsage(this); } } @@ -256,7 +256,7 @@ namespace Microsoft.Iris.Render.Graphics EffectProperty propertyFromCache = this.GetPropertyFromCache(stPropertyName); Debug2.Validate(propertyFromCache != null, typeof(InvalidOperationException), "Invalid property name"); Debug2.Validate(propertyFromCache.Type == EffectPropertyType.Video, typeof(InvalidOperationException), "Invalid property type"); - if (propertyFromCache.HasIdenticalValue((object)videoStream)) + if (propertyFromCache.HasIdenticalValue(videoStream)) return; this.SetSharedResourceProperty(propertyFromCache, videoStream); } @@ -277,47 +277,47 @@ namespace Microsoft.Iris.Render.Graphics { Debug2.Validate(property.Type == EffectPropertyType.ImageArray || property.Type == EffectPropertyType.Image, typeof(InvalidOperationException), "Not an Image type"); this.FreeResource(property.Value as SharedResourceArray); - property.Value = (object)oValue; + property.Value = oValue; this.AcquireNewResource(oValue); - this.RemoteProperty(property, (object)oValue); + this.RemoteProperty(property, oValue); } private void SetSharedResourceProperty(EffectProperty property, Image oValue) { Debug2.Validate(property.Type == EffectPropertyType.Image, typeof(InvalidOperationException), "Not an Image type"); this.FreeResource(property.Value as Image); - property.Value = (object)oValue; + property.Value = oValue; this.AcquireNewResource(oValue); - this.RemoteProperty(property, (object)oValue); + this.RemoteProperty(property, oValue); } private void SetSharedResourceProperty(EffectProperty property, VideoStream oValue) { Debug2.Validate(property.Type == EffectPropertyType.Video, typeof(InvalidOperationException), "Not a Video type"); this.FreeResource(property.Value as VideoStream); - property.Value = (object)oValue; + property.Value = oValue; this.AcquireNewResource(oValue); - this.RemoteProperty(property, (object)oValue); + this.RemoteProperty(property, oValue); } private EffectProperty GetPropertyFromCache(string propertyName) { Map dynamicProperties = this.m_effectTemplate.DynamicProperties; if (!dynamicProperties.ContainsKey(propertyName)) - Debug2.Validate(false, typeof(InvalidOperationException), (object)"Invalid property name", (object)propertyName); + Debug2.Validate(false, typeof(InvalidOperationException), "Invalid property name", propertyName); EffectProperty effectProperty = dynamicProperties[propertyName]; Debug2.Validate(effectProperty.IsSharedResource, typeof(InvalidOperationException), "Invalid property type"); - return this.GetPropertyFromCache((int)effectProperty.ID); + return this.GetPropertyFromCache(effectProperty.ID); } private EffectProperty GetPropertyFromCache(int nPropertyId) { foreach (EffectProperty effectProperty in this.m_propertyCache) { - if ((int)effectProperty.ID == nPropertyId) + if (effectProperty.ID == nPropertyId) return effectProperty; } - return (EffectProperty)null; + return null; } private void RemoteProperty(EffectProperty property, object oValue) @@ -325,29 +325,29 @@ namespace Microsoft.Iris.Render.Graphics switch (property.Type) { case EffectPropertyType.Integer: - this.m_remoteEffect.SendSetProperty((int)property.ID, (int)oValue); + this.m_remoteEffect.SendSetProperty(property.ID, (int)oValue); break; case EffectPropertyType.Float: - this.m_remoteEffect.SendSetProperty((int)property.ID, (float)oValue); + this.m_remoteEffect.SendSetProperty(property.ID, (float)oValue); break; case EffectPropertyType.Vector2: - this.m_remoteEffect.SendSetProperty((int)property.ID, (Vector2)oValue); + this.m_remoteEffect.SendSetProperty(property.ID, (Vector2)oValue); break; case EffectPropertyType.Vector3: - this.m_remoteEffect.SendSetProperty((int)property.ID, (Vector3)oValue); + this.m_remoteEffect.SendSetProperty(property.ID, (Vector3)oValue); break; case EffectPropertyType.Vector4: - this.m_remoteEffect.SendSetProperty((int)property.ID, (Vector4)oValue); + this.m_remoteEffect.SendSetProperty(property.ID, (Vector4)oValue); break; case EffectPropertyType.Image: Image image = (Image)oValue; - RemoteSurface surface1 = (RemoteSurface)null; + RemoteSurface surface1 = null; if (image != null && image.Surface != null) surface1 = image.Surface.RemoteStub; - this.m_remoteEffect.SendSetProperty((int)property.ID, surface1); + this.m_remoteEffect.SendSetProperty(property.ID, surface1); break; case EffectPropertyType.Color: - this.m_remoteEffect.SendSetProperty((int)property.ID, ((ColorF)oValue).ToVector4()); + this.m_remoteEffect.SendSetProperty(property.ID, ((ColorF)oValue).ToVector4()); break; case EffectPropertyType.ImageArray: SharedResource[] resources = ((SharedResourceArray)oValue).Resources; @@ -364,17 +364,17 @@ namespace Microsoft.Iris.Render.Graphics } if (flag) { - this.m_remoteEffect.SendSetProperty((int)property.ID, surfaceArray); + this.m_remoteEffect.SendSetProperty(property.ID, surfaceArray); break; } - this.m_remoteEffect.SendSetProperty((int)property.ID, Effect.s_EmptySurfaceArray); + this.m_remoteEffect.SendSetProperty(property.ID, s_EmptySurfaceArray); break; case EffectPropertyType.Video: VideoStream videoStream = (VideoStream)oValue; - RemoteSurface surface2 = (RemoteSurface)null; + RemoteSurface surface2 = null; if (videoStream != null && videoStream.Surface != null) surface2 = videoStream.Surface.RemoteStub; - this.m_remoteEffect.SendSetProperty((int)property.ID, surface2); + this.m_remoteEffect.SendSetProperty(property.ID, surface2); break; default: Debug2.Throw(false, "Unknown property type"); @@ -382,17 +382,17 @@ namespace Microsoft.Iris.Render.Graphics } } - private void RemoteProperty(EffectProperty property, float flValue) => this.m_remoteEffect.SendSetProperty((int)property.ID, flValue); + private void RemoteProperty(EffectProperty property, float flValue) => this.m_remoteEffect.SendSetProperty(property.ID, flValue); - private void RemoteProperty(EffectProperty property, int nValue) => this.m_remoteEffect.SendSetProperty((int)property.ID, nValue); + private void RemoteProperty(EffectProperty property, int nValue) => this.m_remoteEffect.SendSetProperty(property.ID, nValue); - private void RemoteProperty(EffectProperty property, Vector2 vValue) => this.m_remoteEffect.SendSetProperty((int)property.ID, vValue); + private void RemoteProperty(EffectProperty property, Vector2 vValue) => this.m_remoteEffect.SendSetProperty(property.ID, vValue); - private void RemoteProperty(EffectProperty property, Vector3 vValue) => this.m_remoteEffect.SendSetProperty((int)property.ID, vValue); + private void RemoteProperty(EffectProperty property, Vector3 vValue) => this.m_remoteEffect.SendSetProperty(property.ID, vValue); - private void RemoteProperty(EffectProperty property, Vector4 vValue) => this.m_remoteEffect.SendSetProperty((int)property.ID, vValue); + private void RemoteProperty(EffectProperty property, Vector4 vValue) => this.m_remoteEffect.SendSetProperty(property.ID, vValue); - private void RemoteProperty(EffectProperty property, ColorF color) => this.m_remoteEffect.SendSetProperty((int)property.ID, color.ToVector4()); + private void RemoteProperty(EffectProperty property, ColorF color) => this.m_remoteEffect.SendSetProperty(property.ID, color.ToVector4()); private void AddSharedResourcesToCache() { @@ -440,7 +440,7 @@ namespace Microsoft.Iris.Render.Graphics { if (fUpdateCache && property.IsSharedResource) { - EffectProperty propertyFromCache = this.GetPropertyFromCache((int)property.ID); + EffectProperty propertyFromCache = this.GetPropertyFromCache(property.ID); switch (property.Type) { case EffectPropertyType.Image: @@ -462,27 +462,27 @@ namespace Microsoft.Iris.Render.Graphics { if (image == null) return; - image.RegisterUsage((object)this); + image.RegisterUsage(this); image.ContentReloadedEvent += new Image.ContentReloadedHandler(this.ImageContentReloadedHandler); - image.AddActiveUser((object)this); + image.AddActiveUser(this); } private void AcquireNewResource(SharedResourceArray imageArray) { if (imageArray == null) return; - imageArray.RegisterUsage((object)this); + imageArray.RegisterUsage(this); foreach (SharedResource resource in imageArray.Resources) (resource as Image).ContentReloadedEvent += new Image.ContentReloadedHandler(this.ImageContentReloadedHandler); - imageArray.AddActiveUser((object)this); + imageArray.AddActiveUser(this); } private void AcquireNewResource(VideoStream videoStream) { if (videoStream == null) return; - videoStream.RegisterUsage((object)this); - videoStream.AddActiveUser((object)this); + videoStream.RegisterUsage(this); + videoStream.AddActiveUser(this); } internal void FreeResource(Image image) @@ -490,8 +490,8 @@ namespace Microsoft.Iris.Render.Graphics if (image == null) return; image.ContentReloadedEvent -= new Image.ContentReloadedHandler(this.ImageContentReloadedHandler); - image.RemoveActiveUser((object)this); - image.UnregisterUsage((object)this); + image.RemoveActiveUser(this); + image.UnregisterUsage(this); } internal void FreeResource(SharedResourceArray imageArray) @@ -500,16 +500,16 @@ namespace Microsoft.Iris.Render.Graphics return; foreach (SharedResource resource in imageArray.Resources) (resource as Image).ContentReloadedEvent -= new Image.ContentReloadedHandler(this.ImageContentReloadedHandler); - imageArray.RemoveActiveUser((object)this); - imageArray.UnregisterUsage((object)this); + imageArray.RemoveActiveUser(this); + imageArray.UnregisterUsage(this); } internal void FreeResource(VideoStream videoStream) { if (videoStream == null) return; - videoStream.RemoveActiveUser((object)this); - videoStream.UnregisterUsage((object)this); + videoStream.RemoveActiveUser(this); + videoStream.UnregisterUsage(this); } internal void ImageContentReloadedHandler(Image image) diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/EffectProperty.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/EffectProperty.cs index 11cf2ac..dad7df2 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/EffectProperty.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/EffectProperty.cs @@ -44,7 +44,7 @@ namespace Microsoft.Iris.Render.Graphics if (!fInDispose || this.m_oValue == null) return; this.ModifyUsage(false); - this.m_oValue = (object)null; + this.m_oValue = null; } finally { @@ -65,19 +65,19 @@ namespace Microsoft.Iris.Render.Graphics internal bool IsDynamic { - get => ((int)this.m_propertyType & 128) == 128; + get => (m_propertyType & 128) == 128; set { if (value) - this.m_propertyType |= (byte)128; + this.m_propertyType |= 128; else - this.m_propertyType &= (byte)127; + this.m_propertyType &= 127; } } internal bool IsSharedResource => this.Type == EffectPropertyType.Image || this.Type == EffectPropertyType.ImageArray || this.Type == EffectPropertyType.Video; - internal EffectPropertyType Type => (EffectPropertyType)((uint)this.m_propertyType & 4294967167U); + internal EffectPropertyType Type => (EffectPropertyType)(m_propertyType & 4294967167U); internal byte ID { @@ -129,13 +129,13 @@ namespace Microsoft.Iris.Render.Graphics return; if (fLock) { - oValue.RegisterUsage((object)this); - oValue.AddActiveUser((object)this); + oValue.RegisterUsage(this); + oValue.AddActiveUser(this); } else { - oValue.RemoveActiveUser((object)this); - oValue.UnregisterUsage((object)this); + oValue.RemoveActiveUser(this); + oValue.UnregisterUsage(this); } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/EffectTemplate.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/EffectTemplate.cs index e1ce758..3b52170 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/EffectTemplate.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/EffectTemplate.cs @@ -47,16 +47,16 @@ namespace Microsoft.Iris.Render.Graphics { EffectProperty effectProperty = dynamicProperty.Value; if (effectProperty != null && effectProperty.Value != null && effectProperty.IsSharedResource) - ((SharedRenderObject)effectProperty.Value).UnregisterUsage((object)this); + ((SharedRenderObject)effectProperty.Value).UnregisterUsage(this); effectProperty.Dispose(); } - this.m_dynamicProperties = (Map)null; + this.m_dynamicProperties = null; } if (this.m_cache == null) return; this.m_session.CacheManager.UnregisterCache(this.m_cache); this.m_cache.Dispose(); - this.m_cache = (ObjectCache)null; + this.m_cache = null; } finally { @@ -85,7 +85,7 @@ namespace Microsoft.Iris.Render.Graphics public string Name => this.m_stName; - void IEffectTemplate.AddEffectProperty(string stProp) => this.m_dynamicProperties.Add(stProp, (EffectProperty)null); + void IEffectTemplate.AddEffectProperty(string stProp) => this.m_dynamicProperties.Add(stProp, null); bool IEffectTemplate.Build(EffectInput input) { @@ -105,7 +105,7 @@ namespace Microsoft.Iris.Render.Graphics { EffectProperty effectProperty = dynamicProperty.Value; if (effectProperty != null && effectProperty.Value != null && effectProperty.IsSharedResource) - ((SharedRenderObject)effectProperty.Value).RegisterUsage((object)this); + ((SharedRenderObject)effectProperty.Value).RegisterUsage(this); } this.m_fBuilt = true; return true; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/GdiEffect.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/GdiEffect.cs index 8ecf3d8..d968c25 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/GdiEffect.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/GdiEffect.cs @@ -11,8 +11,8 @@ namespace Microsoft.Iris.Render.Graphics internal class GdiEffect : Effect { internal GdiEffect(GdiEffectTemplate effectTemplate) - : base((EffectTemplate)effectTemplate) - => this.m_remoteEffect = (Microsoft.Iris.Render.Protocols.Splash.Rendering.RemoteEffect)this.m_effectTemplate.Session.BuildRemoteGdiEffect(this); + : base(effectTemplate) + => this.m_remoteEffect = this.m_effectTemplate.Session.BuildRemoteGdiEffect(this); internal override void RemoteEffect() { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/GdiEffectTemplate.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/GdiEffectTemplate.cs index 1a1a3ca..02be347 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/GdiEffectTemplate.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/GdiEffectTemplate.cs @@ -23,7 +23,7 @@ namespace Microsoft.Iris.Render.Graphics public override IEffect CreateInstance(object objUser) { Debug2.Validate(this.m_fBuilt, typeof(InvalidOperationException), "Cannot create instance if the template is not built"); - GdiEffect gdiEffect = (GdiEffect)null; + GdiEffect gdiEffect = null; if (this.m_cache != null) gdiEffect = (GdiEffect)this.m_cache.Remove(objUser); if (gdiEffect == null) @@ -33,7 +33,7 @@ namespace Microsoft.Iris.Render.Graphics gdiEffect.RegisterUsage(objUser); gdiEffect.RemoteEffect(); } - return (IEffect)gdiEffect; + return gdiEffect; } protected override bool Build(EffectInput input) diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/GdiGraphicsDevice.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/GdiGraphicsDevice.cs index b95226c..a3e512a 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/GdiGraphicsDevice.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/GdiGraphicsDevice.cs @@ -31,7 +31,7 @@ namespace Microsoft.Iris.Render.Graphics this.m_fAllowAnimations = true; this.m_fEnableBackBuffer = true; this.m_fSystemMemoryBitmaps = false; - this.m_clrBackground = new ColorF((int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue); + this.m_clrBackground = new ColorF(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); this.m_deviceType = GraphicsDeviceType.Gdi; this.m_graphicsCaps = session.GetGraphicsCaps(this.m_deviceType); this.m_renderingQuality = GraphicsRenderingQuality.MinQuality; @@ -41,17 +41,17 @@ namespace Microsoft.Iris.Render.Graphics { if (fInDispose && this.m_remoteDevice != null) this.m_remoteDevice.Dispose(); - this.m_remoteDevice = (RemoteGdiDevice)null; + this.m_remoteDevice = null; base.Dispose(fInDispose); } RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteDevice.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteDevice = (RemoteGdiDevice)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteDevice = null; public override bool IsVideoComposited => false; - internal override RemoteDevice RemoteDevice => (RemoteDevice)this.m_remoteDevice; + internal override RemoteDevice RemoteDevice => m_remoteDevice; public override bool CanPlayAnimations => this.AllowAnimations; @@ -178,6 +178,6 @@ namespace Microsoft.Iris.Render.Graphics public override bool CanPlayAnimationType(AnimationInputType type) => false; - internal override EffectTemplate CreateEffectTemplate(string stName) => (EffectTemplate)new GdiEffectTemplate(this.m_session, (GraphicsDevice)this, stName); + internal override EffectTemplate CreateEffectTemplate(string stName) => new GdiEffectTemplate(this.m_session, this, stName); } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Gradient.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Gradient.cs index 2bb7d7c..c0800a0 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Gradient.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Gradient.cs @@ -25,7 +25,7 @@ namespace Microsoft.Iris.Render.Graphics session.AssertOwningThread(); Debug2.Validate(remoteDevice != null, typeof(ArgumentNullException), "Must have a valid remoteDevice in-param"); RenderPort renderingPort = session.RenderingPort; - RENDERHANDLE renderhandle = renderingPort.AllocHandle((IRenderHandleOwner)this); + RENDERHANDLE renderhandle = renderingPort.AllocHandle(this); try { remoteDevice.SendCreateGradient(renderhandle); @@ -44,7 +44,7 @@ namespace Microsoft.Iris.Render.Graphics { if (fInDispose && this.m_remoteGradient != null) this.m_remoteGradient.Dispose(); - this.m_remoteGradient = (RemoteGradient)null; + this.m_remoteGradient = null; } finally { @@ -81,7 +81,7 @@ namespace Microsoft.Iris.Render.Graphics get => this.m_flOffset; set { - if ((double)this.m_flOffset == (double)value) + if (m_flOffset == (double)value) return; this.m_flOffset = value; this.m_remoteGradient.SendSetOffset(this.m_flOffset); @@ -94,7 +94,7 @@ namespace Microsoft.Iris.Render.Graphics RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteGradient.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteGradient = (RemoteGradient)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteGradient = null; internal RemoteGradient RemoteGradient => this.m_remoteGradient; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/GraphicsDevice.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/GraphicsDevice.cs index 4eb7588..912f629 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/GraphicsDevice.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/GraphicsDevice.cs @@ -31,7 +31,7 @@ namespace Microsoft.Iris.Render.Graphics private readonly DeferredHandler m_cbTrackerUpdate; private bool m_fQueuedTrackerUpdate; protected Size m_sizeGutterPxl; - private static readonly TrackerBase.ObjectTest s_testUnused = new TrackerBase.ObjectTest(GraphicsDevice.TestIsUnused); + private static readonly TrackerBase.ObjectTest s_testUnused = new TrackerBase.ObjectTest(TestIsUnused); private bool m_fBeginCaptureBackBuffer; private bool m_fEndCaptureBackBuffer; @@ -39,8 +39,8 @@ namespace Microsoft.Iris.Render.Graphics { this.m_session = session; this.m_stDisplayName = stDisplayName; - this.m_trackerSurfacePools = new ObjectTracker(session, (object)this); - this.m_trackerWindows = new ObjectTracker(session, (object)this); + this.m_trackerSurfacePools = new ObjectTracker(session, this); + this.m_trackerWindows = new ObjectTracker(session, this); this.m_cRenderGeneration = 1U; this.m_cbRestartRenderer = new DeferredHandler(this.OnRestartRenderer); this.m_cbTrackerUpdate = new DeferredHandler(this.OnTrackerUpdate); @@ -62,10 +62,10 @@ namespace Microsoft.Iris.Render.Graphics if (this.m_trackerWindows != null) this.m_trackerWindows.Dispose(); } - this.m_trackerWindows = (ObjectTracker)null; - this.m_trackerSurfacePools = (ObjectTracker)null; - this.m_manSurfaces = (SurfaceManager)null; - this.m_session = (RenderSession)null; + this.m_trackerWindows = null; + this.m_trackerSurfacePools = null; + this.m_manSurfaces = null; + this.m_session = null; } finally { @@ -101,21 +101,21 @@ namespace Microsoft.Iris.Render.Graphics internal void CreateSurfacePool(SurfacePool spNew, RENDERHANDLE handle, SurfaceFormat nFormat) { - this.CreateSurfacePoolWorker((object)spNew, (object)handle, nFormat); - this.m_trackerSurfacePools.AddObject((object)spNew); + this.CreateSurfacePoolWorker(spNew, handle, nFormat); + this.m_trackerSurfacePools.AddObject(spNew); } internal void OnSurfacePoolDispose() { if (this.m_fQueuedTrackerUpdate) return; - this.m_session.DeferredInvoke((Delegate)this.m_cbTrackerUpdate, (object)null, DeferredInvokePriority.Idle, new TimeSpan(0, 0, 10)); + this.m_session.DeferredInvoke(m_cbTrackerUpdate, null, DeferredInvokePriority.Idle, new TimeSpan(0, 0, 10)); this.m_fQueuedTrackerUpdate = true; } private void OnTrackerUpdate(object args) { - this.m_trackerSurfacePools.RemoveObjects(GraphicsDevice.s_testUnused); + this.m_trackerSurfacePools.RemoveObjects(s_testUnused); this.m_fQueuedTrackerUpdate = false; } @@ -132,13 +132,13 @@ namespace Microsoft.Iris.Render.Graphics internal void CreateVideoPool(VideoPool spNew, RENDERHANDLE handle) { - this.CreateVideoPoolWorker((object)spNew, (object)handle); - this.m_trackerSurfacePools.AddObject((object)spNew); + this.CreateVideoPoolWorker(spNew, handle); + this.m_trackerSurfacePools.AddObject(spNew); } - internal virtual void CreateVideoPoolWorker(object oSurfacePool, object oHandle) => Debug2.Validate(false, (Type)null, "GraphicsDevice type does not support Video Pool"); + internal virtual void CreateVideoPoolWorker(object oSurfacePool, object oHandle) => Debug2.Validate(false, null, "GraphicsDevice type does not support Video Pool"); - internal void RegisterWindow(RenderWindow win) => this.m_trackerWindows.AddObject((object)win); + internal void RegisterWindow(RenderWindow win) => this.m_trackerWindows.AddObject(win); public virtual bool CanPlayAnimationType(AnimationInputType type) => false; @@ -148,7 +148,7 @@ namespace Microsoft.Iris.Render.Graphics internal Image CreateImage(string identifier, ContentNotifyHandler handler) => new Image(this.m_session, this.m_manSurfaces, identifier, handler, this.m_sizeGutterPxl); - protected virtual object InternalComputeBreakdown() => (object)new SurfaceManager.VideoMemoryBreakdown(); + protected virtual object InternalComputeBreakdown() => new SurfaceManager.VideoMemoryBreakdown(); private void RestoreAllSurfaces() { @@ -179,7 +179,7 @@ namespace Microsoft.Iris.Render.Graphics this.ResetDeviceContent(); if (this.m_fQueuedRestart) return; - this.m_session.DeferredInvoke((Delegate)this.m_cbRestartRenderer, (object)null, DeferredInvokePriority.Low); + this.m_session.DeferredInvoke(m_cbRestartRenderer, null, DeferredInvokePriority.Low); this.m_fQueuedRestart = true; } } @@ -229,7 +229,7 @@ namespace Microsoft.Iris.Render.Graphics { Debug2.Validate(this.m_fBeginCaptureBackBuffer, typeof(InvalidOperationException), "BeginCaptureBackBuffer() called but m_fBeginCaptureBackBuffer = false"); Debug2.Validate(!this.m_fEndCaptureBackBuffer, typeof(InvalidOperationException), "EndCaptureBackBuffer() called but m_fEndCaptureBackBuffer = true"); - this.m_session.DeferredInvoke((Delegate)new DeferredHandler(this.DeferredEndCaptureBackBuffer), (object)null, DeferredInvokePriority.VisualUpdate); + this.m_session.DeferredInvoke(new DeferredHandler(this.DeferredEndCaptureBackBuffer), null, DeferredInvokePriority.VisualUpdate); } private void DeferredEndCaptureBackBuffer(object args) diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Image.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Image.cs index 4935033..315f303 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Image.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Image.cs @@ -48,11 +48,11 @@ namespace Microsoft.Iris.Render.Graphics { if (fInDispose && this.m_dataTracker != null) MessagingSession.Current.ReturnDataBufferTracker(this.m_dataTracker); - this.m_surface = (Surface)null; - this.m_surfaceManager = (SurfaceManager)null; - this.m_dataTracker = (DataBufferTracker)null; - this.m_handlerContent = (ContentNotifyHandler)null; - this.m_session = (RenderSession)null; + this.m_surface = null; + this.m_surfaceManager = null; + this.m_dataTracker = null; + this.m_handlerContent = null; + this.m_session = null; } finally { @@ -87,7 +87,7 @@ namespace Microsoft.Iris.Render.Graphics { if (this.m_surface != surface) return; - this.m_surface = (Surface)null; + this.m_surface = null; } void ISurfaceContentOwner.OnRestoreContent(Surface surface) @@ -112,7 +112,7 @@ namespace Microsoft.Iris.Render.Graphics this.m_session.AssertOwningThread(); bool flag1 = false; bool flag2 = false; - DataBuffer buffer = (DataBuffer)null; + DataBuffer buffer = null; try { SurfaceFormat nFormat = SurfaceFormatInfo.FromImageFormat(imageFormat); @@ -121,15 +121,15 @@ namespace Microsoft.Iris.Render.Graphics if (this.m_surface != null && (this.m_imageFormat != imageFormat || this.m_sizeImage != sizeImage || this.m_sizeGutterPxl != this.m_surface.GutterSize)) { if (this.InUse) - this.m_surface.RemoveActiveUser((object)this); - this.m_surface = (Surface)null; + this.m_surface.RemoveActiveUser(this); + this.m_surface = null; } if (this.m_surface == null) { - this.m_surface = this.m_surfaceManager.RequestSurface((ISurfaceContentOwner)this, nFormat, sizeImage, this.m_sizeGutterPxl); + this.m_surface = this.m_surfaceManager.RequestSurface(this, nFormat, sizeImage, this.m_sizeGutterPxl); flag2 = true; if (this.InUse) - this.m_surface.AddActiveUser((object)this); + this.m_surface.AddActiveUser(this); } IntPtr num1 = IntPtr.Zero; if (this.m_session.IsForeignByteOrderOnWindowing) @@ -163,7 +163,7 @@ namespace Microsoft.Iris.Render.Graphics { if (buffer != null) this.StopTracking(buffer); - this.m_surface = (Surface)null; + this.m_surface = null; } } } @@ -182,7 +182,7 @@ namespace Microsoft.Iris.Render.Graphics ((IImage)this).LoadContent(this.m_imageFormat, this.m_sizeImage, this.m_loadInfo.nStride, this.m_loadInfo.rgAppData); } else - this.m_handlerContent(ContentNotification.Acquire, (IImage)this, IntPtr.Zero); + this.m_handlerContent(ContentNotification.Acquire, this, IntPtr.Zero); } Surface surface = this.m_surface; } @@ -194,13 +194,13 @@ namespace Microsoft.Iris.Render.Graphics if (this.m_surface == null) this.AcquireContent(); else - this.m_surface.AddActiveUser((object)this); + this.m_surface.AddActiveUser(this); } else { if (this.m_surface == null) return; - this.m_surface.RemoveActiveUser((object)this); + this.m_surface.RemoveActiveUser(this); } } @@ -223,15 +223,15 @@ namespace Microsoft.Iris.Render.Graphics if (this.m_dataTracker != null) { MessagingSession.Current.ReturnDataBufferTracker(this.m_dataTracker); - this.m_dataTracker = (DataBufferTracker)null; + this.m_dataTracker = null; } - this.m_dataTracker = MessagingSession.Current.CreateDataBufferTracker((object)this); + this.m_dataTracker = MessagingSession.Current.CreateDataBufferTracker(this); } DataBufferCleanupInfo bufferCleanupInfo = new DataBufferCleanupInfo(); bufferCleanupInfo.rgConvertData = rgConvertData; bufferCleanupInfo.imageLoadInfo = imageLoadInfo; - DataBufferTracker.CleanupEventHandler handler = new DataBufferTracker.CleanupEventHandler(Image.OnDataBufferConsumed); - this.m_dataTracker.Track(buffer, handler, (object)bufferCleanupInfo); + DataBufferTracker.CleanupEventHandler handler = new DataBufferTracker.CleanupEventHandler(OnDataBufferConsumed); + this.m_dataTracker.Track(buffer, handler, bufferCleanupInfo); this.m_loadInfo = imageLoadInfo; } @@ -256,12 +256,12 @@ namespace Microsoft.Iris.Render.Graphics if (imageLoadInfo.handlerNotify != null) { imageLoadInfo.imageOwner.m_insideReleaseCallback = true; - imageLoadInfo.handlerNotify(ContentNotification.Release, (IImage)imageLoadInfo.imageOwner, imageLoadInfo.rgAppData); + imageLoadInfo.handlerNotify(ContentNotification.Release, imageLoadInfo.imageOwner, imageLoadInfo.rgAppData); imageLoadInfo.imageOwner.m_insideReleaseCallback = false; } imageLoadInfo.rgAppData = IntPtr.Zero; - imageLoadInfo.handlerNotify = (ContentNotifyHandler)null; - imageLoadInfo.imageOwner = (Image)null; + imageLoadInfo.handlerNotify = null; + imageLoadInfo.imageOwner = null; } if (!(contextData.rgConvertData != IntPtr.Zero)) return; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/NtGraphicsDevice.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/NtGraphicsDevice.cs index bada603..fb34a36 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/NtGraphicsDevice.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/NtGraphicsDevice.cs @@ -29,7 +29,7 @@ namespace Microsoft.Iris.Render.Graphics { if (fInDispose && this.m_remoteDevice != null) this.m_remoteDevice.Dispose(); - this.m_remoteDevice = (RemoteNtDevice)null; + this.m_remoteDevice = null; } finally { @@ -39,11 +39,11 @@ namespace Microsoft.Iris.Render.Graphics RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteDevice.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteDevice = (RemoteNtDevice)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteDevice = null; internal RemoteNtDevice RemoteStub => this.m_remoteDevice; - internal override RemoteDevice RemoteDevice => (RemoteDevice)this.m_remoteDevice; + internal override RemoteDevice RemoteDevice => m_remoteDevice; public Size EstimatedMaxPerformantResolution { @@ -134,18 +134,18 @@ namespace Microsoft.Iris.Render.Graphics if (totalVideoMemory > 67108864UL) sizeSurfacePxl = totalVideoMemory <= 134217728UL ? new Size(1920, 1280) : new Size(2048, 1600); videoMemoryBreakdown.sizeLargeBuffersPxl = sizeSurfacePxl; - uint num2 = NtGraphicsDevice.GetPixelCB(sizeSurfacePxl) * 3U; - ulong num3 = num1 - (ulong)num2; + uint num2 = GetPixelCB(sizeSurfacePxl) * 3U; + ulong num3 = num1 - num2; videoMemoryBreakdown.cbVideo = 16777216U; - ulong num4 = num3 - (ulong)videoMemoryBreakdown.cbVideo; + ulong num4 = num3 - videoMemoryBreakdown.cbVideo; videoMemoryBreakdown.sizeBackgroundPxl = new Size(1024, 768); - uint pixelCb = NtGraphicsDevice.GetPixelCB(videoMemoryBreakdown.sizeBackgroundPxl); - ulong num5 = num4 - (ulong)pixelCb - totalVideoMemory / 20UL; + uint pixelCb = GetPixelCB(videoMemoryBreakdown.sizeBackgroundPxl); + ulong num5 = num4 - pixelCb - totalVideoMemory / 20UL; videoMemoryBreakdown.sizeDynamicPoolPxl = dedicatedVideoMemory >= 121634816UL ? new Size(2048, 2048) : new Size(1920, 548); uint num6 = (uint)(videoMemoryBreakdown.sizeDynamicPoolPxl.Width * videoMemoryBreakdown.sizeDynamicPoolPxl.Height * 4); - for (uint index = 33554432; videoMemoryBreakdown.cbMinimumPool < index && num5 > (ulong)num6; num5 -= (ulong)num6) + for (uint index = 33554432; videoMemoryBreakdown.cbMinimumPool < index && num5 > num6; num5 -= num6) videoMemoryBreakdown.cbMinimumPool += num6; - return (object)videoMemoryBreakdown; + return videoMemoryBreakdown; } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/NullGraphicsDevice.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/NullGraphicsDevice.cs index aee90dd..21d5ee5 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/NullGraphicsDevice.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/NullGraphicsDevice.cs @@ -26,17 +26,17 @@ namespace Microsoft.Iris.Render.Graphics { if (fInDispose && this.m_remoteDevice != null) this.m_remoteDevice.Dispose(); - this.m_remoteDevice = (RemoteNullDevice)null; + this.m_remoteDevice = null; base.Dispose(fInDispose); } RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteDevice.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteDevice = (RemoteNullDevice)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteDevice = null; public override bool IsVideoComposited => false; - internal override RemoteDevice RemoteDevice => (RemoteDevice)this.m_remoteDevice; + internal override RemoteDevice RemoteDevice => m_remoteDevice; public override bool CanPlayAnimations => false; @@ -57,7 +57,7 @@ namespace Microsoft.Iris.Render.Graphics internal override EffectTemplate CreateEffectTemplate(string stName) { Debug2.Throw(false, "Not yet implemented"); - return (EffectTemplate)null; + return null; } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Sprite.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Sprite.cs index 21eaaf6..234378b 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Sprite.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Sprite.cs @@ -23,7 +23,7 @@ namespace Microsoft.Iris.Render.Graphics { this.m_remoteSprite = session.BuildRemoteSprite(this, window); this.m_remoteSprite.SendSetVisible(true); - this.m_remoteVisual = (RemoteVisual)this.m_remoteSprite; + this.m_remoteVisual = m_remoteSprite; } protected override void Dispose(bool fInDispose) @@ -32,12 +32,12 @@ namespace Microsoft.Iris.Render.Graphics { if (fInDispose && this.m_effect != null) { - this.m_effect.UnregisterUsage((object)this); - this.m_effect = (Effect)null; + this.m_effect.UnregisterUsage(this); + this.m_effect = null; } - this.PropertyManager.RemoveCoordmapProp((Visual)this); - this.m_remoteSprite = (RemoteSprite)null; - this.m_effect = (Effect)null; + this.PropertyManager.RemoveCoordmapProp(this); + this.m_remoteSprite = null; + this.m_effect = null; } finally { @@ -95,7 +95,7 @@ namespace Microsoft.Iris.Render.Graphics IEffect ISprite.Effect { - get => (IEffect)this.Effect; + get => Effect; set => this.Effect = (Effect)value; } @@ -108,11 +108,11 @@ namespace Microsoft.Iris.Render.Graphics if (this.m_effect == effect) return; if (this.m_effect != null) - this.m_effect.UnregisterUsage((object)this); + this.m_effect.UnregisterUsage(this); this.m_effect = effect; if (this.m_effect != null) - this.m_effect.RegisterUsage((object)this); - this.m_remoteSprite.SendSetEffect(this.m_effect == null ? (RemoteEffect)null : this.m_effect.RemoteStub); + this.m_effect.RegisterUsage(this); + this.m_remoteSprite.SendSetEffect(this.m_effect == null ? null : this.m_effect.RemoteStub); } } @@ -129,27 +129,27 @@ namespace Microsoft.Iris.Render.Graphics void ISprite.SetNineGrid(int left, int top, int right, int bottom) { Debug2.Validate(left >= 0 && right >= 0 && top >= 0 && bottom >= 0, typeof(ArgumentNullException), "invalid nine grid params"); - this.PropertyManager.RemoveCoordmapProp((Visual)this); + this.PropertyManager.RemoveCoordmapProp(this); this.m_remoteSprite.SendSetNineGrid(left, top, right, bottom); - this.SetPropFlag(Visual.PropId.MaxDynamicProp, true); + this.SetPropFlag(PropId.MaxDynamicProp, true); } void ISprite.SetCoordMap(int idxLayer, CoordMap coordMap) { Debug2.Validate(idxLayer >= 0, typeof(ArgumentOutOfRangeException), "idxLayer must be >= 0"); Debug2.Validate(idxLayer < 4, typeof(ArgumentOutOfRangeException), "quick-check, currently we only support 4 layers/stages"); - if (this.IsPropFlagSet(Visual.PropId.MaxDynamicProp)) + if (this.IsPropFlagSet(PropId.MaxDynamicProp)) { this.m_remoteSprite.SendClearCoordMaps(); - this.SetPropFlag(Visual.PropId.MaxDynamicProp, false); + this.SetPropFlag(PropId.MaxDynamicProp, false); } if (!this.UpdateCoordMap(idxLayer, coordMap)) return; this.m_remoteSprite.SendClearCoordMaps(); - if (!this.IsDynamicValueSet(Visual.PropId.CoordMap)) + if (!this.IsDynamicValueSet(PropId.CoordMap)) return; ArrayList result; - this.PropertyManager.GetCoordmapProp((Visual)this, out result); + this.PropertyManager.GetCoordmapProp(this, out result); foreach (Sprite.CoordMapEntry coordMapEntry in result) { foreach (CoordMap.CoordMapSample rampSample in coordMapEntry.coordMap.RampSamples) @@ -160,18 +160,18 @@ namespace Microsoft.Iris.Render.Graphics private bool UpdateCoordMap(int idxLayer, CoordMap coordMap) { ArrayList result; - if (this.IsDynamicValueSet(Visual.PropId.CoordMap)) + if (this.IsDynamicValueSet(PropId.CoordMap)) { - this.PropertyManager.GetCoordmapProp((Visual)this, out result); + this.PropertyManager.GetCoordmapProp(this, out result); } else { if (coordMap == null) return false; result = new ArrayList(); - this.PropertyManager.SetCoordmapProp((Visual)this, result); + this.PropertyManager.SetCoordmapProp(this, result); } - Sprite.CoordMapEntry coordMapEntry1 = (Sprite.CoordMapEntry)null; + Sprite.CoordMapEntry coordMapEntry1 = null; foreach (Sprite.CoordMapEntry coordMapEntry2 in result) { if (coordMapEntry2.idxLayer == idxLayer) @@ -184,11 +184,11 @@ namespace Microsoft.Iris.Render.Graphics { if (coordMap == null) return false; - result.Add((object)new Sprite.CoordMapEntry(idxLayer, coordMap)); + result.Add(new Sprite.CoordMapEntry(idxLayer, coordMap)); return true; } if (coordMap == null) - result.Remove((object)coordMapEntry1); + result.Remove(coordMapEntry1); else coordMapEntry1.coordMap = coordMap; return true; @@ -196,19 +196,19 @@ namespace Microsoft.Iris.Render.Graphics private void ResetCoordmaps() { - if (this.IsPropFlagSet(Visual.PropId.MaxDynamicProp) || this.IsDynamicValueSet(Visual.PropId.CoordMap)) + if (this.IsPropFlagSet(PropId.MaxDynamicProp) || this.IsDynamicValueSet(PropId.CoordMap)) { this.m_remoteSprite.SendClearCoordMaps(); - this.SetPropFlag(Visual.PropId.MaxDynamicProp, false); + this.SetPropFlag(PropId.MaxDynamicProp, false); } - this.PropertyManager.RemoveCoordmapProp((Visual)this); + this.PropertyManager.RemoveCoordmapProp(this); } internal override void Reset() { base.Reset(); this.ResetCoordmaps(); - this.Effect = (Effect)null; + this.Effect = null; } private class CoordMapEntry diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Surface.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Surface.cs index 46b55bf..7bcbd65 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Surface.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Surface.cs @@ -45,14 +45,14 @@ namespace Microsoft.Iris.Render.Graphics { this.m_surfaceOwner = surfaceOwner; this.m_poolOwner = poolOwner; - this.m_remoteSurface = (RemoteSurface)null; + this.m_remoteSurface = null; this.m_sizeContentPxl = new Size(); this.m_sizeGutterPxl = sizeGutterPxl; RenderPort renderingPort = this.m_poolOwner.Device.Session.RenderingPort; RENDERHANDLE handle = rhExternal; if (handle == RENDERHANDLE.NULL) { - handle = renderingPort.AllocHandle((IRenderHandleOwner)this); + handle = renderingPort.AllocHandle(this); this.m_fPrimaryOwner = true; } try @@ -65,7 +65,7 @@ namespace Microsoft.Iris.Render.Graphics else { this.m_nInstanceID = this.m_poolOwner.AttachSurface(this); - this.m_remoteSurface = RemoteSurface.CreateFromExternalHandle(renderingPort, handle, (IRenderHandleOwner)this); + this.m_remoteSurface = RemoteSurface.CreateFromExternalHandle(renderingPort, handle, this); } this.m_sizeContentPxl = sizeContentPxl; Size sizeStoragePxl = new Size(sizeContentPxl.Width + this.m_sizeGutterPxl.Width * 2, sizeContentPxl.Height + this.m_sizeGutterPxl.Height * 2); @@ -77,7 +77,7 @@ namespace Microsoft.Iris.Render.Graphics { if (this.m_remoteSurface == null) { - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); if (this.m_fPrimaryOwner) renderingPort.FreeHandle(handle); } @@ -102,7 +102,7 @@ namespace Microsoft.Iris.Render.Graphics this.m_nInstanceID = 0; } } - this.m_remoteSurface = (RemoteSurface)null; + this.m_remoteSurface = null; } finally { @@ -112,7 +112,7 @@ namespace Microsoft.Iris.Render.Graphics RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteSurface.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteSurface = (RemoteSurface)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteSurface = null; internal RemoteSurface RemoteStub => this.m_remoteSurface; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/SurfaceManager.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/SurfaceManager.cs index e8a8fc5..b3462a7 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/SurfaceManager.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/SurfaceManager.cs @@ -47,9 +47,9 @@ namespace Microsoft.Iris.Render.Graphics alDynamicSet.Dispose(); this.CollectLargeSurfaces(); } - this.m_listLargeSurfaces = (LinkedList)null; - this.m_alDynamicSets = (ArrayList)null; - this.m_device = (GraphicsDevice)null; + this.m_listLargeSurfaces = null; + this.m_alDynamicSets = null; + this.m_device = null; } finally { @@ -59,10 +59,10 @@ namespace Microsoft.Iris.Render.Graphics private void PreallocateDynamicPools(SurfaceManager.VideoMemoryBreakdown vmb) { - this.m_alDynamicSets.Add((object)new DynamicPoolSet(this.m_device, SurfaceFormat.ARGB32)); + this.m_alDynamicSets.Add(new DynamicPoolSet(this.m_device, SurfaceFormat.ARGB32)); int num = 0; int index = 0; - while ((long)num < (long)vmb.cbMinimumPool) + while (num < vmb.cbMinimumPool) { DynamicPool dynamicPool = ((DynamicPoolSet)this.m_alDynamicSets[index]).AllocateDynamicPool(vmb.sizeDynamicPoolPxl, 8, vmb.ThresholdHeightPxl); num += dynamicPool.TotalSize.Width * dynamicPool.TotalSize.Height * SurfaceFormatInfo.GetBitsPerPixel(dynamicPool.Format) / 8; @@ -86,8 +86,8 @@ namespace Microsoft.Iris.Render.Graphics Debug2.Validate(sizeContentPxl.Width > 0 && sizeContentPxl.Height > 0, typeof(ArgumentOutOfRangeException), "Must provide positive area for surface"); bool flag1 = false; bool flag2 = false; - Surface surface = (Surface)null; - DynamicPoolSet dynamicPoolSet = (DynamicPoolSet)null; + Surface surface = null; + DynamicPoolSet dynamicPoolSet = null; for (int index = 0; index < this.m_alDynamicSets.Count; ++index) { dynamicPoolSet = (DynamicPoolSet)this.m_alDynamicSets[index]; @@ -133,7 +133,7 @@ namespace Microsoft.Iris.Render.Graphics { DestroyWhenEmpty = true }, surfaceOwner, sizeContentPxl); - surface.RegisterUsage((object)this); + surface.RegisterUsage(this); } if (flag2) this.m_listLargeSurfaces.AddLast(new LinkedListNode(surface)); @@ -159,13 +159,13 @@ namespace Microsoft.Iris.Render.Graphics Debug2.Validate(nPoolID > 0, typeof(ArgumentException), "Must have valid ID"); Debug2.Validate(this.m_device.IsSurfaceFormatSupported(nFormat), typeof(ArgumentException), "Surface format is not supported"); Debug2.Validate(sizeStoragePxl.Width > 0 && sizeStoragePxl.Height > 0, typeof(ArgumentException), "Must have valid surface size"); - Debug2.Validate(this.m_dictNamedPools[nPoolID] == null, (Type)null, "SurfacePool must not already be allocated"); + Debug2.Validate(this.m_dictNamedPools[nPoolID] == null, null, "SurfacePool must not already be allocated"); SurfacePool surfacePool = new SurfacePool(this.m_device, sizeStoragePxl, nFormat); try { surfacePool.DestroyWhenEmpty = false; this.m_dictNamedPools[nPoolID] = surfacePool; - surfacePool = (SurfacePool)null; + surfacePool = null; } finally { @@ -175,9 +175,9 @@ namespace Microsoft.Iris.Render.Graphics public void FreeNamedSurface(int nPoolID) { - Debug2.Validate(nPoolID > 0, (Type)null, "Must have valid ID"); + Debug2.Validate(nPoolID > 0, null, "Must have valid ID"); SurfacePool dictNamedPool = this.m_dictNamedPools[nPoolID]; - Debug2.Validate(dictNamedPool != null, (Type)null, "Must have previously allocated pool"); + Debug2.Validate(dictNamedPool != null, null, "Must have previously allocated pool"); this.m_dictNamedPools.Remove(nPoolID); dictNamedPool.Dispose(); } @@ -201,7 +201,7 @@ namespace Microsoft.Iris.Render.Graphics Surface surface = node.Value; if (!surface.InUse) { - surface.UnregisterUsage((object)this); + surface.UnregisterUsage(this); this.m_listLargeSurfaces.Remove(node); } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/SurfacePool.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/SurfacePool.cs index 77726ab..a1822b8 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/SurfacePool.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/SurfacePool.cs @@ -48,13 +48,13 @@ namespace Microsoft.Iris.Render.Graphics this.m_session = device.Session; Debug2.Validate(this.m_session != null, typeof(InvalidOperationException), "Creating a SurfacePool requires a RenderSession"); this.m_session.AssertOwningThread(); - this.m_remotePool = (RemoteSurfacePool)null; + this.m_remotePool = null; this.m_sizeStoragePxl = new Size(); this.m_nFormat = nFormat; RENDERHANDLE handle = rhExternal; if (handle == RENDERHANDLE.NULL) { - handle = this.m_session.RenderingPort.AllocHandle((IRenderHandleOwner)this); + handle = this.m_session.RenderingPort.AllocHandle(this); this.m_fPrimaryOwner = true; } try @@ -65,12 +65,12 @@ namespace Microsoft.Iris.Render.Graphics { if (this.m_remotePool == null) { - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); if (this.m_fPrimaryOwner) this.m_session.RenderingPort.FreeHandle(handle); } } - this.m_trackerSurfaces = new ObjectTracker(this.m_session, (object)this); + this.m_trackerSurfaces = new ObjectTracker(this.m_session, this); if (this.m_fPrimaryOwner) return; this.m_nStorage = SurfacePoolAllocationResult.Immoveable; @@ -84,7 +84,7 @@ namespace Microsoft.Iris.Render.Graphics this.m_remotePool = RemoteSurfacePool.CreateFromHandle(this.m_session.RenderingPort, handle); } else - this.m_remotePool = RemoteSurfacePool.CreateFromExternalHandle(this.m_session.RenderingPort, handle, (IRenderHandleOwner)this); + this.m_remotePool = RemoteSurfacePool.CreateFromExternalHandle(this.m_session.RenderingPort, handle, this); } protected override void Dispose(bool fInDispose) @@ -94,16 +94,16 @@ namespace Microsoft.Iris.Render.Graphics if (fInDispose) { if (this.m_effect != null) - this.m_effect.UnregisterUsage((object)this); + this.m_effect.UnregisterUsage(this); this.DisposeAllSurfaces(); this.m_trackerSurfaces.Dispose(); this.m_remotePool.Dispose(); this.m_device.OnSurfacePoolDispose(); } - this.m_effect = (Effect)null; - this.m_remotePool = (RemoteSurfacePool)null; - this.m_trackerSurfaces = (ObjectTracker)null; - this.m_device = (GraphicsDevice)null; + this.m_effect = null; + this.m_remotePool = null; + this.m_trackerSurfaces = null; + this.m_device = null; } finally { @@ -113,7 +113,7 @@ namespace Microsoft.Iris.Render.Graphics RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remotePool.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remotePool = (RemoteSurfacePool)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remotePool = null; public Size StorageSize => this.m_sizeStoragePxl; @@ -135,9 +135,9 @@ namespace Microsoft.Iris.Render.Graphics { get { - IList list = (IList)null; + IList list = null; if (this.m_trackerSurfaces != null) - list = (IList)this.m_trackerSurfaces.LiveObjects; + list = m_trackerSurfaces.LiveObjects; return list; } } @@ -153,11 +153,11 @@ namespace Microsoft.Iris.Render.Graphics if (this.m_effect == effect) return; if (this.m_effect != null) - this.m_effect.UnregisterUsage((object)this); + this.m_effect.UnregisterUsage(this); this.m_effect = effect; if (this.m_effect != null) - this.m_effect.RegisterUsage((object)this); - this.m_remotePool.SendSetEffect(this.m_effect == null ? (RemoteEffect)null : this.m_effect.RemoteStub); + this.m_effect.RegisterUsage(this); + this.m_remotePool.SendSetEffect(this.m_effect == null ? null : this.m_effect.RemoteStub); } } @@ -167,7 +167,7 @@ namespace Microsoft.Iris.Render.Graphics return this.AttachSurface(spNew); } - internal int AttachSurface(Surface spNew) => this.m_trackerSurfaces.AddObject((object)spNew); + internal int AttachSurface(Surface spNew) => this.m_trackerSurfaces.AddObject(spNew); internal void DisposeAllSurfaces() { @@ -175,7 +175,7 @@ namespace Microsoft.Iris.Render.Graphics return; ArrayList liveObjects = this.m_trackerSurfaces.LiveObjects; for (int index = 0; index < liveObjects.Count; ++index) - ((SharedRenderObject)liveObjects[index]).UnregisterUsage((object)this); + ((SharedRenderObject)liveObjects[index]).UnregisterUsage(this); } internal void NotifyDisposeSurface(int nID) @@ -206,7 +206,7 @@ namespace Microsoft.Iris.Render.Graphics return; int surfacePoolInstanceId = surCur.SurfacePoolInstanceID; surfacePool.NotifyDisposeSurface(surfacePoolInstanceId); - int nNewInstanceID = poolNew.m_trackerSurfaces.AddObject((object)surCur); + int nNewInstanceID = poolNew.m_trackerSurfaces.AddObject(surCur); surCur.NotifyNewPool(poolNew, nNewInstanceID); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/TreeNode.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/TreeNode.cs index f1d7ea2..981c2e2 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/TreeNode.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/TreeNode.cs @@ -33,10 +33,10 @@ namespace Microsoft.Iris.Render.Graphics { if (fInDispose) { - this.ChangeParent((TreeNode)null); + this.ChangeParent(null); this.RemoveAllChildren(); } - this.m_treeOwner = (ITreeOwner)null; + this.m_treeOwner = null; } finally { @@ -71,7 +71,7 @@ namespace Microsoft.Iris.Render.Graphics internal TreeNode FirstChild => this.m_nodeFirstChild; - internal TreeNode LastChild => this.m_nodeFirstChild != null ? this.m_nodeFirstChild.LastSibling : (TreeNode)null; + internal TreeNode LastChild => this.m_nodeFirstChild != null ? this.m_nodeFirstChild.LastSibling : null; internal TreeNodeCollection Children => new TreeNodeCollection(this); @@ -101,10 +101,10 @@ namespace Microsoft.Iris.Render.Graphics internal virtual void RemoveAllChildren() { while (this.m_nodeFirstChild != null) - this.m_nodeFirstChild.ChangeParent((TreeNode)null); + this.m_nodeFirstChild.ChangeParent(null); } - internal void ChangeParent(TreeNode nodeNewParent) => this.ChangeParent(nodeNewParent, (TreeNode)null, TreeNode.LinkType.First); + internal void ChangeParent(TreeNode nodeNewParent) => this.ChangeParent(nodeNewParent, null, LinkType.First); internal void ChangeParent(TreeNode nodeNewParent, TreeNode nodeSibling, TreeNode.LinkType lt) { @@ -112,18 +112,18 @@ namespace Microsoft.Iris.Render.Graphics return; TreeNode nodeParent = this.m_nodeParent; if (this.m_nodeParent != null) - TreeNode.DoUnlink(this); + DoUnlink(this); if (nodeNewParent != null) - TreeNode.DoLink(nodeNewParent, this, nodeSibling, lt); + DoLink(nodeNewParent, this, nodeSibling, lt); if (nodeParent == null && nodeNewParent != null) { - this.RegisterUsage((object)this); + this.RegisterUsage(this); } else { if (nodeParent == null || nodeNewParent != null) return; - this.UnregisterUsage((object)this); + this.UnregisterUsage(this); } } @@ -143,7 +143,7 @@ namespace Microsoft.Iris.Render.Graphics { switch (lt) { - case TreeNode.LinkType.Before: + case LinkType.Before: nodeChange.m_nodeNext = nodeSibling; nodeChange.m_nodePrevious = nodeSibling.m_nodePrevious; nodeSibling.m_nodePrevious = nodeChange; @@ -154,7 +154,7 @@ namespace Microsoft.Iris.Render.Graphics } nodeParent.m_nodeFirstChild = nodeChange; break; - case TreeNode.LinkType.Behind: + case LinkType.Behind: nodeChange.m_nodePrevious = nodeSibling; nodeChange.m_nodeNext = nodeSibling.m_nodeNext; nodeSibling.m_nodeNext = nodeChange; @@ -162,14 +162,14 @@ namespace Microsoft.Iris.Render.Graphics break; nodeChange.m_nodeNext.m_nodePrevious = nodeChange; break; - case TreeNode.LinkType.First: + case LinkType.First: nodeParent.m_nodeFirstChild = nodeChange; nodeChange.m_nodeNext = nodeFirstChild; if (nodeFirstChild == null) break; nodeFirstChild.m_nodePrevious = nodeChange; break; - case TreeNode.LinkType.Last: + case LinkType.Last: TreeNode lastSibling = nodeFirstChild.LastSibling; lastSibling.m_nodeNext = nodeChange; nodeChange.m_nodePrevious = lastSibling; @@ -186,9 +186,9 @@ namespace Microsoft.Iris.Render.Graphics nodeChange.m_nodeNext.m_nodePrevious = nodeChange.m_nodePrevious; if (nodeChange.m_nodePrevious != null) nodeChange.m_nodePrevious.m_nodeNext = nodeChange.m_nodeNext; - nodeChange.m_nodeParent = (TreeNode)null; - nodeChange.m_nodeNext = (TreeNode)null; - nodeChange.m_nodePrevious = (TreeNode)null; + nodeChange.m_nodeParent = null; + nodeChange.m_nodeNext = null; + nodeChange.m_nodePrevious = null; } internal int InstanceID @@ -196,27 +196,27 @@ namespace Microsoft.Iris.Render.Graphics get { if (this.m_idObject == 0) - this.SetInstanceID(TreeNode.GenerateInstanceID()); + this.SetInstanceID(GenerateInstanceID()); return this.m_idObject; } } - private static int GenerateInstanceID() => ++TreeNode.s_idObject; + private static int GenerateInstanceID() => ++s_idObject; private void SetInstanceID(int idObject) => this.m_idObject = idObject; public override int GetHashCode() => this.InstanceID; - public override bool Equals(object oRHS) => object.ReferenceEquals((object)this, oRHS); + public override bool Equals(object oRHS) => ReferenceEquals(this, oRHS); public bool TestNodes( TreeNode.NodeTest test, TreeNode.NodeRelation nScope, bool fParentChainsMustGoToRoot) { - if ((nScope & TreeNode.NodeRelation.FullChain) == TreeNode.NodeRelation.None || (nScope & TreeNode.NodeRelation.Self) != TreeNode.NodeRelation.None && !test(this)) + if ((nScope & NodeRelation.FullChain) == NodeRelation.None || (nScope & NodeRelation.Self) != NodeRelation.None && !test(this)) return false; - if ((nScope & TreeNode.NodeRelation.Parents) != TreeNode.NodeRelation.None) + if ((nScope & NodeRelation.Parents) != NodeRelation.None) { TreeNode node = this; do @@ -244,10 +244,10 @@ namespace Microsoft.Iris.Render.Graphics } [Conditional("DEBUG")] - internal void DEBUG_IncTotalNodes() => ++TreeNode.s_DEBUG_nTotalNodes; + internal void DEBUG_IncTotalNodes() => ++s_DEBUG_nTotalNodes; [Conditional("DEBUG")] - internal void DEBUG_DecTotalNodes() => --TreeNode.s_DEBUG_nTotalNodes; + internal void DEBUG_DecTotalNodes() => --s_DEBUG_nTotalNodes; internal enum LinkType { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/TreeNodeCollection.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/TreeNodeCollection.cs index 2fdc6bd..2f83c14 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/TreeNodeCollection.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/TreeNodeCollection.cs @@ -28,7 +28,7 @@ namespace Microsoft.Iris.Render.Graphics object IList.this[int index] { - get => (object)this[index]; + get => this[index]; set => Debug2.Validate(false, typeof(InvalidOperationException), "Use Add() and Remove() to modify collection"); } @@ -45,23 +45,23 @@ namespace Microsoft.Iris.Render.Graphics ++num; } Debug2.Validate(false, typeof(ArgumentOutOfRangeException), "Must have a valid index"); - return (TreeNode)null; + return null; } set => Debug2.Validate(false, typeof(InvalidOperationException), "Use Add() and Remove() to modify collection"); } - IEnumerator IEnumerable.GetEnumerator() => (IEnumerator)this.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => this.GetEnumerator(); public TreeNodeEnumerator GetEnumerator() => new TreeNodeEnumerator(this.m_nodeSubject); void ICollection.CopyTo(Array arDest, int idxDest) { - TreeNodeCollection.PromptCompatibleArray(arDest, idxDest, typeof(TreeNode), this.m_nodeSubject.ChildCount); + PromptCompatibleArray(arDest, idxDest, typeof(TreeNode), this.m_nodeSubject.ChildCount); foreach (TreeNode treeNode in this) - arDest.SetValue((object)treeNode, idxDest++); + arDest.SetValue(treeNode, idxDest++); } - public void CopyTo(TreeNode[] arDest, int idxDest) => ((ICollection)this).CopyTo((Array)arDest, idxDest); + public void CopyTo(TreeNode[] arDest, int idxDest) => ((ICollection)this).CopyTo(arDest, idxDest); int IList.Add(object value) { @@ -73,7 +73,7 @@ namespace Microsoft.Iris.Render.Graphics { Debug2.Validate(nodeChild != null, typeof(ArgumentNullException), "Must have a valid child"); Debug2.Validate(nodeChild.Parent == null, typeof(ArgumentException), "Child must not already be parented"); - nodeChild.ChangeParent(this.m_nodeSubject, (TreeNode)null, TreeNode.LinkType.Last); + nodeChild.ChangeParent(this.m_nodeSubject, null, TreeNode.LinkType.Last); } public void Clear() => this.m_nodeSubject.RemoveAllChildren(); @@ -109,7 +109,7 @@ namespace Microsoft.Iris.Render.Graphics { Debug2.Validate(nodeChild != null, typeof(ArgumentNullException), "Must have a valid child"); Debug2.Validate(nodeChild.Parent == null, typeof(ArgumentException), "Child must not already be parented"); - TreeNode nodeSibling = (TreeNode)null; + TreeNode nodeSibling = null; TreeNode.LinkType lt = TreeNode.LinkType.Last; if (idxInsertAt < this.Count) { @@ -124,10 +124,10 @@ namespace Microsoft.Iris.Render.Graphics public void Remove(TreeNode nodeChild) { Debug2.Validate(nodeChild != null, typeof(ArgumentNullException), "must pass a valid TreeNode"); - nodeChild.ChangeParent((TreeNode)null); + nodeChild.ChangeParent(null); } - public void RemoveAt(int idxRemoveAt) => this[idxRemoveAt].ChangeParent((TreeNode)null); + public void RemoveAt(int idxRemoveAt) => this[idxRemoveAt].ChangeParent(null); public static void PromptCompatibleArray( Array array, diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/TreeNodeEnumerator.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/TreeNodeEnumerator.cs index d141a40..c230d1d 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/TreeNodeEnumerator.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/TreeNodeEnumerator.cs @@ -17,17 +17,17 @@ namespace Microsoft.Iris.Render.Graphics internal TreeNodeEnumerator(TreeNode nodeParent) { this.m_nodeParent = nodeParent; - this.m_nodeCurrent = (TreeNode)null; + this.m_nodeCurrent = null; this.m_nodeNext = nodeParent.FirstChild; } - object IEnumerator.Current => (object)this.m_nodeCurrent; + object IEnumerator.Current => m_nodeCurrent; public TreeNode Current => this.m_nodeCurrent; public void Reset() { - this.m_nodeCurrent = (TreeNode)null; + this.m_nodeCurrent = null; this.m_nodeNext = this.m_nodeParent.FirstChild; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/VideoPool.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/VideoPool.cs index d15ebfc..325fadd 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/VideoPool.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/VideoPool.cs @@ -29,8 +29,8 @@ namespace Microsoft.Iris.Render.Graphics this.m_remoteVideoPool = RemoteVideoPool.CreateFromHandle(this.Session.RenderingPort, rhHandle); } else - this.m_remoteVideoPool = RemoteVideoPool.CreateFromExternalHandle(this.Session.RenderingPort, rhHandle, (IRenderHandleOwner)this); - this.m_remotePool = (RemoteSurfacePool)this.m_remoteVideoPool; + this.m_remoteVideoPool = RemoteVideoPool.CreateFromExternalHandle(this.Session.RenderingPort, rhHandle, this); + this.m_remotePool = m_remoteVideoPool; } internal RemoteVideoPool RemoteVideoStub => this.m_remoteVideoPool; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Visual.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Visual.cs index b5e52c6..61564f2 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Visual.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/Visual.cs @@ -38,10 +38,10 @@ namespace Microsoft.Iris.Render.Graphics private Vector3 m_vecPosition; private Vector2 m_vecSize; private BitVector32 m_bvDataBits; - private static BitVector32.Section s_bvsMouse = BitVector32.CreateSection((short)15); - private static BitVector32.Section s_bvsDebug = BitVector32.CreateSection((short)3, Visual.s_bvsMouse); - private static BitVector32.Section s_bvsValid = BitVector32.CreateSection((short)1, Visual.s_bvsDebug); - private static BitVector32.Section s_bvsVisible = BitVector32.CreateSection((short)1, Visual.s_bvsValid); + private static BitVector32.Section s_bvsMouse = BitVector32.CreateSection(15); + private static BitVector32.Section s_bvsDebug = BitVector32.CreateSection(3, s_bvsMouse); + private static BitVector32.Section s_bvsValid = BitVector32.CreateSection(1, s_bvsDebug); + private static BitVector32.Section s_bvsVisible = BitVector32.CreateSection(1, s_bvsValid); private static BitVector32.Section s_bvsAlpha; private static BitVector32.Section s_bvsCenterPointScale; private static BitVector32.Section s_bvsColor; @@ -50,7 +50,7 @@ namespace Microsoft.Iris.Render.Graphics private static BitVector32.Section s_bvsLayer; private static BitVector32.Section s_bvsRotation; private static BitVector32.Section s_bvsScale; - private static BitVector32.Section s_bvsFlush = BitVector32.CreateSection((short)1, Visual.s_bvsVisible); + private static BitVector32.Section s_bvsFlush = BitVector32.CreateSection(1, s_bvsVisible); private static BitVector32.Section s_bvsRelativeSize; private static BitVector32.Section s_bvsCamera; private static BitVector32.Section s_bvsNineGrid; @@ -59,32 +59,32 @@ namespace Microsoft.Iris.Render.Graphics static Visual() { - Visual.s_bvsAlpha = BitVector32.CreateSection((short)1, Visual.s_bvsFlush); - Visual.s_bvsCenterPointScale = BitVector32.CreateSection((short)1, Visual.s_bvsAlpha); - Visual.s_bvsColor = BitVector32.CreateSection((short)1, Visual.s_bvsCenterPointScale); - Visual.s_bvsCoordmap = BitVector32.CreateSection((short)1, Visual.s_bvsColor); - Visual.s_bvsGradient = BitVector32.CreateSection((short)1, Visual.s_bvsCoordmap); - Visual.s_bvsLayer = BitVector32.CreateSection((short)1, Visual.s_bvsGradient); - Visual.s_bvsRotation = BitVector32.CreateSection((short)1, Visual.s_bvsLayer); - Visual.s_bvsScale = BitVector32.CreateSection((short)1, Visual.s_bvsRotation); - Visual.s_bvsRelativeSize = BitVector32.CreateSection((short)1, Visual.s_bvsScale); - Visual.s_bvsCamera = BitVector32.CreateSection((short)1, Visual.s_bvsRelativeSize); - Visual.s_bvsNineGrid = BitVector32.CreateSection((short)1, Visual.s_bvsCamera); - Visual.s_sectionPropIDMap = new BitVector32.Section[10]; - Visual.s_sectionPropIDMap[0] = Visual.s_bvsAlpha; - Visual.s_sectionPropIDMap[1] = Visual.s_bvsScale; - Visual.s_sectionPropIDMap[2] = Visual.s_bvsRotation; - Visual.s_sectionPropIDMap[3] = Visual.s_bvsCenterPointScale; - Visual.s_sectionPropIDMap[4] = Visual.s_bvsLayer; - Visual.s_sectionPropIDMap[5] = Visual.s_bvsColor; - Visual.s_sectionPropIDMap[6] = Visual.s_bvsCoordmap; - Visual.s_sectionPropIDMap[7] = Visual.s_bvsGradient; - Visual.s_sectionPropIDMap[8] = Visual.s_bvsCamera; - Visual.s_sectionPropIDMap[9] = Visual.s_bvsNineGrid; + s_bvsAlpha = BitVector32.CreateSection(1, s_bvsFlush); + s_bvsCenterPointScale = BitVector32.CreateSection(1, s_bvsAlpha); + s_bvsColor = BitVector32.CreateSection(1, s_bvsCenterPointScale); + s_bvsCoordmap = BitVector32.CreateSection(1, s_bvsColor); + s_bvsGradient = BitVector32.CreateSection(1, s_bvsCoordmap); + s_bvsLayer = BitVector32.CreateSection(1, s_bvsGradient); + s_bvsRotation = BitVector32.CreateSection(1, s_bvsLayer); + s_bvsScale = BitVector32.CreateSection(1, s_bvsRotation); + s_bvsRelativeSize = BitVector32.CreateSection(1, s_bvsScale); + s_bvsCamera = BitVector32.CreateSection(1, s_bvsRelativeSize); + s_bvsNineGrid = BitVector32.CreateSection(1, s_bvsCamera); + s_sectionPropIDMap = new BitVector32.Section[10]; + s_sectionPropIDMap[0] = s_bvsAlpha; + s_sectionPropIDMap[1] = s_bvsScale; + s_sectionPropIDMap[2] = s_bvsRotation; + s_sectionPropIDMap[3] = s_bvsCenterPointScale; + s_sectionPropIDMap[4] = s_bvsLayer; + s_sectionPropIDMap[5] = s_bvsColor; + s_sectionPropIDMap[6] = s_bvsCoordmap; + s_sectionPropIDMap[7] = s_bvsGradient; + s_sectionPropIDMap[8] = s_bvsCamera; + s_sectionPropIDMap[9] = s_bvsNineGrid; } internal Visual(RenderSession session, RenderWindow window, object objOwnerData) - : base((ITreeOwner)window) + : base(window) { Debug2.Validate(session != null, typeof(ArgumentNullException), "Must have valid session"); Debug2.Validate(window != null, typeof(ArgumentNullException), "Must have valid render window"); @@ -114,8 +114,8 @@ namespace Microsoft.Iris.Render.Graphics if (this.m_remoteVisual != null) this.m_remoteVisual.Dispose(); } - this.m_remoteVisual = (RemoteVisual)null; - this.m_objOwnerData = (object)null; + this.m_remoteVisual = null; + this.m_objOwnerData = null; } finally { @@ -163,7 +163,7 @@ namespace Microsoft.Iris.Render.Graphics protected void AddGradient(Gradient gradient) { Vector result; - if (this.IsDynamicValueSet(Visual.PropId.Gradients)) + if (this.IsDynamicValueSet(PropId.Gradients)) { this.PropertyManager.GetGradientProp(this, out result); } @@ -172,20 +172,20 @@ namespace Microsoft.Iris.Render.Graphics result = new Vector(); this.PropertyManager.SetGradientProp(this, result); } - gradient.RegisterUsage((object)this); + gradient.RegisterUsage(this); result.Add(gradient); this.m_remoteVisual.SendAddGradient(gradient.RemoteGradient); } protected void RemoveAllGradients() { - if (!this.IsDynamicValueSet(Visual.PropId.Gradients)) + if (!this.IsDynamicValueSet(PropId.Gradients)) return; Vector result; this.PropertyManager.GetGradientProp(this, out result); this.PropertyManager.RemoveGradientProp(this); foreach (SharedRenderObject sharedRenderObject in result) - sharedRenderObject.UnregisterUsage((object)this); + sharedRenderObject.UnregisterUsage(this); result.Clear(); this.m_remoteVisual.SendClearGradients(); } @@ -196,25 +196,25 @@ namespace Microsoft.Iris.Render.Graphics RemoteVisual remoteVisual2 = this.m_remoteVisual; RemoteVisual remoteVisual3 = visualSibling?.m_remoteVisual; remoteVisual2.SendChangeParent(remoteVisual1, remoteVisual3, nOrder); - this.ChangeParent((TreeNode)visualParent); + this.ChangeParent(visualParent); } internal override void RemoveAllChildren() { for (Visual firstChild = (Visual)this.FirstChild; firstChild != null; firstChild = (Visual)this.FirstChild) - firstChild.ChangeParent((Visual)null, (Visual)null, VisualOrder.First); + firstChild.ChangeParent(null, null, VisualOrder.First); base.RemoveAllChildren(); } protected void RemoveFromTree() { this.RemoveAllChildren(); - this.ChangeParent((Visual)null, (Visual)null, VisualOrder.First); + this.ChangeParent(null, null, VisualOrder.First); } RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteVisual.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteVisual = (RemoteVisual)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteVisual = null; internal RemoteVisual RemoteStub => this.m_remoteVisual; @@ -248,7 +248,7 @@ namespace Microsoft.Iris.Render.Graphics internal void SetSize(Vector2 value, bool force) { - Debug2.Validate((double)value.X >= 0.0 && (double)value.Y >= 0.0, typeof(ArgumentOutOfRangeException), "Negative size not allowed"); + Debug2.Validate(value.X >= 0.0 && value.Y >= 0.0, typeof(ArgumentOutOfRangeException), "Negative size not allowed"); if (!(this.m_vecSize != value) && !force) return; this.m_vecSize = value; @@ -262,7 +262,7 @@ namespace Microsoft.Iris.Render.Graphics get { float result = 1f; - if (this.IsDynamicValueSet(Visual.PropId.Alpha)) + if (this.IsDynamicValueSet(PropId.Alpha)) { this.PropertyManager.GetAlphaProp(this, out result); Debug2.Validate(!Math2.WithinEpsilon(result, 1f), typeof(InvalidOperationException), "expected non-opaque alpha if HasAlpha flag was set"); @@ -274,9 +274,9 @@ namespace Microsoft.Iris.Render.Graphics protected void SetAlpha(float value, bool force) { - if ((double)this.Alpha == (double)value && !force) + if (Alpha == (double)value && !force) return; - Debug2.Validate((double)value >= 0.0 && (double)value <= 1.0, typeof(ArgumentOutOfRangeException), "Alpha value must be within 0-1 range (incl)"); + Debug2.Validate(value >= 0.0 && value <= 1.0, typeof(ArgumentOutOfRangeException), "Alpha value must be within 0-1 range (incl)"); this.PropertyManager.SetAlphaProp(this, value); if (!this.FlushValues) return; @@ -288,7 +288,7 @@ namespace Microsoft.Iris.Render.Graphics get { Vector3 result = Vector3.UnitVector; - if (this.IsDynamicValueSet(Visual.PropId.Scale)) + if (this.IsDynamicValueSet(PropId.Scale)) { this.PropertyManager.GetScaleProp(this, out result); Debug2.Validate(result != Vector3.UnitVector, typeof(InvalidOperationException), "expected non-unit scale if HasScale flag was set"); @@ -313,7 +313,7 @@ namespace Microsoft.Iris.Render.Graphics get { AxisAngle result = AxisAngle.Identity; - if (this.IsDynamicValueSet(Visual.PropId.Rotation)) + if (this.IsDynamicValueSet(PropId.Rotation)) { this.PropertyManager.GetRotationProp(this, out result); Debug2.Validate(result != AxisAngle.Identity, typeof(InvalidOperationException), "expected non-null rotation data if HasRotation flag was set"); @@ -329,7 +329,7 @@ namespace Microsoft.Iris.Render.Graphics return; this.PropertyManager.SetRotationProp(this, value); AxisAngle aaRotation = value; - if (this.m_window.IsRightToLeft && (double)aaRotation.Axis.Y <= 0.0 && (double)aaRotation.Axis.X <= 0.0) + if (this.m_window.IsRightToLeft && aaRotation.Axis.Y <= 0.0 && aaRotation.Axis.X <= 0.0) aaRotation.Angle = -aaRotation.Angle; if (!this.FlushValues) return; @@ -341,7 +341,7 @@ namespace Microsoft.Iris.Render.Graphics get { Vector3 result = Vector3.Zero; - if (this.IsDynamicValueSet(Visual.PropId.CenterPointScale)) + if (this.IsDynamicValueSet(PropId.CenterPointScale)) { this.PropertyManager.GetCenterPointScaleProp(this, out result); Debug2.Validate(result != Vector3.Zero, typeof(InvalidOperationException), "expected non-unit scale if HasCenterPointScale flag was set"); @@ -366,7 +366,7 @@ namespace Microsoft.Iris.Render.Graphics get { uint result = 0; - if (this.IsDynamicValueSet(Visual.PropId.Layer)) + if (this.IsDynamicValueSet(PropId.Layer)) { this.PropertyManager.GetLayerProp(this, out result); Debug2.Validate(result != 0U, typeof(InvalidOperationException), "expected non-zero layer if HasLayer flag was set"); @@ -400,13 +400,13 @@ namespace Microsoft.Iris.Render.Graphics protected bool RelativeSize { - get => this.m_bvDataBits[Visual.s_bvsRelativeSize] != 0; + get => this.m_bvDataBits[s_bvsRelativeSize] != 0; set { int num = value ? 1 : 0; - if (this.m_bvDataBits[Visual.s_bvsRelativeSize] == num) + if (this.m_bvDataBits[s_bvsRelativeSize] == num) return; - this.m_bvDataBits[Visual.s_bvsRelativeSize] = num; + this.m_bvDataBits[s_bvsRelativeSize] = num; this.m_remoteVisual.SendSetRelativeSize(value); } } @@ -415,32 +415,32 @@ namespace Microsoft.Iris.Render.Graphics public MouseOptions MouseOptions { - get => (MouseOptions)this.m_bvDataBits[Visual.s_bvsMouse]; + get => (MouseOptions)this.m_bvDataBits[s_bvsMouse]; set { Debug2.Validate((value & ~MouseOptions.ValidMask) == MouseOptions.None, typeof(ArgumentException), "Expected valid mouse bits"); - uint nMask = (uint)this.m_bvDataBits[Visual.s_bvsMouse] ^ (uint)(short)value; + uint nMask = (uint)this.m_bvDataBits[s_bvsMouse] ^ (uint)(short)value; if (nMask != 0U && this.FlushValues) this.m_remoteVisual.SendChangeDataBits((uint)value, nMask); - this.m_bvDataBits[Visual.s_bvsMouse] = (int)(short)value; + this.m_bvDataBits[s_bvsMouse] = (short)value; } } internal Visual.DebugBits DebugOptions { - get => (Visual.DebugBits)this.m_bvDataBits[Visual.s_bvsDebug]; + get => (Visual.DebugBits)this.m_bvDataBits[s_bvsDebug]; set { - Debug2.Validate((value & ~Visual.DebugBits.Dump) == Visual.DebugBits.None, typeof(ArgumentException), "Expected valid debug bits"); - Debug2.Validate((uint)value < (uint)byte.MaxValue, typeof(ArgumentException), "Expected valid debug bits"); - uint nMask = (uint)((Visual.DebugBits)this.m_bvDataBits[Visual.s_bvsDebug] ^ value); + Debug2.Validate((value & ~DebugBits.Dump) == DebugBits.None, typeof(ArgumentException), "Expected valid debug bits"); + Debug2.Validate((uint)value < byte.MaxValue, typeof(ArgumentException), "Expected valid debug bits"); + uint nMask = (uint)((Visual.DebugBits)this.m_bvDataBits[s_bvsDebug] ^ value); if (nMask != 0U) { uint nValue = (uint)value << 5; if (this.m_remoteVisual.IsValid) this.m_remoteVisual.SendChangeDataBits(nValue, nMask); } - this.m_bvDataBits[Visual.s_bvsDebug] = (int)value; + this.m_bvDataBits[s_bvsDebug] = (int)value; } } @@ -448,42 +448,42 @@ namespace Microsoft.Iris.Render.Graphics internal ColorF DEBUG_OutlineColor { - get => Visual.s_colorTransparent; + get => s_colorTransparent; set { } } - private bool GetValid() => this.m_bvDataBits[Visual.s_bvsValid] != 0; + private bool GetValid() => this.m_bvDataBits[s_bvsValid] != 0; - private void SetValid(bool fValid) => this.m_bvDataBits[Visual.s_bvsValid] = fValid ? 1 : 0; + private void SetValid(bool fValid) => this.m_bvDataBits[s_bvsValid] = fValid ? 1 : 0; - private bool GetVisible() => this.m_bvDataBits[Visual.s_bvsVisible] != 0; + private bool GetVisible() => this.m_bvDataBits[s_bvsVisible] != 0; - private void SetVisible(bool fVisible) => this.m_bvDataBits[Visual.s_bvsVisible] = fVisible ? 1 : 0; + private void SetVisible(bool fVisible) => this.m_bvDataBits[s_bvsVisible] = fVisible ? 1 : 0; internal bool IsDynamicValueSet(Visual.PropId propid) { - Debug2.Validate(propid < Visual.PropId.MaxDynamicProp, typeof(InvalidOperationException), "Cannot call dynvalue on this propid"); - return this.m_bvDataBits[Visual.s_sectionPropIDMap[(int)propid]] != 0; + Debug2.Validate(propid < PropId.MaxDynamicProp, typeof(InvalidOperationException), "Cannot call dynvalue on this propid"); + return this.m_bvDataBits[s_sectionPropIDMap[(int)propid]] != 0; } internal void SetDynamicValueSet(Visual.PropId propid, bool fValue) { - Debug2.Validate(propid < Visual.PropId.MaxDynamicProp, typeof(InvalidOperationException), "Cannot call dynvalue on this propid"); - this.m_bvDataBits[Visual.s_sectionPropIDMap[(int)propid]] = fValue ? 1 : 0; + Debug2.Validate(propid < PropId.MaxDynamicProp, typeof(InvalidOperationException), "Cannot call dynvalue on this propid"); + this.m_bvDataBits[s_sectionPropIDMap[(int)propid]] = fValue ? 1 : 0; } internal bool IsPropFlagSet(Visual.PropId propid) { - Debug2.Validate(propid >= Visual.PropId.MaxDynamicProp && propid < Visual.PropId.MaxFlagProp, typeof(InvalidOperationException), "Cannot call IsPropFlagSet on this propid"); - return this.m_bvDataBits[Visual.s_sectionPropIDMap[(int)propid]] != 0; + Debug2.Validate(propid >= PropId.MaxDynamicProp && propid < PropId.MaxFlagProp, typeof(InvalidOperationException), "Cannot call IsPropFlagSet on this propid"); + return this.m_bvDataBits[s_sectionPropIDMap[(int)propid]] != 0; } internal void SetPropFlag(Visual.PropId propid, bool fValue) { - Debug2.Validate(propid >= Visual.PropId.MaxDynamicProp && propid < Visual.PropId.MaxFlagProp, typeof(InvalidOperationException), "Cannot call SetPropFlag on this propid"); - this.m_bvDataBits[Visual.s_sectionPropIDMap[(int)propid]] = fValue ? 1 : 0; + Debug2.Validate(propid >= PropId.MaxDynamicProp && propid < PropId.MaxFlagProp, typeof(InvalidOperationException), "Cannot call SetPropFlag on this propid"); + this.m_bvDataBits[s_sectionPropIDMap[(int)propid]] = fValue ? 1 : 0; } internal override void Reset() @@ -500,7 +500,7 @@ namespace Microsoft.Iris.Render.Graphics this.Rotation = AxisAngle.Identity; this.Visible = true; this.CenterPointScale = Vector3.Zero; - this.OwnerData = (object)null; + this.OwnerData = null; this.MouseOptions = MouseOptions.None; this.FlushValues = flushValues; this.m_remoteVisual.SendReset(); @@ -508,23 +508,23 @@ namespace Microsoft.Iris.Render.Graphics private bool FlushValues { - get => this.m_bvDataBits[Visual.s_bvsFlush] != 0; - set => this.m_bvDataBits[Visual.s_bvsFlush] = value ? 1 : 0; + get => this.m_bvDataBits[s_bvsFlush] != 0; + set => this.m_bvDataBits[s_bvsFlush] = value ? 1 : 0; } RENDERHANDLE IAnimatableObject.GetObjectId() => ((IRenderHandleOwner)this).RenderHandle; uint IAnimatableObject.GetPropertyId(string propertyName) { - if (propertyName == Visual.PositionProperty) + if (propertyName == PositionProperty) return 1; - if (propertyName == Visual.AlphaProperty) + if (propertyName == AlphaProperty) return 2; - if (propertyName == Visual.RotationProperty || propertyName == Visual.OrientationProperty) + if (propertyName == RotationProperty || propertyName == OrientationProperty) return 3; - if (propertyName == Visual.ScaleProperty) + if (propertyName == ScaleProperty) return 4; - if (propertyName == Visual.SizeProperty) + if (propertyName == SizeProperty) return 5; Debug2.Validate(false, typeof(ArgumentException), "Unsupported property"); return 0; @@ -533,17 +533,17 @@ namespace Microsoft.Iris.Render.Graphics AnimationInputType IAnimatableObject.GetPropertyType( string propertyName) { - if (propertyName == Visual.PositionProperty) + if (propertyName == PositionProperty) return AnimationInputType.Vector3; - if (propertyName == Visual.AlphaProperty) + if (propertyName == AlphaProperty) return AnimationInputType.Float; - if (propertyName == Visual.RotationProperty) + if (propertyName == RotationProperty) return AnimationInputType.Vector4; - if (propertyName == Visual.OrientationProperty) + if (propertyName == OrientationProperty) return AnimationInputType.Quaternion; - if (propertyName == Visual.ScaleProperty) + if (propertyName == ScaleProperty) return AnimationInputType.Vector3; - if (propertyName == Visual.SizeProperty) + if (propertyName == SizeProperty) return AnimationInputType.Vector2; Debug2.Validate(false, typeof(ArgumentException), "Unsupported property"); return AnimationInputType.Float; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/VisualContainer.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/VisualContainer.cs index 58adc63..4e5fb7d 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/VisualContainer.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Graphics/VisualContainer.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris.Render.Graphics session.AssertOwningThread(); Debug2.Validate(this.m_window != null, typeof(InvalidOperationException), "Parent visual should have saved our render window"); this.m_fIsRoot = isRoot; - this.m_remoteVisual = (RemoteVisual)session.BuildRemoteVisualContainer((Visual)this); + this.m_remoteVisual = session.BuildRemoteVisualContainer(this); this.m_remoteVisual.SendSetVisible(true); remoteVisual = this.m_remoteVisual; } @@ -46,9 +46,9 @@ namespace Microsoft.Iris.Render.Graphics if (!fInDispose) return; this.RemoveAllChildren(); - if (!this.IsDynamicValueSet(Visual.PropId.Camera)) + if (!this.IsDynamicValueSet(PropId.Camera)) return; - this.PropertyManager.RemoveCameraProp((Visual)this); + this.PropertyManager.RemoveCameraProp(this); } finally { @@ -58,12 +58,12 @@ namespace Microsoft.Iris.Render.Graphics private void SetCamera(ICamera camera) { - this.PropertyManager.SetCameraProp((Visual)this, (Camera)camera); + this.PropertyManager.SetCameraProp(this, (Camera)camera); RemoteVisualContainer remoteVisual = (RemoteVisualContainer)this.m_remoteVisual; if (camera != null) remoteVisual.SendSetCamera(((Camera)camera).RemoteStub); else - remoteVisual.SendSetCamera((RemoteCamera)null); + remoteVisual.SendSetCamera(null); } bool IVisualContainer.IsRoot => this.m_fIsRoot; @@ -132,10 +132,10 @@ namespace Microsoft.Iris.Render.Graphics { get { - Camera result = (Camera)null; - if (this.IsDynamicValueSet(Visual.PropId.Camera)) - this.PropertyManager.GetCameraProp((Visual)this, out result); - return (ICamera)result; + Camera result = null; + if (this.IsDynamicValueSet(PropId.Camera)) + this.PropertyManager.GetCameraProp(this, out result); + return result; } set => this.SetCamera(value); } @@ -150,13 +150,13 @@ namespace Microsoft.Iris.Render.Graphics VisualOrder nOrder) { Visual visual = (Visual)vChild; - Visual visualSibling = (Visual)null; + Visual visualSibling = null; if (vSibling != null) visualSibling = (Visual)vSibling; - visual.ChangeParent((Visual)this, visualSibling, nOrder); + visual.ChangeParent(this, visualSibling, nOrder); } - void IVisualContainer.RemoveChild(IVisual vChild) => ((Visual)vChild).ChangeParent((Visual)null, (Visual)null, VisualOrder.First); + void IVisualContainer.RemoveChild(IVisual vChild) => ((Visual)vChild).ChangeParent(null, null, VisualOrder.First); void IVisualContainer.RemoveAllChildren() => this.RemoveAllChildren(); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/HSLElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/HSLElement.cs index d7b14a7..44f7dc7 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/HSLElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/HSLElement.cs @@ -26,9 +26,9 @@ namespace Microsoft.Iris.Render : this() { Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); - Debug2.Validate((double)flHue >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Hue is >= 0"); - Debug2.Validate((double)flSaturation >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Saturation is >= 0"); - Debug2.Validate((double)flLightness >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Lightness is >= 0"); + Debug2.Validate(flHue >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Hue is >= 0"); + Debug2.Validate(flSaturation >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Saturation is >= 0"); + Debug2.Validate(flLightness >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Lightness is >= 0"); this.m_flHue = flHue; this.m_flSaturation = flSaturation; this.m_flLightness = flLightness; @@ -65,10 +65,10 @@ namespace Microsoft.Iris.Render Map dictionary, ref byte nNextUniqueID) { - return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Hue", (byte)8, ref this.m_nHueID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Saturation", (byte)8, ref this.m_nSaturationID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Lightness", (byte)8, ref this.m_nLightnessID, ref nNextUniqueID); + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Hue", 8, ref this.m_nHueID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Saturation", 8, ref this.m_nSaturationID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Lightness", 8, ref this.m_nLightnessID, ref nNextUniqueID); } - internal override bool Process(Map dictProperties) => this.GenerateProperty("Hue", EffectPropertyType.Float, (object)this.m_flHue, this.m_nHueID, dictProperties) && this.GenerateProperty("Saturation", EffectPropertyType.Float, (object)this.m_flSaturation, this.m_nSaturationID, dictProperties) && this.GenerateProperty("Lightness", EffectPropertyType.Float, (object)this.m_flLightness, this.m_nLightnessID, dictProperties); + internal override bool Process(Map dictProperties) => this.GenerateProperty("Hue", EffectPropertyType.Float, m_flHue, this.m_nHueID, dictProperties) && this.GenerateProperty("Saturation", EffectPropertyType.Float, m_flSaturation, this.m_nSaturationID, dictProperties) && this.GenerateProperty("Lightness", EffectPropertyType.Float, m_flLightness, this.m_nLightnessID, dictProperties); internal override void AddCacheKey(ByteBuilder cacheKey) { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/HSVElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/HSVElement.cs index 3194d91..cabceea 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/HSVElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/HSVElement.cs @@ -26,9 +26,9 @@ namespace Microsoft.Iris.Render : this() { Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); - Debug2.Validate((double)flHue >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Hue is >= 0"); - Debug2.Validate((double)flSaturation >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Saturation is >= 0"); - Debug2.Validate((double)flValue >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Value is >= 0"); + Debug2.Validate(flHue >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Hue is >= 0"); + Debug2.Validate(flSaturation >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Saturation is >= 0"); + Debug2.Validate(flValue >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Value is >= 0"); this.m_flHue = flHue; this.m_flSaturation = flSaturation; this.m_flValue = flValue; @@ -65,10 +65,10 @@ namespace Microsoft.Iris.Render Map dictionary, ref byte nNextUniqueID) { - return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Hue", (byte)8, ref this.m_nHueID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Saturation", (byte)8, ref this.m_nSaturationID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Value", (byte)8, ref this.m_nValueID, ref nNextUniqueID); + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Hue", 8, ref this.m_nHueID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Saturation", 8, ref this.m_nSaturationID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Value", 8, ref this.m_nValueID, ref nNextUniqueID); } - internal override bool Process(Map dictProperties) => this.GenerateProperty("Hue", EffectPropertyType.Float, (object)this.m_flHue, this.m_nHueID, dictProperties) && this.GenerateProperty("Saturation", EffectPropertyType.Float, (object)this.m_flSaturation, this.m_nSaturationID, dictProperties) && this.GenerateProperty("Value", EffectPropertyType.Float, (object)this.m_flValue, this.m_nValueID, dictProperties); + internal override bool Process(Map dictProperties) => this.GenerateProperty("Hue", EffectPropertyType.Float, m_flHue, this.m_nHueID, dictProperties) && this.GenerateProperty("Saturation", EffectPropertyType.Float, m_flSaturation, this.m_nSaturationID, dictProperties) && this.GenerateProperty("Value", EffectPropertyType.Float, m_flValue, this.m_nValueID, dictProperties); internal override void AddCacheKey(ByteBuilder cacheKey) { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/ImageElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/ImageElement.cs index 0e2bd31..4f6ec97 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/ImageElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/ImageElement.cs @@ -56,15 +56,15 @@ namespace Microsoft.Iris.Render int num = base.PreProcessProperties(dictionary, ref nNextUniqueID); this.AddEffectProperty(dictionary, "Image"); this.m_nImageID = nNextUniqueID++; - return num + this.PreProcessProperty(dictionary, "UVOffset", (byte)12, ref this.m_nUVOffsetID, ref nNextUniqueID); + return num + this.PreProcessProperty(dictionary, "UVOffset", 12, ref this.m_nUVOffsetID, ref nNextUniqueID); } internal override bool Process(Map dictProperties) { - if (!this.GenerateProperty("Image", EffectPropertyType.Image, (object)this.m_image, this.m_nImageID, dictProperties)) + if (!this.GenerateProperty("Image", EffectPropertyType.Image, m_image, this.m_nImageID, dictProperties)) return false; dictProperties[this.GeneratePropertyPath("Image")].IsDynamic = true; - return this.GenerateProperty("UVOffset", EffectPropertyType.Vector2, (object)this.m_UVOffset, this.m_nUVOffsetID, dictProperties); + return this.GenerateProperty("UVOffset", EffectPropertyType.Vector2, m_UVOffset, this.m_nUVOffsetID, dictProperties); } internal override void AddCacheKey(ByteBuilder cacheKey) diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/DataCookie.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/DataCookie.cs index c45a69a..b8fe0d5 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/DataCookie.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/DataCookie.cs @@ -37,6 +37,6 @@ namespace Microsoft.Iris.Render.Internal internal static uint ToUInt32(DataCookie handle) => handle.m_value; - public static DataCookie ReserveSlot() => DataCookie.FromUInt32(KeyAllocator.ReserveSlot()); + public static DataCookie ReserveSlot() => FromUInt32(KeyAllocator.ReserveSlot()); } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/Display.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/Display.cs index 383dbf4..532f335 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/Display.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/Display.cs @@ -42,7 +42,7 @@ namespace Microsoft.Iris.Render.Internal this.m_arExtraModes = DisplayMode.EmptyModes; this.m_arAllModes = DisplayMode.EmptyModes; this.m_modeCurrent = new DisplayMode(); - this.m_nCurrentValid = (DisplayModeFlags)0; + this.m_nCurrentValid = 0; } public string DeviceName => this.m_stDeviceName; @@ -100,7 +100,7 @@ namespace Microsoft.Iris.Render.Internal nCompleteCheck = this.m_nCurrentValid; DisplayMode[] array = fAllowAllModes ? this.m_arAllModes : this.m_arExtraModes; DisplayMode.RenderModeComparer renderModeComparer = new DisplayMode.RenderModeComparer(); - if (Array.BinarySearch(array, modeDesired, (IComparer)renderModeComparer) >= 0) + if (Array.BinarySearch(array, modeDesired, renderModeComparer) >= 0) { modeComplete = modeDesired; nCompleteCheck = DisplayModeFlags.Size | DisplayModeFlags.Format | DisplayModeFlags.RefreshRate; @@ -108,11 +108,11 @@ namespace Microsoft.Iris.Render.Internal else { modeComplete = this.m_modeDesktop; - int num = Display.ComputeRank(this.m_modeDesktop, modeDesired, nCheck); + int num = ComputeRank(this.m_modeDesktop, modeDesired, nCheck); nCompleteCheck = DisplayModeFlags.Size | DisplayModeFlags.Format | DisplayModeFlags.RefreshRate; foreach (DisplayMode arSupportedMode in this.m_arSupportedModes) { - int rank = Display.ComputeRank(arSupportedMode, modeDesired, nCheck); + int rank = ComputeRank(arSupportedMode, modeDesired, nCheck); if (rank >= num) { modeComplete = arSupportedMode; @@ -139,8 +139,8 @@ namespace Microsoft.Iris.Render.Internal public bool ChangeFullScreenResolution(DisplayMode modeChanges, DisplayModeFlags nValid) { bool flag = false; - Debug2.Validate(modeChanges.sizePhysicalPxl.Width == 0 && modeChanges.sizePhysicalPxl.Height == 0 || modeChanges.sizePhysicalPxl.Width > 0 && modeChanges.sizePhysicalPxl.Height > 0, typeof(ArgumentException), (object)"Must specify physical 0 x 0 or a positive size", (object)typeof(ArgumentOutOfRangeException)); - Debug2.Validate(modeChanges.sizeLogicalPxl.Width == 0 && modeChanges.sizeLogicalPxl.Height == 0 || modeChanges.sizeLogicalPxl.Width > 0 && modeChanges.sizeLogicalPxl.Height > 0, typeof(ArgumentException), (object)"Must specify logical 0 x 0 or a positive size", (object)typeof(ArgumentOutOfRangeException)); + Debug2.Validate(modeChanges.sizePhysicalPxl.Width == 0 && modeChanges.sizePhysicalPxl.Height == 0 || modeChanges.sizePhysicalPxl.Width > 0 && modeChanges.sizePhysicalPxl.Height > 0, typeof(ArgumentException), "Must specify physical 0 x 0 or a positive size", typeof(ArgumentOutOfRangeException)); + Debug2.Validate(modeChanges.sizeLogicalPxl.Width == 0 && modeChanges.sizeLogicalPxl.Height == 0 || modeChanges.sizeLogicalPxl.Width > 0 && modeChanges.sizeLogicalPxl.Height > 0, typeof(ArgumentException), "Must specify logical 0 x 0 or a positive size", typeof(ArgumentOutOfRangeException)); Debug2.Validate(modeChanges.nRefreshRate >= 0 && modeChanges.nRefreshRate < 1000, typeof(ArgumentException), "Must have valid refresh rate"); DisplayMode modeCurrent = this.m_modeCurrent; this.m_modeCurrent.ChangeFrom(modeChanges, nValid); @@ -190,9 +190,9 @@ namespace Microsoft.Iris.Render.Internal Size size = new Size(modeDesired.sizePhysicalPxl.Width - modeValid.sizePhysicalPxl.Width, modeDesired.sizePhysicalPxl.Height - modeValid.sizePhysicalPxl.Height); if (modeValid.sizePhysicalPxl.Width < 640 && modeValid.sizePhysicalPxl.Height < 480 || size.Width >= 0 && size.Height >= 0) { - float flValue1 = Math.Abs((float)size.Width / (float)modeValid.sizePhysicalPxl.Width); - float flValue2 = Math.Abs((float)size.Height / (float)modeValid.sizePhysicalPxl.Height); - int num2 = 2000 - (int)(1000.0 * (double)Math2.Clamp(flValue1, 0.0f, 1f) + 1000.0 * (double)Math2.Clamp(flValue2, 0.0f, 1f)); + float flValue1 = Math.Abs(size.Width / (float)modeValid.sizePhysicalPxl.Width); + float flValue2 = Math.Abs(size.Height / (float)modeValid.sizePhysicalPxl.Height); + int num2 = 2000 - (int)(1000.0 * Math2.Clamp(flValue1, 0.0f, 1f) + 1000.0 * Math2.Clamp(flValue2, 0.0f, 1f)); if (num2 < 0) num2 = 0; num1 += num2; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/DisplayManager.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/DisplayManager.cs index c5e2f1b..f631fe8 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/DisplayManager.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/DisplayManager.cs @@ -56,11 +56,11 @@ namespace Microsoft.Iris.Render.Internal { if (fInDispose && this.m_remoteManager != null) this.m_remoteManager.Dispose(); - this.m_remoteManager = (RemoteDesktopManager)null; + this.m_remoteManager = null; base.Dispose(fInDispose); } - public IDisplay PrimaryDisplay => (IDisplay)this.m_info.primaryDisplay; + public IDisplay PrimaryDisplay => m_info.primaryDisplay; public DisplayMode[] ExtraModes { @@ -75,11 +75,11 @@ namespace Microsoft.Iris.Render.Internal internal RemoteDesktopManager RemoteStub => this.m_remoteManager; - public IDisplay DisplayFromDeviceName(string stDeviceName) => (IDisplay)this.DisplayFromName(stDeviceName); + public IDisplay DisplayFromDeviceName(string stDeviceName) => this.DisplayFromName(stDeviceName); private Display DisplayFromName(string stDeviceName) { - Display display1 = (Display)null; + Display display1 = null; if (!string.IsNullOrEmpty(stDeviceName)) { foreach (Display display2 in this.m_info.displays) @@ -101,17 +101,17 @@ namespace Microsoft.Iris.Render.Internal if ((int)idDisplay == (int)display.UniqueId) return display; } - return (Display)null; + return null; } RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteManager.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteManager = (RemoteDesktopManager)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteManager = null; void IDesktopManagerCallback.OnBeginEnumMonitorInfo(RENDERHANDLE target) { this.m_infoRebuilding = new DisplayManager.DisplayInfo(); - this.m_dispRebuildLastAdded = (Display)null; + this.m_dispRebuildLastAdded = null; this.m_alRebuildSupportedModes = new ArrayList(); this.m_alRebuildAllModes = new ArrayList(); } @@ -124,13 +124,13 @@ namespace Microsoft.Iris.Render.Internal this.m_infoRebuilding.primaryDisplay = display; } this.m_info = this.m_infoRebuilding; - this.m_infoRebuilding = (DisplayManager.DisplayInfo)null; - this.m_dispRebuildLastAdded = (Display)null; - this.m_alRebuildSupportedModes = (ArrayList)null; - this.m_alRebuildAllModes = (ArrayList)null; + this.m_infoRebuilding = null; + this.m_dispRebuildLastAdded = null; + this.m_alRebuildSupportedModes = null; + this.m_alRebuildAllModes = null; if (this.DisplayChange == null || this.m_fPendingChangeNotification) return; - this.m_session.DeferredInvoke((Delegate)new DeferredHandler(this.DeliverDisplayChangeNotification), (object)null, DeferredInvokePriority.Normal); + this.m_session.DeferredInvoke(new DeferredHandler(this.DeliverDisplayChangeNotification), null, DeferredInvokePriority.Normal); this.m_fPendingChangeNotification = true; } @@ -139,12 +139,12 @@ namespace Microsoft.Iris.Render.Internal Message* pmsgRaw) { if (this.m_session.IsForeignByteOrderOnWindowing) - MarshalHelper.SwapByteOrder((byte*)pmsgRaw, ref DisplayManager.s_ByteOrder_MonitorInfoCallbackMsg, typeof(DisplayManager.MonitorInfoCallbackMsg), 0, 0); + MarshalHelper.SwapByteOrder((byte*)pmsgRaw, ref s_ByteOrder_MonitorInfoCallbackMsg, typeof(DisplayManager.MonitorInfoCallbackMsg), 0, 0); Display display = this.ConvertMonitorInfo((DisplayManager.MonitorInfoCallbackMsg*)pmsgRaw); this.m_dispRebuildLastAdded = display; this.m_alRebuildSupportedModes.Clear(); this.m_alRebuildAllModes.Clear(); - this.m_infoRebuilding.displays.Add((object)display); + this.m_infoRebuilding.displays.Add(display); } void IDesktopManagerCallback.OnBeginDisplayModes(RENDERHANDLE target) @@ -164,9 +164,9 @@ namespace Microsoft.Iris.Render.Internal displayMode.fInterlaced = rmodeAdd.Interlaced; displayMode.fTvMode = false; if (fSupported) - this.m_alRebuildSupportedModes.Add((object)displayMode); + this.m_alRebuildSupportedModes.Add(displayMode); else - this.m_alRebuildAllModes.Add((object)displayMode); + this.m_alRebuildAllModes.Add(displayMode); } void IDesktopManagerCallback.OnEndDisplayModes(RENDERHANDLE target) @@ -191,13 +191,13 @@ namespace Microsoft.Iris.Render.Internal this.m_fPendingChangeNotification = false; if (this.DisplayChange == null) return; - this.DisplayChange((object)this, EventArgs.Empty); + this.DisplayChange(this, EventArgs.Empty); } private unsafe Display ConvertMonitorInfo(DisplayManager.MonitorInfoCallbackMsg* pmsg) { - string stringUni1 = Marshal.PtrToStringUni(new IntPtr((void*)&pmsg->pad_szDevice1)); - Display display = (Display)null; + string stringUni1 = Marshal.PtrToStringUni(new IntPtr(&pmsg->pad_szDevice1)); + Display display = null; if (this.m_info != null) display = this.DisplayFromName(stringUni1); if (display == null) @@ -215,7 +215,7 @@ namespace Microsoft.Iris.Render.Internal modeDesktop.nRefreshRate = pmsg->nRefreshRate; modeDesktop.fInterlaced = pmsg->fInterlaced != 0U; modeDesktop.fTvMode = false; - string stringUni2 = Marshal.PtrToStringUni(new IntPtr((void*)&pmsg->pad_szMonitorPnP1)); + string stringUni2 = Marshal.PtrToStringUni(new IntPtr(&pmsg->pad_szMonitorPnP1)); display.UpdateMonitorInfo(rcMonitor, rcWork, fPrimary, nTvFormat, stringUni2, modeDesktop); return display; } @@ -227,9 +227,9 @@ namespace Microsoft.Iris.Render.Internal { DisplayMode.RenderModeComparer renderModeComparer = new DisplayMode.RenderModeComparer(); arSupportedModes = (DisplayMode[])this.m_alRebuildSupportedModes.ToArray(typeof(DisplayMode)); - Array.Sort(arSupportedModes, (IComparer)renderModeComparer); + Array.Sort(arSupportedModes, renderModeComparer); arAllModes = (DisplayMode[])this.m_alRebuildAllModes.ToArray(typeof(DisplayMode)); - Array.Sort(arAllModes, (IComparer)renderModeComparer); + Array.Sort(arAllModes, renderModeComparer); Vector vector = new Vector(); int length = this.m_arExtraModes.Length; List[] intListArray = new List[length]; @@ -238,7 +238,7 @@ namespace Microsoft.Iris.Render.Internal for (int index1 = 0; index1 < this.m_alRebuildAllModes.Count; ++index1) { DisplayMode alRebuildAllMode = (DisplayMode)this.m_alRebuildAllModes[index1]; - if (Array.BinarySearch(arSupportedModes, alRebuildAllMode, (IComparer)renderModeComparer) < 0) + if (Array.BinarySearch(arSupportedModes, alRebuildAllMode, renderModeComparer) < 0) { for (int index2 = 0; index2 < this.m_arExtraModes.Length; ++index2) { @@ -246,7 +246,7 @@ namespace Microsoft.Iris.Render.Internal if (DisplayMode.CompareRenderModes(alRebuildAllMode, arExtraMode) == 0) { vector.Add(alRebuildAllMode); - intListArray[index2] = (List)null; + intListArray[index2] = null; } else if (DisplayMode.CompareSimilarModes(alRebuildAllMode, arExtraMode) == 0) intListArray[index2]?.Add(index1); @@ -262,7 +262,7 @@ namespace Microsoft.Iris.Render.Internal } } arExtraModes = vector.ToArray(); - Array.Sort(arExtraModes, (IComparer)renderModeComparer); + Array.Sort(arExtraModes, renderModeComparer); } private class DisplayInfo diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/EventCookie.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/EventCookie.cs index 53965f7..ea37fd6 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/EventCookie.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/EventCookie.cs @@ -38,6 +38,6 @@ namespace Microsoft.Iris.Render.Internal internal static uint ToUInt32(EventCookie handle) => handle.m_value; - public static EventCookie ReserveSlot() => EventCookie.FromUInt32(KeyAllocator.ReserveSlot()); + public static EventCookie ReserveSlot() => FromUInt32(KeyAllocator.ReserveSlot()); } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/HwndHostWindow.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/HwndHostWindow.cs index b7b502f..15d9d2f 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/HwndHostWindow.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/HwndHostWindow.cs @@ -29,8 +29,8 @@ namespace Microsoft.Iris.Render.Internal public HwndHostWindow(RenderWindow winParent) { ProtocolSplashDesktopNt ntDesktopProtocol = winParent.Session.NtDesktopProtocol; - this.m_remoteWindow = ntDesktopProtocol.BuildRemoteHwndHostWindow((IRenderHandleOwner)this, winParent.RemoteStub, ntDesktopProtocol.LocalHwndHostWindowCallbackHandle); - this.m_clrBackground = new ColorF((int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue); + this.m_remoteWindow = ntDesktopProtocol.BuildRemoteHwndHostWindow(this, winParent.RemoteStub, ntDesktopProtocol.LocalHwndHostWindowCallbackHandle); + this.m_clrBackground = new ColorF(byte.MaxValue, byte.MaxValue, byte.MaxValue); } protected override void Dispose(bool fInDispose) @@ -38,7 +38,7 @@ namespace Microsoft.Iris.Render.Internal if (fInDispose && this.m_remoteWindow != null) { this.m_remoteWindow.Dispose(); - this.m_remoteWindow = (RemoteHwndHostWindow)null; + this.m_remoteWindow = null; } base.Dispose(fInDispose); } @@ -106,11 +106,11 @@ namespace Microsoft.Iris.Render.Internal this.m_hwnd = hWnd; if (this.m_eventHandleChanged == null) return; - this.m_eventHandleChanged((object)this, EventArgs.Empty); + this.m_eventHandleChanged(this, EventArgs.Empty); } RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteWindow.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteWindow = (RemoteHwndHostWindow)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteWindow = null; } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/InputSystem.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/InputSystem.cs index da522aa..232891f 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/InputSystem.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/InputSystem.cs @@ -44,7 +44,7 @@ namespace Microsoft.Iris.Render.Internal { if (fInDispose && this.m_remoteInputRouter != null) this.m_remoteInputRouter.Dispose(); - this.m_remoteInputRouter = (RemoteInputRouter)null; + this.m_remoteInputRouter = null; } finally { @@ -54,38 +54,38 @@ namespace Microsoft.Iris.Render.Internal RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteInputRouter.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteInputRouter = (RemoteInputRouter)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteInputRouter = null; unsafe void IInputCallback.OnInput(RENDERHANDLE target, Message* inputInfoPtr) { InputSystem.RemoteCallbackMessage* remoteCallbackMessagePtr = (InputSystem.RemoteCallbackMessage*)inputInfoPtr; if (this.m_session.IsForeignByteOrderOnWindowing) - MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref InputSystem.s_ByteOrder_RemoteCallbackMessage, typeof(InputSystem.RemoteCallbackMessage), 0, 0); + MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref s_ByteOrder_RemoteCallbackMessage, typeof(InputSystem.RemoteCallbackMessage), 0, 0); switch (remoteCallbackMessagePtr->ownerMessage) { case 1: if (this.m_session.IsForeignByteOrderOnWindowing) - MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref InputSystem.s_ByteOrder_KeyboardCommandMessage, typeof(InputSystem.KeyboardCommandMessage), sizeof(InputSystem.RemoteCallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref s_ByteOrder_KeyboardCommandMessage, typeof(InputSystem.KeyboardCommandMessage), sizeof(InputSystem.RemoteCallbackMessage), 0); this.HandleKeyboardInput((InputSystem.KeyboardCommandMessage*)remoteCallbackMessagePtr); break; case 2: if (this.m_session.IsForeignByteOrderOnWindowing) - MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref InputSystem.s_ByteOrder_HIDCommandMessage, typeof(InputSystem.HIDCommandMessage), sizeof(InputSystem.RemoteCallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref s_ByteOrder_HIDCommandMessage, typeof(InputSystem.HIDCommandMessage), sizeof(InputSystem.RemoteCallbackMessage), 0); this.HandleHIDCommandInput((InputSystem.HIDCommandMessage*)remoteCallbackMessagePtr); break; case 3: if (this.m_session.IsForeignByteOrderOnWindowing) - MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref InputSystem.s_ByteOrder_AppCommandMessage, typeof(InputSystem.AppCommandMessage), sizeof(InputSystem.RemoteCallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref s_ByteOrder_AppCommandMessage, typeof(InputSystem.AppCommandMessage), sizeof(InputSystem.RemoteCallbackMessage), 0); this.HandleAppCommandInput((InputSystem.AppCommandMessage*)remoteCallbackMessagePtr); break; case 4: if (this.m_session.IsForeignByteOrderOnWindowing) - MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref InputSystem.s_ByteOrder_WindowInputCallbackMessage, typeof(InputSystem.WindowInputCallbackMessage), sizeof(InputSystem.RemoteCallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref s_ByteOrder_WindowInputCallbackMessage, typeof(InputSystem.WindowInputCallbackMessage), sizeof(InputSystem.RemoteCallbackMessage), 0); this.HandleWindowInput((InputSystem.WindowInputCallbackMessage*)remoteCallbackMessagePtr); break; case 5: if (this.m_session.IsForeignByteOrderOnWindowing) - MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref InputSystem.s_ByteOrder_DragInputCallbackMessage, typeof(InputSystem.DragInputCallbackMessage), sizeof(InputSystem.RemoteCallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)remoteCallbackMessagePtr, ref s_ByteOrder_DragInputCallbackMessage, typeof(InputSystem.DragInputCallbackMessage), sizeof(InputSystem.RemoteCallbackMessage), 0); this.HandleDragInput((InputSystem.DragInputCallbackMessage*)remoteCallbackMessagePtr); break; default: @@ -105,7 +105,7 @@ namespace Microsoft.Iris.Render.Internal public void UnregisterRawInputCallbacks() { - this.m_inputHandlers = (IRawInputCallbacks)null; + this.m_inputHandlers = null; this.m_maskInputHandlers = InputHandlerFlags.None; } @@ -139,7 +139,7 @@ namespace Microsoft.Iris.Render.Internal { if (!this.IsRegisteredForInputType(InputHandlerFlags.Mouse)) return; - RawMouseData args = new RawMouseData(this.m_session.TryGetHandleOwner(msg->subjectValue), this.m_session.TryGetHandleOwner(msg->naturalValue), msg->positionXOffset, msg->positionYOffset, msg->naturalXOffset, msg->naturalYOffset, msg->physicalXOffset, msg->physicalYOffset, msg->screenXOffset, msg->screenYOffset, (MouseButtons)msg->buttonFlag, (int)msg->wheelDelta); + RawMouseData args = new RawMouseData(this.m_session.TryGetHandleOwner(msg->subjectValue), this.m_session.TryGetHandleOwner(msg->naturalValue), msg->positionXOffset, msg->positionYOffset, msg->naturalXOffset, msg->naturalYOffset, msg->physicalXOffset, msg->physicalYOffset, msg->screenXOffset, msg->screenYOffset, (MouseButtons)msg->buttonFlag, msg->wheelDelta); this.m_inputHandlers.HandleRawMouseInput(msg->messageValue, (InputModifiers)msg->modifiersValue, ref args); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/KeyAllocator.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/KeyAllocator.cs index 36c47d1..5d187e5 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/KeyAllocator.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/KeyAllocator.cs @@ -12,6 +12,6 @@ namespace Microsoft.Iris.Render.Internal { private static int s_idxKeyGen; - internal static uint ReserveSlot() => (uint)Interlocked.Increment(ref KeyAllocator.s_idxKeyGen); + internal static uint ReserveSlot() => (uint)Interlocked.Increment(ref s_idxKeyGen); } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/Math2.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/Math2.cs index 1156e4e..448ad6e 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/Math2.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/Math2.cs @@ -8,7 +8,7 @@ namespace Microsoft.Iris.Render.Internal { internal class Math2 { - public static int FindPowerOf2(int nValue) => Math2.FindPowerOf2(nValue, 1); + public static int FindPowerOf2(int nValue) => FindPowerOf2(nValue, 1); public static int FindPowerOf2(int nValue, int nStart) { @@ -18,7 +18,7 @@ namespace Microsoft.Iris.Render.Internal return num; } - public static int RoundUp(float flValue) => (int)((double)flValue + 0.5); + public static int RoundUp(float flValue) => (int)(flValue + 0.5); public static int Clamp(int nValue, int nMin, int nMax) { @@ -29,15 +29,15 @@ namespace Microsoft.Iris.Render.Internal public static float Clamp(float flValue, float flMin, float flMax) { - if ((double)flValue < (double)flMin) + if (flValue < (double)flMin) return flMin; - return (double)flValue > (double)flMax ? flMax : flValue; + return flValue > (double)flMax ? flMax : flValue; } public static bool WithinEpsilon(float flValue1, float flValue2) { float num = flValue1 - flValue2; - return -9.99999974737875E-06 <= (double)num && (double)num <= 9.99999974737875E-06; + return -9.99999974737875E-06 <= num && num <= 9.99999974737875E-06; } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/ObjectTracker.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/ObjectTracker.cs index 4172a42..cee5b1f 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/ObjectTracker.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/ObjectTracker.cs @@ -17,15 +17,15 @@ namespace Microsoft.Iris.Render.Internal private GCHandle m_hndOwner; public ObjectTracker(RenderSession session, object objOwner) - : this(session, ObjectTracker.ThreadMode.Private, objOwner) + : this(session, ThreadMode.Private, objOwner) { } public ObjectTracker(RenderSession session, ObjectTracker.ThreadMode nMode, object objOwner) { - Debug2.Validate(session != null || nMode != ObjectTracker.ThreadMode.Private, typeof(ArgumentException), "must specify a session for private trackers"); - Debug2.Validate(objOwner != null || nMode == ObjectTracker.ThreadMode.Master, typeof(ArgumentException), "must specify an owner (except mater tracker)"); - if (nMode == ObjectTracker.ThreadMode.Private) + Debug2.Validate(session != null || nMode != ThreadMode.Private, typeof(ArgumentException), "must specify a session for private trackers"); + Debug2.Validate(objOwner != null || nMode == ThreadMode.Master, typeof(ArgumentException), "must specify an owner (except mater tracker)"); + if (nMode == ThreadMode.Private) ObjectTrackerGroup.RegisterChildTracker(this); this.m_nMode = nMode; this.m_idxNextIdentity = 1; @@ -47,7 +47,7 @@ namespace Microsoft.Iris.Render.Internal { get { - object obj = (object)null; + object obj = null; if (this.m_hndOwner.IsAllocated) obj = this.m_hndOwner.Target; return obj; @@ -60,12 +60,12 @@ namespace Microsoft.Iris.Render.Internal lock (this) { num = this.m_idxNextIdentity++; - this.AddObject((object)num, o); + this.AddObject(num, o); } return num; } - public void RemoveObject(int nIdentity) => this.RemoveKey((object)nIdentity); + public void RemoveObject(int nIdentity) => this.RemoveKey(nIdentity); public object Find(int nIdentity) => this.Find((object)nIdentity); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/ObjectTrackerGroup.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/ObjectTrackerGroup.cs index 13b6b03..eee60cb 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/ObjectTrackerGroup.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/ObjectTrackerGroup.cs @@ -8,8 +8,8 @@ namespace Microsoft.Iris.Render.Internal { internal static class ObjectTrackerGroup { - private static ObjectTracker s_objectTrackerGroup = new ObjectTracker((RenderSession)null, ObjectTracker.ThreadMode.Master, (object)null); + private static ObjectTracker s_objectTrackerGroup = new ObjectTracker(null, ObjectTracker.ThreadMode.Master, null); - internal static void RegisterChildTracker(ObjectTracker trackerToAdd) => ObjectTrackerGroup.s_objectTrackerGroup.AddObject((object)trackerToAdd); + internal static void RegisterChildTracker(ObjectTracker trackerToAdd) => s_objectTrackerGroup.AddObject(trackerToAdd); } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderCaps.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderCaps.cs index 1ee5022..491d8b9 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderCaps.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderCaps.cs @@ -27,7 +27,7 @@ namespace Microsoft.Iris.Render.Internal this.m_currentRequestId = 0U; this.m_graphicsCapsList = new Vector(); this.m_soundCapsList = new Vector(); - this.m_remoteObject = ownerSession.RenderingProtocol.BuildRemoteRenderCaps((IRenderHandleOwner)this, ownerSession.RenderingProtocol.LocalRenderCapsCallbackHandle); + this.m_remoteObject = ownerSession.RenderingProtocol.BuildRemoteRenderCaps(this, ownerSession.RenderingProtocol.LocalRenderCapsCallbackHandle); } internal bool HasValidCaps => this.m_hasValidCaps; @@ -51,12 +51,12 @@ namespace Microsoft.Iris.Render.Internal { if (this.CapsAvailable == null) return; - this.CapsAvailable((object)this, EventArgs.Empty); + this.CapsAvailable(this, EventArgs.Empty); } RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteObject.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteObject = (RemoteRenderCaps)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteObject = null; void IRenderCapsCallback.OnBeginCapsCheck(RENDERHANDLE target, uint cookie) { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderEngine.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderEngine.cs index d749039..9fa4864 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderEngine.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderEngine.cs @@ -31,16 +31,16 @@ namespace Microsoft.Iris.Render.Internal private ContextID m_localContextId; private ContextID m_engineContextId; - static RenderEngine() => RenderEngine.s_contexts = new BitArray((int)RenderEngine.s_maxContextId + 1); + static RenderEngine() => s_contexts = new BitArray((int)s_maxContextId + 1); internal RenderEngine(IrisEngineInfo engineInfo, IRenderHost renderHost) { Debug2.Validate(engineInfo != null, typeof(ArgumentNullException), nameof(engineInfo)); Debug2.Validate(renderHost != null, typeof(ArgumentNullException), nameof(renderHost)); this.m_engineInfo = engineInfo; - this.m_engineContextId = RenderEngine.AllocateContextId(); - this.m_localContextId = RenderEngine.AllocateContextId(); - this.m_primaryToken = new RenderToken((EngineInfo)engineInfo, this.m_localContextId, this.m_engineContextId, RENDERGROUP.NULL); + this.m_engineContextId = AllocateContextId(); + this.m_localContextId = AllocateContextId(); + this.m_primaryToken = new RenderToken(engineInfo, this.m_localContextId, this.m_engineContextId, RENDERGROUP.NULL); this.m_messagingSession = new MessagingSession(renderHost, this.m_primaryToken); this.m_messagingSession.Connect(); this.m_renderSession = new RenderSession(this); @@ -76,14 +76,14 @@ namespace Microsoft.Iris.Render.Internal this.m_messagingSession.Disconnect(); this.m_messagingSession.Dispose(); } - RenderEngine.FreeContextId(this.m_localContextId); - RenderEngine.FreeContextId(this.m_engineContextId); + FreeContextId(this.m_localContextId); + FreeContextId(this.m_engineContextId); } - this.m_soundDevice = (SoundDevice)null; - this.m_displayManager = (DisplayManager)null; - this.m_renderWindow = (RenderWindow)null; - this.m_renderSession = (RenderSession)null; - this.m_messagingSession = (MessagingSession)null; + this.m_soundDevice = null; + this.m_displayManager = null; + this.m_renderWindow = null; + this.m_renderSession = null; + this.m_messagingSession = null; } finally { @@ -112,15 +112,15 @@ namespace Microsoft.Iris.Render.Internal private MessagingSession MessagingSession => this.m_messagingSession; - IRenderSession IRenderEngine.Session => (IRenderSession)this.m_renderSession; + IRenderSession IRenderEngine.Session => m_renderSession; internal RenderSession Session => this.m_renderSession; - IRenderWindow IRenderEngine.Window => (IRenderWindow)this.m_renderWindow; + IRenderWindow IRenderEngine.Window => m_renderWindow; internal RenderWindow Window => this.m_renderWindow; - IDisplayManager IRenderEngine.DisplayManager => (IDisplayManager)this.m_displayManager; + IDisplayManager IRenderEngine.DisplayManager => m_displayManager; public DisplayManager DisplayManager => this.m_displayManager; @@ -207,14 +207,14 @@ namespace Microsoft.Iris.Render.Internal private void OnRenderWindowCreated(object sender, EventArgs args) { - SoundDevice soundDevice = (SoundDevice)null; + SoundDevice soundDevice = null; switch (this.m_typeSound) { case SoundDeviceType.None: this.m_soundDevice = soundDevice; break; case SoundDeviceType.DirectSound8: - soundDevice = (SoundDevice)new Ds8SoundDevice(this.m_renderSession, (IRenderWindow)this.m_renderWindow); + soundDevice = new Ds8SoundDevice(this.m_renderSession, m_renderWindow); goto case SoundDeviceType.None; case SoundDeviceType.WaveAudio: case SoundDeviceType.XAudio: @@ -229,17 +229,17 @@ namespace Microsoft.Iris.Render.Internal internal static ContextID AllocateContextId() { uint num1 = 0; - lock (RenderEngine.s_contexts) + lock (s_contexts) { - for (int index = 0; (long)index < (long)RenderEngine.s_maxContextId; ++index) + for (int index = 0; index < s_maxContextId; ++index) { - uint num2 = RenderEngine.s_contextIdSeed++; - if (RenderEngine.s_contextIdSeed > RenderEngine.s_maxContextId) - RenderEngine.s_contextIdSeed = 1U; - if (!RenderEngine.s_contexts[(int)num2]) + uint num2 = s_contextIdSeed++; + if (s_contextIdSeed > s_maxContextId) + s_contextIdSeed = 1U; + if (!s_contexts[(int)num2]) { num1 = num2; - RenderEngine.s_contexts[(int)num1] = true; + s_contexts[(int)num1] = true; break; } } @@ -251,9 +251,9 @@ namespace Microsoft.Iris.Render.Internal private static void FreeContextId(ContextID contextId) { uint uint32 = ContextID.ToUInt32(contextId); - Debug2.Validate(RenderEngine.s_contexts[(int)uint32], typeof(InvalidOperationException), "ContextID is not in use"); - lock (RenderEngine.s_contexts) - RenderEngine.s_contexts[(int)uint32] = false; + Debug2.Validate(s_contexts[(int)uint32], typeof(InvalidOperationException), "ContextID is not in use"); + lock (s_contexts) + s_contexts[(int)uint32] = false; } protected override void Invariant() diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderSession.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderSession.cs index 6f8e623..a4aad87 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderSession.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderSession.cs @@ -45,7 +45,7 @@ namespace Microsoft.Iris.Render.Internal this.m_protocolRenderingLocal = ProtocolSplashRendering.Bind(this.Messaging.WindowingPort); this.m_renderEngine = renderEngine; this.m_visPropManager = new VisualPropertyManager(); - this.m_cacheManager = (ObjectCacheManager)null; + this.m_cacheManager = null; } internal void Initialize() => this.m_animationSystem = new AnimationSystem(this); @@ -55,9 +55,9 @@ namespace Microsoft.Iris.Render.Internal try { if (fInDispose && this.m_animationSystem != null) - this.m_animationSystem.UnregisterUsage((object)this); + this.m_animationSystem.UnregisterUsage(this); this.UnregisterOwningThread(); - this.m_animationSystem = (AnimationSystem)null; + this.m_animationSystem = null; this.m_visPropManager.Dispose(); } finally @@ -66,15 +66,15 @@ namespace Microsoft.Iris.Render.Internal } } - IGraphicsDevice IRenderSession.GraphicsDevice => (IGraphicsDevice)this.m_renderEngine.Window.GraphicsDevice; + IGraphicsDevice IRenderSession.GraphicsDevice => m_renderEngine.Window.GraphicsDevice; - ISoundDevice IRenderSession.SoundDevice => (ISoundDevice)this.m_renderEngine.SoundDevice; + ISoundDevice IRenderSession.SoundDevice => m_renderEngine.SoundDevice; internal SoundDevice SoundDevice => this.m_renderEngine.SoundDevice; - IAnimationSystem IRenderSession.AnimationSystem => (IAnimationSystem)this.m_animationSystem; + IAnimationSystem IRenderSession.AnimationSystem => m_animationSystem; - IInputSystem IRenderSession.InputSystem => (IInputSystem)this.m_renderEngine.InputSystem; + IInputSystem IRenderSession.InputSystem => m_renderEngine.InputSystem; internal MessagingSession Messaging => this.m_owningSession; @@ -105,7 +105,7 @@ namespace Microsoft.Iris.Render.Internal Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); EffectTemplate effectTemplate = this.m_renderEngine.Window.GraphicsDevice.CreateEffectTemplate(stName); effectTemplate.RegisterUsage(objUser); - return (IEffectTemplate)effectTemplate; + return effectTemplate; } public IVideoStream CreateVideoStream(object objUser) @@ -113,7 +113,7 @@ namespace Microsoft.Iris.Render.Internal Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); VideoStream videoStream = new VideoStream(this, this.m_renderEngine.Window.GraphicsDevice); videoStream.RegisterUsage(objUser); - return (IVideoStream)videoStream; + return videoStream; } public IVisualContainer CreateVisualContainer( @@ -121,7 +121,7 @@ namespace Microsoft.Iris.Render.Internal object objOwnerData) { Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); - VisualContainer visualContainer = (VisualContainer)null; + VisualContainer visualContainer = null; if (this.m_cacheContainer != null) { visualContainer = (VisualContainer)this.m_cacheContainer.Remove(objUser); @@ -135,7 +135,7 @@ namespace Microsoft.Iris.Render.Internal visualContainer.RegisterUsage(objUser); visualContainer.Cache = this.m_cacheContainer; } - return (IVisualContainer)visualContainer; + return visualContainer; } public ICamera CreateCamera(object objUser) @@ -143,7 +143,7 @@ namespace Microsoft.Iris.Render.Internal Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); Camera camera = new Camera(this); camera.RegisterUsage(objUser); - return (ICamera)camera; + return camera; } public IGradient CreateGradient(object objUser) @@ -151,13 +151,13 @@ namespace Microsoft.Iris.Render.Internal Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); Gradient gradient = new Gradient(this, this.m_renderEngine.Window.GraphicsDevice.RemoteDevice); gradient.RegisterUsage(objUser); - return (IGradient)gradient; + return gradient; } public ISprite CreateSprite(object objUser, object objOwnerData) { Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); - Sprite sprite = (Sprite)null; + Sprite sprite = null; if (this.m_cacheSprite != null) { sprite = (Sprite)this.m_cacheSprite.Remove(objUser); @@ -170,7 +170,7 @@ namespace Microsoft.Iris.Render.Internal sprite.RegisterUsage(objUser); sprite.Cache = this.m_cacheSprite; } - return (ISprite)sprite; + return sprite; } public IImage CreateImage( @@ -182,7 +182,7 @@ namespace Microsoft.Iris.Render.Internal Debug2.Validate(handler != null, typeof(InvalidOperationException), "Invalid handler"); Image image = this.m_renderEngine.Window.GraphicsDevice.CreateImage(identifier, handler); image.RegisterUsage(objUser); - return (IImage)image; + return image; } internal GraphicsCaps GetGraphicsCaps(GraphicsDeviceType type) @@ -197,7 +197,7 @@ namespace Microsoft.Iris.Render.Internal private void RegisterOwningThread() => this.m_owningSession = MessagingSession.Current; - private void UnregisterOwningThread() => this.m_owningSession = (MessagingSession)null; + private void UnregisterOwningThread() => this.m_owningSession = null; internal void AssertOwningThread() { @@ -240,13 +240,13 @@ namespace Microsoft.Iris.Render.Internal { this.m_cacheManager.UnregisterCache(this.m_cacheSprite); this.m_cacheSprite.Dispose(); - this.m_cacheSprite = (Microsoft.Iris.Render.Common.ObjectCache)null; + this.m_cacheSprite = null; } if (this.m_cacheContainer == null) return; this.m_cacheManager.UnregisterCache(this.m_cacheContainer); this.m_cacheContainer.Dispose(); - this.m_cacheContainer = (Microsoft.Iris.Render.Common.ObjectCache)null; + this.m_cacheContainer = null; } internal RENDERHANDLE AllocateRenderHandle(IRenderHandleOwner owner) => this.RenderingPort.AllocHandle(owner); @@ -260,7 +260,7 @@ namespace Microsoft.Iris.Render.Internal bool fEnumDisplayModes) { Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread"); - return this.NtDesktopProtocol.BuildRemoteDesktopManager((IRenderHandleOwner)owner, this.NtDesktopProtocol.LocalDesktopManagerCallbackHandle, fEnumDisplayModes); + return this.NtDesktopProtocol.BuildRemoteDesktopManager(owner, this.NtDesktopProtocol.LocalDesktopManagerCallbackHandle, fEnumDisplayModes); } internal RemoteFormWindow BuildRemoteFormWindow( @@ -268,7 +268,7 @@ namespace Microsoft.Iris.Render.Internal DisplayManager displayManager) { Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread"); - return this.NtDesktopProtocol.BuildRemoteFormWindow((IRenderHandleOwner)window, displayManager.RemoteStub, this.DesktopProtocol.LocalFormWindowCallbackHandle); + return this.NtDesktopProtocol.BuildRemoteFormWindow(window, displayManager.RemoteStub, this.DesktopProtocol.LocalFormWindowCallbackHandle); } internal RemoteInputRouter BuildRemoteInputRouter( @@ -276,20 +276,20 @@ namespace Microsoft.Iris.Render.Internal RenderWindow window) { Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread"); - RemoteInputRouter remoteInputRouter = this.DesktopProtocol.BuildRemoteInputRouter((IRenderHandleOwner)inputSystem, this.DesktopProtocol.LocalInputCallbackHandle); + RemoteInputRouter remoteInputRouter = this.DesktopProtocol.BuildRemoteInputRouter(inputSystem, this.DesktopProtocol.LocalInputCallbackHandle); remoteInputRouter?.SendRegisterWithInputSource(this.WindowingPort.DefaultGroupID, ((IRenderHandleOwner)window).RenderHandle); return remoteInputRouter; } - internal RemoteNtDevice BuildRemoteNtDevice(NtGraphicsDevice device) => this.NtRenderingProtocol.BuildRemoteNtDevice((IRenderHandleOwner)device, this.RenderingProtocol.LocalDeviceCallbackHandle); + internal RemoteNtDevice BuildRemoteNtDevice(NtGraphicsDevice device) => this.NtRenderingProtocol.BuildRemoteNtDevice(device, this.RenderingProtocol.LocalDeviceCallbackHandle); - internal RemoteGdiDevice BuildRemoteGdiDevice(GdiGraphicsDevice device) => this.NtRenderingProtocol.BuildRemoteGdiDevice((IRenderHandleOwner)device, this.RenderingProtocol.LocalDeviceCallbackHandle); + internal RemoteGdiDevice BuildRemoteGdiDevice(GdiGraphicsDevice device) => this.NtRenderingProtocol.BuildRemoteGdiDevice(device, this.RenderingProtocol.LocalDeviceCallbackHandle); internal RemoteNullDevice BuildRemoteNullDevice( NullGraphicsDevice device, bool fUseSplitWindowingPort) { - return fUseSplitWindowingPort ? this.LocalRenderingProtocol.BuildRemoteNullDevice((IRenderHandleOwner)device, this.LocalRenderingProtocol.LocalDeviceCallbackHandle) : this.RenderingProtocol.BuildRemoteNullDevice((IRenderHandleOwner)device, this.RenderingProtocol.LocalDeviceCallbackHandle); + return fUseSplitWindowingPort ? this.LocalRenderingProtocol.BuildRemoteNullDevice(device, this.LocalRenderingProtocol.LocalDeviceCallbackHandle) : this.RenderingProtocol.BuildRemoteNullDevice(device, this.RenderingProtocol.LocalDeviceCallbackHandle); } internal unsafe DataBuffer BuildDataBuffer(IntPtr pData, uint cbSize) => new DataBuffer(this.RenderingPort, pData.ToPointer(), cbSize); @@ -301,29 +301,29 @@ namespace Microsoft.Iris.Render.Internal Dx9GraphicsDevice dx9Device, DataBuffer dataBuffer) { - return this.RenderingProtocol.BuildRemoteDx9EffectResource((IRenderHandleOwner)effectResource, dx9Device.RemoteDevice, dataBuffer.RemoteStub); + return this.RenderingProtocol.BuildRemoteDx9EffectResource(effectResource, dx9Device.RemoteDevice, dataBuffer.RemoteStub); } - internal RemoteDx9Effect BuildRemoteDx9Effect(Dx9Effect effect) => RemoteDx9Effect.Create(this.RenderingProtocol, (IRenderHandleOwner)effect); + internal RemoteDx9Effect BuildRemoteDx9Effect(Dx9Effect effect) => RemoteDx9Effect.Create(this.RenderingProtocol, effect); - internal RemoteGdiEffect BuildRemoteGdiEffect(GdiEffect effect) => RemoteGdiEffect.Create(this.NtRenderingProtocol, (IRenderHandleOwner)effect); + internal RemoteGdiEffect BuildRemoteGdiEffect(GdiEffect effect) => RemoteGdiEffect.Create(this.NtRenderingProtocol, effect); - internal RemoteCamera BuildRemoteCamera(Camera camera) => this.RenderingProtocol.BuildRemoteCamera((IRenderHandleOwner)camera); + internal RemoteCamera BuildRemoteCamera(Camera camera) => this.RenderingProtocol.BuildRemoteCamera(camera); - internal RemoteVisualContainer BuildRemoteVisualContainer(Visual visual) => this.RenderingProtocol.BuildRemoteVisualContainer((IRenderHandleOwner)visual); + internal RemoteVisualContainer BuildRemoteVisualContainer(Visual visual) => this.RenderingProtocol.BuildRemoteVisualContainer(visual); internal RemoteSprite BuildRemoteSprite(Sprite sprite, RenderWindow window) { switch (window.GraphicsDeviceType) { case GraphicsDeviceType.Gdi: - return (RemoteSprite)this.NtRenderingProtocol.BuildRemoteGdiSprite((IRenderHandleOwner)sprite); + return this.NtRenderingProtocol.BuildRemoteGdiSprite(sprite); case GraphicsDeviceType.Direct3D9: case GraphicsDeviceType.XeDirectX9: - return (RemoteSprite)this.RenderingProtocol.BuildRemoteDx9Sprite((IRenderHandleOwner)sprite); + return this.RenderingProtocol.BuildRemoteDx9Sprite(sprite); default: - Debug2.Throw(false, "Unrecognized device type: {0}", (object)window.GraphicsDeviceType); - return (RemoteSprite)null; + Debug2.Throw(false, "Unrecognized device type: {0}", window.GraphicsDeviceType); + return null; } } @@ -335,7 +335,7 @@ namespace Microsoft.Iris.Render.Internal AnimationSystem owner) { Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread"); - return this.RenderingProtocol.BuildRemoteAnimationManager((IRenderHandleOwner)owner); + return this.RenderingProtocol.BuildRemoteAnimationManager(owner); } public RemoteAnimation BuildRemoteAnimation( @@ -343,7 +343,7 @@ namespace Microsoft.Iris.Render.Internal AnimationInputType animationType) { Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread"); - return this.RenderingProtocol.BuildRemoteAnimation((IRenderHandleOwner)owner, animationType, this.RenderingProtocol.LocalAnimationCallbackHandle); + return this.RenderingProtocol.BuildRemoteAnimation(owner, animationType, this.RenderingProtocol.LocalAnimationCallbackHandle); } public RemoteExternalAnimationInput BuildRemoteExternalAnimationInput( @@ -351,7 +351,7 @@ namespace Microsoft.Iris.Render.Internal uint uniqueId) { Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread"); - return this.RenderingProtocol.BuildRemoteExternalAnimationInput((IRenderHandleOwner)owner, uniqueId); + return this.RenderingProtocol.BuildRemoteExternalAnimationInput(owner, uniqueId); } public RemoteAnimationInputProvider BuildRemoteAnimationInputProvider( @@ -359,7 +359,7 @@ namespace Microsoft.Iris.Render.Internal uint externalAnimationInputId) { Debug2.Validate(this.IsOwningThread(), typeof(InvalidOperationException), "Must be called on the session's owning client thread"); - return this.RenderingProtocol.BuildRemoteAnimationInputProvider((IRenderHandleOwner)owner, externalAnimationInputId); + return this.RenderingProtocol.BuildRemoteAnimationInputProvider(owner, externalAnimationInputId); } protected override void Invariant() diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderWindow.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderWindow.cs index 6466d31..eb0d7e5 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderWindow.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderWindow.cs @@ -113,10 +113,10 @@ namespace Microsoft.Iris.Render.Internal this.m_fSessionHasDisplay = true; this.m_fSessionLocked = false; this.m_szDefault = new Size(640, 480); - this.m_clrOutlineAllColor = new ColorF((int)byte.MaxValue, 0, (int)byte.MaxValue, 0); - this.m_clrOutlineMarkedColor = new ColorF((int)byte.MaxValue, (int)byte.MaxValue, 0, 0); + this.m_clrOutlineAllColor = new ColorF(byte.MaxValue, 0, byte.MaxValue, 0); + this.m_clrOutlineMarkedColor = new ColorF(byte.MaxValue, byte.MaxValue, 0, 0); this.m_mapShutdownHooks = new SmartMap(); - this.m_nextShutdownHookId = (ushort)1; + this.m_nextShutdownHookId = 1; this.m_nMouseLockCount = 0; this.SetFullScreenExclusive(false); } @@ -128,16 +128,16 @@ namespace Microsoft.Iris.Render.Internal GraphicsDeviceType graphicsDeviceType, GraphicsRenderingQuality renderingQuality) { - GraphicsDevice graphicsDevice = (GraphicsDevice)null; + GraphicsDevice graphicsDevice = null; EngineApi.IFC(FormApi.SpGdiplusInit()); this.m_graphicsDeviceType = graphicsDeviceType; switch (this.m_graphicsDeviceType) { case GraphicsDeviceType.Gdi: - this.m_device = (GraphicsDevice)new GdiGraphicsDevice(session); + this.m_device = new GdiGraphicsDevice(session); break; case GraphicsDeviceType.Direct3D9: - this.m_device = (GraphicsDevice)new NtGraphicsDevice(session, renderingQuality); + this.m_device = new NtGraphicsDevice(session, renderingQuality); break; } return graphicsDevice; @@ -146,8 +146,8 @@ namespace Microsoft.Iris.Render.Internal internal void Dispose() { this.Visible = false; - this.m_remoteWindow.SendSetRoot((RemoteVisual)null); - this.m_rootVisual.UnregisterUsage((object)this); + this.m_remoteWindow.SendSetRoot(null); + this.m_rootVisual.UnregisterUsage(this); this.StopRendering(); } @@ -156,19 +156,19 @@ namespace Microsoft.Iris.Render.Internal if (this.m_device != null) { this.m_device.Dispose(); - this.m_device = (GraphicsDevice)null; + this.m_device = null; } if (this.m_remoteWindow != null) { this.m_remoteWindow.Dispose(); - this.m_remoteWindow = (RemoteFormWindow)null; + this.m_remoteWindow = null; } EngineApi.IFC(FormApi.SpGdiplusUninit()); } RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteWindow.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteWindow = (RemoteFormWindow)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteWindow = null; internal RemoteFormWindow RemoteStub => this.m_remoteWindow; @@ -312,13 +312,13 @@ namespace Microsoft.Iris.Render.Internal IDisplay IRenderWindow.CurrentDisplay { - get => this.m_currentDisplay == null ? this.m_displayManager.PrimaryDisplay : (IDisplay)this.m_currentDisplay; + get => this.m_currentDisplay == null ? this.m_displayManager.PrimaryDisplay : m_currentDisplay; set => this.SetCurrentDisplay(value); } private void SetCurrentDisplay(IDisplay inputIDisplay) { - Debug2.Validate(inputIDisplay is Display, (Type)null, "CurrentDisplay.set param MUST be a valid Display object"); + Debug2.Validate(inputIDisplay is Display, null, "CurrentDisplay.set param MUST be a valid Display object"); Display display = this.m_displayManager.DisplayFromUniqueId((inputIDisplay as Display).UniqueId); if (display == null) return; @@ -380,9 +380,9 @@ namespace Microsoft.Iris.Render.Internal set => this.m_remoteWindow.INPROC_SendSetAppNotifyWindow(value); } - IVisualContainer IRenderWindow.VisualRoot => (IVisualContainer)this.m_rootVisual; + IVisualContainer IRenderWindow.VisualRoot => m_rootVisual; - TreeNode ITreeOwner.Root => (TreeNode)this.m_rootVisual; + TreeNode ITreeOwner.Root => m_rootVisual; internal bool IsClosing => this.m_fClosing; @@ -464,7 +464,7 @@ namespace Microsoft.Iris.Render.Internal { if (this.WindowCreatedEvent == null) return; - this.WindowCreatedEvent((object)this, EventArgs.Empty); + this.WindowCreatedEvent(this, EventArgs.Empty); } private void OnForwardWndMsg(uint msg, IntPtr wParam, IntPtr lParam) @@ -617,11 +617,11 @@ namespace Microsoft.Iris.Render.Internal if (fCanAdd) { ushort uIdMsg = this.m_nextShutdownHookId++; - this.m_mapShutdownHooks.SetValue((uint)uIdMsg, desired); + this.m_mapShutdownHooks.SetValue(uIdMsg, desired); this.m_remoteWindow.SendEnableShellShutdownHook(hookName, uIdMsg); } else - desired = (RenderWindow.ShutdownHookInfo)null; + desired = null; return desired; } @@ -683,7 +683,7 @@ namespace Microsoft.Iris.Render.Internal { RenderWindow.FormStateCallbackMsg* stateCallbackMsgPtr = (RenderWindow.FormStateCallbackMsg*)pmsgRaw; if (this.m_session.IsForeignByteOrderOnWindowing) - MarshalHelper.SwapByteOrder((byte*)stateCallbackMsgPtr, ref RenderWindow.s_ByteOrder_FormStateCallbackMsg, typeof(RenderWindow.FormStateCallbackMsg), 0, 0); + MarshalHelper.SwapByteOrder((byte*)stateCallbackMsgPtr, ref s_ByteOrder_FormStateCallbackMsg, typeof(RenderWindow.FormStateCallbackMsg), 0, 0); uint num = 0; if (this.m_currentDisplay != null) num = this.m_currentDisplay.UniqueId; @@ -713,7 +713,7 @@ namespace Microsoft.Iris.Render.Internal this.OnLocationChanged(); if (flag5) { - this.m_rootVisual.Size = new Vector2((float)this.m_nWidth, (float)this.m_nHeight); + this.m_rootVisual.Size = new Vector2(m_nWidth, m_nHeight); this.OnSizeChanged(); } if (((int)stateCallbackMsgPtr->uRecentlyChanged & 1) != 0) @@ -734,15 +734,15 @@ namespace Microsoft.Iris.Render.Internal { if (this.m_partialDropData == null) this.m_partialDropData = new ArrayList(); - this.m_partialDropData.Add((object)file); + this.m_partialDropData.Add(file); } void IFormWindowCallback.OnDropComplete(RENDERHANDLE target) { if (this.m_partialDropData == null || this.m_partialDropData.Count <= 0) return; - IEnumerable partialDropData = (IEnumerable)this.m_partialDropData; - this.m_partialDropData = (ArrayList)null; + IEnumerable partialDropData = m_partialDropData; + this.m_partialDropData = null; this.OnDroppedFiles(partialDropData); } @@ -763,16 +763,16 @@ namespace Microsoft.Iris.Render.Internal ushort hookId) { RenderWindow.ShutdownHookInfo shutdownHookInfo; - if (!this.m_mapShutdownHooks.TryGetValue((uint)hookId, out shutdownHookInfo)) + if (!this.m_mapShutdownHooks.TryGetValue(hookId, out shutdownHookInfo)) return; - shutdownHookInfo.OnHook((object)this, EventArgs.Empty); + shutdownHookInfo.OnHook(this, EventArgs.Empty); } void IFormWindowCallback.OnNativeScreensave( RENDERHANDLE target, bool fStartScreensave) { - this.m_session.DeferredInvoke((Delegate)new DeferredHandler(this.DoNativeScreensave), (object)fStartScreensave, DeferredInvokePriority.Idle); + this.m_session.DeferredInvoke(new DeferredHandler(this.DoNativeScreensave), fStartScreensave, DeferredInvokePriority.Idle); } private void DoNativeScreensave(object objParam) => this.OnNativeScreensave((bool)objParam); @@ -792,13 +792,13 @@ namespace Microsoft.Iris.Render.Internal { if (this.RendererSuspendedEvent == null) return; - this.RendererSuspendedEvent((object)this.m_device, new RenderWindow.RendererSuspendedArgs(fSuspended)); + this.RendererSuspendedEvent(m_device, new RenderWindow.RendererSuspendedArgs(fSuspended)); } internal RenderWindow.RenderFlags GlobalRenderFlags { get => this.m_renderFlags; - set => this.SetGlobalRenderFlags(value, RenderWindow.RenderFlags.All); + set => this.SetGlobalRenderFlags(value, RenderFlags.All); } internal bool SetGlobalRenderFlags( @@ -843,10 +843,10 @@ namespace Microsoft.Iris.Render.Internal this.m_remoteWindow.SendCreateRootContainer(); this.m_remoteWindow.SendSetHitMasks(1U, 2U, 4U, 8U); RemoteVisual remoteVisual; - this.m_rootVisual = new VisualContainer(true, this.m_session, this, (object)null, out remoteVisual); - this.m_rootVisual.RegisterUsage((object)this); + this.m_rootVisual = new VisualContainer(true, this.m_session, this, null, out remoteVisual); + this.m_rootVisual.RegisterUsage(this); this.m_remoteWindow.SendSetRoot(remoteVisual); - this.m_rootVisual.Size = new Vector2((float)this.m_nWidth, (float)this.m_nHeight); + this.m_rootVisual.Size = new Vector2(m_nWidth, m_nHeight); } void IRenderWindow.ClientToScreen(ref Point point) @@ -930,7 +930,7 @@ namespace Microsoft.Iris.Render.Internal { if (this.m_stkWaitCursors == null) this.m_stkWaitCursors = new Stack(); - this.m_stkWaitCursors.Push((object)cursor); + this.m_stkWaitCursors.Push(cursor); this.UpdateCursors(); } @@ -975,18 +975,18 @@ namespace Microsoft.Iris.Render.Internal { if (!this.m_session.IsValid) return; - Debug2.Validate(edges != null, (Type)null, "Must pass non-null edges set"); - Debug2.Validate(edges.Length == 4, (Type)null, "Must pass exactly 4 edges, LTRB"); + Debug2.Validate(edges != null, null, "Must pass non-null edges set"); + Debug2.Validate(edges.Length == 4, null, "Must pass exactly 4 edges, LTRB"); for (int index = 0; index < 4; ++index) { - Debug2.Validate(edges[index].ModuleName != null, (Type)null, "Must pass non-null ModuleName:" + index.ToString()); - Debug2.Validate(edges[index].ResourceName != null, (Type)null, "Must pass non-null ResourceName:" + index.ToString()); + Debug2.Validate(edges[index].ModuleName != null, null, "Must pass non-null ModuleName:" + index.ToString()); + Debug2.Validate(edges[index].ResourceName != null, null, "Must pass non-null ResourceName:" + index.ToString()); } - Debug2.Validate(string.Equals(edges[0].ModuleName, edges[1].ModuleName), (Type)null, "Module names differ - not supported"); - Debug2.Validate(string.Equals(edges[0].ModuleName, edges[2].ModuleName), (Type)null, "Module names differ - not supported"); - Debug2.Validate(string.Equals(edges[0].ModuleName, edges[3].ModuleName), (Type)null, "Module names differ - not supported"); - Debug2.Validate(edges[0].SplitPoints == edges[2].SplitPoints, (Type)null, "L+R splits differ - not supported"); - Debug2.Validate(edges[1].SplitPoints == edges[3].SplitPoints, (Type)null, "T+B splits differ - not supported"); + Debug2.Validate(string.Equals(edges[0].ModuleName, edges[1].ModuleName), null, "Module names differ - not supported"); + Debug2.Validate(string.Equals(edges[0].ModuleName, edges[2].ModuleName), null, "Module names differ - not supported"); + Debug2.Validate(string.Equals(edges[0].ModuleName, edges[3].ModuleName), null, "Module names differ - not supported"); + Debug2.Validate(edges[0].SplitPoints == edges[2].SplitPoints, null, "L+R splits differ - not supported"); + Debug2.Validate(edges[1].SplitPoints == edges[3].SplitPoints, null, "T+B splits differ - not supported"); Inset insetSplits = new Inset(edges[1].SplitPoints.Left, edges[0].SplitPoints.Top, edges[1].SplitPoints.Right, edges[0].SplitPoints.Bottom); this.m_remoteWindow.SendSetEdgeImageParts(fActiveEdges, edges[0].ModuleName, edges[0].ResourceName, edges[1].ResourceName, edges[2].ResourceName, edges[3].ResourceName, insetSplits); } @@ -1047,7 +1047,7 @@ namespace Microsoft.Iris.Render.Internal this.m_remoteWindow.SendTemporarilyExitExclusiveMode(); } - public IHwndHostWindow CreateHwndHostWindow() => (IHwndHostWindow)new HwndHostWindow(this); + public IHwndHostWindow CreateHwndHostWindow() => new HwndHostWindow(this); public void UnlockForegroundWindow() { @@ -1092,7 +1092,7 @@ namespace Microsoft.Iris.Render.Internal { Cursor cursor1 = Cursor.NullCursor; Cursor nullCursor = Cursor.NullCursor; - Cursor cursor2 = (Cursor)null; + Cursor cursor2 = null; if (this.m_stkWaitCursors != null && this.m_stkWaitCursors.Count > 0) cursor2 = this.m_stkWaitCursors.Peek() as Cursor; Cursor cursor3; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/Win32Api.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/Win32Api.cs index 293a302..87d9be0 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/Win32Api.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/Win32Api.cs @@ -74,13 +74,13 @@ namespace Microsoft.Iris.Render.Internal public static IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1); private static readonly string[] s_rgsMessageNames = new string[0]; - public static Win32Api.COLORREF ARGB(byte a, byte r, byte g, byte b) => new Win32Api.COLORREF((uint)((int)a << 24 | (int)b << 16 | (int)g << 8) | (uint)r); + public static Win32Api.COLORREF ARGB(byte a, byte r, byte g, byte b) => new Win32Api.COLORREF((uint)(a << 24 | b << 16 | g << 8) | r); - public static Win32Api.COLORREF RGB(byte r, byte g, byte b) => new Win32Api.COLORREF((uint)((int)b << 16 | (int)g << 8) | (uint)r); + public static Win32Api.COLORREF RGB(byte r, byte g, byte b) => new Win32Api.COLORREF((uint)(b << 16 | g << 8) | r); - public static Win32Api.COLORREF RGB(int r, int g, int b) => Win32Api.RGB((byte)r, (byte)g, (byte)b); + public static Win32Api.COLORREF RGB(int r, int g, int b) => RGB((byte)r, (byte)g, (byte)b); - public static int GetRValue(Win32Api.COLORREF cr) => (int)cr.cr & (int)byte.MaxValue; + public static int GetRValue(Win32Api.COLORREF cr) => (int)cr.cr & byte.MaxValue; public static int GetGValue(Win32Api.COLORREF cr) => (int)((cr.cr & 65280U) >> 8); @@ -202,31 +202,31 @@ namespace Microsoft.Iris.Render.Internal internal static uint GetSystemPageSize() { Win32Api.SYSTEM_INFO info; - Win32Api.GetSystemInfo(out info); + GetSystemInfo(out info); return info.dwPageSize; } - internal static string DumpMessage(uint uMsg) => Win32Api.DumpMessageWorker(uMsg) ?? "UNKNOWN MESSAGE"; + internal static string DumpMessage(uint uMsg) => DumpMessageWorker(uMsg) ?? "UNKNOWN MESSAGE"; private static string DumpMessageWorker(uint uMsg) { - Win32Api.InitMessageDump(); - if ((long)uMsg >= (long)Win32Api.s_rgsMessageNames.Length) - return (string)null; - string rgsMessageName = Win32Api.s_rgsMessageNames[(IntPtr)uMsg]; + InitMessageDump(); + if (uMsg >= s_rgsMessageNames.Length) + return null; + string rgsMessageName = s_rgsMessageNames[(IntPtr)uMsg]; if (rgsMessageName != null) return rgsMessageName; uint num = uMsg; while (uMsg > 0U) { --num; - rgsMessageName = Win32Api.s_rgsMessageNames[(IntPtr)num]; + rgsMessageName = s_rgsMessageNames[(IntPtr)num]; if (rgsMessageName != null) break; } if (rgsMessageName == null) - return (string)null; - return string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0} + {1}", (object)rgsMessageName, (object)(uint)((int)uMsg - (int)num)); + return null; + return string.Format(CultureInfo.InvariantCulture, "{0} + {1}", rgsMessageName, (uint)((int)uMsg - (int)num)); } private static void InitMessageDump() @@ -249,7 +249,7 @@ namespace Microsoft.Iris.Render.Internal { public IntPtr h; - public bool IsValid => this.h != Win32Api.INVALID_HANDLE_VALUE; + public bool IsValid => this.h != INVALID_HANDLE_VALUE; public static Win32Api.HANDLE NULL => new Win32Api.HANDLE() { @@ -258,7 +258,7 @@ namespace Microsoft.Iris.Render.Internal public static Win32Api.HANDLE INVALID => new Win32Api.HANDLE() { - h = Win32Api.INVALID_HANDLE_VALUE + h = INVALID_HANDLE_VALUE }; public static bool operator ==(Win32Api.HANDLE hl, Win32Api.HANDLE hr) => hl.h == hr.h; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/InterpolateElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/InterpolateElement.cs index 2785bd1..788e98f 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/InterpolateElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/InterpolateElement.cs @@ -28,7 +28,7 @@ namespace Microsoft.Iris.Render Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); Debug2.Validate(effectInput1 != null, typeof(ArgumentNullException), nameof(effectInput1)); Debug2.Validate(effectInput2 != null, typeof(ArgumentNullException), nameof(effectInput2)); - Debug2.Validate((double)flValue >= 0.0 && (double)flValue <= 1.0, typeof(ArgumentOutOfRangeException), nameof(flValue)); + Debug2.Validate(flValue >= 0.0 && flValue <= 1.0, typeof(ArgumentOutOfRangeException), nameof(flValue)); this.m_stName = stName; this.m_effectInput1 = effectInput1; this.m_effectInput2 = effectInput2; @@ -61,10 +61,10 @@ namespace Microsoft.Iris.Render Map dictionary, ref byte nNextUniqueID) { - return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.m_effectInput1.PreProcessProperties(dictionary, ref nNextUniqueID) + this.m_effectInput2.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Value", (byte)8, ref this.m_nValueID, ref nNextUniqueID); + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.m_effectInput1.PreProcessProperties(dictionary, ref nNextUniqueID) + this.m_effectInput2.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Value", 8, ref this.m_nValueID, ref nNextUniqueID); } - internal override bool Process(Map dictProperties) => this.m_effectInput1.Process(dictProperties) && this.m_effectInput2.Process(dictProperties) && this.GenerateProperty("Value", EffectPropertyType.Float, (object)this.m_flValue, this.m_nValueID, dictProperties); + internal override bool Process(Map dictProperties) => this.m_effectInput1.Process(dictProperties) && this.m_effectInput2.Process(dictProperties) && this.GenerateProperty("Value", EffectPropertyType.Float, m_flValue, this.m_nValueID, dictProperties); internal override void AddCacheKey(ByteBuilder cacheKey) { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/IrisEngineInfo.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/IrisEngineInfo.cs index a3c9632..fdd0ddd 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/IrisEngineInfo.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/IrisEngineInfo.cs @@ -13,16 +13,16 @@ namespace Microsoft.Iris.Render { private ConnectionInfo m_connectionInfo; - public static EngineInfo CreateLocal() => (EngineInfo)new IrisEngineInfo(true); + public static EngineInfo CreateLocal() => new IrisEngineInfo(true); - public static EngineInfo CreateRemote() => (EngineInfo)new IrisEngineInfo(true, TransportProtocol.TCP, "127.0.0.1", false); + public static EngineInfo CreateRemote() => new IrisEngineInfo(true, TransportProtocol.TCP, "127.0.0.1", false); internal IrisEngineInfo(bool isPrimary) : base(EngineType.Iris) { if (!isPrimary) throw new NotImplementedException("Local connections to an existing engine are not supported yet"); - this.m_connectionInfo = (ConnectionInfo)new LocalConnectionInfo(); + this.m_connectionInfo = new LocalConnectionInfo(); } internal IrisEngineInfo( @@ -34,7 +34,7 @@ namespace Microsoft.Iris.Render { if (!isPrimary) throw new NotImplementedException("Local connections to an existing engine are not supported yet"); - this.m_connectionInfo = (ConnectionInfo)new RemoteConnectionInfo(protocol, sessionName, swapByteOrder); + this.m_connectionInfo = new RemoteConnectionInfo(protocol, sessionName, swapByteOrder); } internal ConnectionInfo ConnectionInfo => this.m_connectionInfo; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Key.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Key.cs index 21585f8..dcc3ad8 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Key.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Key.cs @@ -14,9 +14,9 @@ namespace Microsoft.Iris.Render public const string PublicKeyToken = "31bf3856ad364e35"; public const string PublicKeyTokenAttrib = ",PublicKeyToken=31bf3856ad364e35"; public const string PublicKeyAttrib = ",PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9"; - private static readonly byte[] s_arPublicKeyBinary = Key.ComputeBinaryKey(); + private static readonly byte[] s_arPublicKeyBinary = ComputeBinaryKey(); - public static byte[] PublicKeyBinary => (byte[])Key.s_arPublicKeyBinary.Clone(); + public static byte[] PublicKeyBinary => (byte[])s_arPublicKeyBinary.Clone(); private static byte[] ComputeBinaryKey() { @@ -26,7 +26,7 @@ namespace Microsoft.Iris.Render int index2 = 0; while (index2 < length) { - numArray[index2] = (byte)(Key.ParseNibble("0x0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9"[index1]) << 4 | Key.ParseNibble("0x0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9"[index1 + 1])); + numArray[index2] = (byte)(ParseNibble("0x0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9"[index1]) << 4 | ParseNibble("0x0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9"[index1 + 1])); ++index2; index1 += 2; } @@ -36,11 +36,11 @@ namespace Microsoft.Iris.Render private static uint ParseNibble(char c) { if (c >= '0' && c <= '9') - return (uint)c - 48U; + return c - 48U; if (c >= 'a' && c <= 'f') - return (uint)(10 + ((int)c - 97)); + return (uint)(10 + (c - 97)); if (c >= 'A' && c <= 'F') - return (uint)(10 + ((int)c - 65)); + return (uint)(10 + (c - 65)); Debug2.Throw(false, "invalid number format"); return 0; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/LightShaftElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/LightShaftElement.cs index a6b35a2..3c2954d 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/LightShaftElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/LightShaftElement.cs @@ -42,11 +42,11 @@ namespace Microsoft.Iris.Render : this() { Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); - Debug2.Validate((double)flDecay >= 0.0 && (double)flDecay <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Decay is [0,1]"); - Debug2.Validate((double)flDensity > 0.0 && (double)flDensity <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Density is (0..1]"); - Debug2.Validate((double)flFallOff >= 0.0 && (double)flFallOff <= 2.0, typeof(ArgumentOutOfRangeException), "Valid range for FallOff is [0..2])"); - Debug2.Validate((double)flIntensity >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Intensity is [0..)"); - Debug2.Validate((double)flWeight >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Weight is [0..)"); + Debug2.Validate(flDecay >= 0.0 && flDecay <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Decay is [0,1]"); + Debug2.Validate(flDensity > 0.0 && flDensity <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Density is (0..1]"); + Debug2.Validate(flFallOff >= 0.0 && flFallOff <= 2.0, typeof(ArgumentOutOfRangeException), "Valid range for FallOff is [0..2])"); + Debug2.Validate(flIntensity >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Intensity is [0..)"); + Debug2.Validate(flWeight >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Weight is [0..)"); this.m_stName = stName; this.m_vPosition = vPosition; this.m_flDecay = flDecay; @@ -71,7 +71,7 @@ namespace Microsoft.Iris.Render get => this.m_flDecay; set { - Debug2.Validate((double)value >= 0.0 && (double)value <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Decay is [0,1]"); + Debug2.Validate(value >= 0.0 && value <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Decay is [0,1]"); this.m_flDecay = value; } } @@ -83,7 +83,7 @@ namespace Microsoft.Iris.Render get => this.m_flDensity; set { - Debug2.Validate((double)value > 0.0 && (double)value <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Density is (0..1]"); + Debug2.Validate(value > 0.0 && value <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Density is (0..1]"); this.m_flDensity = value; } } @@ -95,7 +95,7 @@ namespace Microsoft.Iris.Render get => this.m_flIntensity; set { - Debug2.Validate((double)value >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Intensity is [0..)"); + Debug2.Validate(value >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Intensity is [0..)"); this.m_flIntensity = value; } } @@ -107,7 +107,7 @@ namespace Microsoft.Iris.Render get => this.m_flFallOff; set { - Debug2.Validate((double)value >= 0.0 && (double)value <= 2.0, typeof(ArgumentOutOfRangeException), "Valid range for FallOff is [0..2])"); + Debug2.Validate(value >= 0.0 && value <= 2.0, typeof(ArgumentOutOfRangeException), "Valid range for FallOff is [0..2])"); this.m_flFallOff = value; } } @@ -119,7 +119,7 @@ namespace Microsoft.Iris.Render get => this.m_flWeight; set { - Debug2.Validate((double)value >= 0.0 && (double)value <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Weight is [0..)"); + Debug2.Validate(value >= 0.0 && value <= 1.0, typeof(ArgumentOutOfRangeException), "Valid range for Weight is [0..)"); this.m_flWeight = value; } } @@ -130,10 +130,10 @@ namespace Microsoft.Iris.Render Map dictionary, ref byte nNextUniqueID) { - return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Position", (byte)16, ref this.m_nPositionID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Decay", (byte)8, ref this.m_nDecayID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Density", (byte)8, ref this.m_nDensityID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Intensity", (byte)8, ref this.m_nIntensityID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "FallOff", (byte)8, ref this.m_nFallOffID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Weight", (byte)8, ref this.m_nWeightID, ref nNextUniqueID); + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Position", 16, ref this.m_nPositionID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Decay", 8, ref this.m_nDecayID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Density", 8, ref this.m_nDensityID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Intensity", 8, ref this.m_nIntensityID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "FallOff", 8, ref this.m_nFallOffID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Weight", 8, ref this.m_nWeightID, ref nNextUniqueID); } - internal override bool Process(Map dictProperties) => this.GenerateProperty("Position", EffectPropertyType.Vector3, (object)this.m_vPosition, this.m_nPositionID, dictProperties) && this.GenerateProperty("Decay", EffectPropertyType.Float, (object)this.m_flDecay, this.m_nDecayID, dictProperties) && (this.GenerateProperty("Density", EffectPropertyType.Float, (object)this.m_flDensity, this.m_nDensityID, dictProperties) && this.GenerateProperty("Intensity", EffectPropertyType.Float, (object)this.m_flIntensity, this.m_nIntensityID, dictProperties)) && this.GenerateProperty("FallOff", EffectPropertyType.Float, (object)this.m_flFallOff, this.m_nFallOffID, dictProperties) && this.GenerateProperty("Weight", EffectPropertyType.Float, (object)this.m_flWeight, this.m_nWeightID, dictProperties); + internal override bool Process(Map dictProperties) => this.GenerateProperty("Position", EffectPropertyType.Vector3, m_vPosition, this.m_nPositionID, dictProperties) && this.GenerateProperty("Decay", EffectPropertyType.Float, m_flDecay, this.m_nDecayID, dictProperties) && (this.GenerateProperty("Density", EffectPropertyType.Float, m_flDensity, this.m_nDensityID, dictProperties) && this.GenerateProperty("Intensity", EffectPropertyType.Float, m_flIntensity, this.m_nIntensityID, dictProperties)) && this.GenerateProperty("FallOff", EffectPropertyType.Float, m_flFallOff, this.m_nFallOffID, dictProperties) && this.GenerateProperty("Weight", EffectPropertyType.Float, m_flWeight, this.m_nWeightID, dictProperties); internal override void AddCacheKey(ByteBuilder cacheKey) { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/LogarithmicInterpolation.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/LogarithmicInterpolation.cs index 1b08088..bd8f8b8 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/LogarithmicInterpolation.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/LogarithmicInterpolation.cs @@ -15,7 +15,7 @@ namespace Microsoft.Iris.Render public LogarithmicInterpolation(float weight) { - Debug2.Validate((double)weight > 0.0, typeof(ArgumentOutOfRangeException), "'weight' must be > 0"); + Debug2.Validate(weight > 0.0, typeof(ArgumentOutOfRangeException), "'weight' must be > 0"); this.m_weight = weight; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Point.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Point.cs index e243cda..d4c7248 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Point.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Point.cs @@ -73,7 +73,7 @@ namespace Microsoft.Iris.Render public override string ToString() => base.ToString(); - public bool IsZero => this.Equals(Point.Zero); + public bool IsZero => this.Equals(Zero); public void Offset(int dx, int dy) { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/PointLight2DElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/PointLight2DElement.cs index c32698e..1a1f1d7 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/PointLight2DElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/PointLight2DElement.cs @@ -38,7 +38,7 @@ namespace Microsoft.Iris.Render : this() { Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); - Debug2.Validate((double)flRadius >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for flRadius is [0..)"); + Debug2.Validate(flRadius >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for flRadius is [0..)"); this.m_stName = stName; this.m_vPosition = vPosition; this.m_flRadius = flRadius; @@ -98,10 +98,10 @@ namespace Microsoft.Iris.Render Map dictionary, ref byte nNextUniqueID) { - return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Position", (byte)16, ref this.m_nPositionID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Radius", (byte)8, ref this.m_nRadiusID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "LightColor", (byte)20, ref this.m_nLightColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "AmbientColor", (byte)20, ref this.m_nAmbientColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Attenuation", (byte)16, ref this.m_nAttenuationID, ref nNextUniqueID); + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Position", 16, ref this.m_nPositionID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Radius", 8, ref this.m_nRadiusID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "LightColor", 20, ref this.m_nLightColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "AmbientColor", 20, ref this.m_nAmbientColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Attenuation", 16, ref this.m_nAttenuationID, ref nNextUniqueID); } - internal override bool Process(Map dictProperties) => this.GenerateProperty("Position", EffectPropertyType.Vector3, (object)this.m_vPosition, this.m_nPositionID, dictProperties) && this.GenerateProperty("Radius", EffectPropertyType.Float, (object)this.m_flRadius, this.m_nRadiusID, dictProperties) && (this.GenerateProperty("LightColor", EffectPropertyType.Color, (object)this.m_clrLight, this.m_nLightColorID, dictProperties) && this.GenerateProperty("AmbientColor", EffectPropertyType.Color, (object)this.m_clrAmbient, this.m_nAmbientColorID, dictProperties)) && this.GenerateProperty("Attenuation", EffectPropertyType.Vector3, (object)this.m_vAttenuation, this.m_nAttenuationID, dictProperties); + internal override bool Process(Map dictProperties) => this.GenerateProperty("Position", EffectPropertyType.Vector3, m_vPosition, this.m_nPositionID, dictProperties) && this.GenerateProperty("Radius", EffectPropertyType.Float, m_flRadius, this.m_nRadiusID, dictProperties) && (this.GenerateProperty("LightColor", EffectPropertyType.Color, m_clrLight, this.m_nLightColorID, dictProperties) && this.GenerateProperty("AmbientColor", EffectPropertyType.Color, m_clrAmbient, this.m_nAmbientColorID, dictProperties)) && this.GenerateProperty("Attenuation", EffectPropertyType.Vector3, m_vAttenuation, this.m_nAttenuationID, dictProperties); internal override void AddCacheKey(ByteBuilder cacheKey) { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/BlobInfo.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/BlobInfo.cs index 6d949e1..0129d7f 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/BlobInfo.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/BlobInfo.cs @@ -24,13 +24,13 @@ namespace Microsoft.Iris.Render.Protocol public unsafe BlobInfo(RenderPort port, uint origTotal) { this.m_foreignByteOrder = port.ForeignByteOrder; - this.m_data = BlobInfo.s_cache; - BlobInfo.s_cache = (Vector)null; + this.m_data = s_cache; + s_cache = null; if (this.m_data == null) this.m_data = new Vector(); this.m_totalSize = origTotal; this.m_blobsOffset = origTotal; - this.m_pmsgBlob = (Message*)null; + this.m_pmsgBlob = null; } public uint AdjustedTotalSize => this.m_totalSize; @@ -40,7 +40,7 @@ namespace Microsoft.Iris.Render.Protocol public BLOBREF Add(RENDERHANDLE[] param) { uint cbData = param == null ? 0U : (uint)(param.Length * 4); - return this.Add((object)param, cbData); + return this.Add(param, cbData); } public BLOBREF Add(string param) @@ -48,7 +48,7 @@ namespace Microsoft.Iris.Render.Protocol if (param == null) param = ""; uint cbData = (uint)((param.Length + 1) * 2); - return this.Add((object)param, cbData); + return this.Add(param, cbData); } public unsafe BLOBREF Add(Message* pmsg) @@ -59,16 +59,16 @@ namespace Microsoft.Iris.Render.Protocol this.m_pmsgBlob = pmsg; cbData = pmsg->cbSize; } - return this.Add(BlobInfo.s_msgBlobSentinal, cbData); + return this.Add(s_msgBlobSentinal, cbData); } private BLOBREF Add(object param, uint cbData) { - Debug2.Validate(cbData < (uint)ushort.MaxValue, typeof(ArgumentException), (object)"data blob too large", (object)nameof(param)); + Debug2.Validate(cbData < ushort.MaxValue, typeof(ArgumentException), "data blob too large", nameof(param)); BLOBREF blobref = BLOBREF.FromUInt32(this.m_totalSize | cbData << 16); if (cbData != 0U) { - if (this.m_totalSize + cbData > (uint)ushort.MaxValue) + if (this.m_totalSize + cbData > ushort.MaxValue) throw new InvalidOperationException("insufficient space in message for data blob"); this.m_totalSize += cbData; this.m_data.Add(param); @@ -133,7 +133,7 @@ namespace Microsoft.Iris.Render.Protocol } } } - else if (obj == BlobInfo.s_msgBlobSentinal) + else if (obj == s_msgBlobSentinal) { byte* pmsgBlob = (byte*)this.m_pmsgBlob; byte* numPtr2 = pmsgBlob + (int)this.m_pmsgBlob->cbSize; @@ -144,8 +144,8 @@ namespace Microsoft.Iris.Render.Protocol Debug2.Throw(false, "Unexpected type."); } this.m_data.Clear(); - BlobInfo.s_cache = this.m_data; - this.m_data = (Vector)null; + s_cache = this.m_data; + this.m_data = null; } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/ConnectionInfo.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/ConnectionInfo.cs index 014bbde..7c3b2d0 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/ConnectionInfo.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/ConnectionInfo.cs @@ -11,6 +11,6 @@ namespace Microsoft.Iris.Render.Protocol [Serializable] internal abstract class ConnectionInfo { - public static readonly ConnectionInfo Default = (ConnectionInfo)new LocalConnectionInfo(); + public static readonly ConnectionInfo Default = new LocalConnectionInfo(); } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/DataBuffer.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/DataBuffer.cs index 5e32389..87ad327 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/DataBuffer.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/DataBuffer.cs @@ -19,7 +19,7 @@ namespace Microsoft.Iris.Render.Protocol public unsafe DataBuffer(RenderPort port, void* pvData, uint cbSize) { this.m_port = port; - this.m_remoteBuffer = (RemoteDataBuffer)null; + this.m_remoteBuffer = null; this.m_pvData = pvData; this.m_cbSize = cbSize; } @@ -29,7 +29,7 @@ namespace Microsoft.Iris.Render.Protocol public void Dispose() { this.m_port.Session.AssertOwningThread(); - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); this.Dispose(true); } @@ -37,7 +37,7 @@ namespace Microsoft.Iris.Render.Protocol { if (fInDispose && this.m_remoteBuffer != null) this.m_remoteBuffer.Dispose(); - this.m_remoteBuffer = (RemoteDataBuffer)null; + this.m_remoteBuffer = null; } public RenderPort Port => this.m_port; @@ -50,7 +50,7 @@ namespace Microsoft.Iris.Render.Protocol public unsafe void Commit() { - RENDERHANDLE renderhandle = this.m_port.AllocHandle((IRenderHandleOwner)this); + RENDERHANDLE renderhandle = this.m_port.AllocHandle(this); try { this.m_port.SendDataBuffer(this.m_pvData, this.m_cbSize, renderhandle); @@ -65,7 +65,7 @@ namespace Microsoft.Iris.Render.Protocol if (this.m_remoteBuffer != null) { this.m_remoteBuffer.Dispose(); - this.m_remoteBuffer = (RemoteDataBuffer)null; + this.m_remoteBuffer = null; } else this.m_port.FreeHandle(renderhandle); @@ -83,7 +83,7 @@ namespace Microsoft.Iris.Render.Protocol this.DataConsumed(sender, args); } - protected void OnDataConsumed() => this.OnDataConsumed((object)this, EventArgs.Empty); + protected void OnDataConsumed() => this.OnDataConsumed(this, EventArgs.Empty); public event EventHandler ReleaseLocalData; @@ -94,11 +94,11 @@ namespace Microsoft.Iris.Render.Protocol this.ReleaseLocalData(sender, args); } - protected void OnReleaseLocalData() => this.OnReleaseLocalData((object)this, EventArgs.Empty); + protected void OnReleaseLocalData() => this.OnReleaseLocalData(this, EventArgs.Empty); RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteBuffer.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteBuffer = (RemoteDataBuffer)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteBuffer = null; void IDataBufferCallback.OnComplete(RENDERHANDLE target) => this.OnDataConsumed(); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/DataBufferTracker.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/DataBufferTracker.cs index 26f66b8..121a890 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/DataBufferTracker.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/DataBufferTracker.cs @@ -19,7 +19,7 @@ namespace Microsoft.Iris.Render.Protocol internal void Dispose() { - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); this.Dispose(true); } @@ -31,7 +31,7 @@ namespace Microsoft.Iris.Render.Protocol trackingInfo.DataBuffer.Dispose(); this.m_alTracking.Clear(); } - this.m_alTracking = (Vector)null; + this.m_alTracking = null; } internal int Count => this.m_alTracking.Count; @@ -49,22 +49,22 @@ namespace Microsoft.Iris.Render.Protocol this.TrackerEmpty(sender, args); } - internal void Track(DataBuffer dataBuffer) => this.Track(dataBuffer, (DataBufferTracker.CleanupEventHandler)null, (object)null); + internal void Track(DataBuffer dataBuffer) => this.Track(dataBuffer, null, null); internal void Track( DataBuffer dataBuffer, DataBufferTracker.CleanupEventHandler handler, object contextData) { - DataBufferTracker.TrackingInfo trackingInfo = new DataBufferTracker.TrackingInfo(dataBuffer, DataBufferTracker.Users.Valid, handler, contextData); + DataBufferTracker.TrackingInfo trackingInfo = new DataBufferTracker.TrackingInfo(dataBuffer, Users.Valid, handler, contextData); dataBuffer.DataConsumed += new EventHandler(this.OnDataConsumed); dataBuffer.ReleaseLocalData += new EventHandler(this.OnReleaseLocalData); - this.m_alTracking.Add((object)trackingInfo); + this.m_alTracking.Add(trackingInfo); } internal void Release(DataBuffer dataBuffer, DataBufferTracker.Users userFlags) { - DataBufferTracker.TrackingInfo trackingInfo1 = (DataBufferTracker.TrackingInfo)null; + DataBufferTracker.TrackingInfo trackingInfo1 = null; foreach (DataBufferTracker.TrackingInfo trackingInfo2 in this.m_alTracking) { if (trackingInfo2.DataBuffer == dataBuffer) @@ -81,22 +81,22 @@ namespace Microsoft.Iris.Render.Protocol if (userFlags1 != 0U) return; if (trackingInfo1.CleanupHandler != null) - trackingInfo1.CleanupHandler((object)this, new DataBufferTracker.CleanupEventArgs(trackingInfo1.CleanupHandlerData)); - this.m_alTracking.Remove((object)trackingInfo1); + trackingInfo1.CleanupHandler(this, new DataBufferTracker.CleanupEventArgs(trackingInfo1.CleanupHandlerData)); + this.m_alTracking.Remove(trackingInfo1); trackingInfo1.DataBuffer.DataConsumed -= new EventHandler(this.OnDataConsumed); trackingInfo1.DataBuffer.ReleaseLocalData -= new EventHandler(this.OnReleaseLocalData); trackingInfo1.DataBuffer.Dispose(); - trackingInfo1.DataBuffer = (DataBuffer)null; - trackingInfo1.CleanupHandler = (DataBufferTracker.CleanupEventHandler)null; - trackingInfo1.CleanupHandlerData = (object)null; + trackingInfo1.DataBuffer = null; + trackingInfo1.CleanupHandler = null; + trackingInfo1.CleanupHandlerData = null; if (this.m_alTracking.Count != 0) return; - this.OnTrackerEmpty((object)this, EventArgs.Empty); + this.OnTrackerEmpty(this, EventArgs.Empty); } - private void OnDataConsumed(object oSender, EventArgs args) => this.Release(oSender as DataBuffer, DataBufferTracker.Users.Consumed); + private void OnDataConsumed(object oSender, EventArgs args) => this.Release(oSender as DataBuffer, Users.Consumed); - private void OnReleaseLocalData(object oSender, EventArgs args) => this.Release(oSender as DataBuffer, DataBufferTracker.Users.LocalData); + private void OnReleaseLocalData(object oSender, EventArgs args) => this.Release(oSender as DataBuffer, Users.LocalData); internal void DEBUG_SetDescription(string stDescription) { @@ -142,7 +142,7 @@ namespace Microsoft.Iris.Render.Protocol { this.DataBuffer = dataBuffer; this.UserFlags = userFlags; - this.Id = DataBufferTracker.TrackingInfo.s_idSeed++; + this.Id = s_idSeed++; this.CleanupHandler = handler; this.CleanupHandlerData = contextData; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/EngineApi.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/EngineApi.cs index d76e940..95c396c 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/EngineApi.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/EngineApi.cs @@ -223,12 +223,12 @@ namespace Microsoft.Iris.Render.Protocol Debug2.Validate(idContextNew != ContextID.NULL, typeof(ArgumentNullException), nameof(idContextNew)); this.cbSize = (uint)Marshal.SizeOf(typeof(EngineApi.InitArgs)); this.idContext = idContextNew; - this.cItemsPerGroupBits = (int)layout.numberOfObjectBits; - this.cGroupBits = (int)layout.numberOfGroupBits; + this.cItemsPerGroupBits = layout.numberOfObjectBits; + this.cGroupBits = layout.numberOfGroupBits; this.pfnProcessBuffer = IntPtr.Zero; this.pvProcessData = IntPtr.Zero; this.idObjectBrokerClass = RENDERHANDLE.FromUInt32(0U); - this.pfnTimeout = (EngineApi.TimeoutEventHandler)null; + this.pfnTimeout = null; this.pvTimeoutData = IntPtr.Zero; this.nTimeOutSec = 0U; } @@ -242,7 +242,7 @@ namespace Microsoft.Iris.Render.Protocol if (pfnProcessBufferProc == null) return; IntPtr num; - EngineApi.IFC(EngineApi.SpWrapBufferProc(pfnProcessBufferProc, &num)); + IFC(SpWrapBufferProc(pfnProcessBufferProc, &num)); this.pfnProcessBuffer = num; } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/HandleGroup.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/HandleGroup.cs index ac2bdca..a022759 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/HandleGroup.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/HandleGroup.cs @@ -48,7 +48,7 @@ namespace Microsoft.Iris.Render.Protocol public HandleGroup(GCHandleType ht, RenderPort portOwner, bool uniquify, uint maxObjects) { - Debug2.Validate(portOwner != null, typeof(ArgumentNullException), (object)nameof(portOwner), (object)"Must specify valid owner"); + Debug2.Validate(portOwner != null, typeof(ArgumentNullException), nameof(portOwner), "Must specify valid owner"); this.m_ht = ht; this.m_portOwner = portOwner; this.m_maxObjects = maxObjects; @@ -81,7 +81,7 @@ namespace Microsoft.Iris.Render.Protocol { this.ValidateSlot(index); GCHandle gcHandle = this.m_objects[(IntPtr)index]; - return !gcHandle.IsAllocated ? (IRenderHandleOwner)null : (IRenderHandleOwner)gcHandle.Target; + return !gcHandle.IsAllocated ? null : (IRenderHandleOwner)gcHandle.Target; } set { @@ -100,9 +100,9 @@ namespace Microsoft.Iris.Render.Protocol bool fAllowInvalid) { if (!this.ValidateAccess(index, expectedUniqueness, fAllowInvalid)) - return (IRenderHandleOwner)null; + return null; GCHandle gcHandle = this.m_objects[(IntPtr)index]; - return !gcHandle.IsAllocated ? (IRenderHandleOwner)null : (IRenderHandleOwner)gcHandle.Target; + return !gcHandle.IsAllocated ? null : (IRenderHandleOwner)gcHandle.Target; } public IRenderHandleOwner Get(uint index, uint expectedUniqueness) => this.Get(index, expectedUniqueness, false); @@ -117,10 +117,10 @@ namespace Microsoft.Iris.Render.Protocol { if (this.m_objects == null) return; - for (uint index = 0; (long)index < (long)this.m_objects.Length; ++index) - this.SetIndex(index, (IRenderHandleOwner)null); - this.m_objects = (GCHandle[])null; - this.m_usage = (uint[])null; + for (uint index = 0; index < m_objects.Length; ++index) + this.SetIndex(index, null); + this.m_objects = null; + this.m_usage = null; if (this.m_uniqueness != null) this.m_uniqueness = new byte[1]; this.m_alloc = 0U; @@ -170,14 +170,14 @@ namespace Microsoft.Iris.Render.Protocol public void Remove(uint index) { this.ValidateSlot(index); - this.SetIndex(index, (IRenderHandleOwner)null); + this.SetIndex(index, null); this.FreeSlot(index); } public void Remove(uint index, uint expectedUniqueness) { this.ValidateAccess(index, expectedUniqueness); - this.SetIndex(index, (IRenderHandleOwner)null); + this.SetIndex(index, null); this.FreeSlot(index); } @@ -186,15 +186,15 @@ namespace Microsoft.Iris.Render.Protocol private void SetIndex(uint index, IRenderHandleOwner newOwner) { GCHandle gch = this.m_objects[(IntPtr)index]; - if (!HandleGroup.IsEmpty(gch)) + if (!IsEmpty(gch)) { ((IRenderHandleOwner)gch.Target)?.OnDisconnect(); gch.Free(); } if (newOwner != null) - this.m_objects[(IntPtr)index] = GCHandle.Alloc((object)newOwner, this.m_ht); + this.m_objects[(IntPtr)index] = GCHandle.Alloc(newOwner, this.m_ht); else - this.m_objects[(IntPtr)index] = HandleGroup.s_gchEmpty; + this.m_objects[(IntPtr)index] = s_gchEmpty; } private void UpdateUniqueness(uint index, out uint unique) @@ -203,18 +203,18 @@ namespace Microsoft.Iris.Render.Protocol if (this.m_uniqueness != null) { byte num2 = this.m_uniqueness[(IntPtr)index]; - num1 = num2 >= byte.MaxValue ? (byte)1 : (byte)((uint)num2 + 1U); + num1 = num2 >= byte.MaxValue ? (byte)1 : (byte)(num2 + 1U); this.m_uniqueness[(IntPtr)index] = num1; } - unique = (uint)num1; + unique = num1; } private void SetUniqueness(uint index, uint unique) { - Debug2.Validate(unique <= (uint)byte.MaxValue, typeof(ArgumentOutOfRangeException), "Uniqueness must be a byte"); + Debug2.Validate(unique <= byte.MaxValue, typeof(ArgumentOutOfRangeException), "Uniqueness must be a byte"); if (this.m_uniqueness == null) return; - this.m_uniqueness[(IntPtr)index] = (byte)(unique & (uint)byte.MaxValue); + this.m_uniqueness[(IntPtr)index] = (byte)(unique & byte.MaxValue); } private void ValidateSlot(uint index) => this.ValidateSlot(index, false); @@ -247,7 +247,7 @@ namespace Microsoft.Iris.Render.Protocol return false; uint num = 0; if (this.m_uniqueness != null) - num = (uint)this.m_uniqueness[(IntPtr)index]; + num = this.m_uniqueness[(IntPtr)index]; bool flag = (int)expectedUniqueness == (int)num; Debug2.Throw(flag || fAllowInvalid, "Slot uniqueness is stale"); return flag; @@ -257,7 +257,7 @@ namespace Microsoft.Iris.Render.Protocol { uint num1 = 0; uint hint; - for (hint = this.m_hint; (long)hint < (long)this.m_usage.Length; ++hint) + for (hint = this.m_hint; hint < m_usage.Length; ++hint) { num1 = this.m_usage[(IntPtr)hint]; if (num1 != uint.MaxValue) @@ -265,7 +265,7 @@ namespace Microsoft.Iris.Render.Protocol } this.m_hint = hint; uint num2 = 16; - uint maxValue = (uint)ushort.MaxValue; + uint maxValue = ushort.MaxValue; uint num3 = 0; do { @@ -316,21 +316,21 @@ namespace Microsoft.Iris.Render.Protocol Debug2.Validate(newSize > this.m_alloc, typeof(ArgumentException), nameof(newSize)); Debug2.Validate(newSize <= this.m_maxObjects, typeof(InvalidOperationException), "Too many video resources have been allocated"); GCHandle[] gcHandleArray = new GCHandle[(IntPtr)newSize]; - uint[] numArray1 = (uint[])null; - byte[] numArray2 = (byte[])null; + uint[] numArray1 = null; + byte[] numArray2 = null; uint num = (uint)((int)newSize + 32 - 1) >> 5; - if (this.m_usage == null || (long)this.m_usage.Length < (long)num) + if (this.m_usage == null || m_usage.Length < num) numArray1 = new uint[(IntPtr)num]; if (this.m_uniqueness != null) { numArray2 = new byte[(IntPtr)newSize]; - Array.Copy((Array)this.m_uniqueness, (Array)numArray2, this.m_uniqueness.Length); + Array.Copy(m_uniqueness, numArray2, this.m_uniqueness.Length); } if (this.m_objects != null) { - Array.Copy((Array)this.m_objects, (Array)gcHandleArray, this.m_objects.Length); + Array.Copy(m_objects, gcHandleArray, this.m_objects.Length); if (numArray1 != null) - Array.Copy((Array)this.m_usage, (Array)numArray1, this.m_usage.Length); + Array.Copy(m_usage, numArray1, this.m_usage.Length); this.m_hint = (uint)this.m_usage.Length; } this.m_objects = gcHandleArray; @@ -352,7 +352,7 @@ namespace Microsoft.Iris.Render.Protocol for (uint index = 0; index < used; ++index) { GCHandle gch = map.m_objects[(IntPtr)index]; - if (!HandleGroup.IsEmpty(gch)) + if (!IsEmpty(gch)) { IRenderHandleOwner target = (IRenderHandleOwner)gch.Target; if (target != null) diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/HandleTable.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/HandleTable.cs index c2acbb9..4639bfb 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/HandleTable.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/HandleTable.cs @@ -26,10 +26,10 @@ namespace Microsoft.Iris.Render.Protocol { Debug2.Validate(portOwner != null, typeof(ArgumentNullException), nameof(portOwner)); this.m_portOwner = portOwner; - uint maxObjects = 1U << (int)layout.numberOfGroupBits; - this.m_MaxObjectsPerGroup = 1U << (int)layout.numberOfObjectBits; - this.m_GroupShift = (int)layout.numberOfObjectBits; - this.m_UniqueShift = (int)layout.numberOfObjectBits + (int)layout.numberOfGroupBits; + uint maxObjects = 1U << layout.numberOfGroupBits; + this.m_MaxObjectsPerGroup = 1U << layout.numberOfObjectBits; + this.m_GroupShift = layout.numberOfObjectBits; + this.m_UniqueShift = layout.numberOfObjectBits + layout.numberOfGroupBits; this.m_GroupMask = (uint)((int)maxObjects - 1 << this.m_GroupShift); this.m_ObjectMask = this.m_MaxObjectsPerGroup - 1U; this.m_UniqueMask = (uint)~((int)this.m_GroupMask | (int)this.m_ObjectMask); @@ -45,7 +45,7 @@ namespace Microsoft.Iris.Render.Protocol foreach (HandleGroup group in this.m_groups) group?.Dispose(); this.m_groups.Clear(); - this.m_groups = (HandleGroup)null; + this.m_groups = null; } finally { @@ -57,7 +57,7 @@ namespace Microsoft.Iris.Render.Protocol { uint uint32 = RENDERGROUP.ToUInt32(groupId); HandleGroup group = this.m_groups[uint32] as HandleGroup; - Debug2.Validate(group != null, typeof(ArgumentException), (object)"Group does not exist", (object)nameof(groupId)); + Debug2.Validate(group != null, typeof(ArgumentException), "Group does not exist", nameof(groupId)); uint unique; uint num = group.Add(owner, out unique); return RENDERHANDLE.FromUInt32((uint)((int)unique << this.m_UniqueShift | (int)uint32 << this.m_GroupShift) | num); @@ -103,12 +103,12 @@ namespace Microsoft.Iris.Render.Protocol public RENDERGROUP GetGroup(RENDERHANDLE handle) => RENDERGROUP.FromUInt32((RENDERHANDLE.ToUInt32(handle) & this.m_GroupMask) >> this.m_GroupShift); - public RENDERGROUP AllocGroup() => RENDERGROUP.FromUInt32(this.m_groups.Add((IRenderHandleOwner)this.CreateNewGroup())); + public RENDERGROUP AllocGroup() => RENDERGROUP.FromUInt32(this.m_groups.Add(this.CreateNewGroup())); public void AllocGroupWithId(RENDERGROUP groupId) { uint uint32 = RENDERGROUP.ToUInt32(groupId); - this.m_groups.AddAtIndex((IRenderHandleOwner)this.CreateNewGroup(), uint32); + this.m_groups.AddAtIndex(this.CreateNewGroup(), uint32); } public void FreeGroup(RENDERGROUP groupId) => this.m_groups.Remove(RENDERGROUP.ToUInt32(groupId)); @@ -119,7 +119,7 @@ namespace Microsoft.Iris.Render.Protocol HandleGroup group; uint index; this.MapHandle(handle, false, out unique, out group, out index); - Debug2.Validate((object)group.Get(index, unique) != null, typeof(ArgumentException), (object)"Must point to valid object", (object)nameof(handle)); + Debug2.Validate(group.Get(index, unique) != null, typeof(ArgumentException), "Must point to valid object", nameof(handle)); } private HandleGroup CreateNewGroup() => new HandleGroup(GCHandleType.Weak, this.m_portOwner, true, this.m_MaxObjectsPerGroup); @@ -146,7 +146,7 @@ namespace Microsoft.Iris.Render.Protocol uint num1 = (uint32 & this.m_UniqueMask) >> this.m_UniqueShift; uint index1 = (uint32 & this.m_GroupMask) >> this.m_GroupShift; uint num2 = uint32 & this.m_ObjectMask; - group = (HandleGroup)null; + group = null; if (index1 <= this.m_groups.Count) group = this.m_groups[index1] as HandleGroup; if (group == null) @@ -154,7 +154,7 @@ namespace Microsoft.Iris.Render.Protocol if (fCreateGroup) { group = this.CreateNewGroup(); - this.m_groups.AddAtIndex((IRenderHandleOwner)group, index1); + this.m_groups.AddAtIndex(group, index1); } else Debug2.Throw(fAllowInvalid, "Group does not exist"); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/MarshalHelper.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/MarshalHelper.cs index ff827ea..78f7a14 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/MarshalHelper.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/MarshalHelper.cs @@ -22,12 +22,12 @@ namespace Microsoft.Iris.Render.Protocol out string param) { uint uint32 = BLOBREF.ToUInt32(refParam); - uint num1 = uint32 & (uint)ushort.MaxValue; + uint num1 = uint32 & ushort.MaxValue; uint num2 = (uint32 & 4294901760U) >> 16; byte* numPtr = (byte*)((IntPtr)pmsg + (int)num1); int length = (int)num2 - 2; byte[] numArray = new byte[length]; - Marshal.Copy(new IntPtr((void*)numPtr), numArray, 0, length); + Marshal.Copy(new IntPtr(numPtr), numArray, 0, length); Encoding encoding = Encoding.Unicode; if (port.AlwaysBigEndian) encoding = Encoding.BigEndianUnicode; @@ -41,21 +41,21 @@ namespace Microsoft.Iris.Render.Protocol out Message* pmsgInner) { byte* numPtr = (byte*)pmsgOuter; - uint num = (uint)ushort.MaxValue & BLOBREF.ToUInt32(refMsgInner); + uint num = ushort.MaxValue & BLOBREF.ToUInt32(refMsgInner); pmsgInner = (Message*)(numPtr + (int)num); } private static ushort[] ComputeByteOrderMap(Type targetType, bool fCompact) { ushort[] fieldMap = new ushort[10]; - MarshalHelper.ComputeByteOrderMapWorker(ref fieldMap, targetType, 0); + ComputeByteOrderMapWorker(ref fieldMap, targetType, 0); if (fCompact) { - int length = (int)fieldMap[0] + 1; + int length = fieldMap[0] + 1; if (fieldMap.Length > length) { ushort[] numArray = new ushort[length]; - Array.Copy((Array)fieldMap, (Array)numArray, length); + Array.Copy(fieldMap, numArray, length); fieldMap = numArray; } } @@ -70,20 +70,20 @@ namespace Microsoft.Iris.Render.Protocol int stopOffset) { if (fieldMapByRef == null) - fieldMapByRef = MarshalHelper.ComputeByteOrderMap(type, true); + fieldMapByRef = ComputeByteOrderMap(type, true); ushort[] numArray = fieldMapByRef; if (stopOffset <= 0) stopOffset = int.MaxValue; - int num1 = (int)numArray[0] + 1; + int num1 = numArray[0] + 1; for (int index1 = 1; index1 < num1; ++index1) { ushort num2 = numArray[index1]; - int num3 = (int)num2 >> 2; + int num3 = num2 >> 2; if (num3 >= startOffset) { if (num3 >= stopOffset) break; - int num4 = 1 << ((int)num2 & 3); + int num4 = 1 << (num2 & 3); byte* numPtr = pMem + num3; int num5 = num4 / 2; for (int index2 = 0; index2 < num5; ++index2) @@ -97,11 +97,11 @@ namespace Microsoft.Iris.Render.Protocol } } - public static object MakeDumpable(string value) => (object)value; + public static object MakeDumpable(string value) => value; public static object MakeDumpable(object value) => value; - public static unsafe object MakeDumpable(void* value) => (object)new IntPtr(value); + public static unsafe object MakeDumpable(void* value) => new IntPtr(value); private static void ComputeByteOrderMapWorker( ref ushort[] fieldMap, @@ -110,7 +110,7 @@ namespace Microsoft.Iris.Render.Protocol { if (targetType.IsPrimitive) return; - int packingForType = MarshalHelper.GetPackingForType(targetType); + int packingForType = GetPackingForType(targetType); int num1 = 0; foreach (FieldInfo field in targetType.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)) { @@ -130,9 +130,9 @@ namespace Microsoft.Iris.Render.Protocol int num4 = num1 + num3 & ~num3; int num5 = num4 + parentOffset; if (type.IsPrimitive) - MarshalHelper.AddByteOrderEntry(ref fieldMap, num5, size); + AddByteOrderEntry(ref fieldMap, num5, size); else - MarshalHelper.ComputeByteOrderMapWorker(ref fieldMap, type, num5); + ComputeByteOrderMapWorker(ref fieldMap, type, num5); num1 = num4 + size; } } @@ -147,30 +147,30 @@ namespace Microsoft.Iris.Render.Protocol case 1: return; case 2: - num = (ushort)1; + num = 1; break; case 3: return; case 4: - num = (ushort)2; + num = 2; break; case 8: - num = (ushort)3; + num = 3; break; default: return; } - int index = (int)fieldMap[0] + 1; + int index = fieldMap[0] + 1; if (index >= fieldMap.Length) { ushort[] numArray = new ushort[2 * fieldMap.Length]; - Array.Copy((Array)fieldMap, (Array)numArray, fieldMap.Length); + Array.Copy(fieldMap, numArray, fieldMap.Length); fieldMap = numArray; } fieldMap[0] = (ushort)index; - fieldMap[index] = (ushort)((uint)(offset << 2) | (uint)num); + fieldMap[index] = (ushort)((uint)(offset << 2) | num); } - public static RENDERHANDLE[] CreateRenderHandleArray(int length) => length == 0 ? MarshalHelper.s_EmptyRenderHandleArray : new RENDERHANDLE[length]; + public static RENDERHANDLE[] CreateRenderHandleArray(int length) => length == 0 ? s_EmptyRenderHandleArray : new RENDERHANDLE[length]; } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/Memory.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/Memory.cs index ef64cfc..3a2d4d8 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/Memory.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/Memory.cs @@ -30,7 +30,7 @@ namespace Microsoft.Iris.Render.Protocol byte* numPtr = (byte*)pointer; int num3 = cbZero - num1 * 4; while (num3-- > 0) - *numPtr++ = (byte)0; + *numPtr++ = 0; } public static unsafe void Copy(IntPtr pvDest, IntPtr pvSrc, int cbCopy) @@ -65,7 +65,7 @@ namespace Microsoft.Iris.Render.Protocol while (num1-- > 0) { uint num2 = *pointer2++; - *pointer1++ = (uint)((int)((num2 & 4278190080U) >> 8) | ((int)num2 & 16711680) << 8 | (int)((num2 & 65280U) >> 8) | ((int)num2 & (int)byte.MaxValue) << 8); + *pointer1++ = (uint)((int)((num2 & 4278190080U) >> 8) | ((int)num2 & 16711680) << 8 | (int)((num2 & 65280U) >> 8) | ((int)num2 & byte.MaxValue) << 8); } if (cbConvert % 4 == 0) break; @@ -75,7 +75,7 @@ namespace Microsoft.Iris.Render.Protocol ushort num3 = *numPtr2; ushort* numPtr4 = numPtr1; ushort* numPtr5 = (ushort*)((IntPtr)numPtr4 + new IntPtr(2)); - int num4 = (int)(ushort)(((int)num3 & 65280) >> 8 | ((int)num3 & (int)byte.MaxValue) << 8); + int num4 = (ushort)((num3 & 65280) >> 8 | (num3 & byte.MaxValue) << 8); *numPtr4 = (ushort)num4; break; case 32: @@ -85,7 +85,7 @@ namespace Microsoft.Iris.Render.Protocol while (num5-- > 0) { uint num2 = *pointer4++; - *pointer3++ = (uint)((int)((num2 & 4278190080U) >> 24) | (int)((num2 & 16711680U) >> 8) | ((int)num2 & 65280) << 8 | ((int)num2 & (int)byte.MaxValue) << 24); + *pointer3++ = (uint)((int)((num2 & 4278190080U) >> 24) | (int)((num2 & 16711680U) >> 8) | ((int)num2 & 65280) << 8 | ((int)num2 & byte.MaxValue) << 24); } break; default: @@ -94,6 +94,6 @@ namespace Microsoft.Iris.Render.Protocol } } - public static uint ConvertEndian(uint src) => (uint)((int)((src & 4278190080U) >> 24) | (int)((src & 16711680U) >> 8) | ((int)src & 65280) << 8 | ((int)src & (int)byte.MaxValue) << 24); + public static uint ConvertEndian(uint src) => (uint)((int)((src & 4278190080U) >> 24) | (int)((src & 16711680U) >> 8) | ((int)src & 65280) << 8 | ((int)src & byte.MaxValue) << 24); } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/MessageHeap.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/MessageHeap.cs index 15dfe01..d05655a 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/MessageHeap.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/MessageHeap.cs @@ -27,7 +27,7 @@ namespace Microsoft.Iris.Render.Protocol this.blockHeaderSize = headerSize; this.allocExtraSize = allocationExtra; this.nextBlockId = 1U; - this.CreateBlock(MessageHeap.BlockType.First, this.smallBlockSize); + this.CreateBlock(BlockType.First, this.smallBlockSize); } protected override void Dispose(bool inDispose) @@ -54,11 +54,11 @@ namespace Microsoft.Iris.Render.Protocol MessageHeap.BlockInfo block = this.tailBlock; if (size > block.size - block.used) { - MessageHeap.BlockType type = MessageHeap.BlockType.Normal; + MessageHeap.BlockType type = BlockType.Normal; uint actualSize = this.smallBlockSize; if (size > this.smallBlockSize - this.blockHeaderSize) { - type = MessageHeap.BlockType.Large; + type = BlockType.Large; actualSize = this.blockHeaderSize + size; } block = this.CreateBlock(type, actualSize); @@ -107,13 +107,13 @@ namespace Microsoft.Iris.Render.Protocol block.size = actualSize; switch (type) { - case MessageHeap.BlockType.First: - block.next = (MessageHeap.BlockInfo)null; + case BlockType.First: + block.next = null; this.headBlock = block; this.tailBlock = block; break; - case MessageHeap.BlockType.Normal: - case MessageHeap.BlockType.Large: + case BlockType.Normal: + case BlockType.Large: block.next = this.tailBlock.next; this.tailBlock.next = block; this.tailBlock = block; @@ -127,7 +127,7 @@ namespace Microsoft.Iris.Render.Protocol private unsafe void DestroyBlock(MessageHeap.BlockInfo block) { Marshal.FreeCoTaskMem(new IntPtr(block.data)); - block.data = (void*)null; + block.data = null; } private void ReleaseAll(bool finalRelease) @@ -137,14 +137,14 @@ namespace Microsoft.Iris.Render.Protocol if (finalRelease) { block = this.headBlock; - this.headBlock = (MessageHeap.BlockInfo)null; - this.tailBlock = (MessageHeap.BlockInfo)null; + this.headBlock = null; + this.tailBlock = null; } else { this.ZeroMemoryBlock(this.headBlock, 0U, this.blockHeaderSize); block = this.headBlock.next; - this.headBlock.next = (MessageHeap.BlockInfo)null; + this.headBlock.next = null; this.headBlock.used = this.blockHeaderSize; this.tailBlock = this.headBlock; this.nextBlockId = 2U; @@ -155,9 +155,9 @@ namespace Microsoft.Iris.Render.Protocol next = block.next; switch (block.type) { - case MessageHeap.BlockType.First: - case MessageHeap.BlockType.Normal: - case MessageHeap.BlockType.Large: + case BlockType.First: + case BlockType.Normal: + case BlockType.Large: this.DestroyBlock(block); break; } @@ -183,7 +183,7 @@ namespace Microsoft.Iris.Render.Protocol Debug2.Validate(offset + size <= block.size, typeof(ArgumentOutOfRangeException), "Invalid memory range for block"); byte* numPtr1 = (byte*)((IntPtr)block.data + (int)offset); for (byte* numPtr2 = numPtr1 + (int)size; numPtr1 < numPtr2; ++numPtr1) - *numPtr1 = (byte)0; + *numPtr1 = 0; } protected override void Invariant() => Debug2.Validate(!this.IsDisposed, typeof(InvalidOperationException), "MessageHeap has already been disposed"); @@ -197,7 +197,7 @@ namespace Microsoft.Iris.Render.Protocol public Enumerator(MessageHeap heap) { this.heap = heap; - this.current = (MessageHeap.BlockInfo)null; + this.current = null; this.key = heap.key; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/MessagingSession.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/MessagingSession.cs index 5e932c1..e74bbc3 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/MessagingSession.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/MessagingSession.cs @@ -35,7 +35,7 @@ namespace Microsoft.Iris.Render.Protocol private EngineApi.TimeoutEventHandler m_internalTimeoutHandler; internal MessagingSession(IRenderHost renderHost, RenderToken token) - : this(renderHost, token, (TimeoutHandler)null, 0U) + : this(renderHost, token, null, 0U) { } @@ -53,11 +53,11 @@ namespace Microsoft.Iris.Render.Protocol this.m_renderHost = renderHost; this.m_ports = new Vector(2); this.m_localContextId = token.LocalContextId; - this.m_batchFlushInvokeItem = new DeferredInvokeItem((SharedRenderObject)null, (Delegate)new DeferredHandler(this.ProcessDeferredFlushBatch), (object)null); + this.m_batchFlushInvokeItem = new DeferredInvokeItem(null, new DeferredHandler(this.ProcessDeferredFlushBatch), null); this.m_batchFillCallback = new BatchCallback(this.OnBatchFirstMessage); this.InitializeLocalMessaging(this.m_localContextId, new EngineApi.MessageBufferEventHandler(this.OnIncomingMessageBuffer), nTimeoutSec, handlerTimeout); this.m_portRendering = this.CreatePort((token.EngineInfo as IrisEngineInfo).ConnectionInfo, token.DestinationContextId, token.RenderGroupId); - this.m_portWindowing = (RenderPort)null; + this.m_portWindowing = null; this.m_activeTrackers = new Vector(); } @@ -75,11 +75,11 @@ namespace Microsoft.Iris.Render.Protocol this.m_ports.Clear(); this.ShutdownLocalMessaging(); } - this.m_activeTrackers = (Vector)null; - this.m_portWindowing = (RenderPort)null; - this.m_portRendering = (RenderPort)null; - this.m_ports = (Vector)null; - this.m_renderHost = (IRenderHost)null; + this.m_activeTrackers = null; + this.m_portWindowing = null; + this.m_portRendering = null; + this.m_ports = null; + this.m_renderHost = null; } finally { @@ -91,8 +91,8 @@ namespace Microsoft.Iris.Render.Protocol { get { - lock (MessagingSession.s_sessions) - return MessagingSession.s_sessions.ContainsKey(Thread.CurrentThread) ? MessagingSession.s_sessions[Thread.CurrentThread] : (MessagingSession)null; + lock (s_sessions) + return s_sessions.ContainsKey(Thread.CurrentThread) ? s_sessions[Thread.CurrentThread] : null; } } @@ -122,24 +122,24 @@ namespace Microsoft.Iris.Render.Protocol args.nTimeOutSec = timeoutInSeconds; } EngineApi.IFC(EngineApi.SpInit(ref args)); - lock (MessagingSession.s_sessions) + lock (s_sessions) { this.m_owningThread = Thread.CurrentThread; - MessagingSession.s_sessions[this.m_owningThread] = this; + s_sessions[this.m_owningThread] = this; } } private void ShutdownLocalMessaging() { - lock (MessagingSession.s_sessions) + lock (s_sessions) { - MessagingSession.s_sessions.Remove(this.m_owningThread); - this.m_owningThread = (Thread)null; + s_sessions.Remove(this.m_owningThread); + this.m_owningThread = null; } EngineApi.IFC(EngineApi.SpUninit()); - this.m_messageBufferHandler = (EngineApi.MessageBufferEventHandler)null; - this.m_externalTimeoutHandler = (TimeoutHandler)null; - this.m_internalTimeoutHandler = (EngineApi.TimeoutEventHandler)null; + this.m_messageBufferHandler = null; + this.m_externalTimeoutHandler = null; + this.m_internalTimeoutHandler = null; } internal static void DoEvents(uint nTimeoutInMsecs) @@ -160,20 +160,20 @@ namespace Microsoft.Iris.Render.Protocol switch (connectionInfo) { case LocalConnectionInfo _: - channel = (IChannel)new LocalChannel((LocalConnectionInfo)connectionInfo); + channel = new LocalChannel((LocalConnectionInfo)connectionInfo); break; case RemoteConnectionInfo _: RemoteConnectionInfo connectionInfo1 = (RemoteConnectionInfo)connectionInfo; - channel = (IChannel)new RemoteChannel(connectionInfo1); + channel = new RemoteChannel(connectionInfo1); foreignByteOrder = connectionInfo1.SwapByteOrder; break; default: - return (RenderPort)null; + return null; } RenderPort renderPort = new RenderPort(this, channel, destinationContextId, grpObjects, MessageCookieLayout.Default, foreignByteOrder); if (this.m_isConnected) renderPort.Connect(); - this.m_ports.Add((object)renderPort); + this.m_ports.Add(renderPort); return renderPort; } @@ -184,7 +184,7 @@ namespace Microsoft.Iris.Render.Protocol if (tracker.Count != 0) { tracker.TrackerEmpty += new EventHandler(this.OnDataBufferTrackerEmpty); - this.m_activeTrackers.Add((object)tracker); + this.m_activeTrackers.Add(tracker); } else tracker.Dispose(); @@ -193,7 +193,7 @@ namespace Microsoft.Iris.Render.Protocol private void OnDataBufferTrackerEmpty(object objSender, EventArgs args) { DataBufferTracker dataBufferTracker = (DataBufferTracker)objSender; - this.m_activeTrackers.Remove((object)dataBufferTracker); + this.m_activeTrackers.Remove(dataBufferTracker); dataBufferTracker.TrackerEmpty -= new EventHandler(this.OnDataBufferTrackerEmpty); dataBufferTracker.Dispose(); } @@ -241,7 +241,7 @@ namespace Microsoft.Iris.Render.Protocol if (this.m_isBatchingMessages) this.FlushBatch(); while (this.m_pingRequestCount > 0) - MessagingSession.DoEvents(uint.MaxValue); + DoEvents(uint.MaxValue); } private void OnPingReply(object sender, EventArgs args) @@ -260,7 +260,7 @@ namespace Microsoft.Iris.Render.Protocol if (this.m_batchBeginCallbacks == null) return; this.m_batchBeginCallbacks(); - this.m_batchBeginCallbacks = (BatchCallback)null; + this.m_batchBeginCallbacks = null; } internal void FlushBatch() => this.FlushCurrentBatch(false); @@ -272,11 +272,11 @@ namespace Microsoft.Iris.Render.Protocol if (this.m_batchEndCallbacks != null) { this.m_batchEndCallbacks(); - this.m_batchEndCallbacks = (BatchCallback)null; + this.m_batchEndCallbacks = null; } this.m_isBatchingMessages = false; BatchCallback deliveryCallbacks = this.m_batchDeliveryCallbacks; - this.m_batchDeliveryCallbacks = (BatchCallback)null; + this.m_batchDeliveryCallbacks = null; foreach (RenderPort port in this.m_ports) port.EndMessageBatch(deliveryCallbacks); if (stopBatching) @@ -333,7 +333,7 @@ namespace Microsoft.Iris.Render.Protocol EngineApi.BufferInfo* pBufferInfo, void* pvBufferData) { - RenderPort renderPort = (RenderPort)null; + RenderPort renderPort = null; for (int index = 0; index < this.m_ports.Count; ++index) { RenderPort port = (RenderPort)this.m_ports[index]; @@ -378,7 +378,7 @@ namespace Microsoft.Iris.Render.Protocol DeferredInvokePriority priority, TimeSpan delay) { - this.DeferredInvoke((SharedRenderObject)null, method, args, priority, delay); + this.DeferredInvoke(null, method, args, priority, delay); } internal void DeferredInvoke( @@ -391,14 +391,14 @@ namespace Microsoft.Iris.Render.Protocol if (this.m_owningThread == null) return; DeferredInvokeItem deferredInvokeItem = new DeferredInvokeItem(instanceOwner, method, args); - this.m_renderHost.DeferredInvoke(priority, (IDeferredInvokeItem)deferredInvokeItem, delay); + this.m_renderHost.DeferredInvoke(priority, deferredInvokeItem, delay); } private void DeferredInvoke(DeferredInvokeItem item, DeferredInvokePriority priority) { if (this.m_owningThread == null) return; - this.m_renderHost.DeferredInvoke(priority, (IDeferredInvokeItem)item, TimeSpan.FromMilliseconds(0.0)); + this.m_renderHost.DeferredInvoke(priority, item, TimeSpan.FromMilliseconds(0.0)); } protected override void Invariant() diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/ObjectCache.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/ObjectCache.cs index cc02725..e2f20c9 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/ObjectCache.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/ObjectCache.cs @@ -18,14 +18,14 @@ namespace Microsoft.Iris.Render.Protocol public ObjectCache(ObjectCache.Callback callback, int cFreeItems, bool fPrePopulate) { Debug2.Validate(callback != null, typeof(ArgumentNullException), "calback"); - Debug2.Validate(cFreeItems > 0, typeof(ArgumentException), (object)"Free list must have at least one entry", (object)nameof(cFreeItems)); + Debug2.Validate(cFreeItems > 0, typeof(ArgumentException), "Free list must have at least one entry", nameof(cFreeItems)); this.m_callback = callback; this.m_arFreeObjs = new object[cFreeItems]; this.m_idxFree = -1; if (!fPrePopulate) return; for (int index = 0; index < cFreeItems; ++index) - this.Push(this.DoCallback(ObjectCache.Operation.Alloc, (object)null)); + this.Push(this.DoCallback(Operation.Alloc, null)); } public void Dispose() @@ -35,18 +35,18 @@ namespace Microsoft.Iris.Render.Protocol return; int idxFree = this.m_idxFree; this.m_idxFree = -1; - this.m_arFreeObjs = (object[])null; + this.m_arFreeObjs = null; for (; idxFree >= 0; --idxFree) - this.DoCallback(ObjectCache.Operation.Free, arFreeObjs[idxFree]); + this.DoCallback(Operation.Free, arFreeObjs[idxFree]); } public object Pop() { - ObjectCache.Operation operation = ObjectCache.Operation.Alloc; - object data = (object)null; + ObjectCache.Operation operation = Operation.Alloc; + object data = null; if (this.m_idxFree >= 0) { - operation = ObjectCache.Operation.Thaw; + operation = Operation.Thaw; data = this.m_arFreeObjs[this.m_idxFree--]; } return this.DoCallback(operation, data); @@ -56,11 +56,11 @@ namespace Microsoft.Iris.Render.Protocol { if (this.m_idxFree + 1 >= this.m_arFreeObjs.Length) { - this.DoCallback(ObjectCache.Operation.Free, data); + this.DoCallback(Operation.Free, data); } else { - data = this.DoCallback(ObjectCache.Operation.Freeze, data); + data = this.DoCallback(Operation.Freeze, data); this.m_arFreeObjs[++this.m_idxFree] = data; } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/RemoteObject.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/RemoteObject.cs index 13eb089..ede898f 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/RemoteObject.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/RemoteObject.cs @@ -30,7 +30,7 @@ namespace Microsoft.Iris.Render.Protocol this.m_fFreeOnDispose = fFreeOnDispose; if (this.m_fFreeOnDispose) return; - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); } protected RemoteObject() @@ -66,7 +66,7 @@ namespace Microsoft.Iris.Render.Protocol if (this.IsValid && this.m_fFreeOnDispose && this.m_renderPort != null) this.m_renderPort.FreeHandle(this.m_renderHandle); this.m_renderHandle = RENDERHANDLE.NULL; - this.m_renderPort = (RenderPort)null; + this.m_renderPort = null; } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/RenderPort.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/RenderPort.cs index 9cccdb1..6982e8b 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/RenderPort.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocol/RenderPort.cs @@ -82,7 +82,7 @@ namespace Microsoft.Iris.Render.Protocol this._layoutOfRenderHandles = layout; this._handleTable = new HandleTable(this, this._layoutOfRenderHandles); this._defaultGroupId = this.AllocHandleGroup(false); - this._rootHandle = this.AllocHandle((IRenderHandleOwner)this); + this._rootHandle = this.AllocHandle(this); if (idGroup != RENDERGROUP.NULL) { this.AllocHandleGroupWithId(idGroup); @@ -110,20 +110,20 @@ namespace Microsoft.Iris.Render.Protocol public void Dispose() { - this.PingReply = (EventHandler)null; + this.PingReply = null; this.DisposeObjectMaps(); if (this._channel != null) { this._channel.Dispose(); - this._channel = (IChannel)null; + this._channel = null; } if (this._spareHeapCache == null) return; if (this._currentMessageHeap != null) this.ReleaseHeap(this._currentMessageHeap); - this._currentMessageHeap = (MessageHeap)null; + this._currentMessageHeap = null; this._spareHeapCache.Dispose(); - this._spareHeapCache = (ObjectCache)null; + this._spareHeapCache = null; } public void DisposeObjectMaps() @@ -131,7 +131,7 @@ namespace Microsoft.Iris.Render.Protocol if (this._handleTable == null) return; this._handleTable.Dispose(); - this._handleTable = (HandleTable)null; + this._handleTable = null; } public MessagingSession Session => this._session; @@ -154,7 +154,7 @@ namespace Microsoft.Iris.Render.Protocol public ProtocolInstance LookUpProtocol(string name) { - ProtocolInstance protocolInstance = (ProtocolInstance)null; + ProtocolInstance protocolInstance = null; foreach (ProtocolInstance protocol in this._protocols) { if (protocol.Name == name) @@ -165,8 +165,8 @@ namespace Microsoft.Iris.Render.Protocol internal void BindProtocol(ProtocolInstance protocol) { - Debug2.Validate(this.LookUpProtocol(protocol.Name) == null, typeof(InvalidOperationException), (object)nameof(protocol), (object)"protocol already bound"); - this._protocols.Add((object)protocol); + Debug2.Validate(this.LookUpProtocol(protocol.Name) == null, typeof(InvalidOperationException), nameof(protocol), "protocol already bound"); + this._protocols.Add(protocol); if (this._channel == null || !this._channel.IsConnected) return; protocol.OnConnect(); @@ -176,7 +176,7 @@ namespace Microsoft.Iris.Render.Protocol { if (className.Equals("Splash::Messaging::Broker")) return this._rootHandle; - RENDERHANDLE idObjectClass = this.AllocHandle((IRenderHandleOwner)this); + RENDERHANDLE idObjectClass = this.AllocHandle(this); RemoteBroker.SendCreateClass(this._protocolMessaging, className, idObjectClass); return idObjectClass; } @@ -189,7 +189,7 @@ namespace Microsoft.Iris.Render.Protocol RemoteBroker.SendCreateObject(this._protocolMessaging, classCreate, hNewObject, pmsgConstructor); } - internal unsafe void SendLocalCallbackMessage(Message* pmsgCallback) => Microsoft.Iris.Render.Protocols.Splash.Messaging.RemoteContext.SendForwardMessage(this._protocolMessaging, this._session.LocalContext, pmsgCallback); + internal unsafe void SendLocalCallbackMessage(Message* pmsgCallback) => Protocols.Splash.Messaging.RemoteContext.SendForwardMessage(this._protocolMessaging, this._session.LocalContext, pmsgCallback); internal void LinkContext(ContextID idContextExisting, ContextID idContextAlias) => RemoteContextRelay.SendLinkContext(this._protocolMessaging, idContextExisting, idContextAlias); @@ -220,7 +220,7 @@ namespace Microsoft.Iris.Render.Protocol idContextSrc = this._session.LocalContext, idContextDest = this._idRemoteContext, idBuffer = idRemoteBuffer, - nFlags = (EngineApi.BufferFlags)0, + nFlags = 0, cbSizeBuffer = cbSize }, pvData)); } @@ -252,7 +252,7 @@ namespace Microsoft.Iris.Render.Protocol idBuffer = RENDERHANDLE.NULL, nFlags = EngineApi.BufferFlags.CopyData, cbSizeBuffer = src - }, (void*)pmsg)); + }, pmsg)); } private void UpdateTraffic(uint uControl, uint uData) @@ -264,7 +264,7 @@ namespace Microsoft.Iris.Render.Protocol { if (this._fPendingTrafficSummary || !this.Session.IsConnected) return; - this.Session.DeferredInvoke((Delegate)this._deferredTrafficUpdate, (object)null, DeferredInvokePriority.Idle, RenderPort.s_timeTrafficWindow); + this.Session.DeferredInvoke(_deferredTrafficUpdate, null, DeferredInvokePriority.Idle, s_timeTrafficWindow); this._fPendingTrafficSummary = true; } else @@ -275,9 +275,9 @@ namespace Microsoft.Iris.Render.Protocol { if (!this._fPendingTrafficSummary) return; - if (DateTime.UtcNow - this._dtRecentTrafficTime < RenderPort.s_timeTrafficWindow) + if (DateTime.UtcNow - this._dtRecentTrafficTime < s_timeTrafficWindow) { - this.Session.DeferredInvoke((Delegate)this._deferredTrafficUpdate, (object)null, DeferredInvokePriority.Idle, this._dtRecentTrafficTime + RenderPort.s_timeTrafficWindow - DateTime.UtcNow); + this.Session.DeferredInvoke(_deferredTrafficUpdate, null, DeferredInvokePriority.Idle, this._dtRecentTrafficTime + s_timeTrafficWindow - DateTime.UtcNow); } else { @@ -288,9 +288,9 @@ namespace Microsoft.Iris.Render.Protocol private void TrafficUpdateWorker() { - this._ulOverallControlTraffic += (ulong)this._uRecentControlTraffic; - this._ulOverallDataTraffic += (ulong)this._uRecentDataTraffic; - this._ulOverallTotalTraffic += (ulong)(this._uRecentControlTraffic + this._uRecentDataTraffic); + this._ulOverallControlTraffic += _uRecentControlTraffic; + this._ulOverallDataTraffic += _uRecentDataTraffic; + this._ulOverallTotalTraffic += this._uRecentControlTraffic + this._uRecentDataTraffic; Debug2.IsCategoryEnabled(DebugCategory.Protocol, 1); this._uRecentControlTraffic = 0U; this._uRecentDataTraffic = 0U; @@ -341,7 +341,7 @@ namespace Microsoft.Iris.Render.Protocol return; if (this._channel != null && this._handleTable.GetGroup(handle) == this._defaultGroupId) { - this._handleTable.SetOwner(handle, (IRenderHandleOwner)null); + this._handleTable.SetOwner(handle, null); this.AddPendingDelete(handle); RemoteBroker.SendDestroyObject(this._protocolMessaging, handle); } @@ -349,7 +349,7 @@ namespace Microsoft.Iris.Render.Protocol this._handleTable.Free(handle); } else - this.Session.DeferredInvoke((Delegate)this._deferredObjectReleaseWorker, (object)handle, DeferredInvokePriority.High); + this.Session.DeferredInvoke(_deferredObjectReleaseWorker, handle, DeferredInvokePriority.High); } public void CancelAllocHandle(RENDERHANDLE handle) @@ -363,7 +363,7 @@ namespace Microsoft.Iris.Render.Protocol public IRenderHandleOwner TryGetProxyOwner(RENDERHANDLE handle) { - IRenderHandleOwner renderHandleOwner = (IRenderHandleOwner)null; + IRenderHandleOwner renderHandleOwner = null; if (this._groupProxies != null) { RENDERGROUP group = this._handleTable.GetGroup(handle); @@ -392,7 +392,7 @@ namespace Microsoft.Iris.Render.Protocol { RENDERGROUP handle = this._handleTable.AllocGroup(); if (this._channel != null) - Microsoft.Iris.Render.Protocols.Splash.Messaging.RemoteContext.SendCreateGroup(this._protocolMessaging, (int)RENDERGROUP.ToUInt32(handle), this._session.LocalContext); + Protocols.Splash.Messaging.RemoteContext.SendCreateGroup(this._protocolMessaging, (int)RENDERGROUP.ToUInt32(handle), this._session.LocalContext); else if (failIfNotConnected) Debug2.Throw(false, "Not connected to renderer"); return handle; @@ -407,32 +407,32 @@ namespace Microsoft.Iris.Render.Protocol if (this._channel != null) { this.AddPendingGroupDelete(group); - Microsoft.Iris.Render.Protocols.Splash.Messaging.RemoteContext.SendDestroyGroup(this._protocolMessaging, (int)RENDERGROUP.ToUInt32(group)); + Protocols.Splash.Messaging.RemoteContext.SendDestroyGroup(this._protocolMessaging, (int)RENDERGROUP.ToUInt32(group)); } else this._handleTable.FreeGroup(group); } else - this.Session.DeferredInvoke((Delegate)this._deferredGroupReleaseWorker, (object)group, DeferredInvokePriority.High); + this.Session.DeferredInvoke(_deferredGroupReleaseWorker, group, DeferredInvokePriority.High); } public void RegisterGroupProxy(RENDERGROUP group, IRenderHandleOwner proxy) { if (this._groupProxies == null) this._groupProxies = new Map(); - this._groupProxies[group] = new WeakReference((object)proxy); + this._groupProxies[group] = new WeakReference(proxy); } public void RevokeGroupProxy(RENDERGROUP group) { if (this._groupProxies == null) return; - this._groupProxies[group] = (WeakReference)null; + this._groupProxies[group] = null; } public IRenderHandleOwner GetGroupProxy(RENDERGROUP group) { - IRenderHandleOwner renderHandleOwner = (IRenderHandleOwner)null; + IRenderHandleOwner renderHandleOwner = null; if (this._groupProxies != null) { WeakReference groupProxy = this._groupProxies[group]; @@ -451,16 +451,16 @@ namespace Microsoft.Iris.Render.Protocol public void ReleaseHeap(MessageHeap heap) { if (this.Session.IsOwningThread()) - this.DeferredHeapReleaseWorker((object)heap); + this.DeferredHeapReleaseWorker(heap); else if (this.Session.OwningThread != null) - this.Session.DeferredInvoke((Delegate)this._deferredHeapReleaseWorker, (object)heap, DeferredInvokePriority.High); + this.Session.DeferredInvoke(_deferredHeapReleaseWorker, heap, DeferredInvokePriority.High); else heap.Dispose(); } private unsafe void StoreMessageEntry(Message* pMethodMsg) { - MessageHeap.Block block = this._currentMessageHeap.LookupBlock((void*)pMethodMsg); + MessageHeap.Block block = this._currentMessageHeap.LookupBlock(pMethodMsg); Debug2.Throw((IntPtr)block.data != IntPtr.Zero, "message should be in current message heap"); uint num = (uint)((ulong)((sbyte*)pMethodMsg - (sbyte*)block.data) - (ulong)sizeof(MessageBatchEntry)); if ((IntPtr)this._lastBatchEntry != IntPtr.Zero && (int)this._lastBatchBlockId == (int)block.id) @@ -473,7 +473,7 @@ namespace Microsoft.Iris.Render.Protocol BatchCallback populateCallback = this._batchPopulateCallback; if (populateCallback == null) return; - this._batchPopulateCallback = (BatchCallback)null; + this._batchPopulateCallback = null; populateCallback(); } @@ -506,18 +506,18 @@ namespace Microsoft.Iris.Render.Protocol RENDERHANDLE idRemoteBuffer = RENDERHANDLE.NULL; --blockCount; if (blockCount > 0) - idRemoteBuffer = this.AllocHandle((IRenderHandleOwner)this); + idRemoteBuffer = this.AllocHandle(this); data->idPredicateBuffer = renderhandle; if (this.ForeignByteOrder) - RenderPort.SwapBatchListByteOrder(data); + SwapBatchListByteOrder(data); num += current.size; this.SendBatchBuffer(current.data, current.size, idRemoteBuffer); renderhandle = idRemoteBuffer; } - this._currentMessageHeap = (MessageHeap)null; - this._pendingBatchDeletes = (RENDERHANDLE[])null; + this._currentMessageHeap = null; + this._pendingBatchDeletes = null; this._pendingBatchDeleteSlot = 0U; - this._pendingBatchGroupDeletes = (RENDERGROUP[])null; + this._pendingBatchGroupDeletes = null; this._pendingBatchGroupDeleteSlot = 0U; } finally @@ -526,7 +526,7 @@ namespace Microsoft.Iris.Render.Protocol { this.DequeuePendingBatch(nextBatchId, true); this.ReleaseHeap(this._currentMessageHeap); - this._currentMessageHeap = (MessageHeap)null; + this._currentMessageHeap = null; } } } @@ -535,7 +535,7 @@ namespace Microsoft.Iris.Render.Protocol if (this._currentMessageHeap != null) { this.ReleaseHeap(this._currentMessageHeap); - this._currentMessageHeap = (MessageHeap)null; + this._currentMessageHeap = null; } if (deliveryCallback == null) return; @@ -544,9 +544,9 @@ namespace Microsoft.Iris.Render.Protocol } finally { - this._currentMessageHeap = (MessageHeap)null; - this._batchPopulateCallback = (BatchCallback)null; - this._lastBatchEntry = (MessageBatchEntry*)null; + this._currentMessageHeap = null; + this._batchPopulateCallback = null; + this._lastBatchEntry = null; this._lastBatchBlockId = 0U; this._uBatchedMessages = 0U; } @@ -556,12 +556,12 @@ namespace Microsoft.Iris.Render.Protocol { byte* pMem1 = (byte*)pHeader; uint num = pHeader->uOffsetFirstEntry; - MarshalHelper.SwapByteOrder(pMem1, ref RenderPort.s_ByteOrder_MessageBatchHeader, typeof(MessageBatchHeader), 0, 0); + MarshalHelper.SwapByteOrder(pMem1, ref s_ByteOrder_MessageBatchHeader, typeof(MessageBatchHeader), 0, 0); while (num != 0U) { byte* pMem2 = pMem1 + (int)num; num = ((MessageBatchEntry*)pMem2)->uOffsetNextEntry; - MarshalHelper.SwapByteOrder(pMem2, ref RenderPort.s_ByteOrder_MessageBatchEntry, typeof(MessageBatchEntry), 0, 0); + MarshalHelper.SwapByteOrder(pMem2, ref s_ByteOrder_MessageBatchEntry, typeof(MessageBatchEntry), 0, 0); } } @@ -569,7 +569,7 @@ namespace Microsoft.Iris.Render.Protocol private void DeferredGroupReleaseWorker(object args) => this.FreeHandleGroup((RENDERGROUP)args); - private void DeferredHeapReleaseWorker(object args) => this._spareHeapCache.Push((object)(MessageHeap)args); + private void DeferredHeapReleaseWorker(object args) => this._spareHeapCache.Push((MessageHeap)args); private object HeapCacheCallback(ObjectCache.Operation operation, object data) { @@ -584,27 +584,27 @@ namespace Microsoft.Iris.Render.Protocol case ObjectCache.Operation.Free: this._activeHeaps.Remove(key); key.Dispose(); - key = (MessageHeap)null; + key = null; break; case ObjectCache.Operation.Freeze: Debug2.Validate(key != null, typeof(ArgumentNullException), nameof(data)); key.Reset(); break; } - return (object)key; + return key; } internal unsafe void ProcessMessageBuffer(EngineApi.BufferInfo* pBufferInfo, void* pvBufferData) { if (this.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)pvBufferData, ref RenderPort.s_ByteOrder_CallbackMessage, typeof(CallbackMessage), 0, 0); + MarshalHelper.SwapByteOrder((byte*)pvBufferData, ref s_ByteOrder_CallbackMessage, typeof(CallbackMessage), 0, 0); CallbackMessage* message = (CallbackMessage*)pvBufferData; this.DispatchCallbackMessage(RENDERHANDLE.ToUInt32(message->idObjectSubject), message); } internal RENDERHANDLE RegisterCallback(PortCallback callback, out uint idCallback) { - idCallback = (uint)this._callbackHandlers.Add((object)callback); + idCallback = (uint)this._callbackHandlers.Add(callback); return RENDERHANDLE.FromUInt32(idCallback + 2U); } @@ -616,7 +616,7 @@ namespace Microsoft.Iris.Render.Protocol PortCallback callbackHandler = (PortCallback)this._callbackHandlers[(int)idCallback]; if (callbackHandler == null) return; - IRenderHandleOwner owner = (IRenderHandleOwner)this; + IRenderHandleOwner owner = this; if (message->hTarget != RENDERHANDLE.NULL) { if (this._handleTable == null) @@ -632,7 +632,7 @@ namespace Microsoft.Iris.Render.Protocol { if (this.PingReply == null) return; - this.PingReply((object)this, EventArgs.Empty); + this.PingReply(this, EventArgs.Empty); } void IRenderPortCallback.OnBatchProcessed( @@ -662,7 +662,7 @@ namespace Microsoft.Iris.Render.Protocol num2 = 16U; RENDERHANDLE[] renderhandleArray = new RENDERHANDLE[(IntPtr)num2]; if (num1 > 0U) - Array.Copy((Array)this._pendingBatchDeletes, (Array)renderhandleArray, this._pendingBatchDeletes.Length); + Array.Copy(_pendingBatchDeletes, renderhandleArray, this._pendingBatchDeletes.Length); this._pendingBatchDeletes = renderhandleArray; } this._pendingBatchDeletes[(IntPtr)this._pendingBatchDeleteSlot] = handle; @@ -692,7 +692,7 @@ namespace Microsoft.Iris.Render.Protocol num2 = 16U; RENDERGROUP[] rendergroupArray = new RENDERGROUP[(IntPtr)num2]; if (num1 > 0U) - Array.Copy((Array)this._pendingBatchGroupDeletes, (Array)rendergroupArray, this._pendingBatchGroupDeletes.Length); + Array.Copy(_pendingBatchGroupDeletes, rendergroupArray, this._pendingBatchGroupDeletes.Length); this._pendingBatchGroupDeletes = rendergroupArray; } this._pendingBatchGroupDeletes[(IntPtr)this._pendingBatchGroupDeleteSlot] = group; @@ -717,7 +717,7 @@ namespace Microsoft.Iris.Render.Protocol { batchSendInfo = this._freeBatchSendInfos; this._freeBatchSendInfos = batchSendInfo.next; - batchSendInfo.next = (RenderPort.BatchSendInfo)null; + batchSendInfo.next = null; --this._numFreeBatchSendInfos; } else @@ -751,7 +751,7 @@ namespace Microsoft.Iris.Render.Protocol private RenderPort.BatchSendInfo DequeuePendingBatch(uint batchID, bool fFreeInfo) { - RenderPort.BatchSendInfo batchSendInfo = (RenderPort.BatchSendInfo)null; + RenderPort.BatchSendInfo batchSendInfo = null; RenderPort.BatchSendInfo info; for (info = this._sentBatchesHead; info != null && (int)info.batchID != (int)batchID; info = info.next) batchSendInfo = info; @@ -763,17 +763,17 @@ namespace Microsoft.Iris.Render.Protocol this._sentBatchesHead = info.next; else batchSendInfo.next = info.next; - info.next = (RenderPort.BatchSendInfo)null; + info.next = null; if (fFreeInfo) { this.FreeBatchSendInfo(info); - info = (RenderPort.BatchSendInfo)null; + info = null; } } return info; } - public static object SyncLock => RenderPort.s_SyncLock; + public static object SyncLock => s_SyncLock; private class BatchSendInfo { @@ -787,11 +787,11 @@ namespace Microsoft.Iris.Render.Protocol public void Reset() { this.batchID = 0U; - this.heap = (MessageHeap)null; - this.pendingDeletes = (RENDERHANDLE[])null; - this.pendingGroupDeletes = (RENDERGROUP[])null; - this.deliveryCallback = (BatchCallback)null; - this.next = (RenderPort.BatchSendInfo)null; + this.heap = null; + this.pendingDeletes = null; + this.pendingGroupDeletes = null; + this.deliveryCallback = null; + this.next = null; } } } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/LocalFormWindowCallback.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/LocalFormWindowCallback.cs index 6b916fb..945c58b 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/LocalFormWindowCallback.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/LocalFormWindowCallback.cs @@ -46,7 +46,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop public override int GetHashCode() => base.GetHashCode(); - internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(LocalFormWindowCallback.DispatchCallback), out uint _); + internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); private static unsafe void DispatchCallback( RenderPort port, @@ -58,46 +58,46 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop switch (message->nMsg) { case 0: - LocalFormWindowCallback.Dispatch_OnRendererSuspended(port, _priv_target, (LocalFormWindowCallback.Msg0_OnRendererSuspended*)message); + Dispatch_OnRendererSuspended(port, _priv_target, (LocalFormWindowCallback.Msg0_OnRendererSuspended*)message); break; case 1: - LocalFormWindowCallback.Dispatch_OnNativeScreensave(port, _priv_target, (LocalFormWindowCallback.Msg1_OnNativeScreensave*)message); + Dispatch_OnNativeScreensave(port, _priv_target, (LocalFormWindowCallback.Msg1_OnNativeScreensave*)message); break; case 2: - LocalFormWindowCallback.Dispatch_OnShellShutdownHook(port, _priv_target, (LocalFormWindowCallback.Msg2_OnShellShutdownHook*)message); + Dispatch_OnShellShutdownHook(port, _priv_target, (LocalFormWindowCallback.Msg2_OnShellShutdownHook*)message); break; case 3: - LocalFormWindowCallback.Dispatch_OnSetFocus(port, _priv_target, (LocalFormWindowCallback.Msg3_OnSetFocus*)message); + Dispatch_OnSetFocus(port, _priv_target, (LocalFormWindowCallback.Msg3_OnSetFocus*)message); break; case 4: - LocalFormWindowCallback.Dispatch_OnDropComplete(port, _priv_target, (LocalFormWindowCallback.Msg4_OnDropComplete*)message); + Dispatch_OnDropComplete(port, _priv_target, (LocalFormWindowCallback.Msg4_OnDropComplete*)message); break; case 5: - LocalFormWindowCallback.Dispatch_OnPartialDrop(port, _priv_target, (LocalFormWindowCallback.Msg5_OnPartialDrop*)message); + Dispatch_OnPartialDrop(port, _priv_target, (LocalFormWindowCallback.Msg5_OnPartialDrop*)message); break; case 6: - LocalFormWindowCallback.Dispatch_OnStateChange(port, _priv_target, (LocalFormWindowCallback.Msg6_OnStateChange*)message); + Dispatch_OnStateChange(port, _priv_target, (LocalFormWindowCallback.Msg6_OnStateChange*)message); break; case 7: - LocalFormWindowCallback.Dispatch_OnTerminalSessionChange(port, _priv_target, (LocalFormWindowCallback.Msg7_OnTerminalSessionChange*)message); + Dispatch_OnTerminalSessionChange(port, _priv_target, (LocalFormWindowCallback.Msg7_OnTerminalSessionChange*)message); break; case 8: - LocalFormWindowCallback.Dispatch_OnPrivateSysCommand(port, _priv_target, (LocalFormWindowCallback.Msg8_OnPrivateSysCommand*)message); + Dispatch_OnPrivateSysCommand(port, _priv_target, (LocalFormWindowCallback.Msg8_OnPrivateSysCommand*)message); break; case 9: - LocalFormWindowCallback.Dispatch_OnMouseIdle(port, _priv_target, (LocalFormWindowCallback.Msg9_OnMouseIdle*)message); + Dispatch_OnMouseIdle(port, _priv_target, (LocalFormWindowCallback.Msg9_OnMouseIdle*)message); break; case 10: - LocalFormWindowCallback.Dispatch_OnCloseRequested(port, _priv_target, (LocalFormWindowCallback.Msg10_OnCloseRequested*)message); + Dispatch_OnCloseRequested(port, _priv_target, (LocalFormWindowCallback.Msg10_OnCloseRequested*)message); break; case 11: - LocalFormWindowCallback.Dispatch_OnLoad(port, _priv_target, (LocalFormWindowCallback.Msg11_OnLoad*)message); + Dispatch_OnLoad(port, _priv_target, (LocalFormWindowCallback.Msg11_OnLoad*)message); break; case 12: - LocalFormWindowCallback.Dispatch_OnWindowDestroyed(port, _priv_target, (LocalFormWindowCallback.Msg12_OnWindowDestroyed*)message); + Dispatch_OnWindowDestroyed(port, _priv_target, (LocalFormWindowCallback.Msg12_OnWindowDestroyed*)message); break; case 13: - LocalFormWindowCallback.Dispatch_OnWindowCreated(port, _priv_target, (LocalFormWindowCallback.Msg13_OnWindowCreated*)message); + Dispatch_OnWindowCreated(port, _priv_target, (LocalFormWindowCallback.Msg13_OnWindowCreated*)message); break; } } @@ -108,7 +108,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop LocalFormWindowCallback.Msg0_OnRendererSuspended* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalFormWindowCallback.s_priv_ByteOrder_Msg0_OnRendererSuspended, typeof(LocalFormWindowCallback.Msg0_OnRendererSuspended), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnRendererSuspended, typeof(LocalFormWindowCallback.Msg0_OnRendererSuspended), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; bool fEnabled = _priv_pmsg->fEnabled != 0U; _priv_target.OnRendererSuspended(target, fEnabled); @@ -120,7 +120,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop LocalFormWindowCallback.Msg1_OnNativeScreensave* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalFormWindowCallback.s_priv_ByteOrder_Msg1_OnNativeScreensave, typeof(LocalFormWindowCallback.Msg1_OnNativeScreensave), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg1_OnNativeScreensave, typeof(LocalFormWindowCallback.Msg1_OnNativeScreensave), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; bool fStartScreensave = _priv_pmsg->fStartScreensave != 0U; _priv_target.OnNativeScreensave(target, fStartScreensave); @@ -132,7 +132,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop LocalFormWindowCallback.Msg2_OnShellShutdownHook* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalFormWindowCallback.s_priv_ByteOrder_Msg2_OnShellShutdownHook, typeof(LocalFormWindowCallback.Msg2_OnShellShutdownHook), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg2_OnShellShutdownHook, typeof(LocalFormWindowCallback.Msg2_OnShellShutdownHook), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; ushort uIdMsg = _priv_pmsg->uIdMsg; _priv_target.OnShellShutdownHook(target, uIdMsg); @@ -155,7 +155,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop LocalFormWindowCallback.Msg4_OnDropComplete* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalFormWindowCallback.s_priv_ByteOrder_Msg4_OnDropComplete, typeof(LocalFormWindowCallback.Msg4_OnDropComplete), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg4_OnDropComplete, typeof(LocalFormWindowCallback.Msg4_OnDropComplete), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; _priv_target.OnDropComplete(target); } @@ -166,7 +166,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop LocalFormWindowCallback.Msg5_OnPartialDrop* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalFormWindowCallback.s_priv_ByteOrder_Msg5_OnPartialDrop, typeof(LocalFormWindowCallback.Msg5_OnPartialDrop), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg5_OnPartialDrop, typeof(LocalFormWindowCallback.Msg5_OnPartialDrop), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; string file; MarshalHelper.Decode(_priv_port, (Message*)_priv_pmsg, _priv_pmsg->file, out file); @@ -179,7 +179,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop LocalFormWindowCallback.Msg6_OnStateChange* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalFormWindowCallback.s_priv_ByteOrder_Msg6_OnStateChange, typeof(LocalFormWindowCallback.Msg6_OnStateChange), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg6_OnStateChange, typeof(LocalFormWindowCallback.Msg6_OnStateChange), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; Message* pmsgInner; MarshalHelper.Decode(_priv_port, (Message*)_priv_pmsg, _priv_pmsg->stateInfo, out pmsgInner); @@ -192,7 +192,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop LocalFormWindowCallback.Msg7_OnTerminalSessionChange* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalFormWindowCallback.s_priv_ByteOrder_Msg7_OnTerminalSessionChange, typeof(LocalFormWindowCallback.Msg7_OnTerminalSessionChange), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg7_OnTerminalSessionChange, typeof(LocalFormWindowCallback.Msg7_OnTerminalSessionChange), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; IntPtr wParam = _priv_pmsg->wParam; IntPtr lParam = _priv_pmsg->lParam; @@ -205,7 +205,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop LocalFormWindowCallback.Msg8_OnPrivateSysCommand* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalFormWindowCallback.s_priv_ByteOrder_Msg8_OnPrivateSysCommand, typeof(LocalFormWindowCallback.Msg8_OnPrivateSysCommand), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg8_OnPrivateSysCommand, typeof(LocalFormWindowCallback.Msg8_OnPrivateSysCommand), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; IntPtr wParam = _priv_pmsg->wParam; IntPtr lParam = _priv_pmsg->lParam; @@ -218,7 +218,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop LocalFormWindowCallback.Msg9_OnMouseIdle* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalFormWindowCallback.s_priv_ByteOrder_Msg9_OnMouseIdle, typeof(LocalFormWindowCallback.Msg9_OnMouseIdle), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg9_OnMouseIdle, typeof(LocalFormWindowCallback.Msg9_OnMouseIdle), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; bool fNewIdle = _priv_pmsg->fNewIdle != 0U; _priv_target.OnMouseIdle(target, fNewIdle); @@ -230,7 +230,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop LocalFormWindowCallback.Msg10_OnCloseRequested* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalFormWindowCallback.s_priv_ByteOrder_Msg10_OnCloseRequested, typeof(LocalFormWindowCallback.Msg10_OnCloseRequested), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg10_OnCloseRequested, typeof(LocalFormWindowCallback.Msg10_OnCloseRequested), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; _priv_target.OnCloseRequested(target); } @@ -241,7 +241,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop LocalFormWindowCallback.Msg11_OnLoad* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalFormWindowCallback.s_priv_ByteOrder_Msg11_OnLoad, typeof(LocalFormWindowCallback.Msg11_OnLoad), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg11_OnLoad, typeof(LocalFormWindowCallback.Msg11_OnLoad), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; _priv_target.OnLoad(target); } @@ -252,7 +252,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop LocalFormWindowCallback.Msg12_OnWindowDestroyed* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalFormWindowCallback.s_priv_ByteOrder_Msg12_OnWindowDestroyed, typeof(LocalFormWindowCallback.Msg12_OnWindowDestroyed), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg12_OnWindowDestroyed, typeof(LocalFormWindowCallback.Msg12_OnWindowDestroyed), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; uint nFinalShow = _priv_pmsg->nFinalShow; Rectangle rcLastPosition = _priv_pmsg->rcLastPosition; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/LocalInputCallback.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/LocalInputCallback.cs index 1dc57ef..39f715d 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/LocalInputCallback.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/LocalInputCallback.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop public override int GetHashCode() => base.GetHashCode(); - internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(LocalInputCallback.DispatchCallback), out uint _); + internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); private static unsafe void DispatchCallback( RenderPort port, @@ -43,7 +43,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop { if (!(owner is IInputCallback _priv_target) || message->nMsg != 0U) return; - LocalInputCallback.Dispatch_OnInput(port, _priv_target, (LocalInputCallback.Msg0_OnInput*)message); + Dispatch_OnInput(port, _priv_target, (LocalInputCallback.Msg0_OnInput*)message); } private static unsafe void Dispatch_OnInput( @@ -52,7 +52,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop LocalInputCallback.Msg0_OnInput* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalInputCallback.s_priv_ByteOrder_Msg0_OnInput, typeof(LocalInputCallback.Msg0_OnInput), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnInput, typeof(LocalInputCallback.Msg0_OnInput), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; Message* pmsgInner; MarshalHelper.Decode(_priv_port, (Message*)_priv_pmsg, _priv_pmsg->inputInfo, out pmsgInner); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/LocalDesktopManagerCallback.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/LocalDesktopManagerCallback.cs index 96222b1..7db7107 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/LocalDesktopManagerCallback.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/LocalDesktopManagerCallback.cs @@ -40,7 +40,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt public override int GetHashCode() => base.GetHashCode(); - internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(LocalDesktopManagerCallback.DispatchCallback), out uint _); + internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); private static unsafe void DispatchCallback( RenderPort port, @@ -52,22 +52,22 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt switch (message->nMsg) { case 0: - LocalDesktopManagerCallback.Dispatch_OnEndDisplayModes(port, _priv_target, (LocalDesktopManagerCallback.Msg0_OnEndDisplayModes*)message); + Dispatch_OnEndDisplayModes(port, _priv_target, (LocalDesktopManagerCallback.Msg0_OnEndDisplayModes*)message); break; case 1: - LocalDesktopManagerCallback.Dispatch_OnDisplayMode(port, _priv_target, (LocalDesktopManagerCallback.Msg1_OnDisplayMode*)message); + Dispatch_OnDisplayMode(port, _priv_target, (LocalDesktopManagerCallback.Msg1_OnDisplayMode*)message); break; case 2: - LocalDesktopManagerCallback.Dispatch_OnBeginDisplayModes(port, _priv_target, (LocalDesktopManagerCallback.Msg2_OnBeginDisplayModes*)message); + Dispatch_OnBeginDisplayModes(port, _priv_target, (LocalDesktopManagerCallback.Msg2_OnBeginDisplayModes*)message); break; case 3: - LocalDesktopManagerCallback.Dispatch_OnEndEnumMonitorInfo(port, _priv_target, (LocalDesktopManagerCallback.Msg3_OnEndEnumMonitorInfo*)message); + Dispatch_OnEndEnumMonitorInfo(port, _priv_target, (LocalDesktopManagerCallback.Msg3_OnEndEnumMonitorInfo*)message); break; case 4: - LocalDesktopManagerCallback.Dispatch_OnMonitorInfo(port, _priv_target, (LocalDesktopManagerCallback.Msg4_OnMonitorInfo*)message); + Dispatch_OnMonitorInfo(port, _priv_target, (LocalDesktopManagerCallback.Msg4_OnMonitorInfo*)message); break; case 5: - LocalDesktopManagerCallback.Dispatch_OnBeginEnumMonitorInfo(port, _priv_target, (LocalDesktopManagerCallback.Msg5_OnBeginEnumMonitorInfo*)message); + Dispatch_OnBeginEnumMonitorInfo(port, _priv_target, (LocalDesktopManagerCallback.Msg5_OnBeginEnumMonitorInfo*)message); break; } } @@ -78,7 +78,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt LocalDesktopManagerCallback.Msg0_OnEndDisplayModes* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalDesktopManagerCallback.s_priv_ByteOrder_Msg0_OnEndDisplayModes, typeof(LocalDesktopManagerCallback.Msg0_OnEndDisplayModes), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnEndDisplayModes, typeof(LocalDesktopManagerCallback.Msg0_OnEndDisplayModes), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; _priv_target.OnEndDisplayModes(target); } @@ -89,7 +89,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt LocalDesktopManagerCallback.Msg1_OnDisplayMode* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalDesktopManagerCallback.s_priv_ByteOrder_Msg1_OnDisplayMode, typeof(LocalDesktopManagerCallback.Msg1_OnDisplayMode), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg1_OnDisplayMode, typeof(LocalDesktopManagerCallback.Msg1_OnDisplayMode), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; RenderDisplayMode mode = _priv_pmsg->mode; bool fSupported = _priv_pmsg->fSupported != 0U; @@ -102,7 +102,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt LocalDesktopManagerCallback.Msg2_OnBeginDisplayModes* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalDesktopManagerCallback.s_priv_ByteOrder_Msg2_OnBeginDisplayModes, typeof(LocalDesktopManagerCallback.Msg2_OnBeginDisplayModes), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg2_OnBeginDisplayModes, typeof(LocalDesktopManagerCallback.Msg2_OnBeginDisplayModes), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; _priv_target.OnBeginDisplayModes(target); } @@ -113,7 +113,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt LocalDesktopManagerCallback.Msg3_OnEndEnumMonitorInfo* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalDesktopManagerCallback.s_priv_ByteOrder_Msg3_OnEndEnumMonitorInfo, typeof(LocalDesktopManagerCallback.Msg3_OnEndEnumMonitorInfo), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg3_OnEndEnumMonitorInfo, typeof(LocalDesktopManagerCallback.Msg3_OnEndEnumMonitorInfo), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; _priv_target.OnEndEnumMonitorInfo(target); } @@ -124,7 +124,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt LocalDesktopManagerCallback.Msg4_OnMonitorInfo* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalDesktopManagerCallback.s_priv_ByteOrder_Msg4_OnMonitorInfo, typeof(LocalDesktopManagerCallback.Msg4_OnMonitorInfo), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg4_OnMonitorInfo, typeof(LocalDesktopManagerCallback.Msg4_OnMonitorInfo), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; Message* pmsgInner; MarshalHelper.Decode(_priv_port, (Message*)_priv_pmsg, _priv_pmsg->info, out pmsgInner); @@ -137,7 +137,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt LocalDesktopManagerCallback.Msg5_OnBeginEnumMonitorInfo* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalDesktopManagerCallback.s_priv_ByteOrder_Msg5_OnBeginEnumMonitorInfo, typeof(LocalDesktopManagerCallback.Msg5_OnBeginEnumMonitorInfo), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg5_OnBeginEnumMonitorInfo, typeof(LocalDesktopManagerCallback.Msg5_OnBeginEnumMonitorInfo), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; _priv_target.OnBeginEnumMonitorInfo(target); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/LocalHwndHostWindowCallback.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/LocalHwndHostWindowCallback.cs index a23d798..98aea14 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/LocalHwndHostWindowCallback.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/LocalHwndHostWindowCallback.cs @@ -32,7 +32,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt public override int GetHashCode() => base.GetHashCode(); - internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(LocalHwndHostWindowCallback.DispatchCallback), out uint _); + internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); private static unsafe void DispatchCallback( RenderPort port, @@ -41,7 +41,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt { if (!(owner is IHwndHostWindowCallback _priv_target) || message->nMsg != 0U) return; - LocalHwndHostWindowCallback.Dispatch_OnHandleChanged(port, _priv_target, (LocalHwndHostWindowCallback.Msg0_OnHandleChanged*)message); + Dispatch_OnHandleChanged(port, _priv_target, (LocalHwndHostWindowCallback.Msg0_OnHandleChanged*)message); } private static unsafe void Dispatch_OnHandleChanged( diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/ProtocolSplashDesktopNt.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/ProtocolSplashDesktopNt.cs index 40b4756..277ccdf 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/ProtocolSplashDesktopNt.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/ProtocolSplashDesktopNt.cs @@ -29,7 +29,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt return protocolSplashDesktopNt; } ProtocolSplashDesktopNt protocolSplashDesktopNt1 = new ProtocolSplashDesktopNt(port); - port.BindProtocol((ProtocolInstance)protocolSplashDesktopNt1); + port.BindProtocol(protocolSplashDesktopNt1); return protocolSplashDesktopNt1; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteDesktopManager.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteDesktopManager.cs index 321cc0b..6e6e6e2 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteDesktopManager.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteDesktopManager.cs @@ -41,7 +41,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt msg2CreatePtr->fEnumDisplayModes = fEnumDisplayModes ? uint.MaxValue : 0U; msg2CreatePtr->_priv_idObjectSubject = remoteDesktopManager.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteDesktopManager.s_priv_ByteOrder_Msg2_Create, typeof(RemoteDesktopManager.Msg2_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg2_Create, typeof(RemoteDesktopManager.Msg2_Create), 0, 0); port.CreateRemoteObject(managerClassHandle, remoteDesktopManager.m_renderHandle, (Message*)msg2CreatePtr); return remoteDesktopManager; } @@ -59,7 +59,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt rebuildMonitorCachePtr->_priv_msgid = 0U; rebuildMonitorCachePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)rebuildMonitorCachePtr, ref RemoteDesktopManager.s_priv_ByteOrder_Msg0_RebuildMonitorCache, typeof(RemoteDesktopManager.Msg0_RebuildMonitorCache), 0, 0); + MarshalHelper.SwapByteOrder((byte*)rebuildMonitorCachePtr, ref s_priv_ByteOrder_Msg0_RebuildMonitorCache, typeof(RemoteDesktopManager.Msg0_RebuildMonitorCache), 0, 0); _priv_pmsgUse = (Message*)rebuildMonitorCachePtr; } @@ -90,7 +90,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt changeFullScreenModePtr->fTvMode = fTvMode ? uint.MaxValue : 0U; changeFullScreenModePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)changeFullScreenModePtr, ref RemoteDesktopManager.s_priv_ByteOrder_Msg1_ChangeFullScreenMode, typeof(RemoteDesktopManager.Msg1_ChangeFullScreenMode), 0, 0); + MarshalHelper.SwapByteOrder((byte*)changeFullScreenModePtr, ref s_priv_ByteOrder_Msg1_ChangeFullScreenMode, typeof(RemoteDesktopManager.Msg1_ChangeFullScreenMode), 0, 0); _priv_pmsgUse = (Message*)changeFullScreenModePtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteFormWindow.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteFormWindow.cs index 0c8d038..dca1fbf 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteFormWindow.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteFormWindow.cs @@ -37,7 +37,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt msg41CreatePtr->_priv_ctxcb = port.Session.LocalContext; msg41CreatePtr->_priv_idObjectSubject = remoteFormWindow.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteFormWindow.s_priv_ByteOrder_Msg41_Create, typeof(RemoteFormWindow.Msg41_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg41_Create, typeof(RemoteFormWindow.Msg41_Create), 0, 0); port.CreateRemoteObject(windowClassHandle, remoteFormWindow.m_renderHandle, (Message*)msg41CreatePtr); return remoteFormWindow; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteHwndHostWindow.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteHwndHostWindow.cs index 8564e2c..d285ee6 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteHwndHostWindow.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Nt/RemoteHwndHostWindow.cs @@ -42,7 +42,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt msg4CreatePtr->_priv_ctxcb = port.Session.LocalContext; msg4CreatePtr->_priv_idObjectSubject = remoteHwndHostWindow.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteHwndHostWindow.s_priv_ByteOrder_Msg4_Create, typeof(RemoteHwndHostWindow.Msg4_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg4_Create, typeof(RemoteHwndHostWindow.Msg4_Create), 0, 0); port.CreateRemoteObject(windowClassHandle, remoteHwndHostWindow.m_renderHandle, (Message*)msg4CreatePtr); return remoteHwndHostWindow; } @@ -62,7 +62,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt msg0SetVisiblePtr->fVisible = fVisible ? uint.MaxValue : 0U; msg0SetVisiblePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0SetVisiblePtr, ref RemoteHwndHostWindow.s_priv_ByteOrder_Msg0_SetVisible, typeof(RemoteHwndHostWindow.Msg0_SetVisible), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0SetVisiblePtr, ref s_priv_ByteOrder_Msg0_SetVisible, typeof(RemoteHwndHostWindow.Msg0_SetVisible), 0, 0); _priv_pmsgUse = (Message*)msg0SetVisiblePtr; } @@ -89,7 +89,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt msg1SetSizePtr->sizeWindowPxl = sizeWindowPxl; msg1SetSizePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg1SetSizePtr, ref RemoteHwndHostWindow.s_priv_ByteOrder_Msg1_SetSize, typeof(RemoteHwndHostWindow.Msg1_SetSize), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg1SetSizePtr, ref s_priv_ByteOrder_Msg1_SetSize, typeof(RemoteHwndHostWindow.Msg1_SetSize), 0, 0); _priv_pmsgUse = (Message*)msg1SetSizePtr; } @@ -116,7 +116,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt msg2SetPositionPtr->ptClientPxl = ptClientPxl; msg2SetPositionPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg2SetPositionPtr, ref RemoteHwndHostWindow.s_priv_ByteOrder_Msg2_SetPosition, typeof(RemoteHwndHostWindow.Msg2_SetPosition), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg2SetPositionPtr, ref s_priv_ByteOrder_Msg2_SetPosition, typeof(RemoteHwndHostWindow.Msg2_SetPosition), 0, 0); _priv_pmsgUse = (Message*)msg2SetPositionPtr; } @@ -143,7 +143,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Nt setBackgroundColorPtr->clrBackground = clrBackground; setBackgroundColorPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setBackgroundColorPtr, ref RemoteHwndHostWindow.s_priv_ByteOrder_Msg3_SetBackgroundColor, typeof(RemoteHwndHostWindow.Msg3_SetBackgroundColor), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setBackgroundColorPtr, ref s_priv_ByteOrder_Msg3_SetBackgroundColor, typeof(RemoteHwndHostWindow.Msg3_SetBackgroundColor), 0, 0); _priv_pmsgUse = (Message*)setBackgroundColorPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/ProtocolSplashDesktop.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/ProtocolSplashDesktop.cs index fec5f5f..5819ee2 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/ProtocolSplashDesktop.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/ProtocolSplashDesktop.cs @@ -28,7 +28,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop return protocolSplashDesktop; } ProtocolSplashDesktop protocolSplashDesktop1 = new ProtocolSplashDesktop(port); - port.BindProtocol((ProtocolInstance)protocolSplashDesktop1); + port.BindProtocol(protocolSplashDesktop1); return protocolSplashDesktop1; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/RemoteFormWindowBase.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/RemoteFormWindowBase.cs index b4f3398..ef12af0 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/RemoteFormWindowBase.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/RemoteFormWindowBase.cs @@ -83,7 +83,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop blobInfo.Attach((Message*)setEdgeImagePartsPtr); setEdgeImagePartsPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setEdgeImagePartsPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg7_SetEdgeImageParts, typeof(RemoteFormWindowBase.Msg7_SetEdgeImageParts), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setEdgeImagePartsPtr, ref s_priv_ByteOrder_Msg7_SetEdgeImageParts, typeof(RemoteFormWindowBase.Msg7_SetEdgeImageParts), 0, 0); _priv_pmsgUse = (Message*)setEdgeImagePartsPtr; } @@ -121,7 +121,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop initialPlacementPtr->ptMaxPosition = ptMaxPosition; initialPlacementPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)initialPlacementPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg8_SetInitialPlacement, typeof(RemoteFormWindowBase.Msg8_SetInitialPlacement), 0, 0); + MarshalHelper.SwapByteOrder((byte*)initialPlacementPtr, ref s_priv_ByteOrder_Msg8_SetInitialPlacement, typeof(RemoteFormWindowBase.Msg8_SetInitialPlacement), 0, 0); _priv_pmsgUse = (Message*)initialPlacementPtr; } @@ -149,7 +149,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop refreshHitTargetPtr->_priv_msgid = 9U; refreshHitTargetPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)refreshHitTargetPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg9_RefreshHitTarget, typeof(RemoteFormWindowBase.Msg9_RefreshHitTarget), 0, 0); + MarshalHelper.SwapByteOrder((byte*)refreshHitTargetPtr, ref s_priv_ByteOrder_Msg9_RefreshHitTarget, typeof(RemoteFormWindowBase.Msg9_RefreshHitTarget), 0, 0); _priv_pmsgUse = (Message*)refreshHitTargetPtr; } @@ -174,7 +174,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop exitInternalDragPtr->_priv_msgid = 10U; exitInternalDragPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)exitInternalDragPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg10_ExitInternalDrag, typeof(RemoteFormWindowBase.Msg10_ExitInternalDrag), 0, 0); + MarshalHelper.SwapByteOrder((byte*)exitInternalDragPtr, ref s_priv_ByteOrder_Msg10_ExitInternalDrag, typeof(RemoteFormWindowBase.Msg10_ExitInternalDrag), 0, 0); _priv_pmsgUse = (Message*)exitInternalDragPtr; } @@ -199,7 +199,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop enterInternalDragPtr->_priv_msgid = 11U; enterInternalDragPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)enterInternalDragPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg11_EnterInternalDrag, typeof(RemoteFormWindowBase.Msg11_EnterInternalDrag), 0, 0); + MarshalHelper.SwapByteOrder((byte*)enterInternalDragPtr, ref s_priv_ByteOrder_Msg11_EnterInternalDrag, typeof(RemoteFormWindowBase.Msg11_EnterInternalDrag), 0, 0); _priv_pmsgUse = (Message*)enterInternalDragPtr; } @@ -228,7 +228,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop setDragDropResultPtr->nDragDropResult = nDragDropResult; setDragDropResultPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setDragDropResultPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg12_SetDragDropResult, typeof(RemoteFormWindowBase.Msg12_SetDragDropResult), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setDragDropResultPtr, ref s_priv_ByteOrder_Msg12_SetDragDropResult, typeof(RemoteFormWindowBase.Msg12_SetDragDropResult), 0, 0); _priv_pmsgUse = (Message*)setDragDropResultPtr; } @@ -255,7 +255,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop externalDragDropPtr->fEnable = fEnable ? uint.MaxValue : 0U; externalDragDropPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)externalDragDropPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg13_EnableExternalDragDrop, typeof(RemoteFormWindowBase.Msg13_EnableExternalDragDrop), 0, 0); + MarshalHelper.SwapByteOrder((byte*)externalDragDropPtr, ref s_priv_ByteOrder_Msg13_EnableExternalDragDrop, typeof(RemoteFormWindowBase.Msg13_EnableExternalDragDrop), 0, 0); _priv_pmsgUse = (Message*)externalDragDropPtr; } @@ -289,7 +289,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop blobInfo.Attach((Message*)msg14SetIconPtr); msg14SetIconPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg14SetIconPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg14_SetIcon, typeof(RemoteFormWindowBase.Msg14_SetIcon), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg14SetIconPtr, ref s_priv_ByteOrder_Msg14_SetIcon, typeof(RemoteFormWindowBase.Msg14_SetIcon), 0, 0); _priv_pmsgUse = (Message*)msg14SetIconPtr; } @@ -316,7 +316,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop setMaxResizeWidthPtr->nMaxResizeWidth = nMaxResizeWidth; setMaxResizeWidthPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setMaxResizeWidthPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg15_SetMaxResizeWidth, typeof(RemoteFormWindowBase.Msg15_SetMaxResizeWidth), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setMaxResizeWidthPtr, ref s_priv_ByteOrder_Msg15_SetMaxResizeWidth, typeof(RemoteFormWindowBase.Msg15_SetMaxResizeWidth), 0, 0); _priv_pmsgUse = (Message*)setMaxResizeWidthPtr; } @@ -343,7 +343,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop setMinResizeWidthPtr->nMinResizeWidth = nMinResizeWidth; setMinResizeWidthPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setMinResizeWidthPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg16_SetMinResizeWidth, typeof(RemoteFormWindowBase.Msg16_SetMinResizeWidth), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setMinResizeWidthPtr, ref s_priv_ByteOrder_Msg16_SetMinResizeWidth, typeof(RemoteFormWindowBase.Msg16_SetMinResizeWidth), 0, 0); _priv_pmsgUse = (Message*)setMinResizeWidthPtr; } @@ -366,7 +366,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop msg17BringToTopPtr->_priv_msgid = 17U; msg17BringToTopPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg17BringToTopPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg17_BringToTop, typeof(RemoteFormWindowBase.Msg17_BringToTop), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg17BringToTopPtr, ref s_priv_ByteOrder_Msg17_BringToTop, typeof(RemoteFormWindowBase.Msg17_BringToTop), 0, 0); _priv_pmsgUse = (Message*)msg17BringToTopPtr; } @@ -398,7 +398,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop blobInfo.Attach((Message*)shellShutdownHookPtr); shellShutdownHookPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)shellShutdownHookPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg18_EnableShellShutdownHook, typeof(RemoteFormWindowBase.Msg18_EnableShellShutdownHook), 0, 0); + MarshalHelper.SwapByteOrder((byte*)shellShutdownHookPtr, ref s_priv_ByteOrder_Msg18_EnableShellShutdownHook, typeof(RemoteFormWindowBase.Msg18_EnableShellShutdownHook), 0, 0); _priv_pmsgUse = (Message*)shellShutdownHookPtr; } @@ -423,7 +423,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop foregroundLockStatePtr->_priv_msgid = 19U; foregroundLockStatePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)foregroundLockStatePtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg19_UpdateForegroundLockState, typeof(RemoteFormWindowBase.Msg19_UpdateForegroundLockState), 0, 0); + MarshalHelper.SwapByteOrder((byte*)foregroundLockStatePtr, ref s_priv_ByteOrder_Msg19_UpdateForegroundLockState, typeof(RemoteFormWindowBase.Msg19_UpdateForegroundLockState), 0, 0); _priv_pmsgUse = (Message*)foregroundLockStatePtr; } @@ -481,7 +481,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop msg21SetHitMasksPtr->uMaskClip = uMaskClip; msg21SetHitMasksPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg21SetHitMasksPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg21_SetHitMasks, typeof(RemoteFormWindowBase.Msg21_SetHitMasks), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg21SetHitMasksPtr, ref s_priv_ByteOrder_Msg21_SetHitMasks, typeof(RemoteFormWindowBase.Msg21_SetHitMasks), 0, 0); _priv_pmsgUse = (Message*)msg21SetHitMasksPtr; } @@ -516,7 +516,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop msg22SetCapturePtr->fState = fState ? uint.MaxValue : 0U; msg22SetCapturePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg22SetCapturePtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg22_SetCapture, typeof(RemoteFormWindowBase.Msg22_SetCapture), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg22SetCapturePtr, ref s_priv_ByteOrder_Msg22_SetCapture, typeof(RemoteFormWindowBase.Msg22_SetCapture), 0, 0); _priv_pmsgUse = (Message*)msg22SetCapturePtr; } @@ -546,7 +546,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop blobInfo.Attach((Message*)msg23SetTextPtr); msg23SetTextPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg23SetTextPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg23_SetText, typeof(RemoteFormWindowBase.Msg23_SetText), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg23SetTextPtr, ref s_priv_ByteOrder_Msg23_SetText, typeof(RemoteFormWindowBase.Msg23_SetText), 0, 0); _priv_pmsgUse = (Message*)msg23SetTextPtr; } @@ -569,7 +569,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop msg24DestroyPtr->_priv_msgid = 24U; msg24DestroyPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg24DestroyPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg24_Destroy, typeof(RemoteFormWindowBase.Msg24_Destroy), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg24DestroyPtr, ref s_priv_ByteOrder_Msg24_Destroy, typeof(RemoteFormWindowBase.Msg24_Destroy), 0, 0); _priv_pmsgUse = (Message*)msg24DestroyPtr; } @@ -596,7 +596,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop msg25SetForegroundPtr->fForce = fForce ? uint.MaxValue : 0U; msg25SetForegroundPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg25SetForegroundPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg25_SetForeground, typeof(RemoteFormWindowBase.Msg25_SetForeground), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg25SetForegroundPtr, ref s_priv_ByteOrder_Msg25_SetForeground, typeof(RemoteFormWindowBase.Msg25_SetForeground), 0, 0); _priv_pmsgUse = (Message*)msg25SetForegroundPtr; } @@ -619,7 +619,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop msg26TakeFocusPtr->_priv_msgid = 26U; msg26TakeFocusPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg26TakeFocusPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg26_TakeFocus, typeof(RemoteFormWindowBase.Msg26_TakeFocus), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg26TakeFocusPtr, ref s_priv_ByteOrder_Msg26_TakeFocus, typeof(RemoteFormWindowBase.Msg26_TakeFocus), 0, 0); _priv_pmsgUse = (Message*)msg26TakeFocusPtr; } @@ -646,7 +646,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop msg27ForceMouseIdlePtr->fIdle = fIdle ? uint.MaxValue : 0U; msg27ForceMouseIdlePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg27ForceMouseIdlePtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg27_ForceMouseIdle, typeof(RemoteFormWindowBase.Msg27_ForceMouseIdle), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg27ForceMouseIdlePtr, ref s_priv_ByteOrder_Msg27_ForceMouseIdle, typeof(RemoteFormWindowBase.Msg27_ForceMouseIdle), 0, 0); _priv_pmsgUse = (Message*)msg27ForceMouseIdlePtr; } @@ -671,7 +671,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop exitExclusiveModePtr->_priv_msgid = 28U; exitExclusiveModePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)exitExclusiveModePtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg28_TemporarilyExitExclusiveMode, typeof(RemoteFormWindowBase.Msg28_TemporarilyExitExclusiveMode), 0, 0); + MarshalHelper.SwapByteOrder((byte*)exitExclusiveModePtr, ref s_priv_ByteOrder_Msg28_TemporarilyExitExclusiveMode, typeof(RemoteFormWindowBase.Msg28_TemporarilyExitExclusiveMode), 0, 0); _priv_pmsgUse = (Message*)exitExclusiveModePtr; } @@ -694,7 +694,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop msg29RestorePtr->_priv_msgid = 29U; msg29RestorePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg29RestorePtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg29_Restore, typeof(RemoteFormWindowBase.Msg29_Restore), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg29RestorePtr, ref s_priv_ByteOrder_Msg29_Restore, typeof(RemoteFormWindowBase.Msg29_Restore), 0, 0); _priv_pmsgUse = (Message*)msg29RestorePtr; } @@ -721,7 +721,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop msg30SetModePtr->uMode = uMode; msg30SetModePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg30SetModePtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg30_SetMode, typeof(RemoteFormWindowBase.Msg30_SetMode), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg30SetModePtr, ref s_priv_ByteOrder_Msg30_SetMode, typeof(RemoteFormWindowBase.Msg30_SetMode), 0, 0); _priv_pmsgUse = (Message*)msg30SetModePtr; } @@ -748,7 +748,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop msg31SetVisiblePtr->fVisible = fVisible ? uint.MaxValue : 0U; msg31SetVisiblePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg31SetVisiblePtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg31_SetVisible, typeof(RemoteFormWindowBase.Msg31_SetVisible), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg31SetVisiblePtr, ref s_priv_ByteOrder_Msg31_SetVisible, typeof(RemoteFormWindowBase.Msg31_SetVisible), 0, 0); _priv_pmsgUse = (Message*)msg31SetVisiblePtr; } @@ -775,7 +775,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop msg32SetPositionPtr->ptScreenPxl = ptScreenPxl; msg32SetPositionPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg32SetPositionPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg32_SetPosition, typeof(RemoteFormWindowBase.Msg32_SetPosition), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg32SetPositionPtr, ref s_priv_ByteOrder_Msg32_SetPosition, typeof(RemoteFormWindowBase.Msg32_SetPosition), 0, 0); _priv_pmsgUse = (Message*)msg32SetPositionPtr; } @@ -802,7 +802,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop msg33SetSizePtr->sizeClientPxl = sizeClientPxl; msg33SetSizePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg33SetSizePtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg33_SetSize, typeof(RemoteFormWindowBase.Msg33_SetSize), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg33SetSizePtr, ref s_priv_ByteOrder_Msg33_SetSize, typeof(RemoteFormWindowBase.Msg33_SetSize), 0, 0); _priv_pmsgUse = (Message*)msg33SetSizePtr; } @@ -831,7 +831,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop msg34SetCursorsPtr->idCursorIdle = idCursorIdle; msg34SetCursorsPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg34SetCursorsPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg34_SetCursors, typeof(RemoteFormWindowBase.Msg34_SetCursors), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg34SetCursorsPtr, ref s_priv_ByteOrder_Msg34_SetCursors, typeof(RemoteFormWindowBase.Msg34_SetCursors), 0, 0); _priv_pmsgUse = (Message*)msg34SetCursorsPtr; } @@ -872,7 +872,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop msg35SetStylesPtr->uFulEx = uFulEx; msg35SetStylesPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg35SetStylesPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg35_SetStyles, typeof(RemoteFormWindowBase.Msg35_SetStyles), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg35SetStylesPtr, ref s_priv_ByteOrder_Msg35_SetStyles, typeof(RemoteFormWindowBase.Msg35_SetStyles), 0, 0); _priv_pmsgUse = (Message*)msg35SetStylesPtr; } @@ -909,7 +909,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop mouseIdleOptionsPtr->dwMouseIdleTimeout = dwMouseIdleTimeout; mouseIdleOptionsPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)mouseIdleOptionsPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg36_SetMouseIdleOptions, typeof(RemoteFormWindowBase.Msg36_SetMouseIdleOptions), 0, 0); + MarshalHelper.SwapByteOrder((byte*)mouseIdleOptionsPtr, ref s_priv_ByteOrder_Msg36_SetMouseIdleOptions, typeof(RemoteFormWindowBase.Msg36_SetMouseIdleOptions), 0, 0); _priv_pmsgUse = (Message*)mouseIdleOptionsPtr; } @@ -938,7 +938,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop msg37SetOptionsPtr->uOptionsValue = uOptionsValue; msg37SetOptionsPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg37SetOptionsPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg37_SetOptions, typeof(RemoteFormWindowBase.Msg37_SetOptions), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg37SetOptionsPtr, ref s_priv_ByteOrder_Msg37_SetOptions, typeof(RemoteFormWindowBase.Msg37_SetOptions), 0, 0); _priv_pmsgUse = (Message*)msg37SetOptionsPtr; } @@ -963,7 +963,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop createRootContainerPtr->_priv_msgid = 38U; createRootContainerPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)createRootContainerPtr, ref RemoteFormWindowBase.s_priv_ByteOrder_Msg38_CreateRootContainer, typeof(RemoteFormWindowBase.Msg38_CreateRootContainer), 0, 0); + MarshalHelper.SwapByteOrder((byte*)createRootContainerPtr, ref s_priv_ByteOrder_Msg38_CreateRootContainer, typeof(RemoteFormWindowBase.Msg38_CreateRootContainer), 0, 0); _priv_pmsgUse = (Message*)createRootContainerPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/RemoteInputRouter.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/RemoteInputRouter.cs index e026c03..b294b22 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/RemoteInputRouter.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/RemoteInputRouter.cs @@ -38,7 +38,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop msg2CreatePtr->_priv_ctxic = port.Session.LocalContext; msg2CreatePtr->_priv_idObjectSubject = remoteInputRouter.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteInputRouter.s_priv_ByteOrder_Msg2_Create, typeof(RemoteInputRouter.Msg2_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg2_Create, typeof(RemoteInputRouter.Msg2_Create), 0, 0); port.CreateRemoteObject(routerClassHandle, remoteInputRouter.m_renderHandle, (Message*)msg2CreatePtr); return remoteInputRouter; } @@ -56,7 +56,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop registerWithInputSourcePtr->_priv_msgid = 0U; registerWithInputSourcePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)registerWithInputSourcePtr, ref RemoteInputRouter.s_priv_ByteOrder_Msg0_UnRegisterWithInputSource, typeof(RemoteInputRouter.Msg0_UnRegisterWithInputSource), 0, 0); + MarshalHelper.SwapByteOrder((byte*)registerWithInputSourcePtr, ref s_priv_ByteOrder_Msg0_UnRegisterWithInputSource, typeof(RemoteInputRouter.Msg0_UnRegisterWithInputSource), 0, 0); _priv_pmsgUse = (Message*)registerWithInputSourcePtr; } @@ -85,7 +85,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop registerWithInputSourcePtr->idSource = idSource; registerWithInputSourcePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)registerWithInputSourcePtr, ref RemoteInputRouter.s_priv_ByteOrder_Msg1_RegisterWithInputSource, typeof(RemoteInputRouter.Msg1_RegisterWithInputSource), 0, 0); + MarshalHelper.SwapByteOrder((byte*)registerWithInputSourcePtr, ref s_priv_ByteOrder_Msg1_RegisterWithInputSource, typeof(RemoteInputRouter.Msg1_RegisterWithInputSource), 0, 0); _priv_pmsgUse = (Message*)registerWithInputSourcePtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Xenon/ProtocolSplashDesktopXenon.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Xenon/ProtocolSplashDesktopXenon.cs index c4fcd72..fe675b1 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Xenon/ProtocolSplashDesktopXenon.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Xenon/ProtocolSplashDesktopXenon.cs @@ -25,7 +25,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Xenon return splashDesktopXenon; } ProtocolSplashDesktopXenon splashDesktopXenon1 = new ProtocolSplashDesktopXenon(port); - port.BindProtocol((ProtocolInstance)splashDesktopXenon1); + port.BindProtocol(splashDesktopXenon1); return splashDesktopXenon1; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Xenon/RemoteFormWindow.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Xenon/RemoteFormWindow.cs index 8bb6067..7840dd8 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Xenon/RemoteFormWindow.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Desktop/Xenon/RemoteFormWindow.cs @@ -35,7 +35,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Desktop.Xenon msg41CreatePtr->_priv_ctxcb = port.Session.LocalContext; msg41CreatePtr->_priv_idObjectSubject = remoteFormWindow.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteFormWindow.s_priv_ByteOrder_Msg41_Create, typeof(RemoteFormWindow.Msg41_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg41_Create, typeof(RemoteFormWindow.Msg41_Create), 0, 0); port.CreateRemoteObject(windowClassHandle, remoteFormWindow.m_renderHandle, (Message*)msg41CreatePtr); return remoteFormWindow; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/LocalDataBufferCallback.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/LocalDataBufferCallback.cs index 55aa6f7..67380fe 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/LocalDataBufferCallback.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/LocalDataBufferCallback.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging public override int GetHashCode() => base.GetHashCode(); - internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(LocalDataBufferCallback.DispatchCallback), out uint _); + internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); private static unsafe void DispatchCallback( RenderPort port, @@ -43,7 +43,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging { if (!(owner is IDataBufferCallback _priv_target) || message->nMsg != 0U) return; - LocalDataBufferCallback.Dispatch_OnComplete(port, _priv_target, (LocalDataBufferCallback.Msg0_OnComplete*)message); + Dispatch_OnComplete(port, _priv_target, (LocalDataBufferCallback.Msg0_OnComplete*)message); } private static unsafe void Dispatch_OnComplete( @@ -52,7 +52,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging LocalDataBufferCallback.Msg0_OnComplete* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalDataBufferCallback.s_priv_ByteOrder_Msg0_OnComplete, typeof(LocalDataBufferCallback.Msg0_OnComplete), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnComplete, typeof(LocalDataBufferCallback.Msg0_OnComplete), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; _priv_target.OnComplete(target); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/LocalRenderPortCallback.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/LocalRenderPortCallback.cs index 005030c..748c099 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/LocalRenderPortCallback.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/LocalRenderPortCallback.cs @@ -36,7 +36,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging onBatchProcessedPtr->uBatchCompleted = uBatchCompleted; onBatchProcessedPtr->_priv_idObjectSubject = callbackInstance; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref LocalRenderPortCallback.s_priv_ByteOrder_Msg0_OnBatchProcessed, typeof(LocalRenderPortCallback.Msg0_OnBatchProcessed), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg0_OnBatchProcessed, typeof(LocalRenderPortCallback.Msg0_OnBatchProcessed), 0, 0); port.SendLocalCallbackMessage((Message*)onBatchProcessedPtr); } @@ -55,7 +55,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging msg1OnPingReplyPtr->target = target; msg1OnPingReplyPtr->_priv_idObjectSubject = callbackInstance; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref LocalRenderPortCallback.s_priv_ByteOrder_Msg1_OnPingReply, typeof(LocalRenderPortCallback.Msg1_OnPingReply), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg1_OnPingReply, typeof(LocalRenderPortCallback.Msg1_OnPingReply), 0, 0); port.SendLocalCallbackMessage((Message*)msg1OnPingReplyPtr); } @@ -75,7 +75,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging public override int GetHashCode() => base.GetHashCode(); - internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(LocalRenderPortCallback.DispatchCallback), out uint _); + internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); private static unsafe void DispatchCallback( RenderPort port, @@ -87,10 +87,10 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging switch (message->nMsg) { case 0: - LocalRenderPortCallback.Dispatch_OnBatchProcessed(port, _priv_target, (LocalRenderPortCallback.Msg0_OnBatchProcessed*)message); + Dispatch_OnBatchProcessed(port, _priv_target, (LocalRenderPortCallback.Msg0_OnBatchProcessed*)message); break; case 1: - LocalRenderPortCallback.Dispatch_OnPingReply(port, _priv_target, (LocalRenderPortCallback.Msg1_OnPingReply*)message); + Dispatch_OnPingReply(port, _priv_target, (LocalRenderPortCallback.Msg1_OnPingReply*)message); break; } } @@ -101,7 +101,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging LocalRenderPortCallback.Msg0_OnBatchProcessed* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalRenderPortCallback.s_priv_ByteOrder_Msg0_OnBatchProcessed, typeof(LocalRenderPortCallback.Msg0_OnBatchProcessed), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnBatchProcessed, typeof(LocalRenderPortCallback.Msg0_OnBatchProcessed), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; uint uBatchCompleted = _priv_pmsg->uBatchCompleted; _priv_target.OnBatchProcessed(target, uBatchCompleted); @@ -113,7 +113,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging LocalRenderPortCallback.Msg1_OnPingReply* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalRenderPortCallback.s_priv_ByteOrder_Msg1_OnPingReply, typeof(LocalRenderPortCallback.Msg1_OnPingReply), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg1_OnPingReply, typeof(LocalRenderPortCallback.Msg1_OnPingReply), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; _priv_target.OnPingReply(target); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/ProtocolSplashMessaging.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/ProtocolSplashMessaging.cs index 6598db6..86541ba 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/ProtocolSplashMessaging.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/ProtocolSplashMessaging.cs @@ -30,7 +30,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging return protocolSplashMessaging; } ProtocolSplashMessaging protocolSplashMessaging1 = new ProtocolSplashMessaging(port); - port.BindProtocol((ProtocolInstance)protocolSplashMessaging1); + port.BindProtocol(protocolSplashMessaging1); return protocolSplashMessaging1; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteBroker.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteBroker.cs index 6f4289f..217bb95 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteBroker.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteBroker.cs @@ -36,7 +36,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging msg0DestroyObjectPtr->idObject = idObject; msg0DestroyObjectPtr->_priv_idObjectSubject = brokerClassHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0DestroyObjectPtr, ref RemoteBroker.s_priv_ByteOrder_Msg0_DestroyObject, typeof(RemoteBroker.Msg0_DestroyObject), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0DestroyObjectPtr, ref s_priv_ByteOrder_Msg0_DestroyObject, typeof(RemoteBroker.Msg0_DestroyObject), 0, 0); _priv_pmsgUse = (Message*)msg0DestroyObjectPtr; } @@ -46,7 +46,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging { RenderPort _priv_portUse; Message* _priv_pmsgUse; - RemoteBroker.BuildDestroyObject(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idObject); + BuildDestroyObject(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idObject); _priv_portUse.SendRemoteMessage(_priv_pmsgUse); } @@ -74,7 +74,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging blobInfo.Attach((Message*)msg1CreateObjectPtr); msg1CreateObjectPtr->_priv_idObjectSubject = brokerClassHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg1CreateObjectPtr, ref RemoteBroker.s_priv_ByteOrder_Msg1_CreateObject, typeof(RemoteBroker.Msg1_CreateObject), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg1CreateObjectPtr, ref s_priv_ByteOrder_Msg1_CreateObject, typeof(RemoteBroker.Msg1_CreateObject), 0, 0); _priv_pmsgUse = (Message*)msg1CreateObjectPtr; } @@ -86,7 +86,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging { RenderPort _priv_portUse; Message* _priv_pmsgUse; - RemoteBroker.BuildCreateObject(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idObjectClass, idObjectNew, msgConstruction); + BuildCreateObject(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idObjectClass, idObjectNew, msgConstruction); _priv_portUse.SendRemoteMessage(_priv_pmsgUse); } @@ -112,7 +112,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging blobInfo.Attach((Message*)msg2CreateClassPtr); msg2CreateClassPtr->_priv_idObjectSubject = brokerClassHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg2CreateClassPtr, ref RemoteBroker.s_priv_ByteOrder_Msg2_CreateClass, typeof(RemoteBroker.Msg2_CreateClass), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg2CreateClassPtr, ref s_priv_ByteOrder_Msg2_CreateClass, typeof(RemoteBroker.Msg2_CreateClass), 0, 0); _priv_pmsgUse = (Message*)msg2CreateClassPtr; } @@ -123,7 +123,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging { RenderPort _priv_portUse; Message* _priv_pmsgUse; - RemoteBroker.BuildCreateClass(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, stClassName, idObjectClass); + BuildCreateClass(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, stClassName, idObjectClass); _priv_portUse.SendRemoteMessage(_priv_pmsgUse); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteContext.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteContext.cs index 4e70182..3684d02 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteContext.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteContext.cs @@ -38,7 +38,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging msg0ReleaseObjectPtr->punkObj = punkObj; msg0ReleaseObjectPtr->_priv_idObjectSubject = contextClassHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0ReleaseObjectPtr, ref RemoteContext.s_priv_ByteOrder_Msg0_ReleaseObject, typeof(RemoteContext.Msg0_ReleaseObject), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0ReleaseObjectPtr, ref s_priv_ByteOrder_Msg0_ReleaseObject, typeof(RemoteContext.Msg0_ReleaseObject), 0, 0); _priv_pmsgUse = (Message*)msg0ReleaseObjectPtr; } @@ -48,7 +48,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging { RenderPort _priv_portUse; Message* _priv_pmsgUse; - RemoteContext.BuildReleaseObject(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, punkObj); + BuildReleaseObject(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, punkObj); _priv_portUse.SendRemoteMessage(_priv_pmsgUse); } @@ -74,7 +74,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging blobInfo.Attach((Message*)msg2ForwardMessagePtr); msg2ForwardMessagePtr->_priv_idObjectSubject = contextClassHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg2ForwardMessagePtr, ref RemoteContext.s_priv_ByteOrder_Msg2_ForwardMessage, typeof(RemoteContext.Msg2_ForwardMessage), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg2ForwardMessagePtr, ref s_priv_ByteOrder_Msg2_ForwardMessage, typeof(RemoteContext.Msg2_ForwardMessage), 0, 0); _priv_pmsgUse = (Message*)msg2ForwardMessagePtr; } @@ -85,7 +85,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging { RenderPort _priv_portUse; Message* _priv_pmsgUse; - RemoteContext.BuildForwardMessage(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idContextDest, msgReturn); + BuildForwardMessage(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idContextDest, msgReturn); _priv_portUse.SendRemoteMessage(_priv_pmsgUse); } @@ -106,7 +106,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging msg3DestroyGroupPtr->idxGroup = idxGroup; msg3DestroyGroupPtr->_priv_idObjectSubject = contextClassHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg3DestroyGroupPtr, ref RemoteContext.s_priv_ByteOrder_Msg3_DestroyGroup, typeof(RemoteContext.Msg3_DestroyGroup), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg3DestroyGroupPtr, ref s_priv_ByteOrder_Msg3_DestroyGroup, typeof(RemoteContext.Msg3_DestroyGroup), 0, 0); _priv_pmsgUse = (Message*)msg3DestroyGroupPtr; } @@ -116,7 +116,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging { RenderPort _priv_portUse; Message* _priv_pmsgUse; - RemoteContext.BuildDestroyGroup(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idxGroup); + BuildDestroyGroup(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idxGroup); _priv_portUse.SendRemoteMessage(_priv_pmsgUse); } @@ -139,7 +139,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging msg4CreateGroupPtr->idContextOwner = idContextOwner; msg4CreateGroupPtr->_priv_idObjectSubject = contextClassHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg4CreateGroupPtr, ref RemoteContext.s_priv_ByteOrder_Msg4_CreateGroup, typeof(RemoteContext.Msg4_CreateGroup), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg4CreateGroupPtr, ref s_priv_ByteOrder_Msg4_CreateGroup, typeof(RemoteContext.Msg4_CreateGroup), 0, 0); _priv_pmsgUse = (Message*)msg4CreateGroupPtr; } @@ -150,7 +150,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging { RenderPort _priv_portUse; Message* _priv_pmsgUse; - RemoteContext.BuildCreateGroup(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idxGroup, idContextOwner); + BuildCreateGroup(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idxGroup, idContextOwner); _priv_portUse.SendRemoteMessage(_priv_pmsgUse); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteContextRelay.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteContextRelay.cs index b4e0054..ad300eb 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteContextRelay.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteContextRelay.cs @@ -44,7 +44,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging blobInfo.Attach((Message*)msg2CreatePtr); msg2CreatePtr->_priv_idObjectSubject = remoteContextRelay.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteContextRelay.s_priv_ByteOrder_Msg2_Create, typeof(RemoteContextRelay.Msg2_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg2_Create, typeof(RemoteContextRelay.Msg2_Create), 0, 0); port.CreateRemoteObject(relayClassHandle, remoteContextRelay.m_renderHandle, (Message*)msg2CreatePtr); return remoteContextRelay; } @@ -68,7 +68,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging msg0UnlinkContextPtr->idContextAlias = idContextAlias; msg0UnlinkContextPtr->_priv_idObjectSubject = relayClassHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0UnlinkContextPtr, ref RemoteContextRelay.s_priv_ByteOrder_Msg0_UnlinkContext, typeof(RemoteContextRelay.Msg0_UnlinkContext), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0UnlinkContextPtr, ref s_priv_ByteOrder_Msg0_UnlinkContext, typeof(RemoteContextRelay.Msg0_UnlinkContext), 0, 0); _priv_pmsgUse = (Message*)msg0UnlinkContextPtr; } @@ -79,7 +79,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging { RenderPort _priv_portUse; Message* _priv_pmsgUse; - RemoteContextRelay.BuildUnlinkContext(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idContextExisting, idContextAlias); + BuildUnlinkContext(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idContextExisting, idContextAlias); _priv_portUse.SendRemoteMessage(_priv_pmsgUse); } @@ -102,7 +102,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging msg1LinkContextPtr->idContextAlias = idContextAlias; msg1LinkContextPtr->_priv_idObjectSubject = relayClassHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg1LinkContextPtr, ref RemoteContextRelay.s_priv_ByteOrder_Msg1_LinkContext, typeof(RemoteContextRelay.Msg1_LinkContext), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg1LinkContextPtr, ref s_priv_ByteOrder_Msg1_LinkContext, typeof(RemoteContextRelay.Msg1_LinkContext), 0, 0); _priv_pmsgUse = (Message*)msg1LinkContextPtr; } @@ -113,7 +113,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging { RenderPort _priv_portUse; Message* _priv_pmsgUse; - RemoteContextRelay.BuildLinkContext(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idContextExisting, idContextAlias); + BuildLinkContext(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idContextExisting, idContextAlias); _priv_portUse.SendRemoteMessage(_priv_pmsgUse); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteDataBuffer.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteDataBuffer.cs index 37807dd..c3dc6db 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteDataBuffer.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Messaging/RemoteDataBuffer.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Messaging msg0RegisterOwnerPtr->_priv_ctxcb = _priv_portUse.Session.LocalContext; msg0RegisterOwnerPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0RegisterOwnerPtr, ref RemoteDataBuffer.s_priv_ByteOrder_Msg0_RegisterOwner, typeof(RemoteDataBuffer.Msg0_RegisterOwner), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0RegisterOwnerPtr, ref s_priv_ByteOrder_Msg0_RegisterOwner, typeof(RemoteDataBuffer.Msg0_RegisterOwner), 0, 0); _priv_pmsgUse = (Message*)msg0RegisterOwnerPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalAnimationCallback.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalAnimationCallback.cs index 01ebf21..09d5bb9 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalAnimationCallback.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalAnimationCallback.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering public override int GetHashCode() => base.GetHashCode(); - internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(LocalAnimationCallback.DispatchCallback), out uint _); + internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); private static unsafe void DispatchCallback( RenderPort port, @@ -43,7 +43,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering { if (!(owner is IAnimationCallback _priv_target) || message->nMsg != 0U) return; - LocalAnimationCallback.Dispatch_AsyncNotify(port, _priv_target, (LocalAnimationCallback.Msg0_AsyncNotify*)message); + Dispatch_AsyncNotify(port, _priv_target, (LocalAnimationCallback.Msg0_AsyncNotify*)message); } private static unsafe void Dispatch_AsyncNotify( @@ -52,7 +52,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering LocalAnimationCallback.Msg0_AsyncNotify* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalAnimationCallback.s_priv_ByteOrder_Msg0_AsyncNotify, typeof(LocalAnimationCallback.Msg0_AsyncNotify), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_AsyncNotify, typeof(LocalAnimationCallback.Msg0_AsyncNotify), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; int nCookie = _priv_pmsg->nCookie; _priv_target.AsyncNotify(target, nCookie); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalDeviceCallback.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalDeviceCallback.cs index ac98a48..b292fbd 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalDeviceCallback.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalDeviceCallback.cs @@ -39,7 +39,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering public override int GetHashCode() => base.GetHashCode(); - internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(LocalDeviceCallback.DispatchCallback), out uint _); + internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); private static unsafe void DispatchCallback( RenderPort port, @@ -51,19 +51,19 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering switch (message->nMsg) { case 0: - LocalDeviceCallback.Dispatch_OnBackBufferCaptured(port, _priv_target, (LocalDeviceCallback.Msg0_OnBackBufferCaptured*)message); + Dispatch_OnBackBufferCaptured(port, _priv_target, (LocalDeviceCallback.Msg0_OnBackBufferCaptured*)message); break; case 1: - LocalDeviceCallback.Dispatch_OnSurfacePoolAllocation(port, _priv_target, (LocalDeviceCallback.Msg1_OnSurfacePoolAllocation*)message); + Dispatch_OnSurfacePoolAllocation(port, _priv_target, (LocalDeviceCallback.Msg1_OnSurfacePoolAllocation*)message); break; case 2: - LocalDeviceCallback.Dispatch_OnVsaBlock(port, _priv_target, (LocalDeviceCallback.Msg2_OnVsaBlock*)message); + Dispatch_OnVsaBlock(port, _priv_target, (LocalDeviceCallback.Msg2_OnVsaBlock*)message); break; case 3: - LocalDeviceCallback.Dispatch_OnLostDevice(port, _priv_target, (LocalDeviceCallback.Msg3_OnLostDevice*)message); + Dispatch_OnLostDevice(port, _priv_target, (LocalDeviceCallback.Msg3_OnLostDevice*)message); break; case 4: - LocalDeviceCallback.Dispatch_OnCreated(port, _priv_target, (LocalDeviceCallback.Msg4_OnCreated*)message); + Dispatch_OnCreated(port, _priv_target, (LocalDeviceCallback.Msg4_OnCreated*)message); break; } } @@ -74,7 +74,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering LocalDeviceCallback.Msg0_OnBackBufferCaptured* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalDeviceCallback.s_priv_ByteOrder_Msg0_OnBackBufferCaptured, typeof(LocalDeviceCallback.Msg0_OnBackBufferCaptured), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnBackBufferCaptured, typeof(LocalDeviceCallback.Msg0_OnBackBufferCaptured), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; _priv_target.OnBackBufferCaptured(target); } @@ -85,7 +85,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering LocalDeviceCallback.Msg1_OnSurfacePoolAllocation* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalDeviceCallback.s_priv_ByteOrder_Msg1_OnSurfacePoolAllocation, typeof(LocalDeviceCallback.Msg1_OnSurfacePoolAllocation), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg1_OnSurfacePoolAllocation, typeof(LocalDeviceCallback.Msg1_OnSurfacePoolAllocation), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; RENDERHANDLE idSurfacePool = _priv_pmsg->idSurfacePool; SurfacePoolAllocationResult nResult = _priv_pmsg->nResult; @@ -98,7 +98,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering LocalDeviceCallback.Msg2_OnVsaBlock* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalDeviceCallback.s_priv_ByteOrder_Msg2_OnVsaBlock, typeof(LocalDeviceCallback.Msg2_OnVsaBlock), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg2_OnVsaBlock, typeof(LocalDeviceCallback.Msg2_OnVsaBlock), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; bool fInBlock = _priv_pmsg->fInBlock != 0U; _priv_target.OnVsaBlock(target, fInBlock); @@ -110,7 +110,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering LocalDeviceCallback.Msg3_OnLostDevice* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalDeviceCallback.s_priv_ByteOrder_Msg3_OnLostDevice, typeof(LocalDeviceCallback.Msg3_OnLostDevice), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg3_OnLostDevice, typeof(LocalDeviceCallback.Msg3_OnLostDevice), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; uint renderGeneration = _priv_pmsg->cRenderGeneration; bool fLost = _priv_pmsg->fLost != 0U; @@ -123,7 +123,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering LocalDeviceCallback.Msg4_OnCreated* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalDeviceCallback.s_priv_ByteOrder_Msg4_OnCreated, typeof(LocalDeviceCallback.Msg4_OnCreated), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg4_OnCreated, typeof(LocalDeviceCallback.Msg4_OnCreated), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; bool fAllowDynamicPool = _priv_pmsg->fAllowDynamicPool != 0U; _priv_target.OnCreated(target, fAllowDynamicPool); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalRenderCapsCallback.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalRenderCapsCallback.cs index 61c5305..2feeda0 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalRenderCapsCallback.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalRenderCapsCallback.cs @@ -38,7 +38,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering public override int GetHashCode() => base.GetHashCode(); - internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(LocalRenderCapsCallback.DispatchCallback), out uint _); + internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); private static unsafe void DispatchCallback( RenderPort port, @@ -50,16 +50,16 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering switch (message->nMsg) { case 0: - LocalRenderCapsCallback.Dispatch_OnSoundCaps(port, _priv_target, (LocalRenderCapsCallback.Msg0_OnSoundCaps*)message); + Dispatch_OnSoundCaps(port, _priv_target, (LocalRenderCapsCallback.Msg0_OnSoundCaps*)message); break; case 1: - LocalRenderCapsCallback.Dispatch_OnGraphicsCaps(port, _priv_target, (LocalRenderCapsCallback.Msg1_OnGraphicsCaps*)message); + Dispatch_OnGraphicsCaps(port, _priv_target, (LocalRenderCapsCallback.Msg1_OnGraphicsCaps*)message); break; case 2: - LocalRenderCapsCallback.Dispatch_OnEndCapsCheck(port, _priv_target, (LocalRenderCapsCallback.Msg2_OnEndCapsCheck*)message); + Dispatch_OnEndCapsCheck(port, _priv_target, (LocalRenderCapsCallback.Msg2_OnEndCapsCheck*)message); break; case 3: - LocalRenderCapsCallback.Dispatch_OnBeginCapsCheck(port, _priv_target, (LocalRenderCapsCallback.Msg3_OnBeginCapsCheck*)message); + Dispatch_OnBeginCapsCheck(port, _priv_target, (LocalRenderCapsCallback.Msg3_OnBeginCapsCheck*)message); break; } } @@ -70,7 +70,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering LocalRenderCapsCallback.Msg0_OnSoundCaps* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalRenderCapsCallback.s_priv_ByteOrder_Msg0_OnSoundCaps, typeof(LocalRenderCapsCallback.Msg0_OnSoundCaps), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnSoundCaps, typeof(LocalRenderCapsCallback.Msg0_OnSoundCaps), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; uint nCookie = _priv_pmsg->nCookie; Microsoft.Iris.Render.Internal.SoundCaps capsInfo = _priv_pmsg->capsInfo; @@ -83,7 +83,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering LocalRenderCapsCallback.Msg1_OnGraphicsCaps* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalRenderCapsCallback.s_priv_ByteOrder_Msg1_OnGraphicsCaps, typeof(LocalRenderCapsCallback.Msg1_OnGraphicsCaps), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg1_OnGraphicsCaps, typeof(LocalRenderCapsCallback.Msg1_OnGraphicsCaps), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; uint nCookie = _priv_pmsg->nCookie; GraphicsCaps capsInfo = _priv_pmsg->capsInfo; @@ -96,7 +96,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering LocalRenderCapsCallback.Msg2_OnEndCapsCheck* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalRenderCapsCallback.s_priv_ByteOrder_Msg2_OnEndCapsCheck, typeof(LocalRenderCapsCallback.Msg2_OnEndCapsCheck), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg2_OnEndCapsCheck, typeof(LocalRenderCapsCallback.Msg2_OnEndCapsCheck), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; uint nCookie = _priv_pmsg->nCookie; _priv_target.OnEndCapsCheck(target, nCookie); @@ -108,7 +108,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering LocalRenderCapsCallback.Msg3_OnBeginCapsCheck* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalRenderCapsCallback.s_priv_ByteOrder_Msg3_OnBeginCapsCheck, typeof(LocalRenderCapsCallback.Msg3_OnBeginCapsCheck), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg3_OnBeginCapsCheck, typeof(LocalRenderCapsCallback.Msg3_OnBeginCapsCheck), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; uint nCookie = _priv_pmsg->nCookie; _priv_target.OnBeginCapsCheck(target, nCookie); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalSoundBufferCallback.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalSoundBufferCallback.cs index 7b057f3..2dd681e 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalSoundBufferCallback.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalSoundBufferCallback.cs @@ -35,7 +35,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering public override int GetHashCode() => base.GetHashCode(); - internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(LocalSoundBufferCallback.DispatchCallback), out uint _); + internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); private static unsafe void DispatchCallback( RenderPort port, @@ -47,10 +47,10 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering switch (message->nMsg) { case 0: - LocalSoundBufferCallback.Dispatch_OnSoundBufferReady(port, _priv_target, (LocalSoundBufferCallback.Msg0_OnSoundBufferReady*)message); + Dispatch_OnSoundBufferReady(port, _priv_target, (LocalSoundBufferCallback.Msg0_OnSoundBufferReady*)message); break; case 1: - LocalSoundBufferCallback.Dispatch_OnSoundBufferLost(port, _priv_target, (LocalSoundBufferCallback.Msg1_OnSoundBufferLost*)message); + Dispatch_OnSoundBufferLost(port, _priv_target, (LocalSoundBufferCallback.Msg1_OnSoundBufferLost*)message); break; } } @@ -61,7 +61,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering LocalSoundBufferCallback.Msg0_OnSoundBufferReady* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalSoundBufferCallback.s_priv_ByteOrder_Msg0_OnSoundBufferReady, typeof(LocalSoundBufferCallback.Msg0_OnSoundBufferReady), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnSoundBufferReady, typeof(LocalSoundBufferCallback.Msg0_OnSoundBufferReady), sizeof(CallbackMessage), 0); RENDERHANDLE idTarget = _priv_pmsg->idTarget; _priv_target.OnSoundBufferReady(idTarget); } @@ -72,7 +72,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering LocalSoundBufferCallback.Msg1_OnSoundBufferLost* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalSoundBufferCallback.s_priv_ByteOrder_Msg1_OnSoundBufferLost, typeof(LocalSoundBufferCallback.Msg1_OnSoundBufferLost), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg1_OnSoundBufferLost, typeof(LocalSoundBufferCallback.Msg1_OnSoundBufferLost), sizeof(CallbackMessage), 0); RENDERHANDLE idTarget = _priv_pmsg->idTarget; _priv_target.OnSoundBufferLost(idTarget); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalVideoPoolCallback.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalVideoPoolCallback.cs index 6225e6f..5269d1d 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalVideoPoolCallback.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/LocalVideoPoolCallback.cs @@ -35,7 +35,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering public override int GetHashCode() => base.GetHashCode(); - internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(LocalVideoPoolCallback.DispatchCallback), out uint _); + internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(DispatchCallback), out uint _); private static unsafe void DispatchCallback( RenderPort port, @@ -47,10 +47,10 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering switch (message->nMsg) { case 0: - LocalVideoPoolCallback.Dispatch_OnInvalidate(port, _priv_target, (LocalVideoPoolCallback.Msg0_OnInvalidate*)message); + Dispatch_OnInvalidate(port, _priv_target, (LocalVideoPoolCallback.Msg0_OnInvalidate*)message); break; case 1: - LocalVideoPoolCallback.Dispatch_OnInputChanged(port, _priv_target, (LocalVideoPoolCallback.Msg1_OnInputChanged*)message); + Dispatch_OnInputChanged(port, _priv_target, (LocalVideoPoolCallback.Msg1_OnInputChanged*)message); break; } } @@ -61,7 +61,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering LocalVideoPoolCallback.Msg0_OnInvalidate* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalVideoPoolCallback.s_priv_ByteOrder_Msg0_OnInvalidate, typeof(LocalVideoPoolCallback.Msg0_OnInvalidate), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg0_OnInvalidate, typeof(LocalVideoPoolCallback.Msg0_OnInvalidate), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; _priv_target.OnInvalidate(target); } @@ -72,7 +72,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering LocalVideoPoolCallback.Msg1_OnInputChanged* _priv_pmsg) { if (_priv_port.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalVideoPoolCallback.s_priv_ByteOrder_Msg1_OnInputChanged, typeof(LocalVideoPoolCallback.Msg1_OnInputChanged), sizeof(CallbackMessage), 0); + MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref s_priv_ByteOrder_Msg1_OnInputChanged, typeof(LocalVideoPoolCallback.Msg1_OnInputChanged), sizeof(CallbackMessage), 0); RENDERHANDLE target = _priv_pmsg->target; Size sizeTargetPxl = _priv_pmsg->sizeTargetPxl; Size sizeAspectRatioPxl = _priv_pmsg->sizeAspectRatioPxl; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/ProtocolSplashRenderingNt.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/ProtocolSplashRenderingNt.cs index ce9c235..23a8214 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/ProtocolSplashRenderingNt.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/ProtocolSplashRenderingNt.cs @@ -30,7 +30,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt return splashRenderingNt; } ProtocolSplashRenderingNt splashRenderingNt1 = new ProtocolSplashRenderingNt(port); - port.BindProtocol((ProtocolInstance)splashRenderingNt1); + port.BindProtocol(splashRenderingNt1); return splashRenderingNt1; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiDevice.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiDevice.cs index ed514c0..a25fc4f 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiDevice.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiDevice.cs @@ -45,7 +45,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt msg23CreatePtr->_priv_ctxcb = port.Session.LocalContext; msg23CreatePtr->_priv_idObjectSubject = remoteGdiDevice.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteGdiDevice.s_priv_ByteOrder_Msg23_Create, typeof(RemoteGdiDevice.Msg23_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg23_Create, typeof(RemoteGdiDevice.Msg23_Create), 0, 0); port.CreateRemoteObject(deviceClassHandle, remoteGdiDevice.m_renderHandle, (Message*)msg23CreatePtr); return remoteGdiDevice; } @@ -65,7 +65,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt secureDesktopModePtr->fEnabled = fEnabled ? uint.MaxValue : 0U; secureDesktopModePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)secureDesktopModePtr, ref RemoteGdiDevice.s_priv_ByteOrder_Msg8_SecureDesktopMode, typeof(RemoteGdiDevice.Msg8_SecureDesktopMode), 0, 0); + MarshalHelper.SwapByteOrder((byte*)secureDesktopModePtr, ref s_priv_ByteOrder_Msg8_SecureDesktopMode, typeof(RemoteGdiDevice.Msg8_SecureDesktopMode), 0, 0); _priv_pmsgUse = (Message*)secureDesktopModePtr; } @@ -92,7 +92,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt msg9SetZoomModePtr->vzmZoomMode = vzmZoomMode; msg9SetZoomModePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg9SetZoomModePtr, ref RemoteGdiDevice.s_priv_ByteOrder_Msg9_SetZoomMode, typeof(RemoteGdiDevice.Msg9_SetZoomMode), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg9SetZoomModePtr, ref s_priv_ByteOrder_Msg9_SetZoomMode, typeof(RemoteGdiDevice.Msg9_SetZoomMode), 0, 0); _priv_pmsgUse = (Message*)msg9SetZoomModePtr; } @@ -119,7 +119,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt enableAlphaTrackingPtr->fEnableAlphaTracking = fEnableAlphaTracking ? uint.MaxValue : 0U; enableAlphaTrackingPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)enableAlphaTrackingPtr, ref RemoteGdiDevice.s_priv_ByteOrder_Msg11_SetEnableAlphaTracking, typeof(RemoteGdiDevice.Msg11_SetEnableAlphaTracking), 0, 0); + MarshalHelper.SwapByteOrder((byte*)enableAlphaTrackingPtr, ref s_priv_ByteOrder_Msg11_SetEnableAlphaTracking, typeof(RemoteGdiDevice.Msg11_SetEnableAlphaTracking), 0, 0); _priv_pmsgUse = (Message*)enableAlphaTrackingPtr; } @@ -146,7 +146,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt setBackgroundColorPtr->clrBackground = clrBackground; setBackgroundColorPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setBackgroundColorPtr, ref RemoteGdiDevice.s_priv_ByteOrder_Msg13_SetBackgroundColor, typeof(RemoteGdiDevice.Msg13_SetBackgroundColor), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setBackgroundColorPtr, ref s_priv_ByteOrder_Msg13_SetBackgroundColor, typeof(RemoteGdiDevice.Msg13_SetBackgroundColor), 0, 0); _priv_pmsgUse = (Message*)setBackgroundColorPtr; } @@ -173,7 +173,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt systemMemoryBitmapsPtr->fSystemMemoryBitmaps = fSystemMemoryBitmaps ? uint.MaxValue : 0U; systemMemoryBitmapsPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)systemMemoryBitmapsPtr, ref RemoteGdiDevice.s_priv_ByteOrder_Msg15_SetUseSystemMemoryBitmaps, typeof(RemoteGdiDevice.Msg15_SetUseSystemMemoryBitmaps), 0, 0); + MarshalHelper.SwapByteOrder((byte*)systemMemoryBitmapsPtr, ref s_priv_ByteOrder_Msg15_SetUseSystemMemoryBitmaps, typeof(RemoteGdiDevice.Msg15_SetUseSystemMemoryBitmaps), 0, 0); _priv_pmsgUse = (Message*)systemMemoryBitmapsPtr; } @@ -200,7 +200,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt enableBackBufferPtr->fEnableBackBuffer = fEnableBackBuffer ? uint.MaxValue : 0U; enableBackBufferPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)enableBackBufferPtr, ref RemoteGdiDevice.s_priv_ByteOrder_Msg17_SetEnableBackBuffer, typeof(RemoteGdiDevice.Msg17_SetEnableBackBuffer), 0, 0); + MarshalHelper.SwapByteOrder((byte*)enableBackBufferPtr, ref s_priv_ByteOrder_Msg17_SetEnableBackBuffer, typeof(RemoteGdiDevice.Msg17_SetEnableBackBuffer), 0, 0); _priv_pmsgUse = (Message*)enableBackBufferPtr; } @@ -227,7 +227,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt setAllowAnimationsPtr->fAllowAnimations = fAllowAnimations ? uint.MaxValue : 0U; setAllowAnimationsPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setAllowAnimationsPtr, ref RemoteGdiDevice.s_priv_ByteOrder_Msg19_SetAllowAnimations, typeof(RemoteGdiDevice.Msg19_SetAllowAnimations), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setAllowAnimationsPtr, ref s_priv_ByteOrder_Msg19_SetAllowAnimations, typeof(RemoteGdiDevice.Msg19_SetAllowAnimations), 0, 0); _priv_pmsgUse = (Message*)setAllowAnimationsPtr; } @@ -254,7 +254,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt msg21SetAllowAlphaPtr->fAllowAlpha = fAllowAlpha ? uint.MaxValue : 0U; msg21SetAllowAlphaPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg21SetAllowAlphaPtr, ref RemoteGdiDevice.s_priv_ByteOrder_Msg21_SetAllowAlpha, typeof(RemoteGdiDevice.Msg21_SetAllowAlpha), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg21SetAllowAlphaPtr, ref s_priv_ByteOrder_Msg21_SetAllowAlpha, typeof(RemoteGdiDevice.Msg21_SetAllowAlpha), 0, 0); _priv_pmsgUse = (Message*)msg21SetAllowAlphaPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiEffect.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiEffect.cs index a08fb80..31befb3 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiEffect.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiEffect.cs @@ -25,7 +25,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt RenderPort port = _priv_protocolInstance.Port; RENDERHANDLE effectClassHandle = _priv_protocolInstance.GdiEffect_ClassHandle; RemoteGdiEffect remoteGdiEffect = new RemoteGdiEffect(port, _priv_owner); - port.CreateRemoteObject(effectClassHandle, remoteGdiEffect.m_renderHandle, (Message*)null); + port.CreateRemoteObject(effectClassHandle, remoteGdiEffect.m_renderHandle, null); return remoteGdiEffect; } @@ -44,7 +44,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt msg8SetTypePtr->nType = nType; msg8SetTypePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg8SetTypePtr, ref RemoteGdiEffect.s_priv_ByteOrder_Msg8_SetType, typeof(RemoteGdiEffect.Msg8_SetType), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg8SetTypePtr, ref s_priv_ByteOrder_Msg8_SetType, typeof(RemoteGdiEffect.Msg8_SetType), 0, 0); _priv_pmsgUse = (Message*)msg8SetTypePtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiSprite.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiSprite.cs index cf7c600..7d87358 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiSprite.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteGdiSprite.cs @@ -32,7 +32,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt msg22CreatePtr->_priv_msgid = 22U; msg22CreatePtr->_priv_idObjectSubject = remoteGdiSprite.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteGdiSprite.s_priv_ByteOrder_Msg22_Create, typeof(RemoteGdiSprite.Msg22_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg22_Create, typeof(RemoteGdiSprite.Msg22_Create), 0, 0); port.CreateRemoteObject(spriteClassHandle, remoteGdiSprite.m_renderHandle, (Message*)msg22CreatePtr); return remoteGdiSprite; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteNtDevice.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteNtDevice.cs index 30844d9..7dd3fff 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteNtDevice.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteNtDevice.cs @@ -41,7 +41,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt msg19CreatePtr->_priv_ctxcb = port.Session.LocalContext; msg19CreatePtr->_priv_idObjectSubject = remoteNtDevice.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteNtDevice.s_priv_ByteOrder_Msg19_Create, typeof(RemoteNtDevice.Msg19_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg19_Create, typeof(RemoteNtDevice.Msg19_Create), 0, 0); port.CreateRemoteObject(deviceClassHandle, remoteNtDevice.m_renderHandle, (Message*)msg19CreatePtr); return remoteNtDevice; } @@ -59,7 +59,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt renderNowIfPossiblePtr->_priv_msgid = 11U; renderNowIfPossiblePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)renderNowIfPossiblePtr, ref RemoteNtDevice.s_priv_ByteOrder_Msg11_RenderNowIfPossible, typeof(RemoteNtDevice.Msg11_RenderNowIfPossible), 0, 0); + MarshalHelper.SwapByteOrder((byte*)renderNowIfPossiblePtr, ref s_priv_ByteOrder_Msg11_RenderNowIfPossible, typeof(RemoteNtDevice.Msg11_RenderNowIfPossible), 0, 0); _priv_pmsgUse = (Message*)renderNowIfPossiblePtr; } @@ -88,7 +88,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt createTransferBufferPtr->nFormat = nFormat; createTransferBufferPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)createTransferBufferPtr, ref RemoteNtDevice.s_priv_ByteOrder_Msg12_CreateTransferBuffer, typeof(RemoteNtDevice.Msg12_CreateTransferBuffer), 0, 0); + MarshalHelper.SwapByteOrder((byte*)createTransferBufferPtr, ref s_priv_ByteOrder_Msg12_CreateTransferBuffer, typeof(RemoteNtDevice.Msg12_CreateTransferBuffer), 0, 0); _priv_pmsgUse = (Message*)createTransferBufferPtr; } @@ -115,7 +115,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt msg13SetMaxOverscanPtr->flMaxOverscan = flMaxOverscan; msg13SetMaxOverscanPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg13SetMaxOverscanPtr, ref RemoteNtDevice.s_priv_ByteOrder_Msg13_SetMaxOverscan, typeof(RemoteNtDevice.Msg13_SetMaxOverscan), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg13SetMaxOverscanPtr, ref s_priv_ByteOrder_Msg13_SetMaxOverscan, typeof(RemoteNtDevice.Msg13_SetMaxOverscan), 0, 0); _priv_pmsgUse = (Message*)msg13SetMaxOverscanPtr; } @@ -142,7 +142,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt setDisplayOverscanPtr->flDisplayOverscan = flDisplayOverscan; setDisplayOverscanPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setDisplayOverscanPtr, ref RemoteNtDevice.s_priv_ByteOrder_Msg15_SetDisplayOverscan, typeof(RemoteNtDevice.Msg15_SetDisplayOverscan), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setDisplayOverscanPtr, ref s_priv_ByteOrder_Msg15_SetDisplayOverscan, typeof(RemoteNtDevice.Msg15_SetDisplayOverscan), 0, 0); _priv_pmsgUse = (Message*)setDisplayOverscanPtr; } @@ -169,7 +169,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt setEnablePageFlipPtr->fPageFlip = fPageFlip ? uint.MaxValue : 0U; setEnablePageFlipPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setEnablePageFlipPtr, ref RemoteNtDevice.s_priv_ByteOrder_Msg17_SetEnablePageFlip, typeof(RemoteNtDevice.Msg17_SetEnablePageFlip), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setEnablePageFlipPtr, ref s_priv_ByteOrder_Msg17_SetEnablePageFlip, typeof(RemoteNtDevice.Msg17_SetEnablePageFlip), 0, 0); _priv_pmsgUse = (Message*)setEnablePageFlipPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteWinSoundDevice.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteWinSoundDevice.cs index e5b777b..799089e 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteWinSoundDevice.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Nt/RemoteWinSoundDevice.cs @@ -32,7 +32,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Nt msg4CreatePtr->_priv_msgid = 4U; msg4CreatePtr->_priv_idObjectSubject = remoteWinSoundDevice.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteWinSoundDevice.s_priv_ByteOrder_Msg4_Create, typeof(RemoteWinSoundDevice.Msg4_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg4_Create, typeof(RemoteWinSoundDevice.Msg4_Create), 0, 0); port.CreateRemoteObject(deviceClassHandle, remoteWinSoundDevice.m_renderHandle, (Message*)msg4CreatePtr); return remoteWinSoundDevice; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/ProtocolSplashRendering.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/ProtocolSplashRendering.cs index ce7d3a9..a0e0b21 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/ProtocolSplashRendering.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/ProtocolSplashRendering.cs @@ -57,7 +57,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering return protocolSplashRendering; } ProtocolSplashRendering protocolSplashRendering1 = new ProtocolSplashRendering(port); - port.BindProtocol((ProtocolInstance)protocolSplashRendering1); + port.BindProtocol(protocolSplashRendering1); return protocolSplashRendering1; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimation.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimation.cs index 60a98a1..51fd8f2 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimation.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimation.cs @@ -76,7 +76,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg43CreatePtr->_priv_ctxcb = port.Session.LocalContext; msg43CreatePtr->_priv_idObjectSubject = remoteAnimation.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteAnimation.s_priv_ByteOrder_Msg43_Create, typeof(RemoteAnimation.Msg43_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg43_Create, typeof(RemoteAnimation.Msg43_Create), 0, 0); port.CreateRemoteObject(animationClassHandle, remoteAnimation.m_renderHandle, (Message*)msg43CreatePtr); return remoteAnimation; } @@ -94,7 +94,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg0RemoveAllEventsPtr->_priv_msgid = 0U; msg0RemoveAllEventsPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0RemoveAllEventsPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg0_RemoveAllEvents, typeof(RemoteAnimation.Msg0_RemoveAllEvents), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0RemoveAllEventsPtr, ref s_priv_ByteOrder_Msg0_RemoveAllEvents, typeof(RemoteAnimation.Msg0_RemoveAllEvents), 0, 0); _priv_pmsgUse = (Message*)msg0RemoveAllEventsPtr; } @@ -121,7 +121,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg1RemoveEventPtr->idEvent = idEvent; msg1RemoveEventPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg1RemoveEventPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg1_RemoveEvent, typeof(RemoteAnimation.Msg1_RemoveEvent), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg1RemoveEventPtr, ref s_priv_ByteOrder_Msg1_RemoveEvent, typeof(RemoteAnimation.Msg1_RemoveEvent), 0, 0); _priv_pmsgUse = (Message*)msg1RemoveEventPtr; } @@ -160,7 +160,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg2AddValueEventPtr->fAllowRepeat = fAllowRepeat ? uint.MaxValue : 0U; msg2AddValueEventPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg2AddValueEventPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg2_AddValueEvent, typeof(RemoteAnimation.Msg2_AddValueEvent), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg2AddValueEventPtr, ref s_priv_ByteOrder_Msg2_AddValueEvent, typeof(RemoteAnimation.Msg2_AddValueEvent), 0, 0); _priv_pmsgUse = (Message*)msg2AddValueEventPtr; } @@ -206,7 +206,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering addProgressEventPtr->fAllowRepeat = fAllowRepeat ? uint.MaxValue : 0U; addProgressEventPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)addProgressEventPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg3_AddProgressEvent, typeof(RemoteAnimation.Msg3_AddProgressEvent), 0, 0); + MarshalHelper.SwapByteOrder((byte*)addProgressEventPtr, ref s_priv_ByteOrder_Msg3_AddProgressEvent, typeof(RemoteAnimation.Msg3_AddProgressEvent), 0, 0); _priv_pmsgUse = (Message*)addProgressEventPtr; } @@ -252,7 +252,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg4AddTimeEventPtr->fAllowRepeat = fAllowRepeat ? uint.MaxValue : 0U; msg4AddTimeEventPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg4AddTimeEventPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg4_AddTimeEvent, typeof(RemoteAnimation.Msg4_AddTimeEvent), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg4AddTimeEventPtr, ref s_priv_ByteOrder_Msg4_AddTimeEvent, typeof(RemoteAnimation.Msg4_AddTimeEvent), 0, 0); _priv_pmsgUse = (Message*)msg4AddTimeEventPtr; } @@ -298,7 +298,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg5AddStageEventPtr->fAllowRepeat = fAllowRepeat ? uint.MaxValue : 0U; msg5AddStageEventPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg5AddStageEventPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg5_AddStageEvent, typeof(RemoteAnimation.Msg5_AddStageEvent), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg5AddStageEventPtr, ref s_priv_ByteOrder_Msg5_AddStageEvent, typeof(RemoteAnimation.Msg5_AddStageEvent), 0, 0); _priv_pmsgUse = (Message*)msg5AddStageEventPtr; } @@ -332,7 +332,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg6RemoveTargetPtr->targetId = targetId; msg6RemoveTargetPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg6RemoveTargetPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg6_RemoveTarget, typeof(RemoteAnimation.Msg6_RemoveTarget), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg6RemoveTargetPtr, ref s_priv_ByteOrder_Msg6_RemoveTarget, typeof(RemoteAnimation.Msg6_RemoveTarget), 0, 0); _priv_pmsgUse = (Message*)msg6RemoveTargetPtr; } @@ -365,7 +365,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg7AddTargetPtr->propertyInfo = propertyInfo; msg7AddTargetPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg7AddTargetPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg7_AddTarget, typeof(RemoteAnimation.Msg7_AddTarget), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg7AddTargetPtr, ref s_priv_ByteOrder_Msg7_AddTarget, typeof(RemoteAnimation.Msg7_AddTarget), 0, 0); _priv_pmsgUse = (Message*)msg7AddTargetPtr; } @@ -402,7 +402,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg8SetEaseOutPtr->flHandle = flHandle; msg8SetEaseOutPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg8SetEaseOutPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg8_SetEaseOut, typeof(RemoteAnimation.Msg8_SetEaseOut), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg8SetEaseOutPtr, ref s_priv_ByteOrder_Msg8_SetEaseOut, typeof(RemoteAnimation.Msg8_SetEaseOut), 0, 0); _priv_pmsgUse = (Message*)msg8SetEaseOutPtr; } @@ -439,7 +439,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg9SetEaseInPtr->flHandle = flHandle; msg9SetEaseInPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg9SetEaseInPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg9_SetEaseIn, typeof(RemoteAnimation.Msg9_SetEaseIn), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg9SetEaseInPtr, ref s_priv_ByteOrder_Msg9_SetEaseIn, typeof(RemoteAnimation.Msg9_SetEaseIn), 0, 0); _priv_pmsgUse = (Message*)msg9SetEaseInPtr; } @@ -476,7 +476,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg10SetBezierPtr->flHandle2 = flHandle2; msg10SetBezierPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg10SetBezierPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg10_SetBezier, typeof(RemoteAnimation.Msg10_SetBezier), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg10SetBezierPtr, ref s_priv_ByteOrder_Msg10_SetBezier, typeof(RemoteAnimation.Msg10_SetBezier), 0, 0); _priv_pmsgUse = (Message*)msg10SetBezierPtr; } @@ -509,7 +509,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg11SetCosinePtr->fSpherical = fSpherical ? uint.MaxValue : 0U; msg11SetCosinePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg11SetCosinePtr, ref RemoteAnimation.s_priv_ByteOrder_Msg11_SetCosine, typeof(RemoteAnimation.Msg11_SetCosine), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg11SetCosinePtr, ref s_priv_ByteOrder_Msg11_SetCosine, typeof(RemoteAnimation.Msg11_SetCosine), 0, 0); _priv_pmsgUse = (Message*)msg11SetCosinePtr; } @@ -538,7 +538,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg12SetSinePtr->fSpherical = fSpherical ? uint.MaxValue : 0U; msg12SetSinePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg12SetSinePtr, ref RemoteAnimation.s_priv_ByteOrder_Msg12_SetSine, typeof(RemoteAnimation.Msg12_SetSine), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg12SetSinePtr, ref s_priv_ByteOrder_Msg12_SetSine, typeof(RemoteAnimation.Msg12_SetSine), 0, 0); _priv_pmsgUse = (Message*)msg12SetSinePtr; } @@ -569,7 +569,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg13SetScurvePtr->flWeight = flWeight; msg13SetScurvePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg13SetScurvePtr, ref RemoteAnimation.s_priv_ByteOrder_Msg13_SetSCurve, typeof(RemoteAnimation.Msg13_SetSCurve), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg13SetScurvePtr, ref s_priv_ByteOrder_Msg13_SetSCurve, typeof(RemoteAnimation.Msg13_SetSCurve), 0, 0); _priv_pmsgUse = (Message*)msg13SetScurvePtr; } @@ -600,7 +600,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg14SetLogarithmicPtr->flWeight = flWeight; msg14SetLogarithmicPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg14SetLogarithmicPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg14_SetLogarithmic, typeof(RemoteAnimation.Msg14_SetLogarithmic), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg14SetLogarithmicPtr, ref s_priv_ByteOrder_Msg14_SetLogarithmic, typeof(RemoteAnimation.Msg14_SetLogarithmic), 0, 0); _priv_pmsgUse = (Message*)msg14SetLogarithmicPtr; } @@ -631,7 +631,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg15SetExponentialPtr->flWeight = flWeight; msg15SetExponentialPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg15SetExponentialPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg15_SetExponential, typeof(RemoteAnimation.Msg15_SetExponential), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg15SetExponentialPtr, ref s_priv_ByteOrder_Msg15_SetExponential, typeof(RemoteAnimation.Msg15_SetExponential), 0, 0); _priv_pmsgUse = (Message*)msg15SetExponentialPtr; } @@ -660,7 +660,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg16SetLinearPtr->fSpherical = fSpherical ? uint.MaxValue : 0U; msg16SetLinearPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg16SetLinearPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg16_SetLinear, typeof(RemoteAnimation.Msg16_SetLinear), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg16SetLinearPtr, ref s_priv_ByteOrder_Msg16_SetLinear, typeof(RemoteAnimation.Msg16_SetLinear), 0, 0); _priv_pmsgUse = (Message*)msg16SetLinearPtr; } @@ -689,7 +689,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering setBinaryOperationPtr->opCode = opCode; setBinaryOperationPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setBinaryOperationPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg17_SetBinaryOperation, typeof(RemoteAnimation.Msg17_SetBinaryOperation), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setBinaryOperationPtr, ref s_priv_ByteOrder_Msg17_SetBinaryOperation, typeof(RemoteAnimation.Msg17_SetBinaryOperation), 0, 0); _priv_pmsgUse = (Message*)setBinaryOperationPtr; } @@ -722,7 +722,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg18SetContinuousPtr->propertyInfo = propertyInfo; msg18SetContinuousPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg18SetContinuousPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg18_SetContinuous, typeof(RemoteAnimation.Msg18_SetContinuous), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg18SetContinuousPtr, ref s_priv_ByteOrder_Msg18_SetContinuous, typeof(RemoteAnimation.Msg18_SetContinuous), 0, 0); _priv_pmsgUse = (Message*)msg18SetContinuousPtr; } @@ -761,7 +761,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg19SetCapturedPtr->fRefreshOnRepeat = fRefreshOnRepeat ? uint.MaxValue : 0U; msg19SetCapturedPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg19SetCapturedPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg19_SetCaptured, typeof(RemoteAnimation.Msg19_SetCaptured), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg19SetCapturedPtr, ref s_priv_ByteOrder_Msg19_SetCaptured, typeof(RemoteAnimation.Msg19_SetCaptured), 0, 0); _priv_pmsgUse = (Message*)msg19SetCapturedPtr; } @@ -795,7 +795,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg20SetQuaternionPtr->qValue = qValue; msg20SetQuaternionPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg20SetQuaternionPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg20_SetQuaternion, typeof(RemoteAnimation.Msg20_SetQuaternion), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg20SetQuaternionPtr, ref s_priv_ByteOrder_Msg20_SetQuaternion, typeof(RemoteAnimation.Msg20_SetQuaternion), 0, 0); _priv_pmsgUse = (Message*)msg20SetQuaternionPtr; } @@ -824,7 +824,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg21SetVector4Ptr->vValue = vValue; msg21SetVector4Ptr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg21SetVector4Ptr, ref RemoteAnimation.s_priv_ByteOrder_Msg21_SetVector4, typeof(RemoteAnimation.Msg21_SetVector4), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg21SetVector4Ptr, ref s_priv_ByteOrder_Msg21_SetVector4, typeof(RemoteAnimation.Msg21_SetVector4), 0, 0); _priv_pmsgUse = (Message*)msg21SetVector4Ptr; } @@ -853,7 +853,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg22SetVector3Ptr->vValue = vValue; msg22SetVector3Ptr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg22SetVector3Ptr, ref RemoteAnimation.s_priv_ByteOrder_Msg22_SetVector3, typeof(RemoteAnimation.Msg22_SetVector3), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg22SetVector3Ptr, ref s_priv_ByteOrder_Msg22_SetVector3, typeof(RemoteAnimation.Msg22_SetVector3), 0, 0); _priv_pmsgUse = (Message*)msg22SetVector3Ptr; } @@ -882,7 +882,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg23SetVector2Ptr->vValue = vValue; msg23SetVector2Ptr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg23SetVector2Ptr, ref RemoteAnimation.s_priv_ByteOrder_Msg23_SetVector2, typeof(RemoteAnimation.Msg23_SetVector2), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg23SetVector2Ptr, ref s_priv_ByteOrder_Msg23_SetVector2, typeof(RemoteAnimation.Msg23_SetVector2), 0, 0); _priv_pmsgUse = (Message*)msg23SetVector2Ptr; } @@ -911,7 +911,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg24SetFloatPtr->flValue = flValue; msg24SetFloatPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg24SetFloatPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg24_SetFloat, typeof(RemoteAnimation.Msg24_SetFloat), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg24SetFloatPtr, ref s_priv_ByteOrder_Msg24_SetFloat, typeof(RemoteAnimation.Msg24_SetFloat), 0, 0); _priv_pmsgUse = (Message*)msg24SetFloatPtr; } @@ -938,7 +938,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering endAnimationInputPtr->idxKeyframe = idxKeyframe; endAnimationInputPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)endAnimationInputPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg25_EndAnimationInput, typeof(RemoteAnimation.Msg25_EndAnimationInput), 0, 0); + MarshalHelper.SwapByteOrder((byte*)endAnimationInputPtr, ref s_priv_ByteOrder_Msg25_EndAnimationInput, typeof(RemoteAnimation.Msg25_EndAnimationInput), 0, 0); _priv_pmsgUse = (Message*)endAnimationInputPtr; } @@ -965,7 +965,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering beginAnimationInputPtr->idxKeyframe = idxKeyframe; beginAnimationInputPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)beginAnimationInputPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg26_BeginAnimationInput, typeof(RemoteAnimation.Msg26_BeginAnimationInput), 0, 0); + MarshalHelper.SwapByteOrder((byte*)beginAnimationInputPtr, ref s_priv_ByteOrder_Msg26_BeginAnimationInput, typeof(RemoteAnimation.Msg26_BeginAnimationInput), 0, 0); _priv_pmsgUse = (Message*)beginAnimationInputPtr; } @@ -994,7 +994,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg27SetKeyframeTimePtr->flTimeSec = flTimeSec; msg27SetKeyframeTimePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg27SetKeyframeTimePtr, ref RemoteAnimation.s_priv_ByteOrder_Msg27_SetKeyframeTime, typeof(RemoteAnimation.Msg27_SetKeyframeTime), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg27SetKeyframeTimePtr, ref s_priv_ByteOrder_Msg27_SetKeyframeTime, typeof(RemoteAnimation.Msg27_SetKeyframeTime), 0, 0); _priv_pmsgUse = (Message*)msg27SetKeyframeTimePtr; } @@ -1021,7 +1021,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering setKeyframeCountPtr->cKeyframes = cKeyframes; setKeyframeCountPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setKeyframeCountPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg29_SetKeyframeCount, typeof(RemoteAnimation.Msg29_SetKeyframeCount), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setKeyframeCountPtr, ref s_priv_ByteOrder_Msg29_SetKeyframeCount, typeof(RemoteAnimation.Msg29_SetKeyframeCount), 0, 0); _priv_pmsgUse = (Message*)setKeyframeCountPtr; } @@ -1050,7 +1050,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg31AddKeyframePtr->flTimeSec = flTimeSec; msg31AddKeyframePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg31AddKeyframePtr, ref RemoteAnimation.s_priv_ByteOrder_Msg31_AddKeyframe, typeof(RemoteAnimation.Msg31_AddKeyframe), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg31AddKeyframePtr, ref s_priv_ByteOrder_Msg31_AddKeyframe, typeof(RemoteAnimation.Msg31_AddKeyframe), 0, 0); _priv_pmsgUse = (Message*)msg31AddKeyframePtr; } @@ -1073,7 +1073,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg32InstantFinishPtr->_priv_msgid = 32U; msg32InstantFinishPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg32InstantFinishPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg32_InstantFinish, typeof(RemoteAnimation.Msg32_InstantFinish), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg32InstantFinishPtr, ref s_priv_ByteOrder_Msg32_InstantFinish, typeof(RemoteAnimation.Msg32_InstantFinish), 0, 0); _priv_pmsgUse = (Message*)msg32InstantFinishPtr; } @@ -1100,7 +1100,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg33InstantAdvancePtr->advanceTime = advanceTime; msg33InstantAdvancePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg33InstantAdvancePtr, ref RemoteAnimation.s_priv_ByteOrder_Msg33_InstantAdvance, typeof(RemoteAnimation.Msg33_InstantAdvance), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg33InstantAdvancePtr, ref s_priv_ByteOrder_Msg33_InstantAdvance, typeof(RemoteAnimation.Msg33_InstantAdvance), 0, 0); _priv_pmsgUse = (Message*)msg33InstantAdvancePtr; } @@ -1123,7 +1123,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg34ResetPtr->_priv_msgid = 34U; msg34ResetPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg34ResetPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg34_Reset, typeof(RemoteAnimation.Msg34_Reset), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg34ResetPtr, ref s_priv_ByteOrder_Msg34_Reset, typeof(RemoteAnimation.Msg34_Reset), 0, 0); _priv_pmsgUse = (Message*)msg34ResetPtr; } @@ -1146,7 +1146,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg35PausePtr->_priv_msgid = 35U; msg35PausePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg35PausePtr, ref RemoteAnimation.s_priv_ByteOrder_Msg35_Pause, typeof(RemoteAnimation.Msg35_Pause), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg35PausePtr, ref s_priv_ByteOrder_Msg35_Pause, typeof(RemoteAnimation.Msg35_Pause), 0, 0); _priv_pmsgUse = (Message*)msg35PausePtr; } @@ -1169,7 +1169,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg36PlayPtr->_priv_msgid = 36U; msg36PlayPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg36PlayPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg36_Play, typeof(RemoteAnimation.Msg36_Play), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg36PlayPtr, ref s_priv_ByteOrder_Msg36_Play, typeof(RemoteAnimation.Msg36_Play), 0, 0); _priv_pmsgUse = (Message*)msg36PlayPtr; } @@ -1196,7 +1196,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering setResetBehaviorPtr->behavior = behavior; setResetBehaviorPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setResetBehaviorPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg37_SetResetBehavior, typeof(RemoteAnimation.Msg37_SetResetBehavior), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setResetBehaviorPtr, ref s_priv_ByteOrder_Msg37_SetResetBehavior, typeof(RemoteAnimation.Msg37_SetResetBehavior), 0, 0); _priv_pmsgUse = (Message*)setResetBehaviorPtr; } @@ -1223,7 +1223,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg39SetAutoResetPtr->fAutoReset = fAutoReset ? uint.MaxValue : 0U; msg39SetAutoResetPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg39SetAutoResetPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg39_SetAutoReset, typeof(RemoteAnimation.Msg39_SetAutoReset), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg39SetAutoResetPtr, ref s_priv_ByteOrder_Msg39_SetAutoReset, typeof(RemoteAnimation.Msg39_SetAutoReset), 0, 0); _priv_pmsgUse = (Message*)msg39SetAutoResetPtr; } @@ -1250,7 +1250,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg41SetRepeatCountPtr->cRepeats = cRepeats; msg41SetRepeatCountPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg41SetRepeatCountPtr, ref RemoteAnimation.s_priv_ByteOrder_Msg41_SetRepeatCount, typeof(RemoteAnimation.Msg41_SetRepeatCount), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg41SetRepeatCountPtr, ref s_priv_ByteOrder_Msg41_SetRepeatCount, typeof(RemoteAnimation.Msg41_SetRepeatCount), 0, 0); _priv_pmsgUse = (Message*)msg41SetRepeatCountPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimationInputProvider.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimationInputProvider.cs index 2e142f7..c39958e 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimationInputProvider.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimationInputProvider.cs @@ -45,7 +45,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg10CreatePtr->nExternalAnimationInputId = nExternalAnimationInputId; msg10CreatePtr->_priv_idObjectSubject = animationInputProvider.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteAnimationInputProvider.s_priv_ByteOrder_Msg10_Create, typeof(RemoteAnimationInputProvider.Msg10_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg10_Create, typeof(RemoteAnimationInputProvider.Msg10_Create), 0, 0); port.CreateRemoteObject(providerClassHandle, animationInputProvider.m_renderHandle, (Message*)msg10CreatePtr); return animationInputProvider; } @@ -65,7 +65,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering revokeQuaternionPtr->propertyId = propertyId; revokeQuaternionPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)revokeQuaternionPtr, ref RemoteAnimationInputProvider.s_priv_ByteOrder_Msg0_RevokeQuaternion, typeof(RemoteAnimationInputProvider.Msg0_RevokeQuaternion), 0, 0); + MarshalHelper.SwapByteOrder((byte*)revokeQuaternionPtr, ref s_priv_ByteOrder_Msg0_RevokeQuaternion, typeof(RemoteAnimationInputProvider.Msg0_RevokeQuaternion), 0, 0); _priv_pmsgUse = (Message*)revokeQuaternionPtr; } @@ -92,7 +92,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg1RevokeVector4Ptr->propertyId = propertyId; msg1RevokeVector4Ptr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg1RevokeVector4Ptr, ref RemoteAnimationInputProvider.s_priv_ByteOrder_Msg1_RevokeVector4, typeof(RemoteAnimationInputProvider.Msg1_RevokeVector4), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg1RevokeVector4Ptr, ref s_priv_ByteOrder_Msg1_RevokeVector4, typeof(RemoteAnimationInputProvider.Msg1_RevokeVector4), 0, 0); _priv_pmsgUse = (Message*)msg1RevokeVector4Ptr; } @@ -119,7 +119,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg2RevokeVector3Ptr->propertyId = propertyId; msg2RevokeVector3Ptr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg2RevokeVector3Ptr, ref RemoteAnimationInputProvider.s_priv_ByteOrder_Msg2_RevokeVector3, typeof(RemoteAnimationInputProvider.Msg2_RevokeVector3), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg2RevokeVector3Ptr, ref s_priv_ByteOrder_Msg2_RevokeVector3, typeof(RemoteAnimationInputProvider.Msg2_RevokeVector3), 0, 0); _priv_pmsgUse = (Message*)msg2RevokeVector3Ptr; } @@ -146,7 +146,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg3RevokeVector2Ptr->propertyId = propertyId; msg3RevokeVector2Ptr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg3RevokeVector2Ptr, ref RemoteAnimationInputProvider.s_priv_ByteOrder_Msg3_RevokeVector2, typeof(RemoteAnimationInputProvider.Msg3_RevokeVector2), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg3RevokeVector2Ptr, ref s_priv_ByteOrder_Msg3_RevokeVector2, typeof(RemoteAnimationInputProvider.Msg3_RevokeVector2), 0, 0); _priv_pmsgUse = (Message*)msg3RevokeVector2Ptr; } @@ -173,7 +173,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg4RevokeFloatPtr->propertyId = propertyId; msg4RevokeFloatPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg4RevokeFloatPtr, ref RemoteAnimationInputProvider.s_priv_ByteOrder_Msg4_RevokeFloat, typeof(RemoteAnimationInputProvider.Msg4_RevokeFloat), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg4RevokeFloatPtr, ref s_priv_ByteOrder_Msg4_RevokeFloat, typeof(RemoteAnimationInputProvider.Msg4_RevokeFloat), 0, 0); _priv_pmsgUse = (Message*)msg4RevokeFloatPtr; } @@ -202,7 +202,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering publishQuaternionPtr->value = value; publishQuaternionPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)publishQuaternionPtr, ref RemoteAnimationInputProvider.s_priv_ByteOrder_Msg5_PublishQuaternion, typeof(RemoteAnimationInputProvider.Msg5_PublishQuaternion), 0, 0); + MarshalHelper.SwapByteOrder((byte*)publishQuaternionPtr, ref s_priv_ByteOrder_Msg5_PublishQuaternion, typeof(RemoteAnimationInputProvider.Msg5_PublishQuaternion), 0, 0); _priv_pmsgUse = (Message*)publishQuaternionPtr; } @@ -231,7 +231,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg6PublishVector4Ptr->value = value; msg6PublishVector4Ptr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg6PublishVector4Ptr, ref RemoteAnimationInputProvider.s_priv_ByteOrder_Msg6_PublishVector4, typeof(RemoteAnimationInputProvider.Msg6_PublishVector4), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg6PublishVector4Ptr, ref s_priv_ByteOrder_Msg6_PublishVector4, typeof(RemoteAnimationInputProvider.Msg6_PublishVector4), 0, 0); _priv_pmsgUse = (Message*)msg6PublishVector4Ptr; } @@ -260,7 +260,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg7PublishVector3Ptr->value = value; msg7PublishVector3Ptr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg7PublishVector3Ptr, ref RemoteAnimationInputProvider.s_priv_ByteOrder_Msg7_PublishVector3, typeof(RemoteAnimationInputProvider.Msg7_PublishVector3), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg7PublishVector3Ptr, ref s_priv_ByteOrder_Msg7_PublishVector3, typeof(RemoteAnimationInputProvider.Msg7_PublishVector3), 0, 0); _priv_pmsgUse = (Message*)msg7PublishVector3Ptr; } @@ -289,7 +289,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg8PublishVector2Ptr->value = value; msg8PublishVector2Ptr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg8PublishVector2Ptr, ref RemoteAnimationInputProvider.s_priv_ByteOrder_Msg8_PublishVector2, typeof(RemoteAnimationInputProvider.Msg8_PublishVector2), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg8PublishVector2Ptr, ref s_priv_ByteOrder_Msg8_PublishVector2, typeof(RemoteAnimationInputProvider.Msg8_PublishVector2), 0, 0); _priv_pmsgUse = (Message*)msg8PublishVector2Ptr; } @@ -318,7 +318,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg9PublishFloatPtr->value = value; msg9PublishFloatPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg9PublishFloatPtr, ref RemoteAnimationInputProvider.s_priv_ByteOrder_Msg9_PublishFloat, typeof(RemoteAnimationInputProvider.Msg9_PublishFloat), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg9PublishFloatPtr, ref s_priv_ByteOrder_Msg9_PublishFloat, typeof(RemoteAnimationInputProvider.Msg9_PublishFloat), 0, 0); _priv_pmsgUse = (Message*)msg9PublishFloatPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimationManager.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimationManager.cs index e26a3bd..7f66f2b 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimationManager.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteAnimationManager.cs @@ -36,7 +36,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg3CreatePtr->_priv_msgid = 3U; msg3CreatePtr->_priv_idObjectSubject = animationManager.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteAnimationManager.s_priv_ByteOrder_Msg3_Create, typeof(RemoteAnimationManager.Msg3_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg3_Create, typeof(RemoteAnimationManager.Msg3_Create), 0, 0); port.CreateRemoteObject(managerClassHandle, animationManager.m_renderHandle, (Message*)msg3CreatePtr); return animationManager; } @@ -56,7 +56,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering setAnimationRatePtr->nFramesPerSecond = nFramesPerSecond; setAnimationRatePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setAnimationRatePtr, ref RemoteAnimationManager.s_priv_ByteOrder_Msg0_SetAnimationRate, typeof(RemoteAnimationManager.Msg0_SetAnimationRate), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setAnimationRatePtr, ref s_priv_ByteOrder_Msg0_SetAnimationRate, typeof(RemoteAnimationManager.Msg0_SetAnimationRate), 0, 0); _priv_pmsgUse = (Message*)setAnimationRatePtr; } @@ -83,7 +83,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering pulseTimeAdvancePtr->nPulseMs = nPulseMs; pulseTimeAdvancePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)pulseTimeAdvancePtr, ref RemoteAnimationManager.s_priv_ByteOrder_Msg1_PulseTimeAdvance, typeof(RemoteAnimationManager.Msg1_PulseTimeAdvance), 0, 0); + MarshalHelper.SwapByteOrder((byte*)pulseTimeAdvancePtr, ref s_priv_ByteOrder_Msg1_PulseTimeAdvance, typeof(RemoteAnimationManager.Msg1_PulseTimeAdvance), 0, 0); _priv_pmsgUse = (Message*)pulseTimeAdvancePtr; } @@ -110,7 +110,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering globalSpeedAdjustmentPtr->flFactor = flFactor; globalSpeedAdjustmentPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)globalSpeedAdjustmentPtr, ref RemoteAnimationManager.s_priv_ByteOrder_Msg2_SetGlobalSpeedAdjustment, typeof(RemoteAnimationManager.Msg2_SetGlobalSpeedAdjustment), 0, 0); + MarshalHelper.SwapByteOrder((byte*)globalSpeedAdjustmentPtr, ref s_priv_ByteOrder_Msg2_SetGlobalSpeedAdjustment, typeof(RemoteAnimationManager.Msg2_SetGlobalSpeedAdjustment), 0, 0); _priv_pmsgUse = (Message*)globalSpeedAdjustmentPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteCamera.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteCamera.cs index 6661bc0..c3efe77 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteCamera.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteCamera.cs @@ -38,7 +38,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg5CreatePtr->_priv_msgid = 5U; msg5CreatePtr->_priv_idObjectSubject = remoteCamera.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteCamera.s_priv_ByteOrder_Msg5_Create, typeof(RemoteCamera.Msg5_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg5_Create, typeof(RemoteCamera.Msg5_Create), 0, 0); port.CreateRemoteObject(cameraClassHandle, remoteCamera.m_renderHandle, (Message*)msg5CreatePtr); return remoteCamera; } @@ -58,7 +58,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg0SetPerspectivePtr->fPerspective = fPerspective ? uint.MaxValue : 0U; msg0SetPerspectivePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0SetPerspectivePtr, ref RemoteCamera.s_priv_ByteOrder_Msg0_SetPerspective, typeof(RemoteCamera.Msg0_SetPerspective), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0SetPerspectivePtr, ref s_priv_ByteOrder_Msg0_SetPerspective, typeof(RemoteCamera.Msg0_SetPerspective), 0, 0); _priv_pmsgUse = (Message*)msg0SetPerspectivePtr; } @@ -85,7 +85,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg1SetZnPtr->flZn = flZn; msg1SetZnPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg1SetZnPtr, ref RemoteCamera.s_priv_ByteOrder_Msg1_SetZn, typeof(RemoteCamera.Msg1_SetZn), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg1SetZnPtr, ref s_priv_ByteOrder_Msg1_SetZn, typeof(RemoteCamera.Msg1_SetZn), 0, 0); _priv_pmsgUse = (Message*)msg1SetZnPtr; } @@ -112,7 +112,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg2SetUpPtr->vUp = vUp; msg2SetUpPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg2SetUpPtr, ref RemoteCamera.s_priv_ByteOrder_Msg2_SetUp, typeof(RemoteCamera.Msg2_SetUp), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg2SetUpPtr, ref s_priv_ByteOrder_Msg2_SetUp, typeof(RemoteCamera.Msg2_SetUp), 0, 0); _priv_pmsgUse = (Message*)msg2SetUpPtr; } @@ -139,7 +139,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg3SetAtPtr->vAt = vAt; msg3SetAtPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg3SetAtPtr, ref RemoteCamera.s_priv_ByteOrder_Msg3_SetAt, typeof(RemoteCamera.Msg3_SetAt), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg3SetAtPtr, ref s_priv_ByteOrder_Msg3_SetAt, typeof(RemoteCamera.Msg3_SetAt), 0, 0); _priv_pmsgUse = (Message*)msg3SetAtPtr; } @@ -166,7 +166,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg4SetEyePtr->vEye = vEye; msg4SetEyePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg4SetEyePtr, ref RemoteCamera.s_priv_ByteOrder_Msg4_SetEye, typeof(RemoteCamera.Msg4_SetEye), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg4SetEyePtr, ref s_priv_ByteOrder_Msg4_SetEye, typeof(RemoteCamera.Msg4_SetEye), 0, 0); _priv_pmsgUse = (Message*)msg4SetEyePtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDevice.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDevice.cs index 5abf92d..85bfa8a 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDevice.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDevice.cs @@ -37,7 +37,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering triggerDeviceResetPtr->_priv_msgid = 0U; triggerDeviceResetPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)triggerDeviceResetPtr, ref RemoteDevice.s_priv_ByteOrder_Msg0_TriggerDeviceReset, typeof(RemoteDevice.Msg0_TriggerDeviceReset), 0, 0); + MarshalHelper.SwapByteOrder((byte*)triggerDeviceResetPtr, ref s_priv_ByteOrder_Msg0_TriggerDeviceReset, typeof(RemoteDevice.Msg0_TriggerDeviceReset), 0, 0); _priv_pmsgUse = (Message*)triggerDeviceResetPtr; } @@ -62,7 +62,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering captureBackBufferPtr->_priv_msgid = 1U; captureBackBufferPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)captureBackBufferPtr, ref RemoteDevice.s_priv_ByteOrder_Msg1_EndCaptureBackBuffer, typeof(RemoteDevice.Msg1_EndCaptureBackBuffer), 0, 0); + MarshalHelper.SwapByteOrder((byte*)captureBackBufferPtr, ref s_priv_ByteOrder_Msg1_EndCaptureBackBuffer, typeof(RemoteDevice.Msg1_EndCaptureBackBuffer), 0, 0); _priv_pmsgUse = (Message*)captureBackBufferPtr; } @@ -92,7 +92,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering blobInfo.Attach((Message*)captureBackBufferPtr); captureBackBufferPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)captureBackBufferPtr, ref RemoteDevice.s_priv_ByteOrder_Msg2_BeginCaptureBackBuffer, typeof(RemoteDevice.Msg2_BeginCaptureBackBuffer), 0, 0); + MarshalHelper.SwapByteOrder((byte*)captureBackBufferPtr, ref s_priv_ByteOrder_Msg2_BeginCaptureBackBuffer, typeof(RemoteDevice.Msg2_BeginCaptureBackBuffer), 0, 0); _priv_pmsgUse = (Message*)captureBackBufferPtr; } @@ -119,7 +119,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg3CreateGradientPtr->idNewGradient = idNewGradient; msg3CreateGradientPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg3CreateGradientPtr, ref RemoteDevice.s_priv_ByteOrder_Msg3_CreateGradient, typeof(RemoteDevice.Msg3_CreateGradient), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg3CreateGradientPtr, ref s_priv_ByteOrder_Msg3_CreateGradient, typeof(RemoteDevice.Msg3_CreateGradient), 0, 0); _priv_pmsgUse = (Message*)msg3CreateGradientPtr; } @@ -142,7 +142,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg4StopPtr->_priv_msgid = 4U; msg4StopPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg4StopPtr, ref RemoteDevice.s_priv_ByteOrder_Msg4_Stop, typeof(RemoteDevice.Msg4_Stop), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg4StopPtr, ref s_priv_ByteOrder_Msg4_Stop, typeof(RemoteDevice.Msg4_Stop), 0, 0); _priv_pmsgUse = (Message*)msg4StopPtr; } @@ -169,7 +169,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg5RestartPtr->nRenderGeneration = nRenderGeneration; msg5RestartPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg5RestartPtr, ref RemoteDevice.s_priv_ByteOrder_Msg5_Restart, typeof(RemoteDevice.Msg5_Restart), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg5RestartPtr, ref s_priv_ByteOrder_Msg5_Restart, typeof(RemoteDevice.Msg5_Restart), 0, 0); _priv_pmsgUse = (Message*)msg5RestartPtr; } @@ -198,7 +198,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering createSurfacePoolPtr->nFormat = nFormat; createSurfacePoolPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)createSurfacePoolPtr, ref RemoteDevice.s_priv_ByteOrder_Msg6_CreateSurfacePool, typeof(RemoteDevice.Msg6_CreateSurfacePool), 0, 0); + MarshalHelper.SwapByteOrder((byte*)createSurfacePoolPtr, ref s_priv_ByteOrder_Msg6_CreateSurfacePool, typeof(RemoteDevice.Msg6_CreateSurfacePool), 0, 0); _priv_pmsgUse = (Message*)createSurfacePoolPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Device.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Device.cs index 18f207a..3d9d412 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Device.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Device.cs @@ -38,7 +38,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg8CreateVideoPoolPtr->idNewSurface = idNewSurface; msg8CreateVideoPoolPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg8CreateVideoPoolPtr, ref RemoteDx9Device.s_priv_ByteOrder_Msg8_CreateVideoPool, typeof(RemoteDx9Device.Msg8_CreateVideoPool), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg8CreateVideoPoolPtr, ref s_priv_ByteOrder_Msg8_CreateVideoPool, typeof(RemoteDx9Device.Msg8_CreateVideoPool), 0, 0); _priv_pmsgUse = (Message*)msg8CreateVideoPoolPtr; } @@ -65,7 +65,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering surfaceAllocationPtr->_priv_msgid = 9U; surfaceAllocationPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)surfaceAllocationPtr, ref RemoteDx9Device.s_priv_ByteOrder_Msg9_EndVideoSurfaceAllocation, typeof(RemoteDx9Device.Msg9_EndVideoSurfaceAllocation), 0, 0); + MarshalHelper.SwapByteOrder((byte*)surfaceAllocationPtr, ref s_priv_ByteOrder_Msg9_EndVideoSurfaceAllocation, typeof(RemoteDx9Device.Msg9_EndVideoSurfaceAllocation), 0, 0); _priv_pmsgUse = (Message*)surfaceAllocationPtr; } @@ -90,7 +90,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering surfaceAllocationPtr->_priv_msgid = 10U; surfaceAllocationPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)surfaceAllocationPtr, ref RemoteDx9Device.s_priv_ByteOrder_Msg10_BeginVideoSurfaceAllocation, typeof(RemoteDx9Device.Msg10_BeginVideoSurfaceAllocation), 0, 0); + MarshalHelper.SwapByteOrder((byte*)surfaceAllocationPtr, ref s_priv_ByteOrder_Msg10_BeginVideoSurfaceAllocation, typeof(RemoteDx9Device.Msg10_BeginVideoSurfaceAllocation), 0, 0); _priv_pmsgUse = (Message*)surfaceAllocationPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Effect.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Effect.cs index 6473313..5a29fea 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Effect.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Effect.cs @@ -25,7 +25,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering RenderPort port = _priv_protocolInstance.Port; RENDERHANDLE effectClassHandle = _priv_protocolInstance.Dx9Effect_ClassHandle; RemoteDx9Effect remoteDx9Effect = new RemoteDx9Effect(port, _priv_owner); - port.CreateRemoteObject(effectClassHandle, remoteDx9Effect.m_renderHandle, (Message*)null); + port.CreateRemoteObject(effectClassHandle, remoteDx9Effect.m_renderHandle, null); return remoteDx9Effect; } @@ -46,7 +46,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering loadEffectResourcePtr->effectResource = effectResource != null ? effectResource.RenderHandle : RENDERHANDLE.NULL; loadEffectResourcePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)loadEffectResourcePtr, ref RemoteDx9Effect.s_priv_ByteOrder_Msg8_LoadEffectResource, typeof(RemoteDx9Effect.Msg8_LoadEffectResource), 0, 0); + MarshalHelper.SwapByteOrder((byte*)loadEffectResourcePtr, ref s_priv_ByteOrder_Msg8_LoadEffectResource, typeof(RemoteDx9Effect.Msg8_LoadEffectResource), 0, 0); _priv_pmsgUse = (Message*)loadEffectResourcePtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9EffectResource.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9EffectResource.cs index d0616f7..ee11d3e 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9EffectResource.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9EffectResource.cs @@ -48,7 +48,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg10CreatePtr->dataBuffer = dataBuffer != null ? dataBuffer.RenderHandle : RENDERHANDLE.NULL; msg10CreatePtr->_priv_idObjectSubject = dx9EffectResource.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteDx9EffectResource.s_priv_ByteOrder_Msg10_Create, typeof(RemoteDx9EffectResource.Msg10_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg10_Create, typeof(RemoteDx9EffectResource.Msg10_Create), 0, 0); port.CreateRemoteObject(resourceClassHandle, dx9EffectResource.m_renderHandle, (Message*)msg10CreatePtr); return dx9EffectResource; } @@ -71,7 +71,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering blobInfo.Attach((Message*)msg0SetDebugIdPtr); msg0SetDebugIdPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0SetDebugIdPtr, ref RemoteDx9EffectResource.s_priv_ByteOrder_Msg0_SetDebugID, typeof(RemoteDx9EffectResource.Msg0_SetDebugID), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0SetDebugIdPtr, ref s_priv_ByteOrder_Msg0_SetDebugID, typeof(RemoteDx9EffectResource.Msg0_SetDebugID), 0, 0); _priv_pmsgUse = (Message*)msg0SetDebugIdPtr; } @@ -98,7 +98,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg1SetGutterSizePtr->sizeGutterPxl = sizeGutterPxl; msg1SetGutterSizePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg1SetGutterSizePtr, ref RemoteDx9EffectResource.s_priv_ByteOrder_Msg1_SetGutterSize, typeof(RemoteDx9EffectResource.Msg1_SetGutterSize), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg1SetGutterSizePtr, ref s_priv_ByteOrder_Msg1_SetGutterSize, typeof(RemoteDx9EffectResource.Msg1_SetGutterSize), 0, 0); _priv_pmsgUse = (Message*)msg1SetGutterSizePtr; } @@ -123,7 +123,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering postPropertiesAddedPtr->_priv_msgid = 2U; postPropertiesAddedPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)postPropertiesAddedPtr, ref RemoteDx9EffectResource.s_priv_ByteOrder_Msg2_PostPropertiesAdded, typeof(RemoteDx9EffectResource.Msg2_PostPropertiesAdded), 0, 0); + MarshalHelper.SwapByteOrder((byte*)postPropertiesAddedPtr, ref s_priv_ByteOrder_Msg2_PostPropertiesAdded, typeof(RemoteDx9EffectResource.Msg2_PostPropertiesAdded), 0, 0); _priv_pmsgUse = (Message*)postPropertiesAddedPtr; } @@ -165,7 +165,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering blobInfo.Attach((Message*)textureRequirementsPtr); textureRequirementsPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)textureRequirementsPtr, ref RemoteDx9EffectResource.s_priv_ByteOrder_Msg3_AddTextureRequirements, typeof(RemoteDx9EffectResource.Msg3_AddTextureRequirements), 0, 0); + MarshalHelper.SwapByteOrder((byte*)textureRequirementsPtr, ref s_priv_ByteOrder_Msg3_AddTextureRequirements, typeof(RemoteDx9EffectResource.Msg3_AddTextureRequirements), 0, 0); _priv_pmsgUse = (Message*)textureRequirementsPtr; } @@ -205,7 +205,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering blobInfo.Attach((Message*)msg4AddPropertyPtr); msg4AddPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg4AddPropertyPtr, ref RemoteDx9EffectResource.s_priv_ByteOrder_Msg4_AddProperty, typeof(RemoteDx9EffectResource.Msg4_AddProperty), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg4AddPropertyPtr, ref s_priv_ByteOrder_Msg4_AddProperty, typeof(RemoteDx9EffectResource.Msg4_AddProperty), 0, 0); _priv_pmsgUse = (Message*)msg4AddPropertyPtr; } @@ -237,7 +237,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering blobInfo.Attach((Message*)msg5AddPropertyPtr); msg5AddPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg5AddPropertyPtr, ref RemoteDx9EffectResource.s_priv_ByteOrder_Msg5_AddProperty, typeof(RemoteDx9EffectResource.Msg5_AddProperty), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg5AddPropertyPtr, ref s_priv_ByteOrder_Msg5_AddProperty, typeof(RemoteDx9EffectResource.Msg5_AddProperty), 0, 0); _priv_pmsgUse = (Message*)msg5AddPropertyPtr; } @@ -269,7 +269,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering blobInfo.Attach((Message*)msg6AddPropertyPtr); msg6AddPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg6AddPropertyPtr, ref RemoteDx9EffectResource.s_priv_ByteOrder_Msg6_AddProperty, typeof(RemoteDx9EffectResource.Msg6_AddProperty), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg6AddPropertyPtr, ref s_priv_ByteOrder_Msg6_AddProperty, typeof(RemoteDx9EffectResource.Msg6_AddProperty), 0, 0); _priv_pmsgUse = (Message*)msg6AddPropertyPtr; } @@ -301,7 +301,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering blobInfo.Attach((Message*)msg7AddPropertyPtr); msg7AddPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg7AddPropertyPtr, ref RemoteDx9EffectResource.s_priv_ByteOrder_Msg7_AddProperty, typeof(RemoteDx9EffectResource.Msg7_AddProperty), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg7AddPropertyPtr, ref s_priv_ByteOrder_Msg7_AddProperty, typeof(RemoteDx9EffectResource.Msg7_AddProperty), 0, 0); _priv_pmsgUse = (Message*)msg7AddPropertyPtr; } @@ -333,7 +333,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering blobInfo.Attach((Message*)msg8AddPropertyPtr); msg8AddPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg8AddPropertyPtr, ref RemoteDx9EffectResource.s_priv_ByteOrder_Msg8_AddProperty, typeof(RemoteDx9EffectResource.Msg8_AddProperty), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg8AddPropertyPtr, ref s_priv_ByteOrder_Msg8_AddProperty, typeof(RemoteDx9EffectResource.Msg8_AddProperty), 0, 0); _priv_pmsgUse = (Message*)msg8AddPropertyPtr; } @@ -365,7 +365,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering blobInfo.Attach((Message*)msg9AddPropertyPtr); msg9AddPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg9AddPropertyPtr, ref RemoteDx9EffectResource.s_priv_ByteOrder_Msg9_AddProperty, typeof(RemoteDx9EffectResource.Msg9_AddProperty), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg9AddPropertyPtr, ref s_priv_ByteOrder_Msg9_AddProperty, typeof(RemoteDx9EffectResource.Msg9_AddProperty), 0, 0); _priv_pmsgUse = (Message*)msg9AddPropertyPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Sprite.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Sprite.cs index 97bca81..1307fe2 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Sprite.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDx9Sprite.cs @@ -32,7 +32,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg22CreatePtr->_priv_msgid = 22U; msg22CreatePtr->_priv_idObjectSubject = remoteDx9Sprite.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteDx9Sprite.s_priv_ByteOrder_Msg22_Create, typeof(RemoteDx9Sprite.Msg22_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg22_Create, typeof(RemoteDx9Sprite.Msg22_Create), 0, 0); port.CreateRemoteObject(spriteClassHandle, remoteDx9Sprite.m_renderHandle, (Message*)msg22CreatePtr); return remoteDx9Sprite; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDynamicSurfaceFactory.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDynamicSurfaceFactory.cs index 93b466b..43af8f8 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDynamicSurfaceFactory.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteDynamicSurfaceFactory.cs @@ -36,7 +36,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg0CloseInstancePtr->nUniqueID = nUniqueID; msg0CloseInstancePtr->_priv_idObjectSubject = factoryClassHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0CloseInstancePtr, ref RemoteDynamicSurfaceFactory.s_priv_ByteOrder_Msg0_CloseInstance, typeof(RemoteDynamicSurfaceFactory.Msg0_CloseInstance), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0CloseInstancePtr, ref s_priv_ByteOrder_Msg0_CloseInstance, typeof(RemoteDynamicSurfaceFactory.Msg0_CloseInstance), 0, 0); _priv_pmsgUse = (Message*)msg0CloseInstancePtr; } @@ -46,7 +46,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering { RenderPort _priv_portUse; Message* _priv_pmsgUse; - RemoteDynamicSurfaceFactory.BuildCloseInstance(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, nUniqueID); + BuildCloseInstance(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, nUniqueID); _priv_portUse.SendRemoteMessage(_priv_pmsgUse); } @@ -81,7 +81,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering createVideoInstancePtr->poolScene = poolScene != null ? poolScene.RenderHandle : RENDERHANDLE.NULL; createVideoInstancePtr->_priv_idObjectSubject = factoryClassHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)createVideoInstancePtr, ref RemoteDynamicSurfaceFactory.s_priv_ByteOrder_Msg1_CreateVideoInstance, typeof(RemoteDynamicSurfaceFactory.Msg1_CreateVideoInstance), 0, 0); + MarshalHelper.SwapByteOrder((byte*)createVideoInstancePtr, ref s_priv_ByteOrder_Msg1_CreateVideoInstance, typeof(RemoteDynamicSurfaceFactory.Msg1_CreateVideoInstance), 0, 0); _priv_pmsgUse = (Message*)createVideoInstancePtr; } @@ -95,7 +95,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering { RenderPort _priv_portUse; Message* _priv_pmsgUse; - RemoteDynamicSurfaceFactory.BuildCreateVideoInstance(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, nUniqueID, idClassContext, devOwner, surScene, poolScene); + BuildCreateVideoInstance(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, nUniqueID, idClassContext, devOwner, surScene, poolScene); _priv_portUse.SendRemoteMessage(_priv_pmsgUse); } @@ -130,7 +130,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering createSurfaceInstancePtr->poolScene = poolScene != null ? poolScene.RenderHandle : RENDERHANDLE.NULL; createSurfaceInstancePtr->_priv_idObjectSubject = factoryClassHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)createSurfaceInstancePtr, ref RemoteDynamicSurfaceFactory.s_priv_ByteOrder_Msg2_CreateSurfaceInstance, typeof(RemoteDynamicSurfaceFactory.Msg2_CreateSurfaceInstance), 0, 0); + MarshalHelper.SwapByteOrder((byte*)createSurfaceInstancePtr, ref s_priv_ByteOrder_Msg2_CreateSurfaceInstance, typeof(RemoteDynamicSurfaceFactory.Msg2_CreateSurfaceInstance), 0, 0); _priv_pmsgUse = (Message*)createSurfaceInstancePtr; } @@ -144,7 +144,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering { RenderPort _priv_portUse; Message* _priv_pmsgUse; - RemoteDynamicSurfaceFactory.BuildCreateSurfaceInstance(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, nUniqueID, idClassContext, devOwner, surScene, poolScene); + BuildCreateSurfaceInstance(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, nUniqueID, idClassContext, devOwner, surScene, poolScene); _priv_portUse.SendRemoteMessage(_priv_pmsgUse); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteEffect.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteEffect.cs index 0c7d8c8..a832ff1 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteEffect.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteEffect.cs @@ -43,7 +43,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering blobInfo.Attach((Message*)msg0SetDebugIdPtr); msg0SetDebugIdPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0SetDebugIdPtr, ref RemoteEffect.s_priv_ByteOrder_Msg0_SetDebugID, typeof(RemoteEffect.Msg0_SetDebugID), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0SetDebugIdPtr, ref s_priv_ByteOrder_Msg0_SetDebugID, typeof(RemoteEffect.Msg0_SetDebugID), 0, 0); _priv_pmsgUse = (Message*)msg0SetDebugIdPtr; } @@ -78,7 +78,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering blobInfo.Attach((Message*)msg1SetPropertyPtr); msg1SetPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg1SetPropertyPtr, ref RemoteEffect.s_priv_ByteOrder_Msg1_SetProperty, typeof(RemoteEffect.Msg1_SetProperty), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg1SetPropertyPtr, ref s_priv_ByteOrder_Msg1_SetProperty, typeof(RemoteEffect.Msg1_SetProperty), 0, 0); _priv_pmsgUse = (Message*)msg1SetPropertyPtr; } @@ -109,7 +109,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg2SetPropertyPtr->surface = surface != null ? surface.RenderHandle : RENDERHANDLE.NULL; msg2SetPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg2SetPropertyPtr, ref RemoteEffect.s_priv_ByteOrder_Msg2_SetProperty, typeof(RemoteEffect.Msg2_SetProperty), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg2SetPropertyPtr, ref s_priv_ByteOrder_Msg2_SetProperty, typeof(RemoteEffect.Msg2_SetProperty), 0, 0); _priv_pmsgUse = (Message*)msg2SetPropertyPtr; } @@ -138,7 +138,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg3SetPropertyPtr->vValue = vValue; msg3SetPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg3SetPropertyPtr, ref RemoteEffect.s_priv_ByteOrder_Msg3_SetProperty, typeof(RemoteEffect.Msg3_SetProperty), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg3SetPropertyPtr, ref s_priv_ByteOrder_Msg3_SetProperty, typeof(RemoteEffect.Msg3_SetProperty), 0, 0); _priv_pmsgUse = (Message*)msg3SetPropertyPtr; } @@ -167,7 +167,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg4SetPropertyPtr->vValue = vValue; msg4SetPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg4SetPropertyPtr, ref RemoteEffect.s_priv_ByteOrder_Msg4_SetProperty, typeof(RemoteEffect.Msg4_SetProperty), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg4SetPropertyPtr, ref s_priv_ByteOrder_Msg4_SetProperty, typeof(RemoteEffect.Msg4_SetProperty), 0, 0); _priv_pmsgUse = (Message*)msg4SetPropertyPtr; } @@ -196,7 +196,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg5SetPropertyPtr->vValue = vValue; msg5SetPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg5SetPropertyPtr, ref RemoteEffect.s_priv_ByteOrder_Msg5_SetProperty, typeof(RemoteEffect.Msg5_SetProperty), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg5SetPropertyPtr, ref s_priv_ByteOrder_Msg5_SetProperty, typeof(RemoteEffect.Msg5_SetProperty), 0, 0); _priv_pmsgUse = (Message*)msg5SetPropertyPtr; } @@ -225,7 +225,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg6SetPropertyPtr->flValue = flValue; msg6SetPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg6SetPropertyPtr, ref RemoteEffect.s_priv_ByteOrder_Msg6_SetProperty, typeof(RemoteEffect.Msg6_SetProperty), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg6SetPropertyPtr, ref s_priv_ByteOrder_Msg6_SetProperty, typeof(RemoteEffect.Msg6_SetProperty), 0, 0); _priv_pmsgUse = (Message*)msg6SetPropertyPtr; } @@ -254,7 +254,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg7SetPropertyPtr->nValue = nValue; msg7SetPropertyPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg7SetPropertyPtr, ref RemoteEffect.s_priv_ByteOrder_Msg7_SetProperty, typeof(RemoteEffect.Msg7_SetProperty), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg7SetPropertyPtr, ref s_priv_ByteOrder_Msg7_SetProperty, typeof(RemoteEffect.Msg7_SetProperty), 0, 0); _priv_pmsgUse = (Message*)msg7SetPropertyPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteExternalAnimationInput.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteExternalAnimationInput.cs index 0398357..8a6c829 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteExternalAnimationInput.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteExternalAnimationInput.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg0CreatePtr->nUniqueId = nUniqueId; msg0CreatePtr->_priv_idObjectSubject = externalAnimationInput.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteExternalAnimationInput.s_priv_ByteOrder_Msg0_Create, typeof(RemoteExternalAnimationInput.Msg0_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg0_Create, typeof(RemoteExternalAnimationInput.Msg0_Create), 0, 0); port.CreateRemoteObject(inputClassHandle, externalAnimationInput.m_renderHandle, (Message*)msg0CreatePtr); return externalAnimationInput; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteGradient.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteGradient.cs index 14ba804..403f523 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteGradient.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteGradient.cs @@ -33,7 +33,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg0ClearPtr->_priv_msgid = 0U; msg0ClearPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0ClearPtr, ref RemoteGradient.s_priv_ByteOrder_Msg0_Clear, typeof(RemoteGradient.Msg0_Clear), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0ClearPtr, ref s_priv_ByteOrder_Msg0_Clear, typeof(RemoteGradient.Msg0_Clear), 0, 0); _priv_pmsgUse = (Message*)msg0ClearPtr; } @@ -64,7 +64,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg1AddValuePtr->relative = relative; msg1AddValuePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg1AddValuePtr, ref RemoteGradient.s_priv_ByteOrder_Msg1_AddValue, typeof(RemoteGradient.Msg1_AddValue), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg1AddValuePtr, ref s_priv_ByteOrder_Msg1_AddValue, typeof(RemoteGradient.Msg1_AddValue), 0, 0); _priv_pmsgUse = (Message*)msg1AddValuePtr; } @@ -91,7 +91,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg2SetOffsetPtr->flOffset = flOffset; msg2SetOffsetPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg2SetOffsetPtr, ref RemoteGradient.s_priv_ByteOrder_Msg2_SetOffset, typeof(RemoteGradient.Msg2_SetOffset), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg2SetOffsetPtr, ref s_priv_ByteOrder_Msg2_SetOffset, typeof(RemoteGradient.Msg2_SetOffset), 0, 0); _priv_pmsgUse = (Message*)msg2SetOffsetPtr; } @@ -118,7 +118,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg3SetColorMaskPtr->clrMask = clrMask; msg3SetColorMaskPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg3SetColorMaskPtr, ref RemoteGradient.s_priv_ByteOrder_Msg3_SetColorMask, typeof(RemoteGradient.Msg3_SetColorMask), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg3SetColorMaskPtr, ref s_priv_ByteOrder_Msg3_SetColorMask, typeof(RemoteGradient.Msg3_SetColorMask), 0, 0); _priv_pmsgUse = (Message*)msg3SetColorMaskPtr; } @@ -145,7 +145,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg4SetOrientationPtr->dir = dir; msg4SetOrientationPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg4SetOrientationPtr, ref RemoteGradient.s_priv_ByteOrder_Msg4_SetOrientation, typeof(RemoteGradient.Msg4_SetOrientation), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg4SetOrientationPtr, ref s_priv_ByteOrder_Msg4_SetOrientation, typeof(RemoteGradient.Msg4_SetOrientation), 0, 0); _priv_pmsgUse = (Message*)msg4SetOrientationPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteNullDevice.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteNullDevice.cs index f1375d1..e2b1d62 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteNullDevice.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteNullDevice.cs @@ -35,7 +35,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg8CreatePtr->_priv_ctxcb = port.Session.LocalContext; msg8CreatePtr->_priv_idObjectSubject = remoteNullDevice.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteNullDevice.s_priv_ByteOrder_Msg8_Create, typeof(RemoteNullDevice.Msg8_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg8_Create, typeof(RemoteNullDevice.Msg8_Create), 0, 0); port.CreateRemoteObject(deviceClassHandle, remoteNullDevice.m_renderHandle, (Message*)msg8CreatePtr); return remoteNullDevice; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteRasterizer.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteRasterizer.cs index 1e2103c..acaddcc 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteRasterizer.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteRasterizer.cs @@ -44,7 +44,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg0LoadRawImagePtr->info = info; msg0LoadRawImagePtr->_priv_idObjectSubject = rasterizerClassHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0LoadRawImagePtr, ref RemoteRasterizer.s_priv_ByteOrder_Msg0_LoadRawImage, typeof(RemoteRasterizer.Msg0_LoadRawImage), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0LoadRawImagePtr, ref s_priv_ByteOrder_Msg0_LoadRawImage, typeof(RemoteRasterizer.Msg0_LoadRawImage), 0, 0); _priv_pmsgUse = (Message*)msg0LoadRawImagePtr; } @@ -56,7 +56,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering { RenderPort _priv_portUse; Message* _priv_pmsgUse; - RemoteRasterizer.BuildLoadRawImage(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, surContent, buffer, info); + BuildLoadRawImage(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, surContent, buffer, info); _priv_portUse.SendRemoteMessage(_priv_pmsgUse); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteRenderCaps.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteRenderCaps.cs index b1f060a..30dcb00 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteRenderCaps.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteRenderCaps.cs @@ -37,7 +37,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg1CreatePtr->_priv_ctxcallback = port.Session.LocalContext; msg1CreatePtr->_priv_idObjectSubject = remoteRenderCaps.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteRenderCaps.s_priv_ByteOrder_Msg1_Create, typeof(RemoteRenderCaps.Msg1_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg1_Create, typeof(RemoteRenderCaps.Msg1_Create), 0, 0); port.CreateRemoteObject(renderCapsClassHandle, remoteRenderCaps.m_renderHandle, (Message*)msg1CreatePtr); return remoteRenderCaps; } @@ -57,7 +57,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg0CheckCapsPtr->nCookie = nCookie; msg0CheckCapsPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0CheckCapsPtr, ref RemoteRenderCaps.s_priv_ByteOrder_Msg0_CheckCaps, typeof(RemoteRenderCaps.Msg0_CheckCaps), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0CheckCapsPtr, ref s_priv_ByteOrder_Msg0_CheckCaps, typeof(RemoteRenderCaps.Msg0_CheckCaps), 0, 0); _priv_pmsgUse = (Message*)msg0CheckCapsPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSound.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSound.cs index ec6c247..149c54c 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSound.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSound.cs @@ -30,7 +30,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg0StopPtr->_priv_msgid = 0U; msg0StopPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0StopPtr, ref RemoteSound.s_priv_ByteOrder_Msg0_Stop, typeof(RemoteSound.Msg0_Stop), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0StopPtr, ref s_priv_ByteOrder_Msg0_Stop, typeof(RemoteSound.Msg0_Stop), 0, 0); _priv_pmsgUse = (Message*)msg0StopPtr; } @@ -53,7 +53,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg1PlayPtr->_priv_msgid = 1U; msg1PlayPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg1PlayPtr, ref RemoteSound.s_priv_ByteOrder_Msg1_Play, typeof(RemoteSound.Msg1_Play), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg1PlayPtr, ref s_priv_ByteOrder_Msg1_Play, typeof(RemoteSound.Msg1_Play), 0, 0); _priv_pmsgUse = (Message*)msg1PlayPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSoundBuffer.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSoundBuffer.cs index fcab43e..81fc569 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSoundBuffer.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSoundBuffer.cs @@ -36,7 +36,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg0LoadSoundDataPtr->dataBuffer = dataBuffer != null ? dataBuffer.RenderHandle : RENDERHANDLE.NULL; msg0LoadSoundDataPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0LoadSoundDataPtr, ref RemoteSoundBuffer.s_priv_ByteOrder_Msg0_LoadSoundData, typeof(RemoteSoundBuffer.Msg0_LoadSoundData), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0LoadSoundDataPtr, ref s_priv_ByteOrder_Msg0_LoadSoundData, typeof(RemoteSoundBuffer.Msg0_LoadSoundData), 0, 0); _priv_pmsgUse = (Message*)msg0LoadSoundDataPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSoundDevice.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSoundDevice.cs index 3b8efa5..aee8289 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSoundDevice.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSoundDevice.cs @@ -41,7 +41,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg0CreateSoundPtr->soundBuffer = soundBuffer != null ? soundBuffer.RenderHandle : RENDERHANDLE.NULL; msg0CreateSoundPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0CreateSoundPtr, ref RemoteSoundDevice.s_priv_ByteOrder_Msg0_CreateSound, typeof(RemoteSoundDevice.Msg0_CreateSound), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0CreateSoundPtr, ref s_priv_ByteOrder_Msg0_CreateSound, typeof(RemoteSoundDevice.Msg0_CreateSound), 0, 0); _priv_pmsgUse = (Message*)msg0CreateSoundPtr; } @@ -73,7 +73,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering createSoundBufferPtr->_priv_ctxcb = _priv_portUse.Session.LocalContext; createSoundBufferPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)createSoundBufferPtr, ref RemoteSoundDevice.s_priv_ByteOrder_Msg1_CreateSoundBuffer, typeof(RemoteSoundDevice.Msg1_CreateSoundBuffer), 0, 0); + MarshalHelper.SwapByteOrder((byte*)createSoundBufferPtr, ref s_priv_ByteOrder_Msg1_CreateSoundBuffer, typeof(RemoteSoundDevice.Msg1_CreateSoundBuffer), 0, 0); _priv_pmsgUse = (Message*)createSoundBufferPtr; } @@ -101,7 +101,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering externalResourcesPtr->_priv_msgid = 2U; externalResourcesPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)externalResourcesPtr, ref RemoteSoundDevice.s_priv_ByteOrder_Msg2_EvictExternalResources, typeof(RemoteSoundDevice.Msg2_EvictExternalResources), 0, 0); + MarshalHelper.SwapByteOrder((byte*)externalResourcesPtr, ref s_priv_ByteOrder_Msg2_EvictExternalResources, typeof(RemoteSoundDevice.Msg2_EvictExternalResources), 0, 0); _priv_pmsgUse = (Message*)externalResourcesPtr; } @@ -126,7 +126,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering externalResourcesPtr->_priv_msgid = 3U; externalResourcesPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)externalResourcesPtr, ref RemoteSoundDevice.s_priv_ByteOrder_Msg3_CreateExternalResources, typeof(RemoteSoundDevice.Msg3_CreateExternalResources), 0, 0); + MarshalHelper.SwapByteOrder((byte*)externalResourcesPtr, ref s_priv_ByteOrder_Msg3_CreateExternalResources, typeof(RemoteSoundDevice.Msg3_CreateExternalResources), 0, 0); _priv_pmsgUse = (Message*)externalResourcesPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSprite.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSprite.cs index a0ea306..ca3865d 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSprite.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSprite.cs @@ -42,7 +42,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg18SetNineGridPtr->nBottom = nBottom; msg18SetNineGridPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg18SetNineGridPtr, ref RemoteSprite.s_priv_ByteOrder_Msg18_SetNineGrid, typeof(RemoteSprite.Msg18_SetNineGrid), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg18SetNineGridPtr, ref s_priv_ByteOrder_Msg18_SetNineGrid, typeof(RemoteSprite.Msg18_SetNineGrid), 0, 0); _priv_pmsgUse = (Message*)msg18SetNineGridPtr; } @@ -75,7 +75,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering addCoordMapEntryPtr->flValue = flValue; addCoordMapEntryPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)addCoordMapEntryPtr, ref RemoteSprite.s_priv_ByteOrder_Msg19_AddCoordMapEntry, typeof(RemoteSprite.Msg19_AddCoordMapEntry), 0, 0); + MarshalHelper.SwapByteOrder((byte*)addCoordMapEntryPtr, ref s_priv_ByteOrder_Msg19_AddCoordMapEntry, typeof(RemoteSprite.Msg19_AddCoordMapEntry), 0, 0); _priv_pmsgUse = (Message*)addCoordMapEntryPtr; } @@ -102,7 +102,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg20ClearCoordMapsPtr->_priv_msgid = 20U; msg20ClearCoordMapsPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg20ClearCoordMapsPtr, ref RemoteSprite.s_priv_ByteOrder_Msg20_ClearCoordMaps, typeof(RemoteSprite.Msg20_ClearCoordMaps), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg20ClearCoordMapsPtr, ref s_priv_ByteOrder_Msg20_ClearCoordMaps, typeof(RemoteSprite.Msg20_ClearCoordMaps), 0, 0); _priv_pmsgUse = (Message*)msg20ClearCoordMapsPtr; } @@ -131,7 +131,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg21SetEffectPtr->effect = effect != null ? effect.RenderHandle : RENDERHANDLE.NULL; msg21SetEffectPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg21SetEffectPtr, ref RemoteSprite.s_priv_ByteOrder_Msg21_SetEffect, typeof(RemoteSprite.Msg21_SetEffect), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg21SetEffectPtr, ref s_priv_ByteOrder_Msg21_SetEffect, typeof(RemoteSprite.Msg21_SetEffect), 0, 0); _priv_pmsgUse = (Message*)msg21SetEffectPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSurface.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSurface.cs index a11d0c4..94f9d3e 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSurface.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSurface.cs @@ -42,7 +42,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg0RemapContainerPtr->poolNewContainer = poolNewContainer != null ? poolNewContainer.RenderHandle : RENDERHANDLE.NULL; msg0RemapContainerPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0RemapContainerPtr, ref RemoteSurface.s_priv_ByteOrder_Msg0_RemapContainer, typeof(RemoteSurface.Msg0_RemapContainer), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0RemapContainerPtr, ref s_priv_ByteOrder_Msg0_RemapContainer, typeof(RemoteSurface.Msg0_RemapContainer), 0, 0); _priv_pmsgUse = (Message*)msg0RemapContainerPtr; } @@ -69,7 +69,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg1RemapLocationPtr->rcContentPxl = rcContentPxl; msg1RemapLocationPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg1RemapLocationPtr, ref RemoteSurface.s_priv_ByteOrder_Msg1_RemapLocation, typeof(RemoteSurface.Msg1_RemapLocation), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg1RemapLocationPtr, ref s_priv_ByteOrder_Msg1_RemapLocation, typeof(RemoteSurface.Msg1_RemapLocation), 0, 0); _priv_pmsgUse = (Message*)msg1RemapLocationPtr; } @@ -94,7 +94,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering markContentValidPtr->_priv_msgid = 2U; markContentValidPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)markContentValidPtr, ref RemoteSurface.s_priv_ByteOrder_Msg2_MarkContentValid, typeof(RemoteSurface.Msg2_MarkContentValid), 0, 0); + MarshalHelper.SwapByteOrder((byte*)markContentValidPtr, ref s_priv_ByteOrder_Msg2_MarkContentValid, typeof(RemoteSurface.Msg2_MarkContentValid), 0, 0); _priv_pmsgUse = (Message*)markContentValidPtr; } @@ -117,7 +117,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg3ClearPtr->_priv_msgid = 3U; msg3ClearPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg3ClearPtr, ref RemoteSurface.s_priv_ByteOrder_Msg3_Clear, typeof(RemoteSurface.Msg3_Clear), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg3ClearPtr, ref s_priv_ByteOrder_Msg3_Clear, typeof(RemoteSurface.Msg3_Clear), 0, 0); _priv_pmsgUse = (Message*)msg3ClearPtr; } @@ -144,7 +144,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg5SetGutterPtr->sizeGutter = sizeGutter; msg5SetGutterPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg5SetGutterPtr, ref RemoteSurface.s_priv_ByteOrder_Msg5_SetGutter, typeof(RemoteSurface.Msg5_SetGutter), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg5SetGutterPtr, ref s_priv_ByteOrder_Msg5_SetGutter, typeof(RemoteSurface.Msg5_SetGutter), 0, 0); _priv_pmsgUse = (Message*)msg5SetGutterPtr; } @@ -174,7 +174,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering blobInfo.Attach((Message*)msg6SetDescriptionPtr); msg6SetDescriptionPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg6SetDescriptionPtr, ref RemoteSurface.s_priv_ByteOrder_Msg6_SetDescription, typeof(RemoteSurface.Msg6_SetDescription), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg6SetDescriptionPtr, ref s_priv_ByteOrder_Msg6_SetDescription, typeof(RemoteSurface.Msg6_SetDescription), 0, 0); _priv_pmsgUse = (Message*)msg6SetDescriptionPtr; } @@ -201,7 +201,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg7SetRotationPtr->fRotated = fRotated ? uint.MaxValue : 0U; msg7SetRotationPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg7SetRotationPtr, ref RemoteSurface.s_priv_ByteOrder_Msg7_SetRotation, typeof(RemoteSurface.Msg7_SetRotation), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg7SetRotationPtr, ref s_priv_ByteOrder_Msg7_SetRotation, typeof(RemoteSurface.Msg7_SetRotation), 0, 0); _priv_pmsgUse = (Message*)msg7SetRotationPtr; } @@ -228,7 +228,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg8SetStorageSizePtr->sizeStoragePxl = sizeStoragePxl; msg8SetStorageSizePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg8SetStorageSizePtr, ref RemoteSurface.s_priv_ByteOrder_Msg8_SetStorageSize, typeof(RemoteSurface.Msg8_SetStorageSize), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg8SetStorageSizePtr, ref s_priv_ByteOrder_Msg8_SetStorageSize, typeof(RemoteSurface.Msg8_SetStorageSize), 0, 0); _priv_pmsgUse = (Message*)msg8SetStorageSizePtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSurfacePool.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSurfacePool.cs index 49c2d28..f9808fd 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSurfacePool.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteSurfacePool.cs @@ -39,7 +39,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg0SetEffectPtr->effect = effect != null ? effect.RenderHandle : RENDERHANDLE.NULL; msg0SetEffectPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0SetEffectPtr, ref RemoteSurfacePool.s_priv_ByteOrder_Msg0_SetEffect, typeof(RemoteSurfacePool.Msg0_SetEffect), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0SetEffectPtr, ref s_priv_ByteOrder_Msg0_SetEffect, typeof(RemoteSurfacePool.Msg0_SetEffect), 0, 0); _priv_pmsgUse = (Message*)msg0SetEffectPtr; } @@ -66,7 +66,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg1CreateSurfacePtr->idNewSurface = idNewSurface; msg1CreateSurfacePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg1CreateSurfacePtr, ref RemoteSurfacePool.s_priv_ByteOrder_Msg1_CreateSurface, typeof(RemoteSurfacePool.Msg1_CreateSurface), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg1CreateSurfacePtr, ref s_priv_ByteOrder_Msg1_CreateSurface, typeof(RemoteSurfacePool.Msg1_CreateSurface), 0, 0); _priv_pmsgUse = (Message*)msg1CreateSurfacePtr; } @@ -89,7 +89,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg2FreePtr->_priv_msgid = 2U; msg2FreePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg2FreePtr, ref RemoteSurfacePool.s_priv_ByteOrder_Msg2_Free, typeof(RemoteSurfacePool.Msg2_Free), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg2FreePtr, ref s_priv_ByteOrder_Msg2_Free, typeof(RemoteSurfacePool.Msg2_Free), 0, 0); _priv_pmsgUse = (Message*)msg2FreePtr; } @@ -116,7 +116,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg3AllocatePtr->sizePxl = sizePxl; msg3AllocatePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg3AllocatePtr, ref RemoteSurfacePool.s_priv_ByteOrder_Msg3_Allocate, typeof(RemoteSurfacePool.Msg3_Allocate), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg3AllocatePtr, ref s_priv_ByteOrder_Msg3_Allocate, typeof(RemoteSurfacePool.Msg3_Allocate), 0, 0); _priv_pmsgUse = (Message*)msg3AllocatePtr; } @@ -143,7 +143,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg4SetPriorityPtr->nPriority = nPriority; msg4SetPriorityPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg4SetPriorityPtr, ref RemoteSurfacePool.s_priv_ByteOrder_Msg4_SetPriority, typeof(RemoteSurfacePool.Msg4_SetPriority), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg4SetPriorityPtr, ref s_priv_ByteOrder_Msg4_SetPriority, typeof(RemoteSurfacePool.Msg4_SetPriority), 0, 0); _priv_pmsgUse = (Message*)msg4SetPriorityPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVideoPool.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVideoPool.cs index bcc2e71..45f296b 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVideoPool.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVideoPool.cs @@ -42,7 +42,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering videoInputChangedPtr->sizeAspectRatio = sizeAspectRatio; videoInputChangedPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)videoInputChangedPtr, ref RemoteVideoPool.s_priv_ByteOrder_Msg6_NotifyVideoInputChanged, typeof(RemoteVideoPool.Msg6_NotifyVideoInputChanged), 0, 0); + MarshalHelper.SwapByteOrder((byte*)videoInputChangedPtr, ref s_priv_ByteOrder_Msg6_NotifyVideoInputChanged, typeof(RemoteVideoPool.Msg6_NotifyVideoInputChanged), 0, 0); _priv_pmsgUse = (Message*)videoInputChangedPtr; } @@ -69,7 +69,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering setContentOverscanPtr->flContentOverscan = flContentOverscan; setContentOverscanPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setContentOverscanPtr, ref RemoteVideoPool.s_priv_ByteOrder_Msg7_SetContentOverscan, typeof(RemoteVideoPool.Msg7_SetContentOverscan), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setContentOverscanPtr, ref s_priv_ByteOrder_Msg7_SetContentOverscan, typeof(RemoteVideoPool.Msg7_SetContentOverscan), 0, 0); _priv_pmsgUse = (Message*)setContentOverscanPtr; } @@ -96,7 +96,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering videoSizeChangedPtr->sizeTargetPxl = sizeTargetPxl; videoSizeChangedPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)videoSizeChangedPtr, ref RemoteVideoPool.s_priv_ByteOrder_Msg8_NotifyVideoSizeChanged, typeof(RemoteVideoPool.Msg8_NotifyVideoSizeChanged), 0, 0); + MarshalHelper.SwapByteOrder((byte*)videoSizeChangedPtr, ref s_priv_ByteOrder_Msg8_NotifyVideoSizeChanged, typeof(RemoteVideoPool.Msg8_NotifyVideoSizeChanged), 0, 0); _priv_pmsgUse = (Message*)videoSizeChangedPtr; } @@ -131,7 +131,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg10OnFrameReadyPtr->nOptions = nOptions; msg10OnFrameReadyPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg10OnFrameReadyPtr, ref RemoteVideoPool.s_priv_ByteOrder_Msg10_OnFrameReady, typeof(RemoteVideoPool.Msg10_OnFrameReady), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg10OnFrameReadyPtr, ref s_priv_ByteOrder_Msg10_OnFrameReady, typeof(RemoteVideoPool.Msg10_OnFrameReady), 0, 0); _priv_pmsgUse = (Message*)msg10OnFrameReadyPtr; } @@ -159,7 +159,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg11OnClockStopPtr->_priv_msgid = 11U; msg11OnClockStopPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg11OnClockStopPtr, ref RemoteVideoPool.s_priv_ByteOrder_Msg11_OnClockStop, typeof(RemoteVideoPool.Msg11_OnClockStop), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg11OnClockStopPtr, ref s_priv_ByteOrder_Msg11_OnClockStop, typeof(RemoteVideoPool.Msg11_OnClockStop), 0, 0); _priv_pmsgUse = (Message*)msg11OnClockStopPtr; } @@ -194,7 +194,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg12OnClockStartPtr->sizeAspectRatio = sizeAspectRatio; msg12OnClockStartPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg12OnClockStartPtr, ref RemoteVideoPool.s_priv_ByteOrder_Msg12_OnClockStart, typeof(RemoteVideoPool.Msg12_OnClockStart), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg12OnClockStartPtr, ref s_priv_ByteOrder_Msg12_OnClockStart, typeof(RemoteVideoPool.Msg12_OnClockStart), 0, 0); _priv_pmsgUse = (Message*)msg12OnClockStartPtr; } @@ -222,7 +222,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg13OnDisconnectPtr->_priv_msgid = 13U; msg13OnDisconnectPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg13OnDisconnectPtr, ref RemoteVideoPool.s_priv_ByteOrder_Msg13_OnDisconnect, typeof(RemoteVideoPool.Msg13_OnDisconnect), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg13OnDisconnectPtr, ref s_priv_ByteOrder_Msg13_OnDisconnect, typeof(RemoteVideoPool.Msg13_OnDisconnect), 0, 0); _priv_pmsgUse = (Message*)msg13OnDisconnectPtr; } @@ -245,7 +245,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg14OnConnectPtr->_priv_msgid = 14U; msg14OnConnectPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg14OnConnectPtr, ref RemoteVideoPool.s_priv_ByteOrder_Msg14_OnConnect, typeof(RemoteVideoPool.Msg14_OnConnect), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg14OnConnectPtr, ref s_priv_ByteOrder_Msg14_OnConnect, typeof(RemoteVideoPool.Msg14_OnConnect), 0, 0); _priv_pmsgUse = (Message*)msg14OnConnectPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVisual.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVisual.cs index a3bd1a5..7995a40 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVisual.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVisual.cs @@ -44,7 +44,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg0ClearGradientsPtr->_priv_msgid = 0U; msg0ClearGradientsPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0ClearGradientsPtr, ref RemoteVisual.s_priv_ByteOrder_Msg0_ClearGradients, typeof(RemoteVisual.Msg0_ClearGradients), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0ClearGradientsPtr, ref s_priv_ByteOrder_Msg0_ClearGradients, typeof(RemoteVisual.Msg0_ClearGradients), 0, 0); _priv_pmsgUse = (Message*)msg0ClearGradientsPtr; } @@ -73,7 +73,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg1AddGradientPtr->grad = grad != null ? grad.RenderHandle : RENDERHANDLE.NULL; msg1AddGradientPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg1AddGradientPtr, ref RemoteVisual.s_priv_ByteOrder_Msg1_AddGradient, typeof(RemoteVisual.Msg1_AddGradient), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg1AddGradientPtr, ref s_priv_ByteOrder_Msg1_AddGradient, typeof(RemoteVisual.Msg1_AddGradient), 0, 0); _priv_pmsgUse = (Message*)msg1AddGradientPtr; } @@ -100,7 +100,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg2SetRelativeSizePtr->fRelative = fRelative ? uint.MaxValue : 0U; msg2SetRelativeSizePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg2SetRelativeSizePtr, ref RemoteVisual.s_priv_ByteOrder_Msg2_SetRelativeSize, typeof(RemoteVisual.Msg2_SetRelativeSize), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg2SetRelativeSizePtr, ref s_priv_ByteOrder_Msg2_SetRelativeSize, typeof(RemoteVisual.Msg2_SetRelativeSize), 0, 0); _priv_pmsgUse = (Message*)msg2SetRelativeSizePtr; } @@ -123,7 +123,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg3ResetPtr->_priv_msgid = 3U; msg3ResetPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg3ResetPtr, ref RemoteVisual.s_priv_ByteOrder_Msg3_Reset, typeof(RemoteVisual.Msg3_Reset), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg3ResetPtr, ref s_priv_ByteOrder_Msg3_Reset, typeof(RemoteVisual.Msg3_Reset), 0, 0); _priv_pmsgUse = (Message*)msg3ResetPtr; } @@ -152,7 +152,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg4ChangeDataBitsPtr->nMask = nMask; msg4ChangeDataBitsPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg4ChangeDataBitsPtr, ref RemoteVisual.s_priv_ByteOrder_Msg4_ChangeDataBits, typeof(RemoteVisual.Msg4_ChangeDataBits), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg4ChangeDataBitsPtr, ref s_priv_ByteOrder_Msg4_ChangeDataBits, typeof(RemoteVisual.Msg4_ChangeDataBits), 0, 0); _priv_pmsgUse = (Message*)msg4ChangeDataBitsPtr; } @@ -187,7 +187,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg5ChangeParentPtr->nOrder = nOrder; msg5ChangeParentPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg5ChangeParentPtr, ref RemoteVisual.s_priv_ByteOrder_Msg5_ChangeParent, typeof(RemoteVisual.Msg5_ChangeParent), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg5ChangeParentPtr, ref s_priv_ByteOrder_Msg5_ChangeParent, typeof(RemoteVisual.Msg5_ChangeParent), 0, 0); _priv_pmsgUse = (Message*)msg5ChangeParentPtr; } @@ -217,7 +217,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering debugOutlineColorPtr->clr = clr; debugOutlineColorPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)debugOutlineColorPtr, ref RemoteVisual.s_priv_ByteOrder_Msg6_SetDebugOutlineColor, typeof(RemoteVisual.Msg6_SetDebugOutlineColor), 0, 0); + MarshalHelper.SwapByteOrder((byte*)debugOutlineColorPtr, ref s_priv_ByteOrder_Msg6_SetDebugOutlineColor, typeof(RemoteVisual.Msg6_SetDebugOutlineColor), 0, 0); _priv_pmsgUse = (Message*)debugOutlineColorPtr; } @@ -247,7 +247,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering blobInfo.Attach((Message*)msg7SetDebugIdPtr); msg7SetDebugIdPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg7SetDebugIdPtr, ref RemoteVisual.s_priv_ByteOrder_Msg7_SetDebugID, typeof(RemoteVisual.Msg7_SetDebugID), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg7SetDebugIdPtr, ref s_priv_ByteOrder_Msg7_SetDebugID, typeof(RemoteVisual.Msg7_SetDebugID), 0, 0); _priv_pmsgUse = (Message*)msg7SetDebugIdPtr; } @@ -274,7 +274,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg8SetAlphaPtr->fAlpha = fAlpha; msg8SetAlphaPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg8SetAlphaPtr, ref RemoteVisual.s_priv_ByteOrder_Msg8_SetAlpha, typeof(RemoteVisual.Msg8_SetAlpha), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg8SetAlphaPtr, ref s_priv_ByteOrder_Msg8_SetAlpha, typeof(RemoteVisual.Msg8_SetAlpha), 0, 0); _priv_pmsgUse = (Message*)msg8SetAlphaPtr; } @@ -301,7 +301,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg9SetLayerPtr->layer = layer; msg9SetLayerPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg9SetLayerPtr, ref RemoteVisual.s_priv_ByteOrder_Msg9_SetLayer, typeof(RemoteVisual.Msg9_SetLayer), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg9SetLayerPtr, ref s_priv_ByteOrder_Msg9_SetLayer, typeof(RemoteVisual.Msg9_SetLayer), 0, 0); _priv_pmsgUse = (Message*)msg9SetLayerPtr; } @@ -328,7 +328,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg10SetRotationPtr->aaRotation = aaRotation; msg10SetRotationPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg10SetRotationPtr, ref RemoteVisual.s_priv_ByteOrder_Msg10_SetRotation, typeof(RemoteVisual.Msg10_SetRotation), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg10SetRotationPtr, ref s_priv_ByteOrder_Msg10_SetRotation, typeof(RemoteVisual.Msg10_SetRotation), 0, 0); _priv_pmsgUse = (Message*)msg10SetRotationPtr; } @@ -355,7 +355,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering centerPointScalePtr->vCenterPointScale = vCenterPointScale; centerPointScalePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)centerPointScalePtr, ref RemoteVisual.s_priv_ByteOrder_Msg11_SetCenterPointScale, typeof(RemoteVisual.Msg11_SetCenterPointScale), 0, 0); + MarshalHelper.SwapByteOrder((byte*)centerPointScalePtr, ref s_priv_ByteOrder_Msg11_SetCenterPointScale, typeof(RemoteVisual.Msg11_SetCenterPointScale), 0, 0); _priv_pmsgUse = (Message*)centerPointScalePtr; } @@ -382,7 +382,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg12SetScalePtr->vScale = vScale; msg12SetScalePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg12SetScalePtr, ref RemoteVisual.s_priv_ByteOrder_Msg12_SetScale, typeof(RemoteVisual.Msg12_SetScale), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg12SetScalePtr, ref s_priv_ByteOrder_Msg12_SetScale, typeof(RemoteVisual.Msg12_SetScale), 0, 0); _priv_pmsgUse = (Message*)msg12SetScalePtr; } @@ -409,7 +409,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg13SetSizePtr->vSizePxl = vSizePxl; msg13SetSizePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg13SetSizePtr, ref RemoteVisual.s_priv_ByteOrder_Msg13_SetSize, typeof(RemoteVisual.Msg13_SetSize), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg13SetSizePtr, ref s_priv_ByteOrder_Msg13_SetSize, typeof(RemoteVisual.Msg13_SetSize), 0, 0); _priv_pmsgUse = (Message*)msg13SetSizePtr; } @@ -436,7 +436,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg14SetPositionPtr->vPositionPxl = vPositionPxl; msg14SetPositionPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg14SetPositionPtr, ref RemoteVisual.s_priv_ByteOrder_Msg14_SetPosition, typeof(RemoteVisual.Msg14_SetPosition), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg14SetPositionPtr, ref s_priv_ByteOrder_Msg14_SetPosition, typeof(RemoteVisual.Msg14_SetPosition), 0, 0); _priv_pmsgUse = (Message*)msg14SetPositionPtr; } @@ -463,7 +463,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg16SetVisiblePtr->fVisible = fVisible ? uint.MaxValue : 0U; msg16SetVisiblePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg16SetVisiblePtr, ref RemoteVisual.s_priv_ByteOrder_Msg16_SetVisible, typeof(RemoteVisual.Msg16_SetVisible), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg16SetVisiblePtr, ref s_priv_ByteOrder_Msg16_SetVisible, typeof(RemoteVisual.Msg16_SetVisible), 0, 0); _priv_pmsgUse = (Message*)msg16SetVisiblePtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVisualContainer.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVisualContainer.cs index 39ff480..85e078e 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVisualContainer.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteVisualContainer.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg19CreatePtr->_priv_msgid = 19U; msg19CreatePtr->_priv_idObjectSubject = remoteVisualContainer.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteVisualContainer.s_priv_ByteOrder_Msg19_Create, typeof(RemoteVisualContainer.Msg19_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg19_Create, typeof(RemoteVisualContainer.Msg19_Create), 0, 0); port.CreateRemoteObject(containerClassHandle, remoteVisualContainer.m_renderHandle, (Message*)msg19CreatePtr); return remoteVisualContainer; } @@ -56,7 +56,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg18SetCameraPtr->camera = camera != null ? camera.RenderHandle : RENDERHANDLE.NULL; msg18SetCameraPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg18SetCameraPtr, ref RemoteVisualContainer.s_priv_ByteOrder_Msg18_SetCamera, typeof(RemoteVisualContainer.Msg18_SetCamera), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg18SetCameraPtr, ref s_priv_ByteOrder_Msg18_SetCamera, typeof(RemoteVisualContainer.Msg18_SetCamera), 0, 0); _priv_pmsgUse = (Message*)msg18SetCameraPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteWaitCursor.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteWaitCursor.cs index 85fedbb..a1c5fa1 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteWaitCursor.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteWaitCursor.cs @@ -38,7 +38,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg5CreatePtr->_priv_msgid = 5U; msg5CreatePtr->_priv_idObjectSubject = remoteWaitCursor.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteWaitCursor.s_priv_ByteOrder_Msg5_Create, typeof(RemoteWaitCursor.Msg5_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg5_Create, typeof(RemoteWaitCursor.Msg5_Create), 0, 0); port.CreateRemoteObject(cursorClassHandle, remoteWaitCursor.m_renderHandle, (Message*)msg5CreatePtr); return remoteWaitCursor; } @@ -54,7 +54,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg0ShowPtr->_priv_msgid = 0U; msg0ShowPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg0ShowPtr, ref RemoteWaitCursor.s_priv_ByteOrder_Msg0_Show, typeof(RemoteWaitCursor.Msg0_Show), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg0ShowPtr, ref s_priv_ByteOrder_Msg0_Show, typeof(RemoteWaitCursor.Msg0_Show), 0, 0); _priv_pmsgUse = (Message*)msg0ShowPtr; } @@ -77,7 +77,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg1HidePtr->_priv_msgid = 1U; msg1HidePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg1HidePtr, ref RemoteWaitCursor.s_priv_ByteOrder_Msg1_Hide, typeof(RemoteWaitCursor.Msg1_Hide), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg1HidePtr, ref s_priv_ByteOrder_Msg1_Hide, typeof(RemoteWaitCursor.Msg1_Hide), 0, 0); _priv_pmsgUse = (Message*)msg1HidePtr; } @@ -110,7 +110,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering blobInfo.Attach((Message*)msg2SetVisualsPtr); msg2SetVisualsPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg2SetVisualsPtr, ref RemoteWaitCursor.s_priv_ByteOrder_Msg2_SetVisuals, typeof(RemoteWaitCursor.Msg2_SetVisuals), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg2SetVisualsPtr, ref s_priv_ByteOrder_Msg2_SetVisuals, typeof(RemoteWaitCursor.Msg2_SetVisuals), 0, 0); _priv_pmsgUse = (Message*)msg2SetVisualsPtr; } @@ -143,7 +143,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering blobInfo.Attach((Message*)setShowAnimationsPtr); setShowAnimationsPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setShowAnimationsPtr, ref RemoteWaitCursor.s_priv_ByteOrder_Msg3_SetShowAnimations, typeof(RemoteWaitCursor.Msg3_SetShowAnimations), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setShowAnimationsPtr, ref s_priv_ByteOrder_Msg3_SetShowAnimations, typeof(RemoteWaitCursor.Msg3_SetShowAnimations), 0, 0); _priv_pmsgUse = (Message*)setShowAnimationsPtr; } @@ -176,7 +176,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering blobInfo.Attach((Message*)setHideAnimationsPtr); setHideAnimationsPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setHideAnimationsPtr, ref RemoteWaitCursor.s_priv_ByteOrder_Msg4_SetHideAnimations, typeof(RemoteWaitCursor.Msg4_SetHideAnimations), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setHideAnimationsPtr, ref s_priv_ByteOrder_Msg4_SetHideAnimations, typeof(RemoteWaitCursor.Msg4_SetHideAnimations), 0, 0); _priv_pmsgUse = (Message*)setHideAnimationsPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteWindow.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteWindow.cs index b67f825..6ab3f41 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteWindow.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/RemoteWindow.cs @@ -37,7 +37,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering setBackgroundColorPtr->clrBack = clrBack; setBackgroundColorPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setBackgroundColorPtr, ref RemoteWindow.s_priv_ByteOrder_Msg0_SetBackgroundColor, typeof(RemoteWindow.Msg0_SetBackgroundColor), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setBackgroundColorPtr, ref s_priv_ByteOrder_Msg0_SetBackgroundColor, typeof(RemoteWindow.Msg0_SetBackgroundColor), 0, 0); _priv_pmsgUse = (Message*)setBackgroundColorPtr; } @@ -64,7 +64,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering outlineMarkedColorPtr->clr = clr; outlineMarkedColorPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)outlineMarkedColorPtr, ref RemoteWindow.s_priv_ByteOrder_Msg1_SetOutlineMarkedColor, typeof(RemoteWindow.Msg1_SetOutlineMarkedColor), 0, 0); + MarshalHelper.SwapByteOrder((byte*)outlineMarkedColorPtr, ref s_priv_ByteOrder_Msg1_SetOutlineMarkedColor, typeof(RemoteWindow.Msg1_SetOutlineMarkedColor), 0, 0); _priv_pmsgUse = (Message*)outlineMarkedColorPtr; } @@ -91,7 +91,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering setOutlineAllColorPtr->clr = clr; setOutlineAllColorPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setOutlineAllColorPtr, ref RemoteWindow.s_priv_ByteOrder_Msg2_SetOutlineAllColor, typeof(RemoteWindow.Msg2_SetOutlineAllColor), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setOutlineAllColorPtr, ref s_priv_ByteOrder_Msg2_SetOutlineAllColor, typeof(RemoteWindow.Msg2_SetOutlineAllColor), 0, 0); _priv_pmsgUse = (Message*)setOutlineAllColorPtr; } @@ -120,7 +120,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg3ChangeDataBitsPtr->nMask = nMask; msg3ChangeDataBitsPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg3ChangeDataBitsPtr, ref RemoteWindow.s_priv_ByteOrder_Msg3_ChangeDataBits, typeof(RemoteWindow.Msg3_ChangeDataBits), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg3ChangeDataBitsPtr, ref s_priv_ByteOrder_Msg3_ChangeDataBits, typeof(RemoteWindow.Msg3_ChangeDataBits), 0, 0); _priv_pmsgUse = (Message*)msg3ChangeDataBitsPtr; } @@ -149,7 +149,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering msg5SetRootPtr->visRoot = visRoot != null ? visRoot.RenderHandle : RENDERHANDLE.NULL; msg5SetRootPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg5SetRootPtr, ref RemoteWindow.s_priv_ByteOrder_Msg5_SetRoot, typeof(RemoteWindow.Msg5_SetRoot), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg5SetRootPtr, ref s_priv_ByteOrder_Msg5_SetRoot, typeof(RemoteWindow.Msg5_SetRoot), 0, 0); _priv_pmsgUse = (Message*)msg5SetRootPtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/ProtocolSplashRenderingXenon.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/ProtocolSplashRenderingXenon.cs index 5aa7557..7178273 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/ProtocolSplashRenderingXenon.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/ProtocolSplashRenderingXenon.cs @@ -26,7 +26,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Xenon return splashRenderingXenon; } ProtocolSplashRenderingXenon splashRenderingXenon1 = new ProtocolSplashRenderingXenon(port); - port.BindProtocol((ProtocolInstance)splashRenderingXenon1); + port.BindProtocol(splashRenderingXenon1); return splashRenderingXenon1; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/RemoteXAudSoundDevice.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/RemoteXAudSoundDevice.cs index e0b62b2..69e9b50 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/RemoteXAudSoundDevice.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/RemoteXAudSoundDevice.cs @@ -35,7 +35,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Xenon msg6CreatePtr->_priv_msgid = 6U; msg6CreatePtr->_priv_idObjectSubject = remoteXaudSoundDevice.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteXAudSoundDevice.s_priv_ByteOrder_Msg6_Create, typeof(RemoteXAudSoundDevice.Msg6_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg6_Create, typeof(RemoteXAudSoundDevice.Msg6_Create), 0, 0); port.CreateRemoteObject(deviceClassHandle, remoteXaudSoundDevice.m_renderHandle, (Message*)msg6CreatePtr); return remoteXaudSoundDevice; } @@ -55,7 +55,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Xenon msg4SetMutePtr->fMuted = fMuted ? uint.MaxValue : 0U; msg4SetMutePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg4SetMutePtr, ref RemoteXAudSoundDevice.s_priv_ByteOrder_Msg4_SetMute, typeof(RemoteXAudSoundDevice.Msg4_SetMute), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg4SetMutePtr, ref s_priv_ByteOrder_Msg4_SetMute, typeof(RemoteXAudSoundDevice.Msg4_SetMute), 0, 0); _priv_pmsgUse = (Message*)msg4SetMutePtr; } @@ -82,7 +82,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Xenon msg5SetVolumePtr->flVolume = flVolume; msg5SetVolumePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)msg5SetVolumePtr, ref RemoteXAudSoundDevice.s_priv_ByteOrder_Msg5_SetVolume, typeof(RemoteXAudSoundDevice.Msg5_SetVolume), 0, 0); + MarshalHelper.SwapByteOrder((byte*)msg5SetVolumePtr, ref s_priv_ByteOrder_Msg5_SetVolume, typeof(RemoteXAudSoundDevice.Msg5_SetVolume), 0, 0); _priv_pmsgUse = (Message*)msg5SetVolumePtr; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/RemoteXeDevice.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/RemoteXeDevice.cs index b5990d8..1a375ce 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/RemoteXeDevice.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Protocols/Splash/Rendering/Xenon/RemoteXeDevice.cs @@ -37,7 +37,7 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering.Xenon msg11CreatePtr->sizeScreenPxl = sizeScreenPxl; msg11CreatePtr->_priv_idObjectSubject = remoteXeDevice.m_renderHandle; if (port.ForeignByteOrder) - MarshalHelper.SwapByteOrder(pMem, ref RemoteXeDevice.s_priv_ByteOrder_Msg11_Create, typeof(RemoteXeDevice.Msg11_Create), 0, 0); + MarshalHelper.SwapByteOrder(pMem, ref s_priv_ByteOrder_Msg11_Create, typeof(RemoteXeDevice.Msg11_Create), 0, 0); port.CreateRemoteObject(deviceClassHandle, remoteXeDevice.m_renderHandle, (Message*)msg11CreatePtr); return remoteXeDevice; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Quaternion.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Quaternion.cs index 11b9988..c045b91 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Quaternion.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Quaternion.cs @@ -30,8 +30,8 @@ namespace Microsoft.Iris.Render public Quaternion(Vector3 vAxis, float flAngle) { vAxis.Normalize(); - float num1 = (float)Math.Sin(0.5 * (double)flAngle); - float num2 = (float)Math.Cos(0.5 * (double)flAngle); + float num1 = (float)Math.Sin(0.5 * flAngle); + float num2 = (float)Math.Cos(0.5 * flAngle); this.m_x = vAxis.X * num1; this.m_y = vAxis.Y * num1; this.m_z = vAxis.Z * num1; @@ -67,14 +67,14 @@ namespace Microsoft.Iris.Render set => this.m_w = value; } - public bool IsIdentity => object.Equals((object)this, (object)Quaternion.Identity); + public bool IsIdentity => Equals(this, Identity); public static Quaternion operator *(Quaternion q1, Quaternion q2) => new Quaternion() { - m_x = (float)((double)q2.m_w * (double)q1.m_x + (double)q2.m_x * (double)q1.m_w + (double)q2.m_y * (double)q1.m_z - (double)q2.m_z * (double)q1.m_y), - m_y = (float)((double)q2.m_w * (double)q1.m_y - (double)q2.m_x * (double)q1.m_z + (double)q2.m_y * (double)q1.m_w + (double)q2.m_z * (double)q1.m_x), - m_z = (float)((double)q2.m_w * (double)q1.m_z + (double)q2.m_x * (double)q1.m_y - (double)q2.m_y * (double)q1.m_x + (double)q2.m_z * (double)q1.m_w), - m_w = (float)((double)q2.m_w * (double)q1.m_w - (double)q2.m_x * (double)q1.m_x - (double)q2.m_y * (double)q1.m_y - (double)q2.m_z * (double)q1.m_z) + m_x = (float)(q2.m_w * (double)q1.m_x + q2.m_x * (double)q1.m_w + q2.m_y * (double)q1.m_z - q2.m_z * (double)q1.m_y), + m_y = (float)(q2.m_w * (double)q1.m_y - q2.m_x * (double)q1.m_z + q2.m_y * (double)q1.m_w + q2.m_z * (double)q1.m_x), + m_z = (float)(q2.m_w * (double)q1.m_z + q2.m_x * (double)q1.m_y - q2.m_y * (double)q1.m_x + q2.m_z * (double)q1.m_w), + m_w = (float)(q2.m_w * (double)q1.m_w - q2.m_x * (double)q1.m_x - q2.m_y * (double)q1.m_y - q2.m_z * (double)q1.m_z) }; public static Quaternion Multiply(Quaternion qLeft, Quaternion qRight) => qLeft * qRight; @@ -96,12 +96,12 @@ namespace Microsoft.Iris.Render internal void Normalize() { - float flValue1 = (float)((double)this.m_x * (double)this.m_x + (double)this.m_y * (double)this.m_y + (double)this.m_z * (double)this.m_z + (double)this.m_w * (double)this.m_w); + float flValue1 = (float)(m_x * (double)this.m_x + m_y * (double)this.m_y + m_z * (double)this.m_z + m_w * (double)this.m_w); if (Math2.WithinEpsilon(flValue1, 1f)) return; - if ((double)flValue1 > 1.40129846432482E-45) + if (flValue1 > 1.40129846432482E-45) { - float num = (float)Math.Sqrt((double)flValue1); + float num = (float)Math.Sqrt(flValue1); this.m_x /= num; this.m_y /= num; this.m_z /= num; @@ -123,7 +123,7 @@ namespace Microsoft.Iris.Render public void ToAxisAngle(out Vector3 vAxis, out float flAngle) { vAxis = new Vector3(this.m_x, this.m_y, this.m_z); - flAngle = (float)(2.0 * Math.Acos((double)this.m_w)); + flAngle = (float)(2.0 * Math.Acos(m_w)); } public bool IsApproximate(Quaternion q) => Math2.WithinEpsilon(this.m_x, q.m_x) && Math2.WithinEpsilon(this.m_y, q.m_y) && Math2.WithinEpsilon(this.m_z, q.m_z) && Math2.WithinEpsilon(this.m_w, q.m_w); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Rectangle.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Rectangle.cs index 9e61a82..178114b 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Rectangle.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Rectangle.cs @@ -27,10 +27,10 @@ namespace Microsoft.Iris.Render public Rectangle(float x, float y, float width, float height) { - this.m_x = (int)Math.Round((double)x); - this.m_y = (int)Math.Round((double)y); - this.m_width = (int)Math.Round((double)width); - this.m_height = (int)Math.Round((double)height); + this.m_x = (int)Math.Round(x); + this.m_y = (int)Math.Round(y); + this.m_width = (int)Math.Round(width); + this.m_height = (int)Math.Round(height); } public Rectangle(Size extent) @@ -85,7 +85,7 @@ namespace Microsoft.Iris.Render int num1 = Math.Min(left.X + left.Width, right.X + right.Width); int y = Math.Max(left.Y, right.Y); int num2 = Math.Min(left.Y + left.Height, right.Y + right.Height); - return num1 >= x && num2 >= y ? new Rectangle(x, y, num1 - x, num2 - y) : Rectangle.Zero; + return num1 >= x && num2 >= y ? new Rectangle(x, y, num1 - x, num2 - y) : Zero; } public static Rectangle Union(Rectangle left, Rectangle right) @@ -155,11 +155,11 @@ namespace Microsoft.Iris.Render public void Inflate(Size size) => this.Inflate(size.Width, size.Height); - public static Rectangle Inflate(Rectangle source, Rectangle offset) => Rectangle.FromLTRB(source.Left - offset.Left, source.Top - offset.Top, source.Right + offset.Right, source.Bottom + offset.Bottom); + public static Rectangle Inflate(Rectangle source, Rectangle offset) => FromLTRB(source.Left - offset.Left, source.Top - offset.Top, source.Right + offset.Right, source.Bottom + offset.Bottom); public void Intersect(Rectangle rect) { - Rectangle rectangle = Rectangle.Intersect(rect, this); + Rectangle rectangle = Intersect(rect, this); this.X = rectangle.X; this.Y = rectangle.Y; this.Width = rectangle.Width; @@ -170,7 +170,7 @@ namespace Microsoft.Iris.Render public void Union(Rectangle rect) { - Rectangle rectangle = Rectangle.Union(rect, this); + Rectangle rectangle = Union(rect, this); this.X = rectangle.X; this.Y = rectangle.Y; this.Width = rectangle.Width; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/RenderApi.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/RenderApi.cs index 3fba0a2..1435f26 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/RenderApi.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/RenderApi.cs @@ -25,9 +25,9 @@ namespace Microsoft.Iris.Render { Debug2.Validate(engineInfo != null, typeof(ArgumentNullException), nameof(engineInfo)); Debug2.Validate(renderHost != null, typeof(ArgumentNullException), nameof(renderHost)); - IRenderEngine renderEngine = (IRenderEngine)null; + IRenderEngine renderEngine = null; if (engineInfo.Type == EngineType.Iris) - renderEngine = (IRenderEngine)new RenderEngine(engineInfo as IrisEngineInfo, renderHost); + renderEngine = new RenderEngine(engineInfo as IrisEngineInfo, renderHost); return renderEngine; } @@ -38,9 +38,9 @@ namespace Microsoft.Iris.Render Debug2.Validate(sessionToken != null, typeof(ArgumentNullException), nameof(sessionToken)); Debug2.Validate(sessionToken.EngineInfo != null, typeof(ArgumentNullException), "sessionToken.EngineInfo"); Debug2.Validate(renderHost != null, typeof(ArgumentNullException), nameof(renderHost)); - IRenderSession renderSession = (IRenderSession)null; + IRenderSession renderSession = null; if (sessionToken.EngineInfo.Type == EngineType.Iris) - renderSession = (IRenderSession)new RenderSession((RenderEngine)null); + renderSession = new RenderSession(null); return renderSession; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/SCurveInterpolation.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/SCurveInterpolation.cs index f309eb2..b4c9b5f 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/SCurveInterpolation.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/SCurveInterpolation.cs @@ -15,7 +15,7 @@ namespace Microsoft.Iris.Render public SCurveInterpolation(float weight) { - Debug2.Validate((double)weight > 0.0, typeof(ArgumentOutOfRangeException), "weight must be > 0"); + Debug2.Validate(weight > 0.0, typeof(ArgumentOutOfRangeException), "weight must be > 0"); this.m_weight = weight; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/SepiaElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/SepiaElement.cs index e9bc394..7811d7f 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/SepiaElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/SepiaElement.cs @@ -33,8 +33,8 @@ namespace Microsoft.Iris.Render float flTone) { Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); - Debug2.Validate((double)flDesat >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Desat is >= 0"); - Debug2.Validate((double)flTone >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Tone is >= 0"); + Debug2.Validate(flDesat >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Desat is >= 0"); + Debug2.Validate(flTone >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for Tone is >= 0"); this.m_typeOperation = EffectOperationType.Sepia; this.m_lightColor = lightColor; this.m_darkColor = darkColor; @@ -54,7 +54,7 @@ namespace Microsoft.Iris.Render } public SepiaElement() - : this((string)null) + : this(null) { } @@ -94,10 +94,10 @@ namespace Microsoft.Iris.Render Map dictionary, ref byte nNextUniqueID) { - return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "LightColor", (byte)20, ref this.m_nLightColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "DarkColor", (byte)20, ref this.m_nDarkColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Desaturate", (byte)8, ref this.m_nDesaturateID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Tone", (byte)8, ref this.m_nToneID, ref nNextUniqueID); + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "LightColor", 20, ref this.m_nLightColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "DarkColor", 20, ref this.m_nDarkColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Desaturate", 8, ref this.m_nDesaturateID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Tone", 8, ref this.m_nToneID, ref nNextUniqueID); } - internal override bool Process(Map dictProperties) => this.GenerateProperty("LightColor", EffectPropertyType.Color, (object)this.m_lightColor, this.m_nLightColorID, dictProperties) && this.GenerateProperty("DarkColor", EffectPropertyType.Color, (object)this.m_darkColor, this.m_nDarkColorID, dictProperties) && this.GenerateProperty("Desaturate", EffectPropertyType.Float, (object)this.m_flDesaturate, this.m_nDesaturateID, dictProperties) && this.GenerateProperty("Tone", EffectPropertyType.Float, (object)this.m_flTone, this.m_nToneID, dictProperties); + internal override bool Process(Map dictProperties) => this.GenerateProperty("LightColor", EffectPropertyType.Color, m_lightColor, this.m_nLightColorID, dictProperties) && this.GenerateProperty("DarkColor", EffectPropertyType.Color, m_darkColor, this.m_nDarkColorID, dictProperties) && this.GenerateProperty("Desaturate", EffectPropertyType.Float, m_flDesaturate, this.m_nDesaturateID, dictProperties) && this.GenerateProperty("Tone", EffectPropertyType.Float, m_flTone, this.m_nToneID, dictProperties); internal override void AddCacheKey(ByteBuilder cacheKey) { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Size.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Size.cs index cbb8e52..9b9d184 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Size.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Size.cs @@ -13,7 +13,7 @@ namespace Microsoft.Iris.Render private int m_width; private int m_height; public static readonly Size Zero = new Size(0, 0); - public static readonly object ZeroBox = (object)Size.Zero; + public static readonly object ZeroBox = Zero; public Size(int width, int height) { @@ -81,23 +81,23 @@ namespace Microsoft.Iris.Render public static Size Max(Size sz1, Size sz2) => new Size(Math.Max(sz1.Width, sz2.Width), Math.Max(sz1.Height, sz2.Height)); - public bool IsZero => this.Equals(Size.Zero); + public bool IsZero => this.Equals(Zero); public bool IsEmpty => this.Width == 0 || this.Height == 0; public static Size LargestFit(Size source, Size bounds) { - float num = (float)source.Width / (float)source.Height; - Size size = new Size(bounds.Width, (int)Math.Ceiling((double)bounds.Width / (double)num)); + float num = source.Width / (float)source.Height; + Size size = new Size(bounds.Width, (int)Math.Ceiling(bounds.Width / (double)num)); if (size.Height > bounds.Height) - size = new Size((int)Math.Ceiling((double)bounds.Height * (double)num), bounds.Height); + size = new Size((int)Math.Ceiling(bounds.Height * (double)num), bounds.Height); return size; } public void Scale(float flScale) { - this.Width = (int)((double)this.Width * (double)flScale); - this.Height = (int)((double)this.Height * (double)flScale); + this.Width = (int)(Width * (double)flScale); + this.Height = (int)(Height * (double)flScale); } public static Size Scale(Size size, float flScale) diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Sound/Ds8SoundDevice.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Sound/Ds8SoundDevice.cs index 43aa3f5..4be7c2e 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Sound/Ds8SoundDevice.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Sound/Ds8SoundDevice.cs @@ -33,7 +33,7 @@ namespace Microsoft.Iris.Render.Sound if (this.m_remoteDevice == null) return; this.m_remoteDevice.Dispose(); - this.m_remoteDevice = (RemoteDs8SoundDevice)null; + this.m_remoteDevice = null; } finally { @@ -43,11 +43,11 @@ namespace Microsoft.Iris.Render.Sound RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteDevice.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteDevice = (RemoteDs8SoundDevice)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteDevice = null; protected override SoundDeviceType DeviceType => SoundDeviceType.DirectSound8; - protected override void CreateRemoteSoundDeviceImpl() => this.m_remoteDevice = this.Session.NtRenderingProtocol.INPROC_BuildRemoteDs8SoundDevice((IRenderHandleOwner)this, this.m_ownerWindow.WindowHandle); + protected override void CreateRemoteSoundDeviceImpl() => this.m_remoteDevice = this.Session.NtRenderingProtocol.INPROC_BuildRemoteDs8SoundDevice(this, this.m_ownerWindow.WindowHandle); protected override void CreateExternalResourcesImpl() => this.m_remoteDevice.SendCreateExternalResources(); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Sound/Sound.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Sound/Sound.cs index 52c7499..97a3a72 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Sound/Sound.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Sound/Sound.cs @@ -38,9 +38,9 @@ namespace Microsoft.Iris.Render.Sound if (this.m_remoteSound != null) { this.m_remoteSound.Dispose(); - this.m_remoteSound = (RemoteSound)null; + this.m_remoteSound = null; } - this.m_bufferOwner = (SoundBuffer)null; + this.m_bufferOwner = null; } finally { @@ -66,8 +66,8 @@ namespace Microsoft.Iris.Render.Sound private RemoteSound CreateRemoteObject(SoundBuffer buffer) { - RemoteSound remoteSound = (RemoteSound)null; - RENDERHANDLE handle = buffer.Device.Session.AllocateRenderHandle((IRenderHandleOwner)this); + RemoteSound remoteSound = null; + RENDERHANDLE handle = buffer.Device.Session.AllocateRenderHandle(this); try { buffer.Device.CreateRemoteSound(handle, buffer); @@ -83,17 +83,17 @@ namespace Microsoft.Iris.Render.Sound RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteSound.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteSound = (RemoteSound)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteSound = null; RENDERHANDLE IActivatableObject.GetObjectId() => this.m_remoteSound.RenderHandle; uint IActivatableObject.GetMethodId(string methodName) { - if (methodName == Microsoft.Iris.Render.Sound.Sound.PlayMethod) + if (methodName == PlayMethod) return 1; - if (methodName == Microsoft.Iris.Render.Sound.Sound.StopMethod) + if (methodName == StopMethod) return 2; - Debug2.Validate(false, typeof(ArgumentException), (object)"Unsupported method: {0}", (object)methodName); + Debug2.Validate(false, typeof(ArgumentException), "Unsupported method: {0}", methodName); return 0; } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Sound/SoundBuffer.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Sound/SoundBuffer.cs index cc0f3b2..9213378 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Sound/SoundBuffer.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Sound/SoundBuffer.cs @@ -35,7 +35,7 @@ namespace Microsoft.Iris.Render.Sound Debug2.Validate(soundData.SampleCount % soundData.ChannelCount == 0U, typeof(ArgumentException), "Insufficient sample data"); this.m_device = device; this.m_soundData = soundData; - this.m_tracker = MessagingSession.Current.CreateDataBufferTracker((object)this); + this.m_tracker = MessagingSession.Current.CreateDataBufferTracker(this); this.m_remoteBuffer = this.CreateRemoteObject(); this.LoadContent(); } @@ -51,10 +51,10 @@ namespace Microsoft.Iris.Render.Sound if (this.m_remoteBuffer != null) this.m_remoteBuffer.Dispose(); } - this.m_tracker = (DataBufferTracker)null; - this.m_soundData = (ISoundData)null; - this.m_device = (SoundDevice)null; - this.m_remoteBuffer = (RemoteSoundBuffer)null; + this.m_tracker = null; + this.m_soundData = null; + this.m_device = null; + this.m_remoteBuffer = null; } finally { @@ -70,29 +70,29 @@ namespace Microsoft.Iris.Render.Sound RENDERHANDLE IRenderHandleOwner.RenderHandle => this.m_remoteBuffer.RenderHandle; - void IRenderHandleOwner.OnDisconnect() => this.m_remoteBuffer = (RemoteSoundBuffer)null; + void IRenderHandleOwner.OnDisconnect() => this.m_remoteBuffer = null; ISound ISoundBuffer.CreateSound(object objUser) { Debug2.Validate(objUser != null, typeof(ArgumentNullException), nameof(objUser)); Microsoft.Iris.Render.Sound.Sound sound = new Microsoft.Iris.Render.Sound.Sound(this); sound.RegisterUsage(objUser); - return (ISound)sound; + return sound; } private RemoteSoundBuffer CreateRemoteObject() { - RemoteSoundBuffer remoteSoundBuffer = (RemoteSoundBuffer)null; + RemoteSoundBuffer remoteSoundBuffer = null; SoundHeader info; - info.wFormatTag = (ushort)1; + info.wFormatTag = 1; info.nChannels = (ushort)this.m_soundData.ChannelCount; info.nSamplesPerSec = this.m_soundData.SampleRate; info.nAvgBytesPerSec = this.m_soundData.SampleRate * (this.m_soundData.SampleSize / 8U) * this.m_soundData.ChannelCount; info.nBlockAlign = (ushort)(this.m_soundData.ChannelCount * (this.m_soundData.SampleSize / 8U)); info.wBitsPerSample = (ushort)this.m_soundData.SampleSize; - info.cbExtraData = (ushort)0; + info.cbExtraData = 0; info.cbDataSize = this.m_soundData.SampleCount * (this.m_soundData.SampleSize / 8U); - RENDERHANDLE handle = this.m_device.Session.AllocateRenderHandle((IRenderHandleOwner)this); + RENDERHANDLE handle = this.m_device.Session.AllocateRenderHandle(this); try { this.m_device.CreateRemoteSoundBuffer(handle, info, this.m_device.Session.RenderingProtocol.LocalSoundBufferCallbackHandle); @@ -111,7 +111,7 @@ namespace Microsoft.Iris.Render.Sound if (this.m_contentLoaded) return; IntPtr pData = this.m_soundData.AcquireContent(); - DataBuffer dataBuffer = (DataBuffer)null; + DataBuffer dataBuffer = null; try { uint cbSize = this.m_soundData.SampleCount * (this.m_soundData.SampleSize / 8U); @@ -123,7 +123,7 @@ namespace Microsoft.Iris.Render.Sound this.m_loadInfo.soundData = this.m_soundData; } ++this.m_loadInfo.loadCount; - this.m_tracker.Track(dataBuffer, new DataBufferTracker.CleanupEventHandler(SoundBuffer.OnDataBufferConsumed), (object)this.m_loadInfo); + this.m_tracker.Track(dataBuffer, new DataBufferTracker.CleanupEventHandler(OnDataBufferConsumed), m_loadInfo); dataBuffer.Commit(); if (this.m_remoteBuffer.IsValid) this.m_remoteBuffer.SendLoadSoundData(dataBuffer.RemoteStub); @@ -143,7 +143,7 @@ namespace Microsoft.Iris.Render.Sound if (contextData.loadCount != 0) return; contextData.soundData.ReleaseContent(); - contextData.soundData = (ISoundData)null; + contextData.soundData = null; } void ISoundBufferCallback.OnSoundBufferLost(RENDERHANDLE target) => this.m_contentLoaded = false; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Sound/SoundDevice.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Sound/SoundDevice.cs index d49b74a..fe50e46 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Sound/SoundDevice.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Sound/SoundDevice.cs @@ -33,7 +33,7 @@ namespace Microsoft.Iris.Render.Sound { try { - this.m_ownerSession = (RenderSession)null; + this.m_ownerSession = null; } finally { @@ -75,7 +75,7 @@ namespace Microsoft.Iris.Render.Sound Debug2.Validate(soundData != null, typeof(ArgumentNullException), nameof(soundData)); SoundBuffer soundBuffer = new SoundBuffer(this, soundData); soundBuffer.RegisterUsage(objUser); - return (ISoundBuffer)soundBuffer; + return soundBuffer; } internal void Rebuild() diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/SpotLight2DElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/SpotLight2DElement.cs index 112d6ea..5f4ba2d 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/SpotLight2DElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/SpotLight2DElement.cs @@ -50,9 +50,9 @@ namespace Microsoft.Iris.Render : this() { Debug2.Validate(!string.IsNullOrEmpty(stName), typeof(ArgumentException), nameof(stName)); - Debug2.Validate((double)flIntensity >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for flIntensity is [0..)"); - Debug2.Validate((double)flInnerConeAngle >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for flInnerConeAngle is [0..)"); - Debug2.Validate((double)flOuterConeAngle >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for flOuterConeAngle is [0..)"); + Debug2.Validate(flIntensity >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for flIntensity is [0..)"); + Debug2.Validate(flInnerConeAngle >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for flInnerConeAngle is [0..)"); + Debug2.Validate(flOuterConeAngle >= 0.0, typeof(ArgumentOutOfRangeException), "Valid range for flOuterConeAngle is [0..)"); this.m_stName = stName; this.m_vPosition = vPosition; this.m_flDirectionAngle = flDirectionAngle; @@ -139,10 +139,10 @@ namespace Microsoft.Iris.Render Map dictionary, ref byte nNextUniqueID) { - return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Position", (byte)16, ref this.m_nPositionID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "DirectionAngle", (byte)8, ref this.m_nDirectionAngleID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "LightColor", (byte)20, ref this.m_nLightColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "AmbientColor", (byte)20, ref this.m_nAmbientColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "InnerConeAngle", (byte)8, ref this.m_nInnerConeAngleID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "OuterConeAngle", (byte)8, ref this.m_nOuterConeAngleID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Intensity", (byte)8, ref this.m_nIntensityID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Attenuation", (byte)16, ref this.m_nAttenuationID, ref nNextUniqueID); + return base.PreProcessProperties(dictionary, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Position", 16, ref this.m_nPositionID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "DirectionAngle", 8, ref this.m_nDirectionAngleID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "LightColor", 20, ref this.m_nLightColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "AmbientColor", 20, ref this.m_nAmbientColorID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "InnerConeAngle", 8, ref this.m_nInnerConeAngleID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "OuterConeAngle", 8, ref this.m_nOuterConeAngleID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Intensity", 8, ref this.m_nIntensityID, ref nNextUniqueID) + this.PreProcessProperty(dictionary, "Attenuation", 16, ref this.m_nAttenuationID, ref nNextUniqueID); } - internal override bool Process(Map dictProperties) => this.GenerateProperty("Position", EffectPropertyType.Vector3, (object)this.m_vPosition, this.m_nPositionID, dictProperties) && this.GenerateProperty("DirectionAngle", EffectPropertyType.Float, (object)this.m_flDirectionAngle, this.m_nDirectionAngleID, dictProperties) && (this.GenerateProperty("LightColor", EffectPropertyType.Color, (object)this.m_clrLight, this.m_nLightColorID, dictProperties) && this.GenerateProperty("AmbientColor", EffectPropertyType.Color, (object)this.m_clrAmbient, this.m_nAmbientColorID, dictProperties)) && (this.GenerateProperty("InnerConeAngle", EffectPropertyType.Float, (object)this.m_flInnerConeAngle, this.m_nInnerConeAngleID, dictProperties) && this.GenerateProperty("OuterConeAngle", EffectPropertyType.Float, (object)this.m_flOuterConeAngle, this.m_nOuterConeAngleID, dictProperties) && (this.GenerateProperty("Intensity", EffectPropertyType.Float, (object)this.m_flIntensity, this.m_nIntensityID, dictProperties) && this.GenerateProperty("Attenuation", EffectPropertyType.Vector3, (object)this.m_vAttenuation, this.m_nAttenuationID, dictProperties))); + internal override bool Process(Map dictProperties) => this.GenerateProperty("Position", EffectPropertyType.Vector3, m_vPosition, this.m_nPositionID, dictProperties) && this.GenerateProperty("DirectionAngle", EffectPropertyType.Float, m_flDirectionAngle, this.m_nDirectionAngleID, dictProperties) && (this.GenerateProperty("LightColor", EffectPropertyType.Color, m_clrLight, this.m_nLightColorID, dictProperties) && this.GenerateProperty("AmbientColor", EffectPropertyType.Color, m_clrAmbient, this.m_nAmbientColorID, dictProperties)) && (this.GenerateProperty("InnerConeAngle", EffectPropertyType.Float, m_flInnerConeAngle, this.m_nInnerConeAngleID, dictProperties) && this.GenerateProperty("OuterConeAngle", EffectPropertyType.Float, m_flOuterConeAngle, this.m_nOuterConeAngleID, dictProperties) && (this.GenerateProperty("Intensity", EffectPropertyType.Float, m_flIntensity, this.m_nIntensityID, dictProperties) && this.GenerateProperty("Attenuation", EffectPropertyType.Vector3, m_vAttenuation, this.m_nAttenuationID, dictProperties))); internal override void AddCacheKey(ByteBuilder cacheKey) { diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/TrackerBase.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/TrackerBase.cs index 8ca694e..51fd57f 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/TrackerBase.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/TrackerBase.cs @@ -13,20 +13,20 @@ namespace Microsoft.Iris.Render { public abstract class TrackerBase { - private static readonly TrackerBase.ObjectTest s_testAll = new TrackerBase.ObjectTest(TrackerBase.AllObjectTest); - private static readonly TrackerBase.ObjectTest s_testDead = new TrackerBase.ObjectTest(TrackerBase.DeadObjectTest); - private static readonly TrackerBase.ObjectTest s_testObject = new TrackerBase.ObjectTest(TrackerBase.SpecificObjectTest); + private static readonly TrackerBase.ObjectTest s_testAll = new TrackerBase.ObjectTest(AllObjectTest); + private static readonly TrackerBase.ObjectTest s_testDead = new TrackerBase.ObjectTest(DeadObjectTest); + private static readonly TrackerBase.ObjectTest s_testObject = new TrackerBase.ObjectTest(SpecificObjectTest); private Map m_tblObjects; ~TrackerBase() => this.Dispose(false); public void Dispose() { - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); this.Dispose(true); } - protected virtual void Dispose(bool fInDispose) => this.RemoveObjects(TrackerBase.s_testAll); + protected virtual void Dispose(bool fInDispose) => this.RemoveObjects(s_testAll); public bool IsEmpty => this.m_tblObjects.Count == 0; @@ -84,14 +84,14 @@ namespace Microsoft.Iris.Render { if (this.m_tblObjects == null) return; - ArrayList arrayList = (ArrayList)null; + ArrayList arrayList = null; foreach (string key in this.m_tblObjects.Keys) { if (keyTest == null || keyTest(key)) { if (arrayList == null) arrayList = new ArrayList(); - arrayList.Add((object)key); + arrayList.Add(key); } } if (arrayList == null) @@ -101,13 +101,13 @@ namespace Microsoft.Iris.Render } } - public void RemoveObject(object objRemove) => this.RemoveObjects(TrackerBase.s_testObject, objRemove); + public void RemoveObject(object objRemove) => this.RemoveObjects(s_testObject, objRemove); - public void RemoveDeadObjects() => this.RemoveObjects(TrackerBase.s_testDead); + public void RemoveDeadObjects() => this.RemoveObjects(s_testDead); - public void RemoveAllObjects() => this.RemoveObjects(TrackerBase.s_testAll); + public void RemoveAllObjects() => this.RemoveObjects(s_testAll); - public void RemoveObjects(TrackerBase.ObjectTest test) => this.RemoveObjects(test, (object)null); + public void RemoveObjects(TrackerBase.ObjectTest test) => this.RemoveObjects(test, null); public void RemoveObjects(TrackerBase.ObjectTest test, object objParam) { @@ -115,7 +115,7 @@ namespace Microsoft.Iris.Render { if (this.m_tblObjects == null) return; - ArrayList arrayList = (ArrayList)null; + ArrayList arrayList = null; foreach (KeyValueEntry tblObject in this.m_tblObjects) { GCHandle gcHandle = tblObject.Value; @@ -138,7 +138,7 @@ namespace Microsoft.Iris.Render public object Find(object key) { - object obj = (object)null; + object obj = null; lock (this) { if (this.m_tblObjects != null) diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Vector2.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Vector2.cs index ae90cb4..1078900 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Vector2.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Vector2.cs @@ -69,12 +69,12 @@ namespace Microsoft.Iris.Render internal void Normalize() { - float flValue1 = (float)((double)this.m_x * (double)this.m_x + (double)this.m_y * (double)this.m_y); + float flValue1 = (float)(m_x * (double)this.m_x + m_y * (double)this.m_y); if (Math2.WithinEpsilon(flValue1, 1f)) return; - if ((double)flValue1 > 1.40129846432482E-45) + if (flValue1 > 1.40129846432482E-45) { - float num = (float)Math.Sqrt((double)flValue1); + float num = (float)Math.Sqrt(flValue1); this.m_x /= num; this.m_y /= num; } @@ -87,7 +87,7 @@ namespace Microsoft.Iris.Render public override bool Equals(object obj) => obj is Vector2 vector2 && this == vector2; - public static bool operator ==(Vector2 left, Vector2 right) => (double)left.X == (double)right.X && (double)left.Y == (double)right.Y; + public static bool operator ==(Vector2 left, Vector2 right) => left.X == (double)right.X && left.Y == (double)right.Y; public static bool operator !=(Vector2 left, Vector2 right) => !(left == right); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Vector3.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Vector3.cs index 6229a33..eb0662f 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Vector3.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Vector3.cs @@ -88,12 +88,12 @@ namespace Microsoft.Iris.Render internal void Normalize() { - float flValue1 = (float)((double)this.m_x * (double)this.m_x + (double)this.m_y * (double)this.m_y + (double)this.m_z * (double)this.m_z); + float flValue1 = (float)(m_x * (double)this.m_x + m_y * (double)this.m_y + m_z * (double)this.m_z); if (Math2.WithinEpsilon(flValue1, 1f)) return; - if ((double)flValue1 > 1.40129846432482E-45) + if (flValue1 > 1.40129846432482E-45) { - float num = (float)Math.Sqrt((double)flValue1); + float num = (float)Math.Sqrt(flValue1); this.m_x /= num; this.m_y /= num; this.m_z /= num; @@ -108,7 +108,7 @@ namespace Microsoft.Iris.Render public override bool Equals(object obj) => obj is Vector3 vector3 && this == vector3; - public static bool operator ==(Vector3 left, Vector3 right) => (double)left.X == (double)right.X && (double)left.Y == (double)right.Y && (double)left.Z == (double)right.Z; + public static bool operator ==(Vector3 left, Vector3 right) => left.X == (double)right.X && left.Y == (double)right.Y && left.Z == (double)right.Z; public static bool operator !=(Vector3 left, Vector3 right) => !(left == right); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Vector4.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Vector4.cs index ba31690..d957800 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Vector4.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Vector4.cs @@ -85,12 +85,12 @@ namespace Microsoft.Iris.Render internal void Normalize() { - float flValue1 = (float)((double)this.m_x * (double)this.m_x + (double)this.m_y * (double)this.m_y + (double)this.m_z * (double)this.m_z + (double)this.m_w * (double)this.m_w); + float flValue1 = (float)(m_x * (double)this.m_x + m_y * (double)this.m_y + m_z * (double)this.m_z + m_w * (double)this.m_w); if (Math2.WithinEpsilon(flValue1, 1f)) return; - if ((double)flValue1 > 1.40129846432482E-45) + if (flValue1 > 1.40129846432482E-45) { - float num = (float)Math.Sqrt((double)flValue1); + float num = (float)Math.Sqrt(flValue1); this.m_x /= num; this.m_y /= num; this.m_z /= num; @@ -107,7 +107,7 @@ namespace Microsoft.Iris.Render public override bool Equals(object obj) => obj is Vector4 vector4 && this == vector4; - public static bool operator ==(Vector4 left, Vector4 right) => (double)left.X == (double)right.X && (double)left.Y == (double)right.Y && (double)left.Z == (double)right.Z && (double)left.W == (double)right.W; + public static bool operator ==(Vector4 left, Vector4 right) => left.X == (double)right.X && left.Y == (double)right.Y && left.Z == (double)right.Z && left.W == (double)right.W; public static bool operator !=(Vector4 left, Vector4 right) => !(left == right); diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/VideoElement.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/VideoElement.cs index af8b474..f95d0d6 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/VideoElement.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/VideoElement.cs @@ -28,7 +28,7 @@ namespace Microsoft.Iris.Render public IVideoStream VideoStream { - get => (IVideoStream)this.m_videoStream; + get => m_videoStream; set => this.m_videoStream = value as Microsoft.Iris.Render.VideoStream; } @@ -46,7 +46,7 @@ namespace Microsoft.Iris.Render internal override bool Process(Map dictProperties) { - if (!this.GenerateProperty("Video", EffectPropertyType.Video, (object)this.VideoStream, this.m_nVideoStreamID, dictProperties)) + if (!this.GenerateProperty("Video", EffectPropertyType.Video, VideoStream, this.m_nVideoStreamID, dictProperties)) return false; dictProperties[this.GeneratePropertyPath("Video")].IsDynamic = true; return true; diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/VideoStream.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/VideoStream.cs index a76e6d7..1563920 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/VideoStream.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/VideoStream.cs @@ -38,17 +38,17 @@ namespace Microsoft.Iris.Render private void Initialize() { - this.m_nUniqueID = Interlocked.Increment(ref VideoStream.s_idxNextUnique); - this.m_poolScene = new VideoPool(this.m_device, (IVideoPoolNotification)this); - this.m_surfaceScene = new Surface((SurfacePool)this.m_poolScene, (ISurfaceContentOwner)this, Size.Zero); - this.m_surfaceScene.RegisterUsage((object)this); - IEffectTemplate effectTemplate = this.m_session.CreateEffectTemplate((object)this, "EmptyVideo"); - ColorElement colorElement = new ColorElement("ColorFill", ColorF.FromArgb((int)byte.MaxValue, 0, 0, 0)); - effectTemplate.Build((EffectInput)colorElement); - IEffect instance = effectTemplate.CreateInstance((object)this); + this.m_nUniqueID = Interlocked.Increment(ref s_idxNextUnique); + this.m_poolScene = new VideoPool(this.m_device, this); + this.m_surfaceScene = new Surface(m_poolScene, this, Size.Zero); + this.m_surfaceScene.RegisterUsage(this); + IEffectTemplate effectTemplate = this.m_session.CreateEffectTemplate(this, "EmptyVideo"); + ColorElement colorElement = new ColorElement("ColorFill", ColorF.FromArgb(byte.MaxValue, 0, 0, 0)); + effectTemplate.Build(colorElement); + IEffect instance = effectTemplate.CreateInstance(this); this.m_poolScene.Effect = (Effect)instance; - instance.UnregisterUsage((object)this); - effectTemplate.UnregisterUsage((object)this); + instance.UnregisterUsage(this); + effectTemplate.UnregisterUsage(this); RemoteDynamicSurfaceFactory.SendCreateVideoInstance(this.m_session.RenderingProtocol, this.m_nUniqueID, this.m_session.RenderingPort.MessagingProtocol.Context_ClassHandle, RemoteDevice.CreateFromHandle(this.m_device.RemoteDevice.Port, this.m_device.RemoteDevice.RenderHandle), this.m_surfaceScene.RemoteStub, this.m_poolScene.RemoteVideoStub); } @@ -58,14 +58,14 @@ namespace Microsoft.Iris.Render { if (this.m_poolScene != null) { - this.m_surfaceScene.UnregisterUsage((object)this); - this.m_surfaceScene = (Surface)null; + this.m_surfaceScene.UnregisterUsage(this); + this.m_surfaceScene = null; this.m_poolScene.Dispose(); - this.m_poolScene = (VideoPool)null; + this.m_poolScene = null; } RemoteDynamicSurfaceFactory.SendCloseInstance(this.m_session.RenderingProtocol, this.m_nUniqueID); } - this.m_device = (GraphicsDevice)null; + this.m_device = null; base.Dispose(fInDispose); } @@ -98,7 +98,7 @@ namespace Microsoft.Iris.Render { if (this.m_surfaceScene != surface) return; - this.m_surfaceScene = (Surface)null; + this.m_surfaceScene = null; } public void OnRestoreContent(Surface surface) @@ -112,7 +112,7 @@ namespace Microsoft.Iris.Render get => this.m_poolScene.ContentOverscan; set { - Debug2.Validate((double)value >= 0.0 && (double)value <= 0.5, typeof(ArgumentException), "Valid range for content overscan is [0, .5]"); + Debug2.Validate(value >= 0.0 && value <= 0.5, typeof(ArgumentException), "Valid range for content overscan is [0, .5]"); if (Math2.WithinEpsilon(this.m_poolScene.ContentOverscan, value)) return; this.m_poolScene.ContentOverscan = value; diff --git a/UIX.RenderApi.Skia/System/Collections/Generic/HashHelpers.cs b/UIX.RenderApi.Skia/System/Collections/Generic/HashHelpers.cs index 78d2946..3e6a665 100644 --- a/UIX.RenderApi.Skia/System/Collections/Generic/HashHelpers.cs +++ b/UIX.RenderApi.Skia/System/Collections/Generic/HashHelpers.cs @@ -10,85 +10,85 @@ namespace System.Collections.Generic { internal static readonly int[] s_primes = new int[72] { - 3, - 7, - 11, - 17, - 23, - 29, - 37, - 47, - 59, - 71, - 89, - 107, - 131, - 163, - 197, - 239, - 293, - 353, - 431, - 521, - 631, - 761, - 919, - 1103, - 1327, - 1597, - 1931, - 2333, - 2801, - 3371, - 4049, - 4861, - 5839, - 7013, - 8419, - 10103, - 12143, - 14591, - 17519, - 21023, - 25229, - 30293, - 36353, - 43627, - 52361, - 62851, - 75431, - 90523, - 108631, - 130363, - 156437, - 187751, - 225307, - 270371, - 324449, - 389357, - 467237, - 560689, - 672827, - 807403, - 968897, - 1162687, - 1395263, - 1674319, - 2009191, - 2411033, - 2893249, - 3471899, - 4166287, - 4999559, - 5999471, - 7199369 + 3, + 7, + 11, + 17, + 23, + 29, + 37, + 47, + 59, + 71, + 89, + 107, + 131, + 163, + 197, + 239, + 293, + 353, + 431, + 521, + 631, + 761, + 919, + 1103, + 1327, + 1597, + 1931, + 2333, + 2801, + 3371, + 4049, + 4861, + 5839, + 7013, + 8419, + 10103, + 12143, + 14591, + 17519, + 21023, + 25229, + 30293, + 36353, + 43627, + 52361, + 62851, + 75431, + 90523, + 108631, + 130363, + 156437, + 187751, + 225307, + 270371, + 324449, + 389357, + 467237, + 560689, + 672827, + 807403, + 968897, + 1162687, + 1395263, + 1674319, + 2009191, + 2411033, + 2893249, + 3471899, + 4166287, + 4999559, + 5999471, + 7199369 }; internal static bool IsPrime(int candidate) { if ((candidate & 1) == 0) return candidate == 2; - int num = (int)Math.Sqrt((double)candidate); + int num = (int)Math.Sqrt(candidate); for (int index = 3; index <= num; index += 2) { if (candidate % index == 0) @@ -101,15 +101,15 @@ namespace System.Collections.Generic { if (min < 0) throw new ArgumentException(nameof(min)); - for (int index = 0; index < HashHelpers.s_primes.Length; ++index) + for (int index = 0; index < s_primes.Length; ++index) { - int prime = HashHelpers.s_primes[index]; + int prime = s_primes[index]; if (prime >= min) return prime; } for (int candidate = min | 1; candidate < int.MaxValue; candidate += 2) { - if (HashHelpers.IsPrime(candidate)) + if (IsPrime(candidate)) return candidate; } return min; diff --git a/UIX.RenderApi.Skia/Vector.cs b/UIX.RenderApi.Skia/Vector.cs index c26ca3d..eac0a1c 100644 --- a/UIX.RenderApi.Skia/Vector.cs +++ b/UIX.RenderApi.Skia/Vector.cs @@ -14,7 +14,7 @@ public class Vector : IVector private object[] _items; private int _size; - public Vector() => this._items = Vector.s_emptyArray; + public Vector() => this._items = s_emptyArray; public Vector(int capacity) => this._items = new object[capacity]; @@ -24,7 +24,7 @@ public class Vector : IVector { int count = collection1.Count; this._items = new object[count]; - collection1.CopyTo((Array)this._items, 0); + collection1.CopyTo(_items, 0); this._size = count; } else @@ -56,11 +56,11 @@ public class Vector : IVector { object[] objArray = new object[value]; if (this._size > 0) - Array.Copy((Array)this._items, 0, (Array)objArray, 0, this._size); + Array.Copy(_items, 0, objArray, 0, this._size); this._items = objArray; } else - this._items = Vector.s_emptyArray; + this._items = s_emptyArray; } } @@ -83,7 +83,7 @@ public class Vector : IVector public void Clear() { - Array.Clear((Array)this._items, 0, this._size); + Array.Clear(_items, 0, this._size); this._size = 0; } @@ -95,11 +95,11 @@ public class Vector : IVector return; try { - Array.Copy((Array)this._items, 0, array, index, this._size); + Array.Copy(_items, 0, array, index, this._size); } catch (ArrayTypeMismatchException ex) { - throw new ArgumentException((string)null); + throw new ArgumentException(null); } } @@ -120,7 +120,7 @@ public class Vector : IVector if (this._size == this._items.Length) this.EnsureCapacity(this._size + 1); if (index < this._size) - Array.Copy((Array)this._items, index, (Array)this._items, index + 1, this._size - index); + Array.Copy(_items, index, _items, index + 1, this._size - index); this._items[index] = item; ++this._size; } @@ -138,8 +138,8 @@ public class Vector : IVector { --this._size; if (index < this._size) - Array.Copy((Array)this._items, index + 1, (Array)this._items, index, this._size - index); - this._items[this._size] = (object)null; + Array.Copy(_items, index + 1, _items, index, this._size - index); + this._items[this._size] = null; } public void RemoveRange(int index, int count) @@ -148,26 +148,26 @@ public class Vector : IVector return; this._size -= count; if (index < this._size) - Array.Copy((Array)this._items, index + count, (Array)this._items, index, this._size - index); - Array.Clear((Array)this._items, this._size, count); + Array.Copy(_items, index + count, _items, index, this._size - index); + Array.Clear(_items, this._size, count); } - public void Sort() => this.Sort(0, this.Count, (IComparer)null); + public void Sort() => this.Sort(0, this.Count, null); public void Sort(IComparer comparer) => this.Sort(0, this.Count, comparer); - public void Sort(int index, int count, IComparer comparer) => Array.Sort((Array)this._items, index, count, comparer); + public void Sort(int index, int count, IComparer comparer) => Array.Sort(_items, index, count, comparer); public object[] ToArray() { object[] objArray = new object[this._size]; - Array.Copy((Array)this._items, 0, (Array)objArray, 0, this._size); + Array.Copy(_items, 0, objArray, 0, this._size); return objArray; } public void TrimExcess() { - if (this._size >= (int)((double)this._items.Length * 0.9)) + if (this._size >= (int)(_items.Length * 0.9)) return; this.Capacity = this._size; } diff --git a/UIX.RenderApi.Skia/Vector`1.cs b/UIX.RenderApi.Skia/Vector`1.cs index a1f471b..03b8f61 100644 --- a/UIX.RenderApi.Skia/Vector`1.cs +++ b/UIX.RenderApi.Skia/Vector`1.cs @@ -14,7 +14,7 @@ public class Vector : IVector private A[] _items; private int _size; - public Vector() => this._items = Vector.s_emptyArray; + public Vector() => this._items = s_emptyArray; public Vector(int capacity) => this._items = new A[capacity]; @@ -24,7 +24,7 @@ public class Vector : IVector { int count = collection1.Count; this._items = new A[count]; - collection1.CopyTo((Array)this._items, 0); + collection1.CopyTo(_items, 0); this._size = count; } else @@ -56,11 +56,11 @@ public class Vector : IVector { A[] aArray = new A[value]; if (this._size > 0) - Array.Copy((Array)this._items, 0, (Array)aArray, 0, this._size); + Array.Copy(_items, 0, aArray, 0, this._size); this._items = aArray; } else - this._items = Vector.s_emptyArray; + this._items = s_emptyArray; } } @@ -72,7 +72,7 @@ public class Vector : IVector set => this._items[index] = value; } - object IVector.this[int index] => (object)this[index]; + object IVector.this[int index] => this[index]; public void Add(A item) { @@ -83,7 +83,7 @@ public class Vector : IVector public void Clear() { - Array.Clear((Array)this._items, 0, this._size); + Array.Clear(_items, 0, this._size); this._size = 0; } @@ -95,11 +95,11 @@ public class Vector : IVector return; try { - Array.Copy((Array)this._items, 0, array, index, this._size); + Array.Copy(_items, 0, array, index, this._size); } catch (ArrayTypeMismatchException ex) { - throw new ArgumentException((string)null); + throw new ArgumentException(null); } } @@ -120,7 +120,7 @@ public class Vector : IVector if (this._size == this._items.Length) this.EnsureCapacity(this._size + 1); if (index < this._size) - Array.Copy((Array)this._items, index, (Array)this._items, index + 1, this._size - index); + Array.Copy(_items, index, _items, index + 1, this._size - index); this._items[index] = item; ++this._size; } @@ -138,7 +138,7 @@ public class Vector : IVector { --this._size; if (index < this._size) - Array.Copy((Array)this._items, index + 1, (Array)this._items, index, this._size - index); + Array.Copy(_items, index + 1, _items, index, this._size - index); this._items[this._size] = default(A); } @@ -148,26 +148,26 @@ public class Vector : IVector return; this._size -= count; if (index < this._size) - Array.Copy((Array)this._items, index + count, (Array)this._items, index, this._size - index); - Array.Clear((Array)this._items, this._size, count); + Array.Copy(_items, index + count, _items, index, this._size - index); + Array.Clear(_items, this._size, count); } - public void Sort() => this.Sort(0, this.Count, (IComparer)null); + public void Sort() => this.Sort(0, this.Count, null); public void Sort(IComparer comparer) => this.Sort(0, this.Count, comparer); - public void Sort(int index, int count, IComparer comparer) => Array.Sort((Array)this._items, index, count, comparer); + public void Sort(int index, int count, IComparer comparer) => Array.Sort(_items, index, count, comparer); public A[] ToArray() { A[] aArray = new A[this._size]; - Array.Copy((Array)this._items, 0, (Array)aArray, 0, this._size); + Array.Copy(_items, 0, aArray, 0, this._size); return aArray; } public void TrimExcess() { - if (this._size >= (int)((double)this._items.Length * 0.9)) + if (this._size >= (int)(_items.Length * 0.9)) return; this.Capacity = this._size; }