aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/glamor/glamor_fbo.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-04-23 22:41:48 +0200
committermarha <marha@users.sourceforge.net>2014-04-23 22:41:48 +0200
commitd26ea2f474c48afa7d3c261572da5d85b7b62bd8 (patch)
treef4b1f3cac1b011283ae536868c3aee42bc14ff07 /xorg-server/glamor/glamor_fbo.c
parentdda1497a1e88c6cb8b8d91a7bc61283b697e8ea0 (diff)
downloadvcxsrv-d26ea2f474c48afa7d3c261572da5d85b7b62bd8.tar.gz
vcxsrv-d26ea2f474c48afa7d3c261572da5d85b7b62bd8.tar.bz2
vcxsrv-d26ea2f474c48afa7d3c261572da5d85b7b62bd8.zip
fontconfig mesa xserver xkeyboard-config pixman git update 23 Apr 2014
xserver commit 99f0365b1fbdfd9238b9f5cc28491e4e6c7324f1 xkeyboard-config commit b5eb5418e5a9d76b172faadf6901bc9c83f2ddad pixman commit 5f661ee719be25c3aa0eb0d45e0db23a37e76468 fontconfig commit 81664fe54f117e4781fda5a30429b51858302e91 mesa commit fd92346c53ed32709c7b56ce58fb9c9bf43ce9a8
Diffstat (limited to 'xorg-server/glamor/glamor_fbo.c')
-rw-r--r--xorg-server/glamor/glamor_fbo.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/xorg-server/glamor/glamor_fbo.c b/xorg-server/glamor/glamor_fbo.c
index 4f6da67fb..552168381 100644
--- a/xorg-server/glamor/glamor_fbo.c
+++ b/xorg-server/glamor/glamor_fbo.c
@@ -129,7 +129,7 @@ glamor_pixmap_fbo_cache_get(glamor_screen_private *glamor_priv,
void
glamor_purge_fbo(glamor_pixmap_fbo *fbo)
{
- glamor_get_context(fbo->glamor_priv);
+ glamor_make_current(fbo->glamor_priv);
if (fbo->fb)
glDeleteFramebuffers(1, &fbo->fb);
@@ -137,7 +137,6 @@ glamor_purge_fbo(glamor_pixmap_fbo *fbo)
glDeleteTextures(1, &fbo->tex);
if (fbo->pbo)
glDeleteBuffers(1, &fbo->pbo);
- glamor_put_context(fbo->glamor_priv);
free(fbo);
}
@@ -175,12 +174,12 @@ glamor_pixmap_fbo_cache_put(glamor_pixmap_fbo *fbo)
#endif
}
-static void
+static int
glamor_pixmap_ensure_fb(glamor_pixmap_fbo *fbo)
{
- int status;
+ int status, err = 0;
- glamor_get_context(fbo->glamor_priv);
+ glamor_make_current(fbo->glamor_priv);
if (fbo->fb == 0)
glGenFramebuffers(1, &fbo->fb);
@@ -216,10 +215,11 @@ glamor_pixmap_ensure_fb(glamor_pixmap_fbo *fbo)
break;
}
- FatalError("destination is framebuffer incomplete: %s [%x]\n",
- str, status);
+ glamor_fallback("glamor: Failed to create fbo, %s\n", str);
+ err = -1;
}
- glamor_put_context(fbo->glamor_priv);
+
+ return err;
}
glamor_pixmap_fbo *
@@ -241,14 +241,17 @@ glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv,
fbo->glamor_priv = glamor_priv;
if (flag == GLAMOR_CREATE_PIXMAP_MAP) {
- glamor_get_context(glamor_priv);
+ glamor_make_current(glamor_priv);
glGenBuffers(1, &fbo->pbo);
- glamor_put_context(glamor_priv);
goto done;
}
- if (flag != GLAMOR_CREATE_FBO_NO_FBO)
- glamor_pixmap_ensure_fb(fbo);
+ if (flag != GLAMOR_CREATE_FBO_NO_FBO) {
+ if (glamor_pixmap_ensure_fb(fbo) != 0) {
+ glamor_purge_fbo(fbo);
+ fbo = NULL;
+ }
+ }
done:
return fbo;
@@ -341,14 +344,13 @@ _glamor_create_tex(glamor_screen_private *glamor_priv,
w, h);
}
if (!tex) {
- glamor_get_context(glamor_priv);
+ glamor_make_current(glamor_priv);
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, format, w, h, 0,
format, GL_UNSIGNED_BYTE, NULL);
- glamor_put_context(glamor_priv);
}
return tex;
}
@@ -367,10 +369,11 @@ glamor_create_fbo(glamor_screen_private *glamor_priv,
if (flag == GLAMOR_CREATE_PIXMAP_MAP)
goto no_tex;
- if (flag == GLAMOR_CREATE_PIXMAP_FIXUP)
- cache_flag = GLAMOR_CACHE_EXACT_SIZE;
- else
- cache_flag = 0;
+ /* Tiling from textures requires exact pixmap sizes. As we don't
+ * know which pixmaps will be used as tiles, just allocate
+ * everything at the requested size
+ */
+ cache_flag = GLAMOR_CACHE_EXACT_SIZE;
fbo = glamor_pixmap_fbo_cache_get(glamor_priv, w, h, format, cache_flag);
if (fbo)
@@ -565,7 +568,8 @@ glamor_pixmap_ensure_fbo(PixmapPtr pixmap, GLenum format, int flag)
pixmap->drawable.height, format);
if (flag != GLAMOR_CREATE_FBO_NO_FBO && pixmap_priv->base.fbo->fb == 0)
- glamor_pixmap_ensure_fb(pixmap_priv->base.fbo);
+ if (glamor_pixmap_ensure_fb(pixmap_priv->base.fbo) != 0)
+ return FALSE;
}
return TRUE;