Files
Xune/UIX.RenderApi.Skia/Microsoft/Iris/Render/RenderApi.cs
T

56 lines
2.2 KiB
C#
Raw Normal View History

2021-07-11 22:59:29 -05:00
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.Render.RenderApi
// Assembly: UIX.RenderApi, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1
// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll
using Microsoft.Iris.Render.Common;
using Microsoft.Iris.Render.Internal;
using Microsoft.Iris.Render.Protocol;
using System;
namespace Microsoft.Iris.Render
{
2021-07-11 23:04:40 -05:00
public static class RenderApi
2021-07-11 22:59:29 -05:00
{
2021-07-11 23:04:40 -05:00
public static IDebug DebugModule
{
get => Debug2.Module;
set => Debug2.Module = value;
}
2021-07-11 22:59:29 -05:00
2021-07-11 23:04:40 -05:00
public static IRenderEngine CreateEngine(
EngineInfo engineInfo,
IRenderHost renderHost)
{
Debug2.Validate(engineInfo != null, typeof(ArgumentNullException), nameof(engineInfo));
Debug2.Validate(renderHost != null, typeof(ArgumentNullException), nameof(renderHost));
2021-07-11 23:07:04 -05:00
IRenderEngine renderEngine = null;
2021-07-11 23:04:40 -05:00
if (engineInfo.Type == EngineType.Iris)
renderEngine = new RenderEngine(engineInfo as IrisEngineInfo, renderHost);
2021-07-11 23:04:40 -05:00
return renderEngine;
}
2021-07-11 22:59:29 -05:00
2021-07-11 23:04:40 -05:00
public static IRenderSession CreateSession(
RenderToken sessionToken,
IRenderHost renderHost)
{
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));
2021-07-11 23:07:04 -05:00
IRenderSession renderSession = null;
2021-07-11 23:04:40 -05:00
if (sessionToken.EngineInfo.Type == EngineType.Iris)
renderSession = new RenderSession((RenderEngine)null);
2021-07-11 23:04:40 -05:00
return renderSession;
}
2021-07-11 22:59:29 -05:00
2021-07-11 23:04:40 -05:00
public static void InitializeForToolOnly()
{
EngineApi.InitArgs args = new EngineApi.InitArgs(MessageCookieLayout.Default, RenderEngine.AllocateContextId());
EngineApi.IFC(EngineApi.SpInit(ref args));
}
2021-07-11 22:59:29 -05:00
2021-07-11 23:04:40 -05:00
public static void ShutdownForToolOnly() => EngineApi.IFC(EngineApi.SpUninit());
}
2021-07-11 22:59:29 -05:00
}