Commit 0ef1698b authored by Zhigang Gong's avatar Zhigang Gong

glamor: Fix one bug for Xephyr.

Xephyr doesn't has a bounded valid texture. It seems that we can't
load texture 0 directly sometimes. Especially in the copyarea, function
if that is the case, we prefer to use fbo blit to read the screen pixmap
rather than load the bound texture.
Signed-off-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
parent 9b667ffd
......@@ -200,7 +200,7 @@ glamor_create_screen_pixmap(ScreenPtr screen, int w, int h, int depth,
pixmap_priv = glamor_get_pixmap_private(pixmap);
pixmap_priv->tex = 0;
pixmap_priv->gl_fbo = 1;
pixmap_priv->gl_tex = 1;
pixmap_priv->gl_tex = 0;
pixmap_priv->container = pixmap;
pixmap_priv->pending_op.type = GLAMOR_PENDING_NONE;
......
......@@ -293,7 +293,8 @@ glamor_copy_n_to_n(DrawablePtr src,
}
/* XXX need revisit to handle overlapped area copying. */
if ( overlaped
if ((overlaped
|| !src_pixmap_priv->gl_tex || !dst_pixmap_priv->gl_tex )
&& glamor_copy_n_to_n_fbo_blit(src, dst, gc, box, nbox, dx, dy)) {
goto done;
return;
......
......@@ -765,7 +765,11 @@ glamor_composite_with_shader(CARD8 op,
glamor_fallback("source == dest\n");
goto fail;
}
if (!source_pixmap_priv || source_pixmap_priv->gl_tex == 0) {
if (!source_pixmap_priv || source_pixmap_priv->gl_fbo == 0) {
/* XXX in Xephyr, we may have gl_fbo equal to 1 but gl_tex
* equal to zero when the pixmap is screen pixmap. Then we may
* refer the tex zero directly latter in the composition.
* It seems that it works fine, but it may have potential problem*/
#ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD
source_status = GLAMOR_UPLOAD_PENDING;
#else
......@@ -786,7 +790,7 @@ glamor_composite_with_shader(CARD8 op,
glamor_fallback("mask == dest\n");
goto fail;
}
if (!mask_pixmap_priv || mask_pixmap_priv->gl_tex == 0) {
if (!mask_pixmap_priv || mask_pixmap_priv->gl_fbo == 0) {
#ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD
mask_status = GLAMOR_UPLOAD_PENDING;
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment