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

main
Sylvain 2021-09-25 11:35:20 +02:00 committed by Ryan C. Gordon
parent f02ad2820f
commit 79732c9d1e
2 changed files with 1 additions and 49 deletions

View File

@ -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;

View File

@ -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;
@ -509,47 +506,6 @@ VITA_GXM_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const S
return 0;
}
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,
@ -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;