Bug fix: GLX backend incompatibility with VirtualBox & others

- GLX backend: Fix a bug that window content does not get updated on
  VirtualBox, by rebinding texture when window content changes. This may
  have a negative effect on performance.

- GLX backend: Add --glx-no-stencil to restore the old clipping method,
  just in case.

- GLX backend: Apply stricter checks on texture-pixmap binding.

- GLX backend: Fix a bug that glx_set_clip() behaves incorrectly when
  None is passed in.

- GLX backend: Use glEnable()/glDisable() to toggle stencil tests, in
  hope to increase performance.

- Move window pixmap/picture fetching to win_paint_win(), in hope to
  increase performance.

- Intersect shadow painting region with its bounding rectangle, in hope
  to increase performance.
This commit is contained in:
Richard Grenville
2013-03-17 12:14:00 +08:00
parent 66be1f2fe1
commit b6a99334ce
4 changed files with 89 additions and 46 deletions

View File

@ -169,7 +169,7 @@ paint_isvalid(session_t *ps, const paint_t *ppaint) {
return false;
#ifdef CONFIG_VSYNC_OPENGL
if (BKEND_GLX == ps->o.backend && !glx_tex_binded(ppaint->ptex))
if (BKEND_GLX == ps->o.backend && !glx_tex_binded(ppaint->ptex, None))
return false;
#endif
@ -179,10 +179,12 @@ paint_isvalid(session_t *ps, const paint_t *ppaint) {
* Bind texture in paint_t if we are using GLX backend.
*/
static inline bool
paint_bind_tex(session_t *ps, paint_t *ppaint, int wid, int hei, int depth) {
paint_bind_tex(session_t *ps, paint_t *ppaint, int wid, int hei, int depth,
bool force) {
#ifdef CONFIG_VSYNC_OPENGL
// TODO: Make sure we have the same Pixmap binded?
if (BKEND_GLX == ps->o.backend && !glx_tex_binded(ppaint->ptex)) {
if (BKEND_GLX == ps->o.backend
&& (force || !glx_tex_binded(ppaint->ptex, ppaint->pixmap))) {
return glx_bind_pixmap(ps, &ppaint->ptex, ppaint->pixmap, wid, hei, depth);
}
#endif