From 890990b37ae12899acb0c36ab1e07d09a9e772be Mon Sep 17 00:00:00 2001 From: Yoshi Askharoun Date: Fri, 1 Oct 2021 21:31:34 -0500 Subject: [PATCH] Added instance of IrisEngineInfo to RenderObject --- .../Iris/Render/Common/RenderObject.cs | 3 +++ .../Iris/Render/Internal/RenderEngine.cs | 1 - .../Splash/Rendering/RemoteAnimationManager.cs | 18 +++++++++--------- UIX.Skia/Microsoft/Iris/Session/UISession.cs | 18 +++++++++--------- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/RenderObject.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/RenderObject.cs index 87a1b86..9ab2a2a 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/RenderObject.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Common/RenderObject.cs @@ -12,6 +12,7 @@ namespace Microsoft.Iris.Render.Common internal abstract class RenderObject : IRenderObject, IDisposable { private bool m_fObjectDisposed; + private IrisEngineInfo m_engineInfo; internal RenderObject() => this.m_fObjectDisposed = false; @@ -40,6 +41,8 @@ namespace Microsoft.Iris.Render.Common } } + internal IrisEngineInfo EngineInfo => m_engineInfo; + [Conditional("DEBUG")] protected virtual void Invariant() => Debug2.Validate(!this.m_fObjectDisposed, typeof(ObjectDisposedException), this.GetType().ToString()); } diff --git a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderEngine.cs b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderEngine.cs index 2686de4..b26e75c 100644 --- a/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderEngine.cs +++ b/UIX.RenderApi.Skia/Microsoft/Iris/Render/Internal/RenderEngine.cs @@ -12,7 +12,6 @@ namespace Microsoft.Iris.Render.Internal private static BitArray s_contexts; private static uint s_contextIdSeed = 1; private static uint s_maxContextId = 254; - private IrisEngineInfo m_engineInfo; private RenderToken m_primaryToken; private MessagingSession m_messagingSession; private RenderSession m_renderSession; 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 ef82cd7..fd222c8 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 @@ -49,14 +49,14 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); _priv_portUse = this.m_renderPort; _priv_portUse.ValidateHandle(this.m_renderHandle); - uint size = (uint)sizeof(RemoteAnimationManager.Msg0_SetAnimationRate); - RemoteAnimationManager.Msg0_SetAnimationRate* setAnimationRatePtr = (RemoteAnimationManager.Msg0_SetAnimationRate*)_priv_portUse.AllocMessageBuffer(size); + uint size = (uint)sizeof(Msg0_SetAnimationRate); + Msg0_SetAnimationRate* setAnimationRatePtr = (Msg0_SetAnimationRate*)_priv_portUse.AllocMessageBuffer(size); setAnimationRatePtr->_priv_size = size; setAnimationRatePtr->_priv_msgid = 0U; setAnimationRatePtr->nFramesPerSecond = nFramesPerSecond; setAnimationRatePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)setAnimationRatePtr, ref s_priv_ByteOrder_Msg0_SetAnimationRate, typeof(RemoteAnimationManager.Msg0_SetAnimationRate), 0, 0); + MarshalHelper.SwapByteOrder((byte*)setAnimationRatePtr, ref s_priv_ByteOrder_Msg0_SetAnimationRate, typeof(Msg0_SetAnimationRate), 0, 0); _priv_pmsgUse = (Message*)setAnimationRatePtr; } @@ -76,14 +76,14 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); _priv_portUse = this.m_renderPort; _priv_portUse.ValidateHandle(this.m_renderHandle); - uint size = (uint)sizeof(RemoteAnimationManager.Msg1_PulseTimeAdvance); - RemoteAnimationManager.Msg1_PulseTimeAdvance* pulseTimeAdvancePtr = (RemoteAnimationManager.Msg1_PulseTimeAdvance*)_priv_portUse.AllocMessageBuffer(size); + uint size = (uint)sizeof(Msg1_PulseTimeAdvance); + Msg1_PulseTimeAdvance* pulseTimeAdvancePtr = (Msg1_PulseTimeAdvance*)_priv_portUse.AllocMessageBuffer(size); pulseTimeAdvancePtr->_priv_size = size; pulseTimeAdvancePtr->_priv_msgid = 1U; pulseTimeAdvancePtr->nPulseMs = nPulseMs; pulseTimeAdvancePtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)pulseTimeAdvancePtr, ref s_priv_ByteOrder_Msg1_PulseTimeAdvance, typeof(RemoteAnimationManager.Msg1_PulseTimeAdvance), 0, 0); + MarshalHelper.SwapByteOrder((byte*)pulseTimeAdvancePtr, ref s_priv_ByteOrder_Msg1_PulseTimeAdvance, typeof(Msg1_PulseTimeAdvance), 0, 0); _priv_pmsgUse = (Message*)pulseTimeAdvancePtr; } @@ -103,14 +103,14 @@ namespace Microsoft.Iris.Render.Protocols.Splash.Rendering Debug2.Throw(this.IsValid, "Non-static method call requires an instance"); _priv_portUse = this.m_renderPort; _priv_portUse.ValidateHandle(this.m_renderHandle); - uint size = (uint)sizeof(RemoteAnimationManager.Msg2_SetGlobalSpeedAdjustment); - RemoteAnimationManager.Msg2_SetGlobalSpeedAdjustment* globalSpeedAdjustmentPtr = (RemoteAnimationManager.Msg2_SetGlobalSpeedAdjustment*)_priv_portUse.AllocMessageBuffer(size); + uint size = (uint)sizeof(Msg2_SetGlobalSpeedAdjustment); + Msg2_SetGlobalSpeedAdjustment* globalSpeedAdjustmentPtr = (Msg2_SetGlobalSpeedAdjustment*)_priv_portUse.AllocMessageBuffer(size); globalSpeedAdjustmentPtr->_priv_size = size; globalSpeedAdjustmentPtr->_priv_msgid = 2U; globalSpeedAdjustmentPtr->flFactor = flFactor; globalSpeedAdjustmentPtr->_priv_idObjectSubject = this.m_renderHandle; if (_priv_portUse.ForeignByteOrder) - MarshalHelper.SwapByteOrder((byte*)globalSpeedAdjustmentPtr, ref s_priv_ByteOrder_Msg2_SetGlobalSpeedAdjustment, typeof(RemoteAnimationManager.Msg2_SetGlobalSpeedAdjustment), 0, 0); + MarshalHelper.SwapByteOrder((byte*)globalSpeedAdjustmentPtr, ref s_priv_ByteOrder_Msg2_SetGlobalSpeedAdjustment, typeof(Msg2_SetGlobalSpeedAdjustment), 0, 0); _priv_pmsgUse = (Message*)globalSpeedAdjustmentPtr; } diff --git a/UIX.Skia/Microsoft/Iris/Session/UISession.cs b/UIX.Skia/Microsoft/Iris/Session/UISession.cs index b904137..dba7db6 100644 --- a/UIX.Skia/Microsoft/Iris/Session/UISession.cs +++ b/UIX.Skia/Microsoft/Iris/Session/UISession.cs @@ -302,14 +302,14 @@ namespace Microsoft.Iris.Session internal void FireOnUnhandledException(object sender, Exception e) { - UISession.UnhandledExceptionHandler unhandledException = OnUnhandledException; + UnhandledExceptionHandler unhandledException = OnUnhandledException; if (unhandledException == null) return; - UISession.UnhandledExceptionArgs args = new UISession.UnhandledExceptionArgs(e); + UnhandledExceptionArgs args = new UnhandledExceptionArgs(e); unhandledException(sender, args); } - public event UISession.UnhandledExceptionHandler OnUnhandledException; + public event UnhandledExceptionHandler OnUnhandledException; public Form Form => _form; @@ -319,7 +319,7 @@ namespace Microsoft.Iris.Session public void PlaySound(string stSoundSource) { - UISession.PlaySoundArgs playSoundArgs = new UISession.PlaySoundArgs(this, stSoundSource); + PlaySoundArgs playSoundArgs = new PlaySoundArgs(this, stSoundSource); if (!UIDispatcher.IsUIThread) DeferredCall.Post(DispatchPriority.High, s_deferredPlaySound, playSoundArgs); else @@ -328,7 +328,7 @@ namespace Microsoft.Iris.Session private static void DeferredPlaySound(object argsObject) { - UISession.PlaySoundArgs playSoundArgs = argsObject as UISession.PlaySoundArgs; + PlaySoundArgs playSoundArgs = argsObject as PlaySoundArgs; if (!playSoundArgs.uiSession.IsValid || playSoundArgs.stSoundSource == null) return; new Sound() { Source = playSoundArgs.stSoundSource }.Play(); @@ -336,7 +336,7 @@ namespace Microsoft.Iris.Session public void PlaySystemSound(SystemSoundEvent systemSoundEvent) { - UISession.PlaySystemSoundArgs playSystemSoundArgs = new UISession.PlaySystemSoundArgs(this, systemSoundEvent); + PlaySystemSoundArgs playSystemSoundArgs = new PlaySystemSoundArgs(this, systemSoundEvent); if (!UIDispatcher.IsUIThread) DeferredCall.Post(DispatchPriority.High, s_deferredPlaySystemSound, playSystemSoundArgs); else @@ -345,7 +345,7 @@ namespace Microsoft.Iris.Session private static void DeferredPlaySystemSound(object argsObject) { - UISession.PlaySystemSoundArgs playSystemSoundArgs = argsObject as UISession.PlaySystemSoundArgs; + PlaySystemSoundArgs playSystemSoundArgs = argsObject as PlaySystemSoundArgs; if (!playSystemSoundArgs.uiSession.IsValid || playSystemSoundArgs.systemSoundEvent == SystemSoundEvent.None) return; new Sound() @@ -367,12 +367,12 @@ namespace Microsoft.Iris.Session public delegate void UnhandledExceptionHandler( object sender, - UISession.UnhandledExceptionArgs args); + UnhandledExceptionArgs args); private class TaskReentrancyDetection : IDisposable { private static string s_currentTask; - private static UISession.TaskReentrancyDetection s_currentTaskClearer = new UISession.TaskReentrancyDetection(); + private static TaskReentrancyDetection s_currentTaskClearer = new TaskReentrancyDetection(); public static IDisposable Enter(string task) {