> The problem is that if you do this in a naive way, with a single huge pixmap, > you will have poor locality of reference. Once you get to 1024 RGBA pixels > across, every scan-line will occupy its own memory page. So any operation > that crosses lots of scan lines but only uses a small fraction of each one > (like drawing a vertical line) may involve a lot of paging. > > The usual workaround to that is to instead break the image up into > rectangular tiles, and store each as a separate pixmap. That way most > localized graphics operations will only involve a fraction of the total > number of tiles. (You can see Photoshop do this, if you run a slow operation > or if it’s had to page part of the image out to disk.) I think this will also > help with the GPU, because CoreGraphics likes to copy pixmaps to GPU memory > so they can be rendered and manipulated faster.
Thanks for the helpful tips! That's pretty much how I ended up organizing things, and it seems to work OK so far. —Mt. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com