Developing the iPad PDF-Reader, we decided to prepare high-quality images for rendering intensive pages (many ways in them) and use them instead of PDF pages to avoid performance problems. We decided that this is a good compromise between readability and rendering performance, which leads to ~ 1.5 MB jpegs . 3*768 by 3*1024
However, we tested two implementations for displaying image pages. One that uses a subclass CATiledLayerthat is also responsible for processing the "normal" PDF pages (drawing with CGContextDrawImage), and the other - UIImageView. The latter has the advantage that the display and scaling are very fast, but the memory usage is really bad - 30 MB in memory is required (which is consistent with the size of the bitmap image). Other approaches ( CATiledLayer) take longer to first render the page and take another two seconds to re-render after scaling (similar to PDF pages, but much faster), but do not take up more memory than it takes to display a much smaller image or PDF page.
Does anyone know what is going on behind the scenes, and if you can combine low-memory usage CGContextDrawImagewith high-performance UIImageViewusing the Quartz Framework.
source
share