Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
draw the layer from the background thread #419
during layer draw we know what parts of the screen will need repainting, so we can call set setNeedsDisplayInRect and do a partial draw of the screen. This brings down overall keyDown-to-drawRect(finish) latency when in "layer" mode from 17ms to 4.5ms (about what the "stock" CoreText renderer does).
With this PR, the layer-backed code is about as fast as the standard code (I measured average latency with osheroff@56bb7eb), fast enough that I think we could swap out the old draw-direct code with the layer code, but I thought I would offer that code in a separate PR so you could easily see the methods I'm using here.