Monado OpenXR Runtime
mock_compositor.h File Reference

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

#include "xrt/xrt_compositor.h"
#include "xrt/xrt_defines.h"
#include "xrt/xrt_handles.h"
Include dependency graph for mock_compositor.h:

Go to the source code of this file.

Data Structures

struct  mock_compositor
 Mock implementation of a native compositor. More...
 
struct  mock_compositor_swapchain
 Mock implementation of xrt_swapchain_native. More...
 

Functions

static struct mock_compositormock_compositor (xrt_compositor *xc)
 Cast a generic xrt_compositor pointer (that you know externally is a mock_compositor) to a mock_compositor pointer. More...
 
static struct mock_compositor_swapchainmock_compositor_swapchain (xrt_swapchain *xsc)
 Cast a generic xrt_swapchain pointer (that you know externally is a mock_compositor_swapchain) to a mock_compositor_swapchain pointer. More...
 
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_compositor()

static struct mock_compositor * mock_compositor ( xrt_compositor xc)
inlinestatic

Cast a generic xrt_compositor pointer (that you know externally is a mock_compositor) to a mock_compositor pointer.

◆ mock_compositor_swapchain()

static struct mock_compositor_swapchain * mock_compositor_swapchain ( xrt_swapchain xsc)
inlinestatic

Cast a generic xrt_swapchain pointer (that you know externally is a mock_compositor_swapchain) to a mock_compositor_swapchain pointer.

◆ 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.