[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

Re: [XaraXtreme-dev] Moving to Cairo (was Ping)


--On 21 February 2007 15:49 +0000 Phil Martin <phil@xxxxxxxx> wrote:

Creating a new RenderRegion-derived class is probably the "correct" way
to do it and that would allow you to use the existing RRCaps mechanism to
express the capabilities of the new class to the rest of the system.

Hmmm... true, but unless it extensively borrows from GRenderRegion
it's probably rather more work. On the other hand there is some
serious code spaghetti in GRenderRegion and friends which could do
with a clear up anyway (static methods and the like).

It's not just GRenderRegion that needs clearing up though - there are
other classes that access GDrawContexts - some in that they assume
that the render region in question has a GDrawContext because they
know how it was created, and some because they use GDrawContext without
a GRenderRegion. Examples include the solid drag code.

I suppose a compromise might be to support a CairoRenderRegion that
was derived from GRenderRegion that also used a (say) CairoRenderContext
that was derived from xxxDrawContext. This would at least allow it
to share code.

One disadvantage of Carl's proposal is that it means Cairo would always
have to draw into an off-screen bitmap, which (as I understand it)
means it loses most hardware acceleration; that's because all the
GRenderRegion classes (which use the GDrawContext) assume the existence
of an underlying accessible bitmap (as opposed to OSRenderRegion which
doesn't). That's a much harder thing to fix, and is probably best fixed
once Cairo is in the obvious way (i.e. replacing GDraw/CDraw).