Summary
Right now, -[View drawRect:] does the following:
- Acquires the GIL.
- Calls
get_renderer() to get the agg renderer
- Calls
buffer_rgba() to get a memoryview of the buffer.
- Performs a
malloc() and copies the contents to the new buffer.
- Wraps in CGDataProviderRef, then CGImageRef
- Draws into the View's buffer via
CGContextDrawImage()
- View's buffer is then composited to the window's buffer.
- Releases the GIL.
We can probably merge Step 6 / Step 7 by using a layer-backed view and setting CALayer.contents directly. There may be more optimizations here as well, if we can directly "push" a buffer to the view rather than relying on the -drawRect: call during the render cycle.
In either case, the rubberband would need to be a separate layer or view (non-opaque).
Proposed fix
No response
Summary
Right now,
-[View drawRect:]does the following:get_renderer()to get the agg rendererbuffer_rgba()to get a memoryview of the buffer.malloc()and copies the contents to the new buffer.CGContextDrawImage()We can probably merge Step 6 / Step 7 by using a layer-backed view and setting
CALayer.contentsdirectly. There may be more optimizations here as well, if we can directly "push" a buffer to the view rather than relying on the-drawRect:call during the render cycle.In either case, the rubberband would need to be a separate layer or view (non-opaque).
Proposed fix
No response