darksworm / imgsel-x11

GUI image selection tool for X11, discontinued, now working on qt version here https://github.com/darksworm/imgsel-qt
GNU General Public License v3.0
0 stars 0 forks source link

imlib_render_image_on_drawable is making the app lag #48

Open darksworm opened 4 years ago

darksworm commented 4 years ago

image

Could we keep the emojis on off-screen pixmaps and just copy them over when required?

darksworm commented 4 years ago

somehow caching the images in pixmaps makes it worse.

darksworm commented 4 years ago

Possible solution: Image loading on a different thread

Something keeps track of which images are on screen & where. On changes, enqueue images which have to be redrawn, cancel queued images which are no longer relevant.

Can we assure that canceled images won't be drawn?

darksworm commented 4 years ago

I've successfully created a mess.... But also made it so that the drawNextShape does not alter the shape -> we don't need it to return anything -> its easier to run async.

darksworm commented 4 years ago

Surprise, surprise - imlib2 isn't thread safe, so loading the images asynchronously won't work. We need a new lib for image loading.

darksworm commented 4 years ago

Could libpng be our saviour? Its thread-safe, well documented & supported, but limits us to only .png images and might be a hassle to implement?

darksworm commented 4 years ago

TBH I kind of don't give a fuck about other image formats, PNG is king in my world.

So if its not too cancerous to implement, I think its time to go with libpng.

darksworm commented 4 years ago

Looks like png++ might make using libpng less painful.