Hosed wrote:
Good primitive drawing is a non-trivial feature set. There are literally hundreds of algorithms for drawing primitives fast, or pretty, or both. I don't imagine this coming to GapiDraw right away, but Johan would be the one to know.
Absolutely true. From what I've seen, Johan knows his stuff like few others do, so I have the utmost confidence in him
Hosed wrote:
Cloning is the same thing as creating a surface and doing a memcpy IE Create Surface, Blit Surface. The only possible performance boosts could come from refcounted cloning. In which case you still suffer the costs of cloning, just that they wouldn't incur until you changed one of the clones. Until then they'd all point to the original surface. This latter effect can be achieved just as easily with pointers to CGapiSurfaces.
I think your assuming that Blit Surface is just doing a memcpy. If it is, than yes, there's no performance boost to be had and it's just a question of whether it would be nice to have the feature built-in or let people do it themselves (and I would agree it's probably not that important to be added then). But my suspicion is that as currently implemented, it's not simply a memcpy but a pixel-by-pixel drawing as any Blit is, in which case implementing cloning natively COULD be reduced to a creation & memcpy combination, which should yield a vast performance increase.
Hosed wrote:
Pixel Shaders are an interesting architecture idea. Completely foreign to most 2D library models I've used, but very neat. However I fail to see how a pixel shader would be any faster then direct access pixel manipulation. Performance wise that is.
I guess it really depends on how the shaders are implemented and how the direct access to surface data is implemented. I don't know how GD exposes the surface data, but in PF you have a GetPixel method. This, generally speaking, tends to be relatively slow. So, being able to give the address of a function that is called to modify the RGB values of each pixel plotted (which I guess is the definition of a pixel shader

) winds up being much more efficient. No more powerful I would think, but better performing and certainly more convenient. Maybe this isn't such a big deal with GD, depending on your access to surface data.
Come to think of it, I guess you can get at the surface data directly like that in PF too, but I've never done so. Ok, so now that I'm thinking about it more, pixel shaders might just be a somewhat more convenient construct than going after raw data in the end, especially in the case of GD. No big deal then.