2019-03-18 05:52:32 +00:00
|
|
|
// Copyright 2019, Collabora, Ltd.
|
|
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
|
|
/*!
|
|
|
|
* @file
|
|
|
|
* @brief Compositor rendering code header.
|
|
|
|
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
|
|
|
|
* @author Jakob Bornecrantz <jakob@collabora.com>
|
2020-03-01 10:31:21 +00:00
|
|
|
* @ingroup comp_main
|
2019-03-18 05:52:32 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "xrt/xrt_compiler.h"
|
2020-05-08 19:24:21 +00:00
|
|
|
#include "xrt/xrt_defines.h"
|
2019-03-18 05:52:32 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
struct comp_compositor;
|
|
|
|
struct comp_renderer;
|
|
|
|
struct comp_swapchain_image;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Called by the main compositor code to create the renderer.
|
|
|
|
*
|
2020-03-01 10:31:21 +00:00
|
|
|
* @ingroup comp_main
|
2019-03-18 05:52:32 +00:00
|
|
|
*/
|
|
|
|
struct comp_renderer *
|
|
|
|
comp_renderer_create(struct comp_compositor *c);
|
|
|
|
|
2020-04-10 23:54:24 +00:00
|
|
|
/*!
|
|
|
|
* Reset renderer as input has changed.
|
|
|
|
*
|
|
|
|
* @ingroup comp_main
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
comp_renderer_reset(struct comp_renderer *r);
|
|
|
|
|
2019-03-18 05:52:32 +00:00
|
|
|
/*!
|
|
|
|
* Clean up and free the renderer.
|
|
|
|
*
|
2020-03-01 10:31:21 +00:00
|
|
|
* @ingroup comp_main
|
2019-03-18 05:52:32 +00:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
comp_renderer_destroy(struct comp_renderer *r);
|
|
|
|
|
2020-04-16 15:56:59 +00:00
|
|
|
/*!
|
2020-05-08 19:24:21 +00:00
|
|
|
* Render frame.
|
2020-04-16 15:56:59 +00:00
|
|
|
*
|
|
|
|
* @ingroup comp_main
|
|
|
|
*/
|
|
|
|
void
|
2020-05-08 19:24:21 +00:00
|
|
|
comp_renderer_draw(struct comp_renderer *r);
|
|
|
|
|
|
|
|
void
|
|
|
|
comp_renderer_set_projection_layer(struct comp_renderer *r,
|
|
|
|
struct comp_swapchain_image *left_image,
|
|
|
|
struct comp_swapchain_image *right_image,
|
|
|
|
bool flip_y,
|
|
|
|
uint32_t layer);
|
|
|
|
|
|
|
|
void
|
|
|
|
comp_renderer_set_quad_layer(struct comp_renderer *r,
|
|
|
|
struct comp_swapchain_image *image,
|
|
|
|
struct xrt_pose *pose,
|
|
|
|
struct xrt_vec2 *size,
|
|
|
|
bool flip_y,
|
|
|
|
uint32_t layer);
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
comp_renderer_allocate_layers(struct comp_renderer *self, uint32_t num_layers);
|
2020-04-16 15:56:59 +00:00
|
|
|
|
|
|
|
void
|
2020-05-08 19:24:21 +00:00
|
|
|
comp_renderer_destroy_layers(struct comp_renderer *self);
|
2019-03-18 05:52:32 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|