summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2015-11-05 15:13:55 -0800
committerEric Anholt <eric@anholt.net>2015-11-10 13:55:47 -0800
commitff8ef975df9cd99ec6f0b8b8047445091bf35ef0 (patch)
tree69a201bc05fa587de438226ce1e25e62f78fb2bf
parenta6b05d10da2fe476f46e6dc4ad8a603964735905 (diff)
glamor: Fix rendering when core font texture allocation fails.
Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
-rw-r--r--glamor/glamor_font.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/glamor/glamor_font.c b/glamor/glamor_font.c
index 6b3a16abc..6753d5089 100644
--- a/glamor/glamor_font.c
+++ b/glamor/glamor_font.c
@@ -127,8 +127,13 @@ glamor_font_get(ScreenPtr screen, FontPtr font)
}
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+ glamor_priv->suppress_gl_out_of_memory_logging = true;
glTexImage2D(GL_TEXTURE_2D, 0, GL_R8UI, overall_width, overall_height,
0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, bits);
+ glamor_priv->suppress_gl_out_of_memory_logging = false;
+ if (glGetError() == GL_OUT_OF_MEMORY)
+ return NULL;
free(bits);