/** * 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 */ #pragma once #include #include "texture.h" #include "interface/renderer.h" /* Composes a packed multi-display atlas frame into a single image of the * guest's virtual desktop, or of one display within it. * * Running this as its own pass, rather than folding it into the desktop * shader, keeps every stage downstream (post processing, HDR handling, the * cursor, damage tracking and input mapping) working on one conventional * frame. Those stages then need no knowledge of multi-display at all. */ typedef struct EGL_Compose EGL_Compose; bool egl_composeInit(EGL_Compose ** compose); void egl_composeFree(EGL_Compose ** compose); /** * Configure the composition for a frame format. * * Returns false if the format cannot be composed, in which case the caller * should fall back to presenting the raw atlas rather than showing nothing. */ bool egl_composeSetup(EGL_Compose * compose, const LG_RendererFormat * format, bool useDMA); /** * Compose `atlas` into the configured view. * * Returns the composed texture, or NULL if composition is not configured or * failed, in which case the caller should present the atlas unchanged. */ EGL_Texture * egl_composeRun(EGL_Compose * compose, EGL_Texture * atlas); /** * The dimensions of the composed output. Only valid after a successful * egl_composeSetup. */ void egl_composeGetSize(EGL_Compose * compose, unsigned int * width, unsigned int * height);