SDL
2.0
|
Go to the source code of this file.
Macros | |
#define | TESTRENDER_SCREEN_W 80 |
#define | TESTRENDER_SCREEN_H 60 |
#define | RENDER_COMPARE_FORMAT SDL_PIXELFORMAT_ARGB8888 |
#define | RENDER_COMPARE_AMASK 0xff000000 |
#define | RENDER_COMPARE_RMASK 0x00ff0000 |
#define | RENDER_COMPARE_GMASK 0x0000ff00 |
#define | RENDER_COMPARE_BMASK 0x000000ff |
#define | ALLOWABLE_ERROR_OPAQUE 0 |
#define | ALLOWABLE_ERROR_BLENDED 64 |
Functions | |
static int | _clearScreen (void) |
Clears the screen. Helper function. More... | |
static void | _compare (SDL_Surface *referenceSurface, int allowable_error) |
Compares screen pixels with image pixels. Helper function. More... | |
static int | _hasTexAlpha (void) |
Test to see if we can vary the alpha of the texture. Helper function. More... | |
static int | _hasTexColor (void) |
Test to see if can set texture color mode. Helper function. More... | |
static SDL_Texture * | _loadTestFace (void) |
Loads the test image 'Face' as texture. Helper function. More... | |
static int | _hasBlendModes (void) |
Test to see if we can vary the blend mode. Helper function. More... | |
static int | _hasDrawColor (void) |
Test to see if we can vary the draw color. Helper function. More... | |
static int | _isSupported (int code) |
Checks to see if functionality is supported. Helper function. More... | |
void | InitCreateRenderer (void *arg) |
void | CleanupDestroyRenderer (void *arg) |
int | render_testGetNumRenderDrivers (void *arg) |
Tests call to SDL_GetNumRenderDrivers. More... | |
int | render_testPrimitives (void *arg) |
Tests the SDL primitives for rendering. More... | |
int | render_testPrimitivesBlend (void *arg) |
Tests the SDL primitives with alpha for rendering. More... | |
int | render_testBlit (void *arg) |
Tests some blitting routines. More... | |
int | render_testBlitColor (void *arg) |
Blits doing color tests. More... | |
int | render_testBlitAlpha (void *arg) |
Tests blitting with alpha. More... | |
static void | _testBlitBlendMode (SDL_Texture *tface, int mode) |
Tests a blend mode. More... | |
int | render_testBlitBlend (void *arg) |
Tests some more blitting routines. More... | |
Variables | |
SDL_Window * | window = NULL |
SDL_Renderer * | renderer = NULL |
static const SDLTest_TestCaseReference | renderTest1 |
static const SDLTest_TestCaseReference | renderTest2 |
static const SDLTest_TestCaseReference | renderTest3 |
static const SDLTest_TestCaseReference | renderTest4 |
static const SDLTest_TestCaseReference | renderTest5 |
static const SDLTest_TestCaseReference | renderTest6 |
static const SDLTest_TestCaseReference | renderTest7 |
static const SDLTest_TestCaseReference * | renderTests [] |
SDLTest_TestSuiteReference | renderTestSuite |
#define ALLOWABLE_ERROR_BLENDED 64 |
Definition at line 23 of file testautomation_render.c.
Referenced by render_testBlitAlpha(), render_testBlitBlend(), and render_testPrimitivesBlend().
#define ALLOWABLE_ERROR_OPAQUE 0 |
Definition at line 22 of file testautomation_render.c.
Referenced by render_testBlit(), render_testBlitBlend(), render_testBlitColor(), and render_testPrimitives().
#define RENDER_COMPARE_AMASK 0xff000000 |
#define RENDER_COMPARE_BMASK 0x000000ff |
#define RENDER_COMPARE_FORMAT SDL_PIXELFORMAT_ARGB8888 |
Definition at line 16 of file testautomation_render.c.
Referenced by _compare().
#define RENDER_COMPARE_GMASK 0x0000ff00 |
#define RENDER_COMPARE_RMASK 0x00ff0000 |
#define TESTRENDER_SCREEN_H 60 |
Definition at line 14 of file testautomation_render.c.
Referenced by _compare(), _testBlitBlendMode(), render_testBlit(), render_testBlitAlpha(), render_testBlitBlend(), render_testBlitColor(), and render_testPrimitivesBlend().
#define TESTRENDER_SCREEN_W 80 |
Original code: automated SDL platform test written by Edgar Simo "bobbens" Extended and extensively updated by aschiffler at ferzkopp dot net
Definition at line 13 of file testautomation_render.c.
Referenced by _compare(), _testBlitBlendMode(), render_testBlit(), render_testBlitAlpha(), render_testBlitBlend(), render_testBlitColor(), render_testPrimitives(), and render_testPrimitivesBlend().
|
static |
Clears the screen. Helper function.
Definition at line 1036 of file testautomation_render.c.
References SDL_ALPHA_OPAQUE, SDL_BLENDMODE_NONE, SDL_RenderClear, SDL_RenderPresent, SDL_SetRenderDrawBlendMode, SDL_SetRenderDrawColor, and SDLTest_AssertCheck().
Referenced by _testBlitBlendMode(), render_testBlit(), render_testBlitAlpha(), render_testBlitBlend(), render_testBlitColor(), render_testPrimitives(), and render_testPrimitivesBlend().
|
static |
Compares screen pixels with image pixels. Helper function.
s | Image to compare against. |
Definition at line 992 of file testautomation_render.c.
References SDL_Rect::h, NULL, rect, RENDER_COMPARE_AMASK, RENDER_COMPARE_BMASK, RENDER_COMPARE_FORMAT, RENDER_COMPARE_GMASK, RENDER_COMPARE_RMASK, SDL_CreateRGBSurfaceFrom, SDL_free, SDL_FreeSurface, SDL_malloc, SDL_RenderReadPixels, SDLTest_AssertCheck(), SDLTest_CompareSurfaces(), TESTRENDER_SCREEN_H, TESTRENDER_SCREEN_W, testSurface, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by render_testBlit(), render_testBlitAlpha(), render_testBlitBlend(), render_testBlitColor(), render_testPrimitives(), and render_testPrimitivesBlend().
|
static |
Test to see if we can vary the blend mode. Helper function.
Definition at line 824 of file testautomation_render.c.
References _isSupported(), SDL_BLENDMODE_ADD, SDL_BLENDMODE_BLEND, SDL_BLENDMODE_MOD, SDL_BLENDMODE_NONE, SDL_GetRenderDrawBlendMode, and SDL_SetRenderDrawBlendMode.
Referenced by render_testBlitBlend(), and render_testPrimitivesBlend().
|
static |
Test to see if we can vary the draw color. Helper function.
Definition at line 786 of file testautomation_render.c.
References _isSupported(), SDL_ALPHA_OPAQUE, SDL_GetRenderDrawColor, and SDL_SetRenderDrawColor.
Referenced by render_testBlit(), render_testPrimitives(), and render_testPrimitivesBlend().
|
static |
Test to see if we can vary the alpha of the texture. Helper function.
Definition at line 950 of file testautomation_render.c.
References _isSupported(), _loadTestFace(), NULL, SDL_DestroyTexture, SDL_GetTextureAlphaMod, and SDL_SetTextureAlphaMod.
Referenced by render_testBlitAlpha(), and render_testBlitBlend().
|
static |
Test to see if can set texture color mode. Helper function.
Definition at line 910 of file testautomation_render.c.
References _isSupported(), _loadTestFace(), NULL, SDL_DestroyTexture, SDL_GetTextureColorMod, and SDL_SetTextureColorMod.
Referenced by render_testBlitBlend().
|
static |
Checks to see if functionality is supported. Helper function.
Definition at line 773 of file testautomation_render.c.
Referenced by _hasBlendModes(), _hasDrawColor(), _hasTexAlpha(), and _hasTexColor().
|
static |
Loads the test image 'Face' as texture. Helper function.
Definition at line 880 of file testautomation_render.c.
References NULL, SDL_CreateTextureFromSurface, SDL_FreeSurface, SDL_GetError, SDLTest_ImageFace(), and SDLTest_LogError().
Referenced by _hasTexAlpha(), _hasTexColor(), render_testBlit(), render_testBlitAlpha(), render_testBlitBlend(), and render_testBlitColor().
|
static |
Tests a blend mode.
Definition at line 583 of file testautomation_render.c.
References _clearScreen(), SDL_Rect::h, i, j, NULL, rect, SDL_QueryTexture, SDL_RenderCopy, SDL_SetTextureBlendMode, SDLTest_AssertCheck(), TESTRENDER_SCREEN_H, TESTRENDER_SCREEN_W, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by render_testBlitBlend().
Definition at line 66 of file testautomation_render.c.
References NULL, SDL_DestroyRenderer, SDL_DestroyWindow, and SDLTest_AssertPass().
Create software renderer for tests
Definition at line 43 of file testautomation_render.c.
References NULL, SDL_CreateRenderer, SDL_CreateWindow, SDL_DestroyWindow, SDL_RENDERER_ACCELERATED, SDLTest_AssertCheck(), and SDLTest_AssertPass().
int render_testBlit | ( | void * | arg | ) |
Tests some blitting routines.
Definition at line 362 of file testautomation_render.c.
References _clearScreen(), _compare(), _hasDrawColor(), _loadTestFace(), ALLOWABLE_ERROR_OPAQUE, SDL_Rect::h, i, j, NULL, rect, referenceSurface, SDL_DestroyTexture, SDL_FreeSurface, SDL_QueryTexture, SDL_RenderCopy, SDL_RenderPresent, SDLTest_AssertCheck(), SDLTest_ImageBlit(), TEST_ABORTED, TEST_COMPLETED, TESTRENDER_SCREEN_H, TESTRENDER_SCREEN_W, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
int render_testBlitAlpha | ( | void * | arg | ) |
Tests blitting with alpha.
Definition at line 506 of file testautomation_render.c.
References _clearScreen(), _compare(), _hasTexAlpha(), _loadTestFace(), ALLOWABLE_ERROR_BLENDED, SDL_Rect::h, i, j, NULL, rect, referenceSurface, SDL_DestroyTexture, SDL_FreeSurface, SDL_QueryTexture, SDL_RenderCopy, SDL_RenderPresent, SDL_SetTextureAlphaMod, SDLTest_AssertCheck(), SDLTest_ImageBlitAlpha(), TEST_ABORTED, TEST_COMPLETED, TESTRENDER_SCREEN_H, TESTRENDER_SCREEN_W, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
int render_testBlitBlend | ( | void * | arg | ) |
Tests some more blitting routines.
Definition at line 635 of file testautomation_render.c.
References _clearScreen(), _compare(), _hasBlendModes(), _hasTexAlpha(), _hasTexColor(), _loadTestFace(), _testBlitBlendMode(), ALLOWABLE_ERROR_BLENDED, ALLOWABLE_ERROR_OPAQUE, SDL_Rect::h, i, j, NULL, rect, referenceSurface, SDL_BLENDMODE_ADD, SDL_BLENDMODE_BLEND, SDL_BLENDMODE_MOD, SDL_BLENDMODE_NONE, SDL_DestroyTexture, SDL_FreeSurface, SDL_QueryTexture, SDL_RenderCopy, SDL_RenderPresent, SDL_SetTextureAlphaMod, SDL_SetTextureBlendMode, SDL_SetTextureColorMod, SDLTest_AssertCheck(), SDLTest_ImageBlitBlend(), SDLTest_ImageBlitBlendAdd(), SDLTest_ImageBlitBlendAll(), SDLTest_ImageBlitBlendMod(), SDLTest_ImageBlitBlendNone(), TEST_ABORTED, TEST_COMPLETED, TESTRENDER_SCREEN_H, TESTRENDER_SCREEN_W, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
int render_testBlitColor | ( | void * | arg | ) |
Blits doing color tests.
Definition at line 432 of file testautomation_render.c.
References _clearScreen(), _compare(), _loadTestFace(), ALLOWABLE_ERROR_OPAQUE, SDL_Rect::h, i, j, NULL, rect, referenceSurface, SDL_DestroyTexture, SDL_FreeSurface, SDL_QueryTexture, SDL_RenderCopy, SDL_RenderPresent, SDL_SetTextureColorMod, SDLTest_AssertCheck(), SDLTest_ImageBlitColor(), TEST_ABORTED, TEST_COMPLETED, TESTRENDER_SCREEN_H, TESTRENDER_SCREEN_W, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
int render_testGetNumRenderDrivers | ( | void * | arg | ) |
Tests call to SDL_GetNumRenderDrivers.
Definition at line 89 of file testautomation_render.c.
References SDL_GetNumRenderDrivers, SDLTest_AssertCheck(), and TEST_COMPLETED.
int render_testPrimitives | ( | void * | arg | ) |
Tests the SDL primitives for rendering.
Definition at line 107 of file testautomation_render.c.
References _clearScreen(), _compare(), _hasDrawColor(), ALLOWABLE_ERROR_OPAQUE, SDL_Rect::h, NULL, rect, referenceSurface, SDL_ALPHA_OPAQUE, SDL_FreeSurface, SDL_RenderDrawLine, SDL_RenderDrawPoint, SDL_RenderFillRect, SDL_RenderPresent, SDL_SetRenderDrawColor, SDLTest_AssertCheck(), SDLTest_ImagePrimitives(), TEST_COMPLETED, TESTRENDER_SCREEN_W, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
int render_testPrimitivesBlend | ( | void * | arg | ) |
Tests the SDL primitives with alpha for rendering.
Definition at line 213 of file testautomation_render.c.
References _clearScreen(), _compare(), _hasBlendModes(), _hasDrawColor(), ALLOWABLE_ERROR_BLENDED, SDL_Rect::h, i, j, NULL, rect, referenceSurface, SDL_BLENDMODE_ADD, SDL_BLENDMODE_BLEND, SDL_BLENDMODE_NONE, SDL_FreeSurface, SDL_RenderDrawLine, SDL_RenderDrawPoint, SDL_RenderFillRect, SDL_RenderPresent, SDL_SetRenderDrawBlendMode, SDL_SetRenderDrawColor, SDLTest_AssertCheck(), SDLTest_ImagePrimitivesBlend(), TEST_COMPLETED, TESTRENDER_SCREEN_H, TESTRENDER_SCREEN_W, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
SDL_Renderer* renderer = NULL |
Definition at line 27 of file testautomation_render.c.
|
static |
Definition at line 1064 of file testautomation_render.c.
|
static |
Definition at line 1067 of file testautomation_render.c.
|
static |
Definition at line 1071 of file testautomation_render.c.
|
static |
Definition at line 1074 of file testautomation_render.c.
|
static |
Definition at line 1077 of file testautomation_render.c.
|
static |
Definition at line 1081 of file testautomation_render.c.
|
static |
Definition at line 1085 of file testautomation_render.c.
|
static |
Definition at line 1089 of file testautomation_render.c.
SDLTest_TestSuiteReference renderTestSuite |
Definition at line 1094 of file testautomation_render.c.
SDL_Window* window = NULL |
Definition at line 26 of file testautomation_render.c.