summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeo Liu <[email protected]>2016-04-25 15:49:28 -0400
committerLeo Liu <[email protected]>2016-05-16 16:28:51 -0400
commit858b329c2cdf43269e083e0861eee2abbf802b4c (patch)
tree5934fac8a1f5f6be03bb8d8ef69d72723f5647c8 /src
parent96580ad593f3821256dc5a5f5f61ee809fb775a1 (diff)
vl/dri3: add support for resizing
When drawable size changed, PresentConfigureNotify event will be emitted, by handling the event to re-allocate resized buffer. Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/vl/vl_winsys_dri3.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri3.c b/src/gallium/auxiliary/vl/vl_winsys_dri3.c
index a370315868d..8bdfe823386 100644
--- a/src/gallium/auxiliary/vl/vl_winsys_dri3.c
+++ b/src/gallium/auxiliary/vl/vl_winsys_dri3.c
@@ -91,7 +91,9 @@ dri3_handle_present_event(struct vl_dri3_screen *scrn,
{
switch (ge->evtype) {
case XCB_PRESENT_CONFIGURE_NOTIFY: {
- /* TODO */
+ xcb_present_configure_notify_event_t *ce = (void *) ge;
+ scrn->width = ce->width;
+ scrn->height = ce->height;
break;
}
case XCB_PRESENT_COMPLETE_NOTIFY: {
@@ -249,12 +251,19 @@ dri3_get_back_buffer(struct vl_dri3_screen *scrn)
return NULL;
buffer = scrn->back_buffers[scrn->cur_back];
- if (!buffer) {
- buffer = dri3_alloc_back_buffer(scrn);
- if (!buffer)
+ if (!buffer || buffer->width != scrn->width ||
+ buffer->height != scrn->height) {
+ struct vl_dri3_buffer *new_buffer;
+
+ new_buffer = dri3_alloc_back_buffer(scrn);
+ if (!new_buffer)
return NULL;
+ if (buffer)
+ dri3_free_back_buffer(scrn, buffer);
+
vl_compositor_reset_dirty_area(&scrn->dirty_areas[scrn->cur_back]);
+ buffer = new_buffer;
scrn->back_buffers[scrn->cur_back] = buffer;
}