/ src / Ryujinx.HLE / UI / RenderingSurfaceInfo.cs
RenderingSurfaceInfo.cs
 1  using Ryujinx.HLE.HOS.Services.SurfaceFlinger;
 2  using System;
 3  
 4  namespace Ryujinx.HLE.UI
 5  {
 6      /// <summary>
 7      /// Information about the indirect layer that is being drawn to.
 8      /// </summary>
 9      class RenderingSurfaceInfo : IEquatable<RenderingSurfaceInfo>
10      {
11          public ColorFormat ColorFormat { get; }
12          public uint Width { get; }
13          public uint Height { get; }
14          public uint Pitch { get; }
15          public uint Size { get; }
16  
17          public RenderingSurfaceInfo(ColorFormat colorFormat, uint width, uint height, uint pitch, uint size)
18          {
19              ColorFormat = colorFormat;
20              Width = width;
21              Height = height;
22              Pitch = pitch;
23              Size = size;
24          }
25  
26          public bool Equals(RenderingSurfaceInfo other)
27          {
28              return ColorFormat == other.ColorFormat &&
29                     Width == other.Width &&
30                     Height == other.Height &&
31                     Pitch == other.Pitch &&
32                     Size == other.Size;
33          }
34  
35          public override bool Equals(object obj)
36          {
37              return obj is RenderingSurfaceInfo info && Equals(info);
38          }
39  
40          public override int GetHashCode()
41          {
42              return BitConverter.ToInt32(BitConverter.GetBytes(((ulong)ColorFormat) ^ Width ^ Height ^ Pitch ^ Size));
43          }
44      }
45  }