[ros-diffs] [chorns] 16024: DIB_24BPP_ColorFill performance test

chorns at svn.reactos.com chorns at svn.reactos.com
Sat Jun 18 10:04:52 CEST 2005


DIB_24BPP_ColorFill performance test
Added:
trunk/reactos/subsys/win32k/tests/tests/DIB_24BPP_ColorFill-performance.
c
Modified: trunk/reactos/subsys/win32k/tests/win32k.xml
  _____  

Added:
trunk/reactos/subsys/win32k/tests/tests/DIB_24BPP_ColorFill-performance.
c
---
trunk/reactos/subsys/win32k/tests/tests/DIB_24BPP_ColorFill-performance.
c	2005-06-18 07:43:49 UTC (rev 16023)
+++
trunk/reactos/subsys/win32k/tests/tests/DIB_24BPP_ColorFill-performance.
c	2005-06-18 08:04:30 UTC (rev 16024)
@@ -0,0 +1,44 @@

+#include <w32k.h>
+
+#include "regtests.h"
+
+static void SetupSurface(SURFOBJ* surface, RECTL* rect)
+{
+  UINT sizex;
+  UINT sizey;
+  UINT size;
+  UINT depth;
+
+  ZeroMemory(surface, sizeof(SURFOBJ));
+  depth = BitsPerFormat(BMF_24BPP);
+  sizex = rect->right - rect->left;
+  sizey = rect->bottom - rect->top;
+  size = sizey * sizex * depth;
+  surface->pvScan0 = malloc(size);
+  surface->lDelta = DIB_GetDIBWidthBytes(sizex, depth);
+}
+
+static void CleanupSurface(SURFOBJ* surface)
+{
+  free(surface->pvScan0);
+}
+
+static void RunTest()
+{
+  static RECTL rect = { 0, 0, 100, 100 };
+  SURFOBJ surface;
+  UINT color;
+  UINT i;
+
+  SetupSurface(&surface, &rect);
+  for (i = 0; i < 1000; i++)
+  {
+    BOOLEAN success = DIB_24BPP_ColorFill(&surface, &rect, color);
+    _AssertTrue(success);
+    if (!success)
+      break;
+  }
+  CleanupSurface(&surface);
+}
+
+_Dispatcher(Dib_24bpp_colorfill_performanceTest, "DIB_24BPP_ColorFill
performance")
Property changes on:
trunk/reactos/subsys/win32k/tests/tests/DIB_24BPP_ColorFill-performance.
c
___________________________________________________________________
Name: svn:eol-style
   + native
  _____  

Modified: trunk/reactos/subsys/win32k/tests/win32k.xml
--- trunk/reactos/subsys/win32k/tests/win32k.xml	2005-06-18
07:43:49 UTC (rev 16023)
+++ trunk/reactos/subsys/win32k/tests/win32k.xml	2005-06-18
08:04:30 UTC (rev 16024)
@@ -19,6 +19,7 @@

 	<linkerflag>-nostartfiles</linkerflag>
 	<linkerflag>-nostdlib</linkerflag>
 	<directory name="tests">
+		<file>DIB_24BPP_ColorFill-performance.c</file>
 	</directory>
 	<file>setup.c</file>
 	<xi:include href="stubs.xml" />
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050618/f805b6c5/attachment.html


More information about the Ros-diffs mailing list