| 368 | } |
| 369 | |
| 370 | static int |
| 371 | QueueCmdSetDrawColor(SDL_Renderer *renderer, const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a) |
| 372 | { |
| 373 | const Uint32 color = ((a << 24) | (r << 16) | (g << 8) | b); |
| 374 | int retval = 0; |
| 375 | |
| 376 | if (!renderer->color_queued || (color != renderer->last_queued_color)) { |
| 377 | SDL_RenderCommand *cmd = AllocateRenderCommand(renderer); |
| 378 | retval = -1; |
| 379 | |
| 380 | if (cmd != NULL) { |
| 381 | cmd->command = SDL_RENDERCMD_SETDRAWCOLOR; |
| 382 | cmd->data.color.first = 0; /* render backend will fill this in. */ |
| 383 | cmd->data.color.r = r; |
| 384 | cmd->data.color.g = g; |
| 385 | cmd->data.color.b = b; |
| 386 | cmd->data.color.a = a; |
| 387 | retval = renderer->QueueSetDrawColor(renderer, cmd); |
| 388 | if (retval < 0) { |
| 389 | cmd->command = SDL_RENDERCMD_NO_OP; |
| 390 | } else { |
| 391 | renderer->last_queued_color = color; |
| 392 | renderer->color_queued = SDL_TRUE; |
| 393 | } |
| 394 | } |
| 395 | } |
| 396 | return retval; |
| 397 | } |
| 398 | |
| 399 | static int |
| 400 | QueueCmdClear(SDL_Renderer *renderer) |
no test coverage detected