Imp: Multi-pass blur & D-Bus fading control

- Add multipass blur support. Note GLX Framebuffer support is required.
  My benchmark shows multipass blur brings 5% performance boost for X
  Render backend (3x3box). On GLX backend it brings 10% performance
  boost for 5x5box but negatively affects performance for 3x3box. Thanks
  to jrfonseca for advice. (#107)

- GLX backend: Cache blur texture for each window, for a 12% performance
  boost.

- Add D-Bus fading control. Thanks to yulan6248 for testing. (#112)

- Fix FAQ link in README.md. Thanks to lorenzos for report. (#111)

- Correctly deinitialize VSync on on-the-fly VSync method switch.

- X Render backend: Normalize blur kernel.

- Code clean-up.

- Known issue: Linear corruption on border of a window may appear with X
  Render multi-pass blur. Possible to fix but probably not worthwhile.
This commit is contained in:
Richard Grenville
2013-05-20 18:04:40 +08:00
parent 1b34dc3a9a
commit 07bc7485c3
7 changed files with 784 additions and 237 deletions

View File

@ -231,6 +231,9 @@ free_win_res(session_t *ps, win *w) {
free(w->class_instance);
free(w->class_general);
free(w->role);
#ifdef CONFIG_VSYNC_OPENGL_GLSL
free_glx_bc(ps, &w->glx_blur_cache);
#endif
}
/**
@ -594,6 +597,24 @@ set_tgt_clip(session_t *ps, XserverRegion reg, const reg_data_t *pcache_reg) {
}
}
static bool
xr_blur_dst(session_t *ps, Picture tgt_buffer,
int x, int y, int wid, int hei, XFixed **blur_kerns,
XserverRegion reg_clip);
/**
* Normalize a convolution kernel.
*/
static inline void
normalize_conv_kern(int wid, int hei, XFixed *kern) {
double sum = 0.0;
for (int i = 0; i < wid * hei; ++i)
sum += XFixedToDouble(kern[i]);
double factor = 1.0 / sum;
for (int i = 0; i < wid * hei; ++i)
kern[i] = XDoubleToFixed(XFixedToDouble(kern[i]) * factor);
}
static void
paint_all(session_t *ps, XserverRegion region, XserverRegion region_real, win *t);
@ -1095,6 +1116,12 @@ vsync_opengl_wait(session_t *ps);
static int
vsync_opengl_oml_wait(session_t *ps);
static void
vsync_opengl_swc_deinit(session_t *ps);
static void
vsync_opengl_mswc_deinit(session_t *ps);
#endif
static void