return dri3_surf->base.SwapInterval;
}
-static int
-egl_dri3_clamp_swap_interval(struct loader_dri3_drawable *draw, int interval)
-{
- struct dri3_egl_surface *dri3_surf = loader_drawable_to_egl_surface(draw);
-
- if (interval > dri3_surf->base.Config->MaxSwapInterval)
- interval = dri3_surf->base.Config->MaxSwapInterval;
- else if (interval < dri3_surf->base.Config->MinSwapInterval)
- interval = dri3_surf->base.Config->MinSwapInterval;
-
- return interval;
-}
-
static void
egl_dri3_set_swap_interval(struct loader_dri3_drawable *draw, int interval)
{
static const struct loader_dri3_vtable egl_dri3_vtable = {
.get_swap_interval = egl_dri3_get_swap_interval,
- .clamp_swap_interval = egl_dri3_clamp_swap_interval,
.set_swap_interval = egl_dri3_set_swap_interval,
.set_drawable_size = egl_dri3_set_drawable_size,
.in_current_context = egl_dri3_in_current_context,
return priv->swap_interval;
}
-static int
-glx_dri3_clamp_swap_interval(struct loader_dri3_drawable *draw, int interval)
-{
- return interval;
-}
-
static void
glx_dri3_set_swap_interval(struct loader_dri3_drawable *draw, int interval)
{
static const struct loader_dri3_vtable glx_dri3_vtable = {
.get_swap_interval = glx_dri3_get_swap_interval,
- .clamp_swap_interval = glx_dri3_clamp_swap_interval,
.set_swap_interval = glx_dri3_set_swap_interval,
.set_drawable_size = glx_dri3_set_drawable_size,
.in_current_context = glx_dri3_in_current_context,
void
loader_dri3_set_swap_interval(struct loader_dri3_drawable *draw, int interval)
{
- interval = draw->vtable->clamp_swap_interval(draw, interval);
draw->vtable->set_swap_interval(draw, interval);
dri3_update_num_back(draw);
}
struct loader_dri3_vtable {
int (*get_swap_interval)(struct loader_dri3_drawable *);
- int (*clamp_swap_interval)(struct loader_dri3_drawable *, int);
void (*set_swap_interval)(struct loader_dri3_drawable *, int);
void (*set_drawable_size)(struct loader_dri3_drawable *, int, int);
bool (*in_current_context)(struct loader_dri3_drawable *);