2018-12-15 16:11:41 -05:00
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
// Copyright (c) Yuxuan Shui <yshuiv7@gmail.com>
|
|
|
|
#pragma once
|
|
|
|
|
2019-01-18 18:30:44 -05:00
|
|
|
#include <stdbool.h>
|
2019-03-30 05:07:21 -04:00
|
|
|
#include <xcb/render.h>
|
|
|
|
#include <xcb/xcb.h>
|
2019-02-03 11:41:04 -05:00
|
|
|
#ifdef CONFIG_OPENGL
|
|
|
|
#include "backend/gl/glx.h"
|
|
|
|
#endif
|
2018-12-15 16:11:41 -05:00
|
|
|
#include "region.h"
|
|
|
|
|
|
|
|
typedef struct _glx_texture glx_texture_t;
|
|
|
|
typedef struct glx_prog_main glx_prog_main_t;
|
|
|
|
typedef struct session session_t;
|
|
|
|
|
2019-04-17 18:14:45 -04:00
|
|
|
struct managed_win;
|
|
|
|
|
2018-12-15 16:11:41 -05:00
|
|
|
typedef struct paint {
|
2019-03-30 05:07:21 -04:00
|
|
|
xcb_pixmap_t pixmap;
|
|
|
|
xcb_render_picture_t pict;
|
|
|
|
glx_texture_t *ptex;
|
2019-02-03 11:41:04 -05:00
|
|
|
#ifdef CONFIG_OPENGL
|
2019-03-30 05:07:21 -04:00
|
|
|
struct glx_fbconfig_info *fbcfg;
|
2019-02-03 11:41:04 -05:00
|
|
|
#endif
|
2018-12-15 16:11:41 -05:00
|
|
|
} paint_t;
|
|
|
|
|
2020-09-05 10:43:25 -04:00
|
|
|
typedef struct clip {
|
|
|
|
xcb_render_picture_t pict;
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
} clip_t;
|
|
|
|
|
|
|
|
void render(session_t *ps, int x, int y, int dx, int dy, int w, int h, int fullw,
|
|
|
|
int fullh, double opacity, bool argb, bool neg, int cr,
|
|
|
|
xcb_render_picture_t pict, glx_texture_t *ptex, const region_t *reg_paint,
|
|
|
|
const glx_prog_main_t *pprogram, clip_t *clip);
|
2019-04-17 18:14:45 -04:00
|
|
|
void paint_one(session_t *ps, struct managed_win *w, const region_t *reg_paint);
|
2018-12-15 16:11:41 -05:00
|
|
|
|
2022-12-12 05:41:54 -05:00
|
|
|
void paint_all(session_t *ps, struct managed_win *const t);
|
2018-12-15 16:11:41 -05:00
|
|
|
|
|
|
|
void free_paint(session_t *ps, paint_t *ppaint);
|
2018-12-15 22:00:56 -05:00
|
|
|
void free_root_tile(session_t *ps);
|
2018-12-15 19:53:41 -05:00
|
|
|
|
|
|
|
bool init_render(session_t *ps);
|
2018-12-15 22:00:56 -05:00
|
|
|
void deinit_render(session_t *ps);
|
2019-02-20 13:17:16 -05:00
|
|
|
|
|
|
|
int maximum_buffer_age(session_t *);
|