The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

xrt: Add get bounds rect function

authored by

Yu Li and committed by
Simon Zeni
e8d3b875 a40de354

+40
+2
src/xrt/auxiliary/util/u_pretty_print.c
··· 138 138 switch (xret) { 139 139 case XRT_SUCCESS: DG("XRT_SUCCESS"); return; 140 140 case XRT_TIMEOUT: DG("XRT_TIMEOUT"); return; 141 + case XRT_SPACE_BOUNDS_UNAVAILABLE: DG("XRT_SPACE_BOUNDS_UNAVAILABLE"); return; 141 142 case XRT_ERROR_IPC_FAILURE: DG("XRT_ERROR_IPC_FAILURE"); return; 142 143 case XRT_ERROR_NO_IMAGE_AVAILABLE: DG("XRT_ERROR_NO_IMAGE_AVAILABLE"); return; 143 144 case XRT_ERROR_VULKAN: DG("XRT_ERROR_VULKAN"); return; ··· 167 168 case XRT_ERROR_COMPOSITOR_NOT_SUPPORTED: DG("XRT_ERROR_COMPOSITOR_NOT_SUPPORTED"); return; 168 169 case XRT_ERROR_IPC_COMPOSITOR_NOT_CREATED: DG("XRT_ERROR_IPC_COMPOSITOR_NOT_CREATED"); return; 169 170 case XRT_ERROR_DEVICE_FUNCTION_NOT_IMPLEMENTED: DG("XRT_ERROR_DEVICE_FUNCTION_NOT_IMPLEMENTED"); return; 171 + case XRT_ERROR_COMPOSITOR_FUNCTION_NOT_IMPLEMENTED: DG("XRT_ERROR_COMPOSITOR_FUNCTION_NOT_IMPLEMENTED"); return; 170 172 } 171 173 // clang-format on 172 174
+28
src/xrt/include/xrt/xrt_compositor.h
··· 1386 1386 enum xrt_perf_set_level level); 1387 1387 1388 1388 /*! 1389 + * @brief Get the extents of the reference space’s bounds rectangle. 1390 + */ 1391 + xrt_result_t (*get_reference_bounds_rect)(struct xrt_compositor *xc, 1392 + enum xrt_reference_space_type reference_space_type, 1393 + struct xrt_vec2 *bounds); 1394 + 1395 + /*! 1389 1396 * Teardown the compositor. 1390 1397 * 1391 1398 * The state tracker must have made sure that no frames or sessions are ··· 1869 1876 xrt_comp_set_performance_level(struct xrt_compositor *xc, enum xrt_perf_domain domain, enum xrt_perf_set_level level) 1870 1877 { 1871 1878 return xc->set_performance_level(xc, domain, level); 1879 + } 1880 + 1881 + /*! 1882 + * @copydoc xrt_compositor::get_reference_bounds_rect 1883 + * 1884 + * Helper for calling through the function pointer. 1885 + * 1886 + * @public @memberof xrt_compositor 1887 + */ 1888 + static inline xrt_result_t 1889 + xrt_comp_get_reference_bounds_rect(struct xrt_compositor *xc, 1890 + enum xrt_reference_space_type reference_space_type, 1891 + struct xrt_vec2 *bounds) 1892 + { 1893 + if (xc->get_reference_bounds_rect == NULL) { 1894 + bounds->x = 0.f; 1895 + bounds->y = 0.f; 1896 + return XRT_ERROR_COMPOSITOR_FUNCTION_NOT_IMPLEMENTED; 1897 + } 1898 + 1899 + return xc->get_reference_bounds_rect(xc, reference_space_type, bounds); 1872 1900 } 1873 1901 1874 1902 /*!
+10
src/xrt/include/xrt/xrt_results.h
··· 33 33 XRT_TIMEOUT = 2, 34 34 35 35 /*! 36 + * The space’s bounds are not known at the moment. 37 + */ 38 + XRT_SPACE_BOUNDS_UNAVAILABLE = 3, 39 + 40 + /*! 36 41 * A problem occurred either with the IPC transport itself, with invalid commands from the client, or with 37 42 * invalid responses from the server. 38 43 */ ··· 181 186 * error condition on bad code. 182 187 */ 183 188 XRT_ERROR_DEVICE_FUNCTION_NOT_IMPLEMENTED = -29, 189 + 190 + /*! 191 + * The function was not implemented in the compositor 192 + */ 193 + XRT_ERROR_COMPOSITOR_FUNCTION_NOT_IMPLEMENTED = -30, 184 194 } xrt_result_t;