Skip to content

performance optimize Surface.draw #84

@oberhamsi

Description

@oberhamsi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions