mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-28 18:46:18 +00:00
xrt: Add get bounds rect function
This commit is contained in:
parent
a40de35486
commit
e8d3b875f0
|
@ -138,6 +138,7 @@ u_pp_xrt_result(struct u_pp_delegate dg, xrt_result_t xret)
|
|||
switch (xret) {
|
||||
case XRT_SUCCESS: DG("XRT_SUCCESS"); return;
|
||||
case XRT_TIMEOUT: DG("XRT_TIMEOUT"); return;
|
||||
case XRT_SPACE_BOUNDS_UNAVAILABLE: DG("XRT_SPACE_BOUNDS_UNAVAILABLE"); return;
|
||||
case XRT_ERROR_IPC_FAILURE: DG("XRT_ERROR_IPC_FAILURE"); return;
|
||||
case XRT_ERROR_NO_IMAGE_AVAILABLE: DG("XRT_ERROR_NO_IMAGE_AVAILABLE"); return;
|
||||
case XRT_ERROR_VULKAN: DG("XRT_ERROR_VULKAN"); return;
|
||||
|
@ -167,6 +168,7 @@ u_pp_xrt_result(struct u_pp_delegate dg, xrt_result_t xret)
|
|||
case XRT_ERROR_COMPOSITOR_NOT_SUPPORTED: DG("XRT_ERROR_COMPOSITOR_NOT_SUPPORTED"); return;
|
||||
case XRT_ERROR_IPC_COMPOSITOR_NOT_CREATED: DG("XRT_ERROR_IPC_COMPOSITOR_NOT_CREATED"); return;
|
||||
case XRT_ERROR_DEVICE_FUNCTION_NOT_IMPLEMENTED: DG("XRT_ERROR_DEVICE_FUNCTION_NOT_IMPLEMENTED"); return;
|
||||
case XRT_ERROR_COMPOSITOR_FUNCTION_NOT_IMPLEMENTED: DG("XRT_ERROR_COMPOSITOR_FUNCTION_NOT_IMPLEMENTED"); return;
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
|
|
|
@ -1385,6 +1385,13 @@ struct xrt_compositor
|
|||
enum xrt_perf_domain domain,
|
||||
enum xrt_perf_set_level level);
|
||||
|
||||
/*!
|
||||
* @brief Get the extents of the reference space’s bounds rectangle.
|
||||
*/
|
||||
xrt_result_t (*get_reference_bounds_rect)(struct xrt_compositor *xc,
|
||||
enum xrt_reference_space_type reference_space_type,
|
||||
struct xrt_vec2 *bounds);
|
||||
|
||||
/*!
|
||||
* Teardown the compositor.
|
||||
*
|
||||
|
@ -1871,6 +1878,27 @@ xrt_comp_set_performance_level(struct xrt_compositor *xc, enum xrt_perf_domain d
|
|||
return xc->set_performance_level(xc, domain, level);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @copydoc xrt_compositor::get_reference_bounds_rect
|
||||
*
|
||||
* Helper for calling through the function pointer.
|
||||
*
|
||||
* @public @memberof xrt_compositor
|
||||
*/
|
||||
static inline xrt_result_t
|
||||
xrt_comp_get_reference_bounds_rect(struct xrt_compositor *xc,
|
||||
enum xrt_reference_space_type reference_space_type,
|
||||
struct xrt_vec2 *bounds)
|
||||
{
|
||||
if (xc->get_reference_bounds_rect == NULL) {
|
||||
bounds->x = 0.f;
|
||||
bounds->y = 0.f;
|
||||
return XRT_ERROR_COMPOSITOR_FUNCTION_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
return xc->get_reference_bounds_rect(xc, reference_space_type, bounds);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @copydoc xrt_compositor::destroy
|
||||
*
|
||||
|
|
|
@ -32,6 +32,11 @@ typedef enum xrt_result
|
|||
*/
|
||||
XRT_TIMEOUT = 2,
|
||||
|
||||
/*!
|
||||
* The space’s bounds are not known at the moment.
|
||||
*/
|
||||
XRT_SPACE_BOUNDS_UNAVAILABLE = 3,
|
||||
|
||||
/*!
|
||||
* A problem occurred either with the IPC transport itself, with invalid commands from the client, or with
|
||||
* invalid responses from the server.
|
||||
|
@ -181,4 +186,9 @@ typedef enum xrt_result
|
|||
* error condition on bad code.
|
||||
*/
|
||||
XRT_ERROR_DEVICE_FUNCTION_NOT_IMPLEMENTED = -29,
|
||||
|
||||
/*!
|
||||
* The function was not implemented in the compositor
|
||||
*/
|
||||
XRT_ERROR_COMPOSITOR_FUNCTION_NOT_IMPLEMENTED = -30,
|
||||
} xrt_result_t;
|
||||
|
|
Loading…
Reference in a new issue