Merge pull request #75 from yshui/split-backend-prepare

Split backend prepare
This commit is contained in:
yshui 2018-12-22 00:36:06 +00:00 committed by GitHub
commit d6a54c25e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 3 deletions

View File

@ -443,7 +443,7 @@ static void paint_root(session_t *ps, const region_t *reg_paint) {
ps->root_tile_paint.pict);
}
static xcb_image_t *make_shadow(session_t *ps, double opacity, int width, int height) {
xcb_image_t *make_shadow(session_t *ps, double opacity, int width, int height) {
xcb_image_t *ximage;
int ylimit, xlimit;
int swidth = width + ps->cgsize;

View File

@ -3,6 +3,7 @@
#pragma once
#include <xcb/render.h>
#include <xcb/xcb_image.h>
#include "region.h"
typedef struct _glx_texture glx_texture_t;
@ -34,3 +35,5 @@ void free_root_tile(session_t *ps);
bool init_render(session_t *ps);
void deinit_render(session_t *ps);
xcb_image_t *make_shadow(session_t *ps, double opacity, int width, int height);

View File

@ -117,6 +117,8 @@ void win_get_region_noframe_local(win *w, region_t *res) {
pixman_region32_init_rect(res, x, y, width, height);
}
gen_by_val(win_get_region_noframe_local)
/**
* Add a window to damaged area.
*
@ -1130,6 +1132,8 @@ void win_extents(win *w, region_t *res) {
w->g.y + w->shadow_dy, w->shadow_width, w->shadow_height);
}
gen_by_val(win_extents)
/**
* Update the out-dated bounding shape of a window.
*

View File

@ -115,7 +115,8 @@ struct win {
bool need_configure;
/// Queued <code>ConfigureNotify</code> when the window is unmapped.
xcb_configure_notify_event_t queue_configure;
/// The region of screen that will be obscured when windows above is painted.
/// The region of screen that will be obscured when windows above is painted,
/// in global coordinates.
/// We use this to reduce the pixels that needed to be paint when painting
/// this window and anything underneath. Depends on window frame
/// opacity state, window geometry, window mapped/unmapped state,
@ -303,12 +304,14 @@ void win_update_focused(session_t *ps, win *w);
// XXX was win_border_size
void win_update_bounding_shape(session_t *ps, win *w);
/**
* Get a rectangular region a window (and possibly its shadow) occupies.
* Get a rectangular region in global coordinates a window (and possibly
* its shadow) occupies.
*
* Note w->shadow and shadow geometry must be correct before calling this
* function.
*/
void win_extents(win *w, region_t *res);
region_t win_extents_by_val(win *w);
/**
* Add a window to damaged area.
*
@ -322,6 +325,7 @@ void add_damage_from_win(session_t *ps, win *w);
* Return region in global coordinates.
*/
void win_get_region_noframe_local(win *w, region_t *);
region_t win_get_region_noframe_local_by_val(win *w);
/**
* Retrieve frame extents from a window.
*/