summaryrefslogtreecommitdiff
path: root/hw/kdrive/ephyr/ephyr_glamor_glx.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2014-02-27 17:55:50 -0800
committerEric Anholt <eric@anholt.net>2014-03-17 14:30:28 -0700
commitf31911ff8f3f3707101b7771d5dc994ed1ca5c70 (patch)
tree49641ab40e5d79fb136760efd8399cf4d58f86cd /hw/kdrive/ephyr/ephyr_glamor_glx.c
parent96a28e9c914d7ae9b269f73a27b99cbd3c465ac8 (diff)
xephyr: Don't forget to glViewport() before drawing the screen.
Fixes misrendering with cairogears. I had noticed the failure while trying to figure out what was going on with traps. Cairogears was apparently putting its results on the screen through putimage, which is a texture upload, so the last GL drawing was done to the size of the cairogears window, not the size of the xephyr screen. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw/kdrive/ephyr/ephyr_glamor_glx.c')
-rw-r--r--hw/kdrive/ephyr/ephyr_glamor_glx.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/hw/kdrive/ephyr/ephyr_glamor_glx.c b/hw/kdrive/ephyr/ephyr_glamor_glx.c
index d56907fe7..eaf565496 100644
--- a/hw/kdrive/ephyr/ephyr_glamor_glx.c
+++ b/hw/kdrive/ephyr/ephyr_glamor_glx.c
@@ -67,6 +67,9 @@ struct ephyr_glamor {
GLuint texture_shader;
GLuint texture_shader_position_loc;
GLuint texture_shader_texcoord_loc;
+
+ /* Size of the window that we're rendering to. */
+ unsigned width, height;
};
static GLint
@@ -205,6 +208,7 @@ ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor,
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glUseProgram(glamor->texture_shader);
+ glViewport(0, 0, glamor->width, glamor->height);
glVertexAttribPointer(glamor->texture_shader_position_loc,
2, GL_FLOAT, FALSE, 0, position);
@@ -329,3 +333,14 @@ ephyr_glamor_get_visual(void)
return xcb_aux_find_visual_by_id(xscreen, visual_info->visualid);
}
+
+void
+ephyr_glamor_set_window_size(struct ephyr_glamor *glamor,
+ unsigned width, unsigned height)
+{
+ if (!glamor)
+ return;
+
+ glamor->width = width;
+ glamor->height = height;
+}