forked from speedie/spmenu
greatly speed up image redrawing/resizing by removing unnecessary calls
to drawimage() and cleanupimage() we don't need to call cleanupimage() as it is already called in cleanup() we don't need to call drawimage() because X11 events should handle that for us anyway
This commit is contained in:
parent
93ebe11e06
commit
91cc7782f7
|
@ -319,8 +319,6 @@ flipimg(const Arg *arg)
|
||||||
|
|
||||||
flip = flip ? 0 : arg->i ? 1 : 2;
|
flip = flip ? 0 : arg->i ? 1 : 2;
|
||||||
|
|
||||||
cleanupimage();
|
|
||||||
drawimage();
|
|
||||||
drawmenu();
|
drawmenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,8 +333,6 @@ rotateimg(const Arg *arg)
|
||||||
|
|
||||||
rotation++;
|
rotation++;
|
||||||
|
|
||||||
cleanupimage();
|
|
||||||
drawimage();
|
|
||||||
drawmenu();
|
drawmenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,12 +343,9 @@ toggleimg(const Arg *arg)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cleanupimage();
|
|
||||||
|
|
||||||
hideimage = !hideimage;
|
hideimage = !hideimage;
|
||||||
|
|
||||||
drawmenu();
|
drawmenu();
|
||||||
drawimage();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -371,5 +364,4 @@ defaultimg(const Arg *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
drawmenu();
|
drawmenu();
|
||||||
drawimage();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ eventloop(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* redraw image on X11 event */
|
||||||
#if USEIMAGE
|
#if USEIMAGE
|
||||||
drawimage();
|
drawimage();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -11,8 +11,6 @@ setimagesize(int width, int height)
|
||||||
/* this makes sure we cannot scale the image up or down too much */
|
/* this makes sure we cannot scale the image up or down too much */
|
||||||
if ((!image && height < imageheight) || (!image && width < imagewidth) || width > mw || hideimage) return;
|
if ((!image && height < imageheight) || (!image && width < imagewidth) || width > mw || hideimage) return;
|
||||||
|
|
||||||
cleanupimage();
|
|
||||||
|
|
||||||
oih = imageheight;
|
oih = imageheight;
|
||||||
oiw = imagewidth;
|
oiw = imagewidth;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue