dri2: Don't send so many needless invalidate events
Only send invalidate events for drawables if some client has requested some buffers. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
ba5540221f
commit
531869448d
|
@ -83,6 +83,7 @@ typedef struct _DRI2Drawable {
|
||||||
CARD64 last_swap_ust; /* ust at completion of most recent swap */
|
CARD64 last_swap_ust; /* ust at completion of most recent swap */
|
||||||
int swap_limit; /* for N-buffering */
|
int swap_limit; /* for N-buffering */
|
||||||
unsigned long serialNumber;
|
unsigned long serialNumber;
|
||||||
|
Bool needInvalidate;
|
||||||
} DRI2DrawableRec, *DRI2DrawablePtr;
|
} DRI2DrawableRec, *DRI2DrawablePtr;
|
||||||
|
|
||||||
typedef struct _DRI2Screen {
|
typedef struct _DRI2Screen {
|
||||||
|
@ -497,6 +498,8 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
|
||||||
DRI2BufferFrontLeft);
|
DRI2BufferFrontLeft);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pPriv->needInvalidate = TRUE;
|
||||||
|
|
||||||
return pPriv->buffers;
|
return pPriv->buffers;
|
||||||
|
|
||||||
err_out:
|
err_out:
|
||||||
|
@ -540,9 +543,11 @@ DRI2InvalidateDrawable(DrawablePtr pDraw)
|
||||||
DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw);
|
DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw);
|
||||||
DRI2DrawableRefPtr ref;
|
DRI2DrawableRefPtr ref;
|
||||||
|
|
||||||
if (!pPriv)
|
if (!pPriv || !pPriv->needInvalidate)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
pPriv->needInvalidate = FALSE;
|
||||||
|
|
||||||
list_for_each_entry(ref, &pPriv->reference_list, link)
|
list_for_each_entry(ref, &pPriv->reference_list, link)
|
||||||
ref->invalidate(pDraw, ref->priv);
|
ref->invalidate(pDraw, ref->priv);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user