richardanaya / conifer

Apache License 2.0
37 stars 4 forks source link

add image support #13

Closed richardanaya closed 4 years ago

richardanaya commented 4 years ago

Adding basic image support.

I'm feeling like Frame should be called Surface.

nbrr commented 4 years ago

I'm feeling like Frame should be called Surface.

How about Canvas?

I think we'd want to advance on #9 before we start drawing actual stuff.

richardanaya commented 4 years ago

Canvas sounds good to m, one thing I observed is that pixel drawing is slow. I'm wondering how we'll be able to address that in layers.

nbrr commented 4 years ago

Canvas sounds good to m, one thing I observed is that pixel drawing is slow. I'm wondering how we'll be able to address that in layers.

How slow? At what point did it become slow? I am working on layers and the drag example and it is indeed very slow, it wasn't the case before.

richardanaya commented 4 years ago

I was actually referring to drawing canvases on canvas in particular with draw_canvas

at one point I was just for looping over each pixel and copying the pixel from the image to the canvas' pixels and it was slow

I switched over to using copy_from_slice to copy pixels and it became an order of magnitude faster.

hmm, i'm not exactly how drag could have changed .. i'll check it the example on my phone!

nbrr commented 4 years ago

It didn't affect drag, my attempt at layers did, so I wanted to know whether we might have ran into the same issue. And we did, I run into troubles when I try to for loop on the pixels to clear the screen. I'm not sure how to get rid of the issue though.