-
Notifications
You must be signed in to change notification settings - Fork 108
Open
Labels
Description
Right now, everything runs through one code path, which understands all of the following situations. Some of which are very expensive and may only happen rarely:
- destination area is only part of the destination surface
- source area is only part of the source surface
- source surface has rotation applied (this is especially expensive because we need to do translate to origin and subsequenet rotation in JS. maybe this too can be improved with canvas-trickery?)
I would leave what we currently have as the slowest code path and add faster paths if possible.
For exmple, on obviously shitty thing we should not do is create objects for default situations like rDest = new Rect([0,0], src.getSize());, that's just a waste because if we want to use the whole destination surface, that should be hardcoded in an IF-path and not create an expensive Rect and then run that through our do-it-all codepath.