Port from xrender to xcb-render

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter
2018-09-27 18:14:44 +02:00
parent 6d54d6b055
commit 539d62ca93
8 changed files with 147 additions and 117 deletions

View File

@ -83,7 +83,6 @@
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/extensions/Xcomposite.h>
#include <X11/extensions/Xrender.h>
#include <X11/extensions/shape.h>
#include <X11/extensions/Xdbe.h>
#ifdef CONFIG_XSYNC
@ -219,6 +218,10 @@
// Window opacity / dim state changed
#define WFLAG_OPCT_CHANGE 0x0004
// xcb-render specific macros
#define XFIXED_TO_DOUBLE(value) (((double) (value)) / 65536)
#define DOUBLE_TO_XFIXED(value) ((xcb_render_fixed_t) (((double) (value)) * 65536))
// === Types ===
typedef uint32_t opacity_t;
@ -489,7 +492,7 @@ typedef struct {
typedef struct {
Pixmap pixmap;
Picture pict;
xcb_render_picture_t pict;
glx_texture_t *ptex;
} paint_t;
@ -685,7 +688,7 @@ typedef struct _options_t {
/// Background blur blacklist. A linked list of conditions.
c2_lptr_t *blur_background_blacklist;
/// Blur convolution kernel.
XFixed *blur_kerns[MAX_BLUR_PASS];
xcb_render_fixed_t *blur_kerns[MAX_BLUR_PASS];
/// How much to dim an inactive window. 0.0 - 1.0, 0 to disable.
double inactive_dim;
/// Whether to use fixed inactive dim opacity, instead of deciding
@ -811,9 +814,9 @@ typedef struct session {
XserverRegion screen_reg;
/// Picture of root window. Destination of painting in no-DBE painting
/// mode.
Picture root_picture;
xcb_render_picture_t root_picture;
/// A Picture acting as the painting target.
Picture tgt_picture;
xcb_render_picture_t tgt_picture;
/// Temporary buffer to paint to before sending to display.
paint_t tgt_buffer;
#ifdef CONFIG_XSYNC
@ -859,7 +862,7 @@ typedef struct session {
/// Whether all windows are currently redirected.
bool redirected;
/// Pre-generated alpha pictures.
Picture *alpha_picts;
xcb_render_picture_t *alpha_picts;
/// Whether all reg_ignore of windows should expire in this paint.
bool reg_ignore_expire;
/// Time of last fading. In milliseconds.
@ -870,7 +873,7 @@ typedef struct session {
/// ignore linked list.
ignore_t **ignore_tail;
// Cached blur convolution kernels.
XFixed *blur_kerns_cache[MAX_BLUR_PASS];
xcb_render_fixed_t *blur_kerns_cache[MAX_BLUR_PASS];
/// Reset program after next paint.
bool reset;
@ -897,11 +900,11 @@ typedef struct session {
// === Shadow/dimming related ===
/// 1x1 black Picture.
Picture black_picture;
xcb_render_picture_t black_picture;
/// 1x1 Picture of the shadow color.
Picture cshadow_picture;
xcb_render_picture_t cshadow_picture;
/// 1x1 white Picture.
Picture white_picture;
xcb_render_picture_t white_picture;
/// Gaussian map of shadow.
conv *gaussian_map;
// for shadow precomputation