mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 08:30:42 -05:00
glx: queue full redraws for the first 2 frames
To consider that we've see a number of drivers that can struggle to get going and may produce a bad first frame we now force the first 2 frames to be full redraws. This became a serious issue after we started using clipped redraws more aggressively because we assumed that after the first frame the full framebuffer was valid and we only redraw the content that changes. With buggy drivers though, applications would be left with junk covering a lot of the stage until some event triggered a full redraw.
This commit is contained in:
parent
771348b369
commit
1e7f22db3b
@ -527,6 +527,9 @@ _clutter_stage_glx_redraw (ClutterStageGLX *stage_glx,
|
||||
if (G_LIKELY (backend_glx->can_blit_sub_buffer) &&
|
||||
/* NB: a degenerate redraw clip width == full stage redraw */
|
||||
stage_glx->bounding_redraw_clip.width != 0 &&
|
||||
/* some drivers struggle to get going and produce some junk
|
||||
* frames when starting up... */
|
||||
G_LIKELY (stage_glx->frame_count > 3) &&
|
||||
/* While resizing a window clipped redraws are disabled to avoid
|
||||
* artefacts. See clutter-event-x11.c:event_translate for a
|
||||
* detailed explanation */
|
||||
@ -739,5 +742,7 @@ _clutter_stage_glx_redraw (ClutterStageGLX *stage_glx,
|
||||
|
||||
/* reset the redraw clipping for the next paint... */
|
||||
stage_glx->initialized_redraw_clip = FALSE;
|
||||
|
||||
stage_glx->frame_count++;
|
||||
}
|
||||
|
||||
|
@ -53,6 +53,11 @@ struct _ClutterStageGLX
|
||||
GLXPixmap glxpixmap;
|
||||
GLXWindow glxwin;
|
||||
|
||||
/* We only enable clipped redraws after 2 frames, since we've seen
|
||||
* a lot of drivers can struggle to get going and may output some
|
||||
* junk frames to start with. */
|
||||
unsigned long frame_count;
|
||||
|
||||
gboolean initialized_redraw_clip;
|
||||
ClutterGeometry bounding_redraw_clip;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user