diff options
author | phintuka <phintuka> | 2012-02-08 11:37:08 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2012-02-08 11:37:08 +0000 |
commit | e4c44b89a46f42def6c22d495d7f3ac50af1617b (patch) | |
tree | 4b7353fc8eb545af51d816a544225c17b0830e8b | |
parent | 4fb8d2bf73275e36cca972786efacc09d42b0dd1 (diff) | |
download | xineliboutput-e4c44b89a46f42def6c22d495d7f3ac50af1617b.tar.gz xineliboutput-e4c44b89a46f42def6c22d495d7f3ac50af1617b.tar.bz2 |
Use XShape with OpenGL
(Thanks to grueni75, patch #3483644)
-rw-r--r-- | xine_sxfe_frontend.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c index f1b11ed6..d116f62d 100644 --- a/xine_sxfe_frontend.c +++ b/xine_sxfe_frontend.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_sxfe_frontend.c,v 1.198 2012-02-08 11:34:10 phintuka Exp $ + * $Id: xine_sxfe_frontend.c,v 1.199 2012-02-08 11:37:08 phintuka Exp $ * */ @@ -197,6 +197,9 @@ typedef struct sxfe_s { uint8_t opengl_always : 1; uint8_t opengl_osd_texture_img_updated : 1; uint8_t opengl_deinit : 1; +#ifdef HAVE_XSHAPE + uint8_t opengl_xshape_available : 1; +#endif #endif /* HAVE_OPENGL */ /* HUD */ @@ -1987,6 +1990,9 @@ static void *opengl_draw_frame_thread(void *arg) static int unsigned count = 0; int16_t win_width = -1, win_height = -1; int16_t win_x = -1, win_y = -1; +#ifdef HAVE_XSHAPE + XRectangle xrect; +#endif GLfloat video_tex_width, video_tex_height; int first_frame = 1; int force_redirect = 0; @@ -2024,6 +2030,16 @@ static void *opengl_draw_frame_thread(void *arg) win_width = this->x.width; win_height = this->x.height; force_redirect = 1; + + // Set the shape of the opengl window +#ifdef HAVE_XSHAPE + xrect.x = win_x; + xrect.y = win_y; + xrect.width = win_width; + xrect.height = win_height; + if (this->opengl_xshape_available) + XShapeCombineRectangles(this->display, this->opengl_window, ShapeBounding, 0, 0, &xrect, 1, ShapeSet, 0); +#endif } LOGVERBOSE("win_x=%d win_y=%d win_width=%d win_height=%d", win_x, win_y, win_width, win_height); // Update the global alpha value of the OSD @@ -2190,6 +2206,13 @@ static int opengl_start(sxfe_t *this) this->opengl_osd_texture_img = malloc(sizeof(uint32_t) * this->osd_width * this->osd_height); memset((void*)this->opengl_osd_texture_img,0,sizeof(uint32_t)*this->osd_width*this->osd_height); this->opengl_osd_texture_img_updated = 0; +#ifdef HAVE_XSHAPE + int dummy; + if (XShapeQueryExtension(this->display, &dummy, &dummy)) + this->opengl_xshape_available = 1; + else + this->opengl_xshape_available = 0; +#endif if (pthread_create(&this->opengl_drawing_thread, &attr, opengl_draw_frame_thread, (void *)this)) { pthread_attr_destroy(&attr); LOGERR("sxfe_display_open: can not start OpenGL drawing thread"); |