cocoa touch - Quartz drawing optimization -


I have a view that has a background image and a CGPath that changes as a user Is the screen? Drawing a picture with CGContextDrawImage () and then pulling the path at the top is not fast enough and this interrupts the touch event performance. What I want to do, has a bitmap buffer and its The change in the way is only to attract. Thus, the view drawRect () will just reflect the buffer I suspect that I will need to use CGContext s, but I can not understand how this To do. Is there any other way to adapt it?

Edit:

Every time I am touching the user screen I am adding to the path; Therefore "path change" refers to adding an existing path to more points. This is the reason why I think that I can just buff the image and can attract only "delta" instead of portraying the whole thing at all. At the moment, my drawing and event logic is something like this:

  - (zero) Draw the draw {// Create the background image // Draw the full path} - (zero) / Add touch point on the path [self setdaydisplay]; }  

By attracting the background, touch event sampling path looks worse than drawing.

If the background image is not changing (I can not definately tell what it is ), Then you should place the background image in a separate coeannimation layer, which has a path on the layer above it, allowing GPU to handle compositing instead of doing it in your all-drawart. The background image can probably be cached later, and you have to update, there will be only one thing (which you can still completely avoid with each frame again). You will be able to work on a large scale or rotating the path without worrying about the impact on the background image.


Comments