mirror of
https://dev.lirent.ru/Vatrog/vm-vgpu-streamer.git
synced 2026-07-09 00:46:36 +03:00
feat: add graphics-context sensors to producer contract
Append three host-readable sensor groups to the producer block, ABI
frozen by offset asserts (producer still fits page 0):
- cursor Tier-1 (hotspot, glyph dims, shape identity), published under
the existing cursor_seq gate
- content_change_ns: monotonic stamp of the last scene-content change
- display geometry on its own cache line under a geom_seq seqlock:
virtual-desktop bbox, captured-output origin, DPI, refresh
Source the cursor from each backend's existing grab metadata instead of
polling GetCursorInfo in the present pump: DDA from the duplication frame
info pointer position (no extra calls), NvFBC visibility from the grab
info plus one GetCursorInfo per frame for position, GDI from
GetCursorInfo. Position sampling now rides the frame rate, not the pump
tick.
Sample display geometry once at startup and re-sample only on backend
session recreate or a captured-mode change. Drop per-tick cursor
sampling (cursor_sample_pos) from the present loop.
Add src/stream/win32/geometry.{c,h}.
This commit is contained in:
@@ -10,9 +10,15 @@
|
||||
* Returns 1 if anything changed since last sample, else 0. */
|
||||
int cursor_sample(vgpu_ctx* ctx);
|
||||
|
||||
/* Sample only cursor position/visibility (no shape extract). Updates
|
||||
* ctx->cursor.{visible,x,y}. Cheap (one GetCursorInfo); safe to call every pump tick. */
|
||||
void cursor_sample_pos(vgpu_ctx* ctx);
|
||||
/* Resolve a HCURSOR to a VGPU_CURSOR_ID_* by comparing against the system cursor table
|
||||
* (LoadCursor(NULL, IDC_*) loaded once on first use). Returns VGPU_CURSOR_ID_UNKNOWN for
|
||||
* custom cursors. Not hot-path: called only under the shape-change gate. */
|
||||
int cursor_resolve_id(HCURSOR hc);
|
||||
|
||||
/* Extract glyph/hotspot/dims for hc into ctx->cursor, resolve its cursor_id, and record it as
|
||||
* the current handle. For backends that source position elsewhere (DDA from frame info) and
|
||||
* only need the shape on a shape-change gate. Caller serializes ctx->cursor writes. */
|
||||
void cursor_apply_shape(vgpu_ctx* ctx, HCURSOR hc);
|
||||
|
||||
/* Alpha/AND-XOR compose the sampled cursor onto a tight BGRA frame. */
|
||||
void cursor_draw(vgpu_ctx* ctx, uint8_t* bgra, uint32_t width, uint32_t height);
|
||||
|
||||
Reference in New Issue
Block a user