mirror of
https://github.com/BoredDevNL/BoredOS.git
synced 2026-05-15 18:58:40 +00:00
OPTIMIZATION: use mem_mcpy in display buffer
This commit is contained in:
parent
1ee2fcad9e
commit
4c46650c64
1 changed files with 2 additions and 3 deletions
|
|
@ -758,10 +758,9 @@ void graphics_flip_buffer(void) {
|
||||||
uint32_t *src_row = &g_back_buffer[curr_y * g_fb->width + x];
|
uint32_t *src_row = &g_back_buffer[curr_y * g_fb->width + x];
|
||||||
|
|
||||||
if (g_fb->bpp == 32) {
|
if (g_fb->bpp == 32) {
|
||||||
|
extern void mem_memcpy(void *dest, const void *src, size_t len);
|
||||||
uint32_t *dst_row = (uint32_t *)((uint8_t *)g_fb->address + curr_y * g_fb->pitch) + x;
|
uint32_t *dst_row = (uint32_t *)((uint8_t *)g_fb->address + curr_y * g_fb->pitch) + x;
|
||||||
for (int j = 0; j < w; j++) {
|
mem_memcpy(dst_row, src_row, w * 4);
|
||||||
dst_row[j] = src_row[j];
|
|
||||||
}
|
|
||||||
} else if (g_fb->bpp == 16) {
|
} else if (g_fb->bpp == 16) {
|
||||||
uint16_t *dst_row = (uint16_t *)((uint8_t *)g_fb->address + curr_y * g_fb->pitch) + x;
|
uint16_t *dst_row = (uint16_t *)((uint8_t *)g_fb->address + curr_y * g_fb->pitch) + x;
|
||||||
for (int j = 0; j < w; j++) {
|
for (int j = 0; j < w; j++) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue