aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <adamdharrison@gmail.com>2021-06-12 22:53:14 -0400
committerGitHub <noreply@github.com>2021-06-12 22:53:14 -0400
commit804429e3b699ee230722a8bd57d0b69b74862e60 (patch)
treeaae6191a0dc06b84e17b7efbb883a906ede13a97 /src
parent637b7f952d64bd2c53cb6285c554274bdc1d3713 (diff)
parent214e6898df88d1855ae595ea7e76c1e7603bea74 (diff)
downloadlite-xl-804429e3b699ee230722a8bd57d0b69b74862e60.tar.gz
lite-xl-804429e3b699ee230722a8bd57d0b69b74862e60.zip
Merge pull request #266 from adamharrison/QuickOptimization
Replaced fill loop with SDL_FillRect.
Diffstat (limited to 'src')
-rw-r--r--src/renderer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/renderer.c b/src/renderer.c
index b08c25d9..cd269687 100644
--- a/src/renderer.c
+++ b/src/renderer.c
@@ -309,7 +309,8 @@ void ren_draw_rect(RenRect rect, RenColor color) {
int dr = surface->w - (x2 - x1);
if (color.a == 0xff) {
- rect_draw_loop(color);
+ SDL_Rect rect = { x1, y1, x2 - x1, y2 - y1 };
+ SDL_FillRect(surface, &rect, SDL_MapRGBA(surface->format, color.r, color.g, color.b, color.a));
} else {
rect_draw_loop(blend_pixel(*d, color));
}