diff options
author | Richard Grenville <[email protected]> | 2013-03-18 11:48:28 +0800 |
---|---|---|
committer | Richard Grenville <[email protected]> | 2013-03-18 13:29:14 +0800 |
commit | 848103bc3447f814c51cb818836533e18e018bf5 (patch) | |
tree | 9a70634e2384200f06ff1f712136039f1ff4acef /common.h | |
parent | 17f7d31a5282d55182aec8938d52e13379dcc2bb (diff) | |
download | tdebase-848103bc3447f814c51cb818836533e18e018bf5.tar.gz tdebase-848103bc3447f814c51cb818836533e18e018bf5.zip |
Bug fix: GLX: ARGB texture too dark & Jitter when resize & others
- GLX backend: Fix a bug that ARGB windows / shadows are rendered too
dark. Thanks to derhass in FreeNode/##opengl for help.
- GLX backend: Fix a problem that during window resize the content looks
jittering, by letting compton fetch pixmap sizes with XGetGeometry()
instead of relying on window width/height, which could be inaccurate
during window resize. Negative effect on performance. Thanks to M4he
for reporting. (#7)
- Add .desktop file. Thanks to quequotion for providing it. (#97)
- Avoid checking presence of window pixmap, because they may not exist
with very old X Composite implementations.
- Add workaround for a strange window restack issue when compton
receieves a ConfigureNotify with non-existent new above window.
- Add debugging function hexdump(). Extra sanity checks on various
places.
Diffstat (limited to 'common.h')
-rw-r--r-- | common.h | 44 |
1 files changed, 40 insertions, 4 deletions
@@ -297,9 +297,9 @@ struct _glx_texture { GLuint texture; GLXPixmap glpixmap; Pixmap pixmap; - int width; - int height; - int depth; + unsigned width; + unsigned height; + unsigned depth; bool y_inverted; }; #endif @@ -1573,7 +1573,7 @@ glx_init_blur(session_t *ps); bool glx_bind_pixmap(session_t *ps, glx_texture_t **pptex, Pixmap pixmap, - int width, int height, int depth); + unsigned width, unsigned height, unsigned depth); void glx_release_pixmap(session_t *ps, glx_texture_t *ptex); @@ -1686,3 +1686,39 @@ c2_match(session_t *ps, win *w, const c2_lptr_t *condlst, ///@} #endif + +/** + * @brief Dump raw bytes in HEX format. + * + * @param data pointer to raw data + * @param len length of data + */ +static inline void +hexdump(const char *data, int len) { + static const int BYTE_PER_LN = 16; + + if (len <= 0) + return; + + // Print header + printf("%10s:", "Offset"); + for (int i = 0; i < BYTE_PER_LN; ++i) + printf(" %2d", i); + putchar('\n'); + + // Dump content + for (int offset = 0; offset < len; ++offset) { + if (!(offset % BYTE_PER_LN)) + printf("0x%08x:", offset); + + printf(" %02hhx", data[offset]); + + if ((BYTE_PER_LN - 1) == offset % BYTE_PER_LN) + putchar('\n'); + } + if (len % BYTE_PER_LN) + putchar('\n'); + + fflush(stdout); +} + |