You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
gives ~10% performance improvement in best case, which is destination.blit(source, array) and it gets worse the more arguments you give it. this works pretty well because w3c context gives us an overloaded drawImage, which fits exactly our argument cases.
0% improvement for rotation. rotation will always be inherently so much slower with JS matrix manipulation that I don't think i'll do much about that case.
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:
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.The text was updated successfully, but these errors were encountered: