Convert XfixesRegion to pixman region

Re-did the painting logic, and document it.

It is unclear to me what is the previous painting logic. But the current
one is basically this:

1. Go through all windows top to bottom, and put visible windows (not
   unmapped, opacity > 0, etc) into a linked list, from bottom to top
2. Accumulate a region of ignore on each window, which is basically the
   region of screen that is obscured by all the windows above current
   one.
3. Paint all the visible windows from bottom to top. Subtract the region
   of ignore from the painting region. If we need to paint shadow, we
   subtract the body of the window from the shadow painting region too,
   because we don't want shadow behind the window.
4. region of ignore is invalidated when window stack change, an
   window on top moved or changed shape, when window changed between
   opaque and transparent, etc.

Notes:

It is unclear whether all the different shapes of a window (extents,
noframe, border, bounding shape, etc) are calculated correctly or not.

It is unclear if window shape related events are handled correctly or
not. Need more testing.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2018-09-30 04:56:00 +01:00
parent 56f7dd36f6
commit 28a2cc62fa
11 changed files with 691 additions and 1111 deletions

View File

@ -124,13 +124,13 @@ glx_hasglext(session_t *ps, const char *ext) {
bool
glx_dim_dst(session_t *ps, int dx, int dy, int width, int height, float z,
GLfloat factor, XserverRegion reg_tgt, const reg_data_t *);
GLfloat factor, const region_t *reg_tgt);
bool
glx_render(session_t *ps, const glx_texture_t *ptex,
int x, int y, int dx, int dy, int width, int height, int z,
double opacity, bool argb, bool neg,
XserverRegion reg_tgt, const reg_data_t *,
const region_t *reg_tgt,
const glx_prog_main_t *pprogram);
bool
@ -162,7 +162,7 @@ glx_bind_pixmap(session_t *ps, glx_texture_t **pptex, Pixmap pixmap,
void
glx_release_pixmap(session_t *ps, glx_texture_t *ptex);
void glx_paint_pre(session_t *ps, XserverRegion *preg)
void glx_paint_pre(session_t *ps, region_t *preg)
__attribute__((nonnull(1, 2)));
/**
@ -175,13 +175,12 @@ glx_tex_binded(const glx_texture_t *ptex, Pixmap pixmap) {
}
void
glx_set_clip(session_t *ps, XserverRegion reg, const reg_data_t *);
glx_set_clip(session_t *ps, const region_t *reg);
bool
glx_blur_dst(session_t *ps, int dx, int dy, int width, int height, float z,
GLfloat factor_center,
XserverRegion reg_tgt,
const reg_data_t *,
const region_t *reg_tgt,
glx_blur_cache_t *pbc);
GLuint