public void RDPEGFX_SurfaceToScreen_PositiveTest_MultiSurfaceOverlap()
{
uint fid;
this.TestSite.Log.Add(LogEntryKind.Comment, "Do capability exchange.");
// Init for capability exchange
RDPEGFX_CapabilityExchange();
RDPGFX_RECT16 verifyRect = RdpegfxTestUtility.ConvertToRect(RdpegfxTestUtility.surfPos, RdpegfxTestUtility.surfWidth, RdpegfxTestUtility.surfHeight);
// Init Data for test
RDPGFX_POINT16[] positions = new RDPGFX_POINT16[4];
positions[0] = new RDPGFX_POINT16(RdpegfxTestUtility.surfPos.x, RdpegfxTestUtility.surfPos.y);
positions[1] = new RDPGFX_POINT16((ushort)(RdpegfxTestUtility.surfPos.x + RdpegfxTestUtility.surfWidth / 2), RdpegfxTestUtility.surfPos.y);
positions[2] = new RDPGFX_POINT16(RdpegfxTestUtility.surfPos.x, (ushort)(RdpegfxTestUtility.surfPos.y + RdpegfxTestUtility.surfHeight / 2));
positions[3] = new RDPGFX_POINT16(RdpegfxTestUtility.surfPos.x, RdpegfxTestUtility.surfPos.y);
ushort[] widths = new ushort[4];
widths[0] = RdpegfxTestUtility.surfWidth;
widths[1] = (ushort)(RdpegfxTestUtility.surfWidth / 2);
widths[2] = RdpegfxTestUtility.surfWidth;
widths[3] = (ushort)(RdpegfxTestUtility.surfWidth / 2);
ushort[] heights = new ushort[4];
heights[0] = (ushort)(RdpegfxTestUtility.surfHeight / 2);
heights[1] = RdpegfxTestUtility.surfHeight;
heights[2] = (ushort)(RdpegfxTestUtility.surfHeight / 2);
heights[3] = RdpegfxTestUtility.surfHeight;
Color[] colors = new Color[4];
colors[0] = Color.Green;
colors[1] = Color.Blue;
colors[2] = Color.Red;
colors[3] = Color.Yellow;
Surface[] surfaces = new Surface[4];
// Test the overlap
for (int i = 0; i < positions.Length; i++)
{
this.TestSite.Log.Add(LogEntryKind.Comment, "Create a surface and fill it with color: {0}.", colors[i]);
// Create & output a surface
RDPGFX_RECT16 surfRect = RdpegfxTestUtility.ConvertToRect(positions[i], widths[i], heights[i]);
surfaces[i] = this.rdpegfxAdapter.CreateAndOutputSurface(surfRect, PixelFormat.PIXEL_FORMAT_XRGB_8888);
this.TestSite.Assert.IsNotNull(surfaces[i], "Surface {0} is created", surfaces[i].Id);
// Send solid fill request to client to fill surface with green color
RDPGFX_RECT16 fillSurfRect = RdpegfxTestUtility.ConvertToRect(RdpegfxTestUtility.imgPos, widths[i], heights[i]);
RDPGFX_RECT16[] fillRects = { fillSurfRect }; // Relative to surface
fid = this.rdpegfxAdapter.SolidFillSurface(surfaces[i], RdpegfxTestUtility.ToRdpgfx_Color32(colors[i]), fillRects);
this.TestSite.Log.Add(LogEntryKind.Debug, "Surface is filled with solid color in frame: {0}", fid);
// Expect the client to send a frame acknowledge pdu
// If the server receives the message, it indicates that the client has been successfully decoded the logical frame of graphics commands
this.rdpegfxAdapter.ExpectFrameAck(fid);
this.TestSite.Log.Add(LogEntryKind.Comment, "Verify output on SUT Display if the verifySUTDisplay entry in PTF config is true.");
this.VerifySUTDisplay(false, verifyRect);
}
// Delete the surface
for (int i = 0; i < surfaces.Length; i++)
{
if (surfaces[i] != null)
{
this.rdpegfxAdapter.DeleteSurface(surfaces[i].Id);
this.TestSite.Log.Add(LogEntryKind.Debug, "Surface {0} is deleted", surfaces[i].Id);
}
}
}