DIB_24BPP_ColorFill performance test

svn path=/trunk/; revision=16024
This commit is contained in:
Casper Hornstrup 2005-06-18 08:04:30 +00:00
parent 2486be430f
commit 1ac8300db4
2 changed files with 45 additions and 0 deletions

View file

@ -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")

View file

@ -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" />