Commit 79732c9d1ef7ff89920cb3f38fd9f3fd4879d058

Sylvain 2021-09-25T11:35:20

Remove FillRects from back-end, where RenderGeometry can be used

diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c
index 88824e4..fde0e0a 100644
--- a/src/render/direct3d11/SDL_render_d3d11.c
+++ b/src/render/direct3d11/SDL_render_d3d11.c
@@ -2388,7 +2388,6 @@ D3D11_CreateRenderer(SDL_Window * window, Uint32 flags)
     renderer->QueueSetDrawColor = D3D11_QueueSetViewport;  /* SetViewport and SetDrawColor are (currently) no-ops. */
     renderer->QueueDrawPoints = D3D11_QueueDrawPoints;
     renderer->QueueDrawLines = D3D11_QueueDrawPoints;  /* lines and points queue vertices the same way. */
-    renderer->QueueFillRects = D3D11_QueueFillRects;
     renderer->QueueGeometry = D3D11_QueueGeometry;
     renderer->RunCommandQueue = D3D11_RunCommandQueue;
     renderer->RenderReadPixels = D3D11_RenderReadPixels;
diff --git a/src/render/vitagxm/SDL_render_vita_gxm.c b/src/render/vitagxm/SDL_render_vita_gxm.c
index 514541e..b214be8 100644
--- a/src/render/vitagxm/SDL_render_vita_gxm.c
+++ b/src/render/vitagxm/SDL_render_vita_gxm.c
@@ -93,8 +93,6 @@ static int VITA_GXM_RenderDrawPoints(SDL_Renderer *renderer, const SDL_RenderCom
 
 static int VITA_GXM_RenderDrawLines(SDL_Renderer *renderer, const SDL_RenderCommand *cmd);
 
-static int VITA_GXM_QueueFillRects(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FRect * rects, int count);
-
 static int VITA_GXM_RenderFillRects(SDL_Renderer *renderer, const SDL_RenderCommand *cmd);
 
 
@@ -244,7 +242,6 @@ VITA_GXM_CreateRenderer(SDL_Window *window, Uint32 flags)
     renderer->QueueSetDrawColor = VITA_GXM_QueueSetDrawColor;
     renderer->QueueDrawPoints = VITA_GXM_QueueDrawPoints;
     renderer->QueueDrawLines = VITA_GXM_QueueDrawLines;
-    renderer->QueueFillRects = VITA_GXM_QueueFillRects;
     renderer->QueueGeometry = VITA_GXM_QueueGeometry;
     renderer->RunCommandQueue = VITA_GXM_RunCommandQueue;
     renderer->RenderReadPixels = VITA_GXM_RenderReadPixels;
@@ -510,47 +507,6 @@ VITA_GXM_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const S
 }
 
 static int
-VITA_GXM_QueueFillRects(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FRect * rects, int count)
-{
-    int color;
-    color_vertex *vertices;
-    VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata;
-
-    cmd->data.draw.count = count;
-    color = data->drawstate.color;
-
-    vertices = (color_vertex *)pool_memalign(
-            data,
-            4 * count * sizeof(color_vertex), // 4 vertices * count
-            sizeof(color_vertex));
-
-    for (int i =0; i < count; i++)
-    {
-        const SDL_FRect *rect = &rects[i];
-
-        vertices[4*i+0].x = rect->x;
-        vertices[4*i+0].y = rect->y;
-        vertices[4*i+0].color = color;
-
-        vertices[4*i+1].x = rect->x + rect->w;
-        vertices[4*i+1].y = rect->y;
-        vertices[4*i+1].color = color;
-
-        vertices[4*i+2].x = rect->x;
-        vertices[4*i+2].y = rect->y + rect->h;
-        vertices[4*i+2].color = color;
-
-        vertices[4*i+3].x = rect->x + rect->w;
-        vertices[4*i+3].y = rect->y + rect->h;
-        vertices[4*i+3].color = color;
-    }
-
-    cmd->data.draw.first = (size_t)vertices;
-
-    return 0;
-}
-
-static int
 VITA_GXM_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture,
         const float *xy, int xy_stride, const int *color, int color_stride, const float *uv, int uv_stride,
         int num_vertices, const void *indices, int num_indices, int size_indices,
@@ -887,11 +843,8 @@ VITA_GXM_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *
                 break;
             }
 
-            case SDL_RENDERCMD_FILL_RECTS: {
-                SetDrawState(data, cmd);
-                VITA_GXM_RenderFillRects(renderer, cmd);
+            case SDL_RENDERCMD_FILL_RECTS: /* unused */
                 break;
-            }
 
             case SDL_RENDERCMD_COPY: /* unused */
                 break;