diff --git a/reactos/subsys/win32k/tests/tests/DIB_24BPP_ColorFill-performance.c b/reactos/subsys/win32k/tests/tests/DIB_24BPP_ColorFill-performance.c new file mode 100644 index 00000000000..3d1b8237101 --- /dev/null +++ b/reactos/subsys/win32k/tests/tests/DIB_24BPP_ColorFill-performance.c @@ -0,0 +1,44 @@ +#include + +#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") diff --git a/reactos/subsys/win32k/tests/win32k.xml b/reactos/subsys/win32k/tests/win32k.xml index 73b95ecdf3f..b3965a15532 100644 --- a/reactos/subsys/win32k/tests/win32k.xml +++ b/reactos/subsys/win32k/tests/win32k.xml @@ -19,6 +19,7 @@ -nostartfiles -nostdlib + DIB_24BPP_ColorFill-performance.c setup.c