Improvement: Improve color inversion performance & Validate pixmap

- Try to improve the performance of color inversion by applying clipping
  region during color inversion. (#75)

- Validate pixmap on window unmap/destruction. Probably slightly helpful
  for #52.

- Change the design of unmap_win() and destroy_win(), a bit.

- Add warning message to help messages about features disabled at
  compile time, instead of dropping their description completely. (#85)

- Silence some warnings. Code clean-up.
This commit is contained in:
Richard Grenville
2013-01-29 09:57:04 +08:00
parent 152ad5fb57
commit 42e17cb4e9
2 changed files with 83 additions and 25 deletions

View File

@ -284,7 +284,7 @@ win_ev_stop(session_t *ps, win *w) {
/**
* Get the children of a window.
*
* @param session_t current session
* @param ps current session
* @param w window to check
* @param children [out] an array of child window IDs
* @param nchildren [out] number of children
@ -374,6 +374,9 @@ win_is_fullscreen(session_t *ps, const win *w) {
static void
win_rounded_corners(session_t *ps, win *w);
static void
win_validate_pixmap(session_t *ps, win *w);
/**
* Wrapper of c2_match().
*/
@ -492,7 +495,7 @@ static void
unmap_callback(session_t *ps, win *w);
static void
unmap_win(session_t *ps, Window id);
unmap_win(session_t *ps, win *w);
static opacity_t
wid_get_opacity_prop(session_t *ps, Window wid, opacity_t def);
@ -900,7 +903,7 @@ redir_stop(session_t *ps);
static inline time_ms_t
timeout_get_newrun(const timeout_t *ptmout) {
return ptmout->firstrun + (max_l((ptmout->lastrun + (long) (ptmout->interval * TIMEOUT_RUN_TOLERANCE) - ptmout->firstrun) / ptmout->interval, (ptmout->lastrun + ptmout->interval * (1 - TIMEOUT_RUN_TOLERANCE) - ptmout->firstrun) / ptmout->interval) + 1) * ptmout->interval;
return ptmout->firstrun + (max_l((ptmout->lastrun + (time_ms_t) (ptmout->interval * TIMEOUT_RUN_TOLERANCE) - ptmout->firstrun) / ptmout->interval, (ptmout->lastrun + (time_ms_t) (ptmout->interval * (1 - TIMEOUT_RUN_TOLERANCE)) - ptmout->firstrun) / ptmout->interval) + 1) * ptmout->interval;
}
static time_ms_t