[fix] Draw effect target

This commit is contained in:
2026-06-05 18:03:13 +08:00
Unverified
parent 5a31effcf1
commit 7c66610c13
9 changed files with 85 additions and 103 deletions
+12 -2
View File
@@ -13,5 +13,15 @@ struct gfx_context {
extern gfx_context g_gfx;
void gfx_init(EFI_GRAPHICS_OUTPUT_PROTOCOL *GOP); // 初始化 GFX
void gfx_clear(void); // 清空 GFX(相当于重置)
struct draw_target {
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *buf;
unsigned int w;
unsigned int h;
};
extern draw_target g_draw_target;
void gfx_init(EFI_GRAPHICS_OUTPUT_PROTOCOL *GOP);
void gfx_clear(void);
void draw_set_target(EFI_GRAPHICS_OUTPUT_BLT_PIXEL *buf, unsigned int w, unsigned int h);
void draw_set_default_target(void);
+7 -1
View File
@@ -3,4 +3,10 @@
#include <efi.h>
#include <graphics/context.h>
void draw_pixel(unsigned int x, unsigned int y, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color); // 画像素
void global_draw_pixel(unsigned int x, unsigned int y, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color);
void global_draw_rect(unsigned int bx, unsigned int by, unsigned int ex, unsigned int ey,
EFI_GRAPHICS_OUTPUT_BLT_PIXEL color);
void draw_pixel(unsigned int x, unsigned int y, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color);
void draw_rect(unsigned int bx, unsigned int by, unsigned int ex, unsigned int ey,
EFI_GRAPHICS_OUTPUT_BLT_PIXEL color);
-13
View File
@@ -1,13 +0,0 @@
#pragma once
#include <efi.h>
void gfx_fill_rect(EFI_GRAPHICS_OUTPUT_BLT_PIXEL* buf,
UINT32 buf_w, UINT32 buf_h,
UINT32 x, UINT32 y, UINT32 w, UINT32 h,
EFI_GRAPHICS_OUTPUT_BLT_PIXEL color);
void gfx_draw_rect(EFI_GRAPHICS_OUTPUT_BLT_PIXEL* buf,
UINT32 buf_w, UINT32 buf_h,
UINT32 x, UINT32 y, UINT32 w, UINT32 h,
EFI_GRAPHICS_OUTPUT_BLT_PIXEL color);