fix widget rendering: stop polluting view_table with frame_buf IDs
Frame_buf IDs (0x10000000-0x1FFFFFFF) were registered in the 256-entry view_table alongside WINGs views, filling it with tombstones until lookups failed. Now frame_buf IDs are excluded from the table; the 3 callers that passed frame_buf IDs to WMDrawString pass raw pixman pointers instead.
This commit is contained in:
parent
f96c847cf7
commit
49a0b50a6d
|
|
@ -25,11 +25,10 @@
|
|||
extern void *W_GetViewBacking(unsigned long id);
|
||||
static inline pixman_image_t *wl_font_resolve_drawable(WMDrawable d)
|
||||
{
|
||||
/* Synthetic IDs: 0x10000000-0x1FFFFFFF = WM frame_buf windows,
|
||||
* 0x20000000-0x2FFFFFFF = WINGs view windows.
|
||||
* Both are registered via W_RegisterBacking so W_GetViewBacking
|
||||
* handles both ranges uniformly. */
|
||||
if ((unsigned long)d >= 0x10000000 && (unsigned long)d < 0x30000000)
|
||||
/* WINGs view IDs (0x20000000-0x2FFFFFFF) are in the backing table.
|
||||
* Frame_buf IDs (0x10000000-0x1FFFFFFF) are no longer stored;
|
||||
* callers pass raw pixman_image_t pointers instead. */
|
||||
if ((unsigned long)d >= 0x20000000 && (unsigned long)d < 0x30000000)
|
||||
return (pixman_image_t *)W_GetViewBacking((unsigned long)d);
|
||||
return (pixman_image_t *)(uintptr_t)d;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ extern void *W_GetViewBacking(unsigned long id);
|
|||
static inline pixman_image_t *
|
||||
resolve_drawable(WMDrawable d)
|
||||
{
|
||||
if ((unsigned long)d >= 0x10000000 && (unsigned long)d < 0x30000000)
|
||||
if ((unsigned long)d >= 0x20000000 && (unsigned long)d < 0x30000000)
|
||||
return (pixman_image_t *)W_GetViewBacking((unsigned long)d);
|
||||
return (pixman_image_t *)d;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,6 +146,11 @@ Bool W_IsValidView(W_View *view)
|
|||
*/
|
||||
void W_RegisterBacking(WNativeWindow id, void *img)
|
||||
{
|
||||
/* Only register WINGs view IDs (0x20000000+) in the table.
|
||||
* Frame_buf IDs (0x10000000-0x1FFFFFFF) are no longer stored here;
|
||||
* callers pass raw pixman pointers for text drawing instead. */
|
||||
if ((unsigned long)id >= 0x10000000 && (unsigned long)id < 0x20000000)
|
||||
return;
|
||||
view_table_put(id, NULL);
|
||||
W_SetViewBacking(id, img);
|
||||
}
|
||||
|
|
@ -153,6 +158,8 @@ void W_RegisterBacking(WNativeWindow id, void *img)
|
|||
/* W_UnregisterBacking - remove a backing registration (on frame_buf destroy). */
|
||||
void W_UnregisterBacking(WNativeWindow id)
|
||||
{
|
||||
if ((unsigned long)id >= 0x10000000 && (unsigned long)id < 0x20000000)
|
||||
return;
|
||||
view_table_remove(id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ wl_workspace_badge_render(WScreen *scr, WNativeWindow badge_win,
|
|||
|
||||
for (int x = 0; x <= 4; x++)
|
||||
for (int y = 0; y <= 4; y++)
|
||||
WMDrawString(scr->wmscreen, (WMDrawable)badge_win, scr->white,
|
||||
WMDrawString(scr->wmscreen, (WMDrawable)(uintptr_t)fb->image, scr->white,
|
||||
scr->workspace_name_font, x, y, name, name_len);
|
||||
|
||||
/* Save mask: pixels with any white component are visible */
|
||||
|
|
@ -58,7 +58,7 @@ wl_workspace_badge_render(WScreen *scr, WNativeWindow badge_win,
|
|||
/* Draw final text: white on black at center (2,2) */
|
||||
for (int i = 0; i < npx; i++)
|
||||
px[i] = 0xFF000000;
|
||||
WMDrawString(scr->wmscreen, (WMDrawable)badge_win, scr->white,
|
||||
WMDrawString(scr->wmscreen, (WMDrawable)(uintptr_t)fb->image, scr->white,
|
||||
scr->workspace_name_font, 2, 2, name, name_len);
|
||||
|
||||
/* Apply mask as alpha channel */
|
||||
|
|
|
|||
|
|
@ -661,7 +661,7 @@ void wl_balloon_show(WScreen *scr, void *bal_ptr)
|
|||
}
|
||||
|
||||
/* Draw text */
|
||||
WMDrawString(scr->wmscreen, (WMDrawable)fb->id, scr->black, font,
|
||||
WMDrawString(scr->wmscreen, (WMDrawable)(uintptr_t)fb->image, scr->black, font,
|
||||
pad, pad, bal->text, textlen);
|
||||
|
||||
/* Position near objectWindow */
|
||||
|
|
|
|||
Loading…
Reference in New Issue