[cairo] Win32 problems

Bill Spitzak spitzak at d2.com
Wed Aug 24 09:32:58 PDT 2005


I don't understand why the backend implementation is not done more like 
this:

If the backend wants trapazoids, it must implement 
_cairo_surface_fill_path like this:

status _cairo_surface_fill_path ( ... ) {
   _cairo_traps_init( & traps );
   ...
   return status;
}

Then the calling code can do:

   return _cairo_surface_fill_path (... )

and remove the unnecessary if statement.

Having a fallback implementation of the backends is standard 
object-oriented programming. It seems silly to test on every call to see 
if the backend can do it, when the fallback code can simply be put into 
the backend.

Owen Taylor wrote:
> On Wed, 2005-08-24 at 17:21 +0300, Nick Ameladiotis wrote:
> 
>>Oops, i've cc again to the list
>>
>>One more question before giving up, when  CAIRO_INT_STATUS_UNSUPPORTED 
>>is returned the previous call from
>>_cairo_gstate_fill will also return the status to cairo_fill_preserve 
>>which in result cause _cairo_set_error to be called.So it looks like 
>>everything is normal as far as regarding compiling, since the fill_path 
>>memeber in the backend is not specified
> 
> 
> The code I have in _cairo_gstate_fill looks like:
> 
>     status = _cairo_surface_fill_path (gstate->operator,
>                                        gstate->source,
>                                        gstate->target,
>                                        path,
>                                        gstate->fill_rule,
>                                        gstate->tolerance);
> 
>     if (status != CAIRO_INT_STATUS_UNSUPPORTED)
>         return status;
> 
>     _cairo_traps_init (&traps);
> 
>    [...]
> 
> Otherwise, if the surface supports fill_path, do that, otherwise
> fall through to a different operation.
> 
> 
>>I realy cannot understand how come and mingw  works as expected, i've 
>>tried both building with borlands c++ and msvc with same results.
> 
> 
> Cairo works fine for other people compiling with MSVC
> 
> 							Owen
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo


More information about the cairo mailing list