console: clip update rectangle
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
bc210eb163
commit
4b4496dbcc
10
console.h
10
console.h
@ -229,6 +229,16 @@ static inline void unregister_displaychangelistener(DisplayState *ds,
|
|||||||
static inline void dpy_gfx_update(DisplayState *s, int x, int y, int w, int h)
|
static inline void dpy_gfx_update(DisplayState *s, int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
struct DisplayChangeListener *dcl;
|
struct DisplayChangeListener *dcl;
|
||||||
|
int width = pixman_image_get_width(s->surface->image);
|
||||||
|
int height = pixman_image_get_height(s->surface->image);
|
||||||
|
|
||||||
|
x = MAX(x, 0);
|
||||||
|
y = MAX(y, 0);
|
||||||
|
x = MIN(x, width);
|
||||||
|
y = MIN(y, height);
|
||||||
|
w = MIN(w, width - x);
|
||||||
|
h = MIN(h, height - y);
|
||||||
|
|
||||||
QLIST_FOREACH(dcl, &s->listeners, next) {
|
QLIST_FOREACH(dcl, &s->listeners, next) {
|
||||||
if (dcl->dpy_gfx_update) {
|
if (dcl->dpy_gfx_update) {
|
||||||
dcl->dpy_gfx_update(s, x, y, w, h);
|
dcl->dpy_gfx_update(s, x, y, w, h);
|
||||||
|
Loading…
Reference in New Issue
Block a user