Monado OpenXR Runtime
mock_compositor.cpp File Reference

A mock native compositor to use when testing client compositors. More...

#include "mock_compositor.h"
#include "util/u_misc.h"
#include "util/u_handles.h"
Include dependency graph for mock_compositor.cpp:

Functions

static void mock_compositor_swapchain_destroy (struct xrt_swapchain *xsc)
 
static xrt_result_t mock_compositor_swapchain_wait_image (struct xrt_swapchain *xsc, uint64_t timeout_ns, uint32_t index)
 
static xrt_result_t mock_compositor_swapchain_acquire_image (struct xrt_swapchain *xsc, uint32_t *out_index)
 
static xrt_result_t mock_compositor_swapchain_release_image (struct xrt_swapchain *xsc, uint32_t index)
 
static xrt_result_t mock_compositor_swapchain_create (struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain **out_xsc)
 
static xrt_result_t mock_compositor_swapchain_import (struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_image_native *native_images, uint32_t image_count, struct xrt_swapchain **out_xsc)
 
static xrt_result_t mock_compositor_get_swapchain_create_properties (struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain_create_properties *xsccp)
 
static void mock_compositor_destroy (struct xrt_compositor *xc)
 
struct xrt_compositor_nativemock_create_native_compositor ()
 Create a mock implementation of xrt_compositor_native. More...
 

Detailed Description

A mock native compositor to use when testing client compositors.

Author
Rylie Pavlik rylie.nosp@m..pav.nosp@m.lik@c.nosp@m.olla.nosp@m.bora..nosp@m.com
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Function Documentation

◆ mock_create_native_compositor()

struct xrt_compositor_native * mock_create_native_compositor ( )

Create a mock implementation of xrt_compositor_native.

The returned value can be passed to mock_compositor() to use the internals of the mock, e.g. to populate hooks to override mock behavior.

References xrt_compositor_native::base, xrt_compositor::get_swapchain_create_properties, and U_TYPED_CALLOC.