perf(sdk): clip_contains 逐像素函数调用→内联 (agent-235, MIPS汇编实证每像素省34指令,修demo滑动卡顿) + invalidate 分支加 clip 窗口收敛 overdraw

meow_ui.a→4ac08c6e; 三App重链已部署; 宿主四套件全PASS+视觉正确性验证; launcher不重链(不含绘制受影响路径,语义等价)
This commit is contained in:
MeowOS committed 2026-08-31 18:59:54 +08:00
1 parent 829ac3ba88
commit 40b8e33b94
18 files changed
+180 -11

No files matched your search

+5 -1
View File
@@ -77,7 +77,10 @@ static void clip_cur(int out[4]) { /* 当前 clip 边界(无 clip = 全屏
out[2] = g_clip_stack[g_clip_n - 1][2]; out[3] = g_clip_stack[g_clip_n - 1][3];
} else { out[0] = 0; out[1] = 0; out[2] = g_xres; out[3] = g_yres; }
}
static int clip_contains(int x, int y)
/* 逐像素 clip 判定:须 inline —— MIPS -Os 若抽成函数调用,每一像素(ring/circle/圆角/
* alpha/blit/5x7)都付一次 call+prologue,软渲上被显著放大(宿主 x86 -Os 会内联故测不出)。
* 强制内联后为 4 次整数比较,与旧「越界检查」同价;顶层(g_clip_n==0)= 全屏零开销直通。 */
static inline int clip_contains(int x, int y)
{
if (g_clip_n == 0) return x >= 0 && x < g_xres && y >= 0 && y < g_yres;
return x >= g_clip_stack[g_clip_n - 1][0] && x < g_clip_stack[g_clip_n - 1][2] &&
@@ -1136,6 +1139,7 @@ int meow_ui_init(const meow_ui_opts *opts)
{
if (g_init_ok) return 0;
meow_log_install_exit_handler(); /* M2.78:SIGTERM/SIGINT 兜底写 exit:<sig> 日志 */
meow_ui_install_sigusr1_guard(); /* M2.87:SIGUSR1 无害护栏(防泄漏 SIGUSR1 杀 App) */
int fw = 0, fh = 0;
if (opts) { fw = opts->width; fh = opts->height; }