[quote=130272:@Oliver Scott-Brown]It seems that scaling with a built-in Xojo function (or using functions built into the OS) is far superior (in general) to writing your own function to process the pixels.
I am guessing this is because you directly use the GPU to handle this? Or is it because the chances are that the code will be more mature and optimised than what people have already written in Xojo? Or is it because of the speed of compiled Xojo code (no matter how well written it is)?
Not that I plan to ever do this but is it possible to directly program the GPU to create something like a fast scaling function?
Just curious really. Not sure how important this knowledge would be for graphics programming.[/quote]
Here what I can tell you (with my limited knowledge of what Xojo does under the hood), on OS X (which is my primary target), Xojo uses the Core Graphics APIs (which you can also declare into), these APIs are at the core of every drawing function used in almost every application, even if you use NSGraphics functions, they resolve down to CoreGraphics.
Core Graphics is heavily optimized and takes advantage of the GPU where it can, there are some things you need to use declares for (such as CGLayers) which can make drawing even quicker (in some circumstances).
I would imagine that on Windows & Linux, Xojo does the same and uses the OS graphics toolbox, which should give you the most optimized functions for tasks.
On OS X, you also have Core Image. Core Image is one of my favorites as it’s highly optimized for pixel manipulations, it will use multi-core processors, GPUs, all without you having to worry or care. It’s so much faster than anything else I’ve come across. Not to say that’s perfect, it has warts and while simple to get started, it also has preferred working paths which no books or online articles task about, once you find these paths, it makes the whole world if difference.
At WWDC this year, Apple explained a change they made in Core Image on iOS (for iOS 8), which gave a 17x performance improvement. You as a developer, don’t need to do anything to take advantage of this!