Files
LookingGlass/client/src/render_queue.h
Geoffrey McRae 8fbe3e7454
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
[repos] lgprotocol: import shared protocol definitions
Add LGProtocol as a pinned submodule and consume its KVMFR protocol
definitions throughout the client, host, IDD, OBS, and profiler.

Keep Looking Glass framebuffer helpers local while removing duplicated
protocol headers and migrating users to KVMFR-scoped types.
2026-09-01 20:58:25 +10:00

95 lines
3.6 KiB
C

/**
* Looking Glass
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., 59
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "interface/renderer.h"
#include <stdatomic.h>
typedef enum RenderQueueSource
{
RENDER_QUEUE_SOURCE_NONE,
RENDER_QUEUE_SOURCE_PRIMARY,
RENDER_QUEUE_SOURCE_FALLBACK,
RENDER_QUEUE_SOURCE_COUNT,
}
RenderQueueSource;
typedef void (*RenderQueueSourceAppliedFn)(void * opaque,
RenderQueueSource source, uint64_t generation, uint64_t serial,
bool swSurface);
typedef bool (*RenderQueueSourcePrepareFn)(void * opaque,
RenderQueueSource source, uint64_t generation, uint64_t serial);
typedef void (*RenderQueueSourceRejectFn)(void * opaque,
RenderQueueSource source, uint64_t serial);
void renderQueue_init(void);
void renderQueue_free(void);
void renderQueue_clear(void);
bool renderQueue_process(void);
void renderQueue_presented(void);
void renderQueue_setSourceFns(RenderQueueSourcePrepareFn prepare,
RenderQueueSourceRejectFn reject,
RenderQueueSourceAppliedFn applied, void * opaque);
/* Starting a source lifecycle makes commands from its prior generation stale.
* After a successful render, call renderQueue_presented on the render thread
* to acknowledge the newest applied transition. */
uint64_t renderQueue_sourceBegin(RenderQueueSource source);
void renderQueue_sourceInvalidate(RenderQueueSource source,
uint64_t generation);
void renderQueue_sourceClearCursor(RenderQueueSource source);
uint64_t renderQueue_sourceTransition(RenderQueueSource source,
uint64_t generation, bool swSurface,
atomic_uint_least64_t * publishedSerial);
bool renderQueue_sourceSwSurfaceConfigure(RenderQueueSource source,
uint64_t generation, int width, int height);
uint64_t renderQueue_sourceSwSurfaceConfigureTransition(
RenderQueueSource source, uint64_t generation, int width, int height,
atomic_uint_least64_t * publishedSerial);
void renderQueue_sourceSwSurfaceDrawFill(RenderQueueSource source,
uint64_t generation, int x, int y, int width, int height,
uint32_t color);
void renderQueue_sourceSwSurfaceDrawBitmap(RenderQueueSource source,
uint64_t generation, int x, int y, int width, int height, int stride,
const void * data, bool topDown);
void renderQueue_sourceSurfaceFormat(RenderQueueSource source,
uint64_t generation, const LG_RendererFormat format,
bool rendererSupportsNativeHDR);
void renderQueue_sourceCursorState(RenderQueueSource source,
uint64_t generation, bool visible, int x, int y, int hx, int hy);
/* Cursor payloads are copied before these calls return. */
void renderQueue_sourceCursorImage(RenderQueueSource source,
uint64_t generation, LG_RendererCursor type,
int width, int height, int pitch, const void * data);
void renderQueue_sourceCursorColorTransform(RenderQueueSource source,
uint64_t generation, const KVMFRColorTransform * transform);
void renderQueue_sourceCursorWhiteLevel(RenderQueueSource source,
uint64_t generation, uint32_t sdrWhiteLevel);