summaryrefslogtreecommitdiffstats
path: root/compton.h
diff options
context:
space:
mode:
authorRichard Grenville <[email protected]>2013-05-20 18:04:40 +0800
committerRichard Grenville <[email protected]>2013-05-20 18:16:27 +0800
commit1bdd035974a0166434cdb2dd5d34405d6ddf184d (patch)
tree38b18053ac6374bb80fcde16558f78efdf7b0d33 /compton.h
parent2b0dfa9b968ce34f35919f9df216e668fec761b8 (diff)
downloadtdebase-1bdd035974a0166434cdb2dd5d34405d6ddf184d.tar.gz
tdebase-1bdd035974a0166434cdb2dd5d34405d6ddf184d.zip
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.
Diffstat (limited to 'compton.h')
-rw-r--r--compton.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/compton.h b/compton.h
index 24325ab12..b3695af29 100644
--- a/compton.h
+++ b/compton.h
@@ -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