SDL: testautomation: only require accelerated renderer with non-dummy video driver

From 3ff56fda1a9bcfee8f947504dbf3c1b984688f38 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Sun, 27 Aug 2023 03:04:23 +0200
Subject: [PATCH] testautomation: only require accelerated renderer with
 non-dummy video driver

Backported from SDL3 commit 85e3099b.

Co-authored-by: Simon McVittie <smcv@collabora.com>
Resolves: https://github.com/libsdl-org/SDL/issues/8799
---
 test/testautomation_render.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/test/testautomation_render.c b/test/testautomation_render.c
index 9cf48effe2bb..45198a826ee1 100644
--- a/test/testautomation_render.c
+++ b/test/testautomation_render.c
@@ -43,6 +43,7 @@ static int _isSupported(int code);
 void InitCreateRenderer(void *arg)
 {
     int posX = 100, posY = 100, width = 320, height = 240;
+    int renderer_flags = SDL_RENDERER_ACCELERATED;
     renderer = NULL;
     window = SDL_CreateWindow("render_testCreateRenderer", posX, posY, width, height, 0);
     SDLTest_AssertPass("SDL_CreateWindow()");
@@ -51,7 +52,11 @@ void InitCreateRenderer(void *arg)
         return;
     }
 
-    renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
+    if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "dummy") == 0) {
+        renderer_flags = 0;
+    }
+
+    renderer = SDL_CreateRenderer(window, -1, renderer_flags);
     SDLTest_AssertPass("SDL_CreateRenderer()");
     SDLTest_AssertCheck(renderer != NULL, "Check SDL_CreateRenderer result");
     if (renderer == NULL) {