It would, in fact, not be an improvement. Everything I'm looking at besides masks are quite limited to aligned rectangles. It looks like we need more flexibility in our alpha compositing options. Namely, we need to be able to alpha mask things without going in and setting each pixel by hand.
I tried something like this just to see how expensive direct pixel access was:
Code: Select all
fb = love.graphics.newFramebuffer(256, 256)
love.graphics.setRenderTarget(fb)
love.graphics.rectangle("fill", 100, 100, 100, 100)
id = fb:getImageData()
id:mapPixel(function(x,y,r,g,b,a) r = 0 end)
im = love.graphics.newImage(id)
love.graphics.draw(im,0,0)
love.graphics.setRenderTarget()
With hilariously slow results. Alright, I'm going to the issue tracker with this. There seem to be multiple ways to deal with this, but we definitely need it. As it is, you are limited to either drawing something in its entirety or not drawing it at all. No in-betweens. This leaves a whole class of problems as unsolvable.