Bug fix: GLX backend incompatibility with mesa & others

- Fix a bug that glx_bind_pixmap() doesn't work with mesa drivers.
  Thanks to Janhouse and mkraemer for reporting. (#7)

- Use stencil buffer to attempt to eliminate potential double-paint
  issue in glx_render(). X Fixes doesn't guarantee the rectangles in a
  region do not overlap, and this may cause some regions to be painted
  twice, which would be a problem if we are painting transparent things.
  Now the target window must have a stencil buffer. Compiz uses its own
  region implementation to deal with this, but as a lightweight
  compositor we can't really do the same. It may have a positive or
  negative effort over performance. Callgrind result indicates basically
  no change in performance, but this may or may not be true.

- Correctly distinguish GL extensions and GLX extensions. Sorry. :-D

- Handle screen size. Thanks to tsmithe for reporting. (#7)

- Rename OpenGL backend to GLX backend, because, we might have a EGL
  backend someday.

- Add configuration file option `backend` to specify backend. Add
  `backend` to D-Bus `opts_get`.

- Add OpenGL shader compilation code, but currently unused.

- Minor adjustments.

- Known issue: Window content doesn't get updated in VirtualBox,
  probably because its OpenGL implementation requires constant rebinding
  of texture. But that's really slow...

- Known issue: Blur feature is still unimplemented in GLX backend.
This commit is contained in:
Richard Grenville
2013-03-16 22:54:43 +08:00
parent 8ffcf1c1e8
commit 66be1f2fe1
8 changed files with 349 additions and 51 deletions

View File

@ -176,7 +176,7 @@ paint_isvalid(session_t *ps, const paint_t *ppaint) {
return true;
}
/**
* Bind texture in paint_t if we are using OpenGL backend.
* 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) {
@ -542,6 +542,20 @@ win_render(session_t *ps, win *w, int x, int y, int wid, int hei, double opacity
pict, (w ? w->paint.ptex: ps->root_tile_paint.ptex), reg_paint);
}
static inline void
set_tgt_clip(session_t *ps, XserverRegion reg) {
switch (ps->o.backend) {
case BKEND_XRENDER:
XFixesSetPictureClipRegion(ps->dpy, ps->tgt_buffer, 0, 0, reg);
break;
#ifdef CONFIG_VSYNC_OPENGL
case BKEND_GLX:
glx_set_clip(ps, reg);
break;
#endif
}
}
static void
paint_all(session_t *ps, XserverRegion region, win *t);