Do less memcpy when copying the framebuf to mem.
Merge pull request #2525 from unknownbrackets/fbo-memory

Do less memcpy when copying the framebuf to mem