mirror of
https://github.com/ZuneDev/Xune.git
synced 2026-07-27 13:13:10 -07:00
Format RenderApi code
This commit is contained in:
@@ -10,62 +10,62 @@ using Microsoft.Iris.Render.Protocols.Splash.Rendering;
|
||||
|
||||
namespace Microsoft.Iris.Render.Graphics
|
||||
{
|
||||
internal sealed class VideoPool : SurfacePool, IVideoPoolCallback
|
||||
{
|
||||
private RemoteVideoPool m_remoteVideoPool;
|
||||
private IVideoPoolNotification m_imgOwner;
|
||||
private float m_flContentOverscan;
|
||||
private Size m_sizeTargetPxl;
|
||||
|
||||
internal VideoPool(GraphicsDevice device, IVideoPoolNotification imgOwner)
|
||||
: base(device, SurfaceFormat.External, RENDERHANDLE.NULL)
|
||||
=> this.m_imgOwner = imgOwner;
|
||||
|
||||
protected override void CreateRemoteSurfacePool(RENDERHANDLE rhHandle, bool fPrimaryOwner)
|
||||
internal sealed class VideoPool : SurfacePool, IVideoPoolCallback
|
||||
{
|
||||
if (fPrimaryOwner)
|
||||
{
|
||||
this.Device.CreateVideoPool(this, rhHandle);
|
||||
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;
|
||||
private RemoteVideoPool m_remoteVideoPool;
|
||||
private IVideoPoolNotification m_imgOwner;
|
||||
private float m_flContentOverscan;
|
||||
private Size m_sizeTargetPxl;
|
||||
|
||||
internal VideoPool(GraphicsDevice device, IVideoPoolNotification imgOwner)
|
||||
: base(device, SurfaceFormat.External, RENDERHANDLE.NULL)
|
||||
=> this.m_imgOwner = imgOwner;
|
||||
|
||||
protected override void CreateRemoteSurfacePool(RENDERHANDLE rhHandle, bool fPrimaryOwner)
|
||||
{
|
||||
if (fPrimaryOwner)
|
||||
{
|
||||
this.Device.CreateVideoPool(this, rhHandle);
|
||||
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;
|
||||
}
|
||||
|
||||
internal RemoteVideoPool RemoteVideoStub => this.m_remoteVideoPool;
|
||||
|
||||
internal float ContentOverscan
|
||||
{
|
||||
get => this.m_flContentOverscan;
|
||||
set
|
||||
{
|
||||
if (Math2.WithinEpsilon(this.m_flContentOverscan, value))
|
||||
return;
|
||||
this.m_flContentOverscan = value;
|
||||
this.m_remoteVideoPool.SendSetContentOverscan(value);
|
||||
}
|
||||
}
|
||||
|
||||
internal void NotifyVideoModeChanged(Size sizeTargetPxl)
|
||||
{
|
||||
if (!(this.m_sizeTargetPxl != sizeTargetPxl))
|
||||
return;
|
||||
this.m_sizeTargetPxl = sizeTargetPxl;
|
||||
this.m_remoteVideoPool.SendNotifyVideoSizeChanged(sizeTargetPxl);
|
||||
}
|
||||
|
||||
void IVideoPoolCallback.OnInputChanged(
|
||||
RENDERHANDLE target,
|
||||
Size sizeTargetPxl,
|
||||
Size sizeAspectRatio,
|
||||
uint nFrameRateNumerator,
|
||||
uint nFrameRateDenominator,
|
||||
SurfaceFormat nFormat)
|
||||
{
|
||||
this.m_imgOwner.NotifySourceChanged(sizeTargetPxl, sizeAspectRatio);
|
||||
}
|
||||
|
||||
void IVideoPoolCallback.OnInvalidate(RENDERHANDLE target) => this.m_imgOwner.InvalidateClients();
|
||||
}
|
||||
|
||||
internal RemoteVideoPool RemoteVideoStub => this.m_remoteVideoPool;
|
||||
|
||||
internal float ContentOverscan
|
||||
{
|
||||
get => this.m_flContentOverscan;
|
||||
set
|
||||
{
|
||||
if (Math2.WithinEpsilon(this.m_flContentOverscan, value))
|
||||
return;
|
||||
this.m_flContentOverscan = value;
|
||||
this.m_remoteVideoPool.SendSetContentOverscan(value);
|
||||
}
|
||||
}
|
||||
|
||||
internal void NotifyVideoModeChanged(Size sizeTargetPxl)
|
||||
{
|
||||
if (!(this.m_sizeTargetPxl != sizeTargetPxl))
|
||||
return;
|
||||
this.m_sizeTargetPxl = sizeTargetPxl;
|
||||
this.m_remoteVideoPool.SendNotifyVideoSizeChanged(sizeTargetPxl);
|
||||
}
|
||||
|
||||
void IVideoPoolCallback.OnInputChanged(
|
||||
RENDERHANDLE target,
|
||||
Size sizeTargetPxl,
|
||||
Size sizeAspectRatio,
|
||||
uint nFrameRateNumerator,
|
||||
uint nFrameRateDenominator,
|
||||
SurfaceFormat nFormat)
|
||||
{
|
||||
this.m_imgOwner.NotifySourceChanged(sizeTargetPxl, sizeAspectRatio);
|
||||
}
|
||||
|
||||
void IVideoPoolCallback.OnInvalidate(RENDERHANDLE target) => this.m_imgOwner.InvalidateClients();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user