Everywhere: Use ctx->plot()

This commit is contained in:
Alec Murphy 2025-03-25 11:33:52 -04:00
parent 6232873c49
commit 6d1fbb51ac
2 changed files with 10 additions and 8 deletions

View file

@ -110,9 +110,9 @@ U0 @templeos_winmgr_redraw()
dc = DCScrnCapture; dc = DCScrnCapture;
for (y = 0; y < GR_HEIGHT; y++) { for (y = 0; y < GR_HEIGHT; y++) {
for (x = 0; x < GR_WIDTH; x++) { for (x = 0; x < GR_WIDTH; x++) {
Plot2D(win->render_ctx, x + 4, y + 24, win->render_ctx->plot(x + 4, y + 24,
tos_palette_std[dc->body[(y * dc->width) + x]]); tos_palette_std[dc->body[(y * dc->width) + x]]);
Plot2D(win->backing_store, x + 4, y + 24, win->backing_store->plot(x + 4, y + 24,
tos_palette_std[dc->body[(y * dc->width) + x]]); tos_palette_std[dc->body[(y * dc->width) + x]]);
} }
} }

View file

@ -1128,6 +1128,7 @@ U0 @umami_vert_scroll_button_repaint(Window* win, I64 x, I64 y, I64 width,
I64 height) I64 height)
{ {
I64 i; I64 i;
Context2D* ctx = win->render_ctx;
Rect2D(win->render_ctx, x, y, width, height, Color(192, 192, 192)); Rect2D(win->render_ctx, x, y, width, height, Color(192, 192, 192));
for (i = 0; i < height; i++) { for (i = 0; i < height; i++) {
@ -1140,14 +1141,14 @@ U0 @umami_vert_scroll_button_repaint(Window* win, I64 x, I64 y, I64 width,
Color(64, 64, 64)); Color(64, 64, 64));
} }
Plot2D(win->render_ctx, x + 1, y, Color(192, 192, 192)); ctx->plot(x + 1, y, Color(192, 192, 192));
Plot2D(win->render_ctx, x + 14, y, Color(192, 192, 192)); ctx->plot(x + 14, y, Color(192, 192, 192));
Plot2D(win->render_ctx, x + 15, y, Color(64, 64, 64)); ctx->plot(x + 15, y, Color(64, 64, 64));
Line2D(win->render_ctx, x + 1, y + 1, x + width - 2, y + 1, Line2D(win->render_ctx, x + 1, y + 1, x + width - 2, y + 1,
Color(255, 255, 255)); Color(255, 255, 255));
Plot2D(win->render_ctx, x + 14, y + 1, Color(128, 128, 128)); ctx->plot(x + 14, y + 1, Color(128, 128, 128));
Plot2D(win->render_ctx, x + 15, y + 1, Color(64, 64, 64)); ctx->plot(x + 15, y + 1, Color(64, 64, 64));
Line2D(win->render_ctx, x + 1, y + height - 2, x + width - 2, y + height - 2, Line2D(win->render_ctx, x + 1, y + height - 2, x + width - 2, y + height - 2,
Color(128, 128, 128)); Color(128, 128, 128));
@ -1164,6 +1165,7 @@ U0 @umami_vert_scrollbar_repaint(Window* win, I64 event,
I64 segment_length = widget->length; I64 segment_length = widget->length;
I64 i, j; I64 i, j;
Bool fill = TRUE; Bool fill = TRUE;
Context2D* ctx = win->render_ctx;
if (widget->in_drag && Mouse.y > win->y + widget->y && Mouse.y < win->y + widget->y + widget->height) { if (widget->in_drag && Mouse.y > win->y + widget->y && Mouse.y < win->y + widget->y + widget->height) {
if (widget->origin.mouse_y != Mouse.y) { if (widget->origin.mouse_y != Mouse.y) {
@ -1195,7 +1197,7 @@ U0 @umami_vert_scrollbar_repaint(Window* win, I64 event,
for (i = 0; i < widget->width; i++) { for (i = 0; i < widget->width; i++) {
for (j = 16; j < widget->height - 16; j++) { for (j = 16; j < widget->height - 16; j++) {
if (fill) if (fill)
Plot2D(win->render_ctx, i + x, j + y, Color(255, 255, 255)); ctx->plot(i + x, j + y, Color(255, 255, 255));
fill = !fill; fill = !fill;
} }
fill = !fill; fill = !fill;