[Mono-devel-list] Re: Texture Brush
duncan at ximian.com
Thu Feb 5 19:27:31 EST 2004
On Tue, 2004-02-03 at 04:27, Ravindra wrote:
> Please find attached the Cairo side implementation of TextureBrush. I've
> not debugged this code yet, it has some problems that I'm looking into.
What are these problems?
> I would like to change this code to OO-C style, once I get it working.
It might make sense to go this route from the beginning. The differences
are significant enough that having this other implementation working
does not mean that the transition to an OO layout will be seamless.
In general, I think it's pretty good! Two things:
* GDI+ uses floats primarily and the -I family of functions is just
there for convenience. For example, for GdipCreateTexture2, it should
not delegate to GdipCreateTexture2I. The opposite should happen instead.
Incidentally, all of Cairo uses doubles for their data storage.
* For all the Matrix operations (Translate, Rotate, Scale, etc), I think
we are required to set the texture's matrix after performing the
operation, for an example see the equivalent functions in graphics.c
As for the diffs in gdip.h, I would prefer that we start a new
texturebrush.h and put all the function prototypes there instead. I've
regretted merging all of the old headers into one single gdip.h; even
though it is a lot more convenient, it is a monster to maintain. Bit by
bit, we should move towards having gdip.h only including other smaller
header files, and I guess that should be true for gdipFunction.cs as
well, as it's getting pretty long and scary.
More information about the Mono-devel-list