mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-13 15:13:54 +00:00
render: an empty clip rect should clip all drawing
Added a test to validate this and fixed the Metal renderer Fixes https://github.com/libsdl-org/SDL/issues/15434
This commit is contained in:
@@ -1361,6 +1361,20 @@ static int SDLCALL render_testClipRect(void *arg)
|
||||
/* Check to see if final image matches. */
|
||||
compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE);
|
||||
|
||||
/*
|
||||
* Verify that empty cliprect clips all drawing
|
||||
*/
|
||||
|
||||
/* Set the cliprect and do a fill operation */
|
||||
cliprect.h = 0;
|
||||
CHECK_FUNC(SDL_SetRenderClipRect, (renderer, &cliprect))
|
||||
CHECK_FUNC(SDL_SetRenderDrawColor, (renderer, 255, 0, 0, SDL_ALPHA_OPAQUE))
|
||||
CHECK_FUNC(SDL_RenderFillRect, (renderer, NULL))
|
||||
CHECK_FUNC(SDL_SetRenderClipRect, (renderer, NULL))
|
||||
|
||||
/* Check to see if final image matches. */
|
||||
compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE);
|
||||
|
||||
/*
|
||||
* Verify that clear ignores the cliprect
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user