2018-12-16 05:11:41 +08:00
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
// Copyright (c) Yuxuan Shui <yshuiv7@gmail.com>
|
|
|
|
#pragma once
|
|
|
|
|
2019-01-21 05:15:20 +08:00
|
|
|
#include <xcb/xcb.h>
|
2018-12-16 05:11:41 +08:00
|
|
|
#include <xcb/render.h>
|
2019-01-19 07:30:44 +08:00
|
|
|
#include <stdbool.h>
|
2018-12-16 05:11:41 +08:00
|
|
|
#include "region.h"
|
|
|
|
|
|
|
|
typedef struct _glx_texture glx_texture_t;
|
|
|
|
typedef struct glx_prog_main glx_prog_main_t;
|
|
|
|
typedef struct win win;
|
|
|
|
typedef struct session session_t;
|
|
|
|
|
|
|
|
typedef struct paint {
|
|
|
|
xcb_pixmap_t pixmap;
|
|
|
|
xcb_render_picture_t pict;
|
|
|
|
glx_texture_t *ptex;
|
|
|
|
} paint_t;
|
|
|
|
|
|
|
|
void
|
|
|
|
render(session_t *ps, int x, int y, int dx, int dy, int wid, int hei,
|
|
|
|
double opacity, bool argb, bool neg,
|
|
|
|
xcb_render_picture_t pict, glx_texture_t *ptex,
|
|
|
|
const region_t *reg_paint, const glx_prog_main_t *pprogram);
|
|
|
|
void
|
|
|
|
paint_one(session_t *ps, win *w, const region_t *reg_paint);
|
|
|
|
|
|
|
|
void
|
2019-01-09 07:15:00 +08:00
|
|
|
paint_all(session_t *ps, win * const t, bool ignore_damage);
|
2018-12-16 05:11:41 +08:00
|
|
|
|
|
|
|
void free_picture(xcb_connection_t *c, xcb_render_picture_t *p);
|
|
|
|
|
|
|
|
void free_paint(session_t *ps, paint_t *ppaint);
|
2018-12-16 11:00:56 +08:00
|
|
|
void free_root_tile(session_t *ps);
|
2018-12-16 08:53:41 +08:00
|
|
|
|
|
|
|
bool init_render(session_t *ps);
|
2018-12-16 11:00:56 +08:00
|
|
|
void deinit_render(session_t *ps);
|