[cairo] [PATCH] Path clipping

Keith Packard keithp at keithp.com
Mon Jun 13 12:57:19 PDT 2005


On Fri, 2005-06-03 at 15:29 -0400, Kristian Høgsberg wrote:

+struct _cairo_clip_path {
+    unsigned int       ref_count;
+    cairo_path_fixed_t path;
+    cairo_fill_rule_t  fill_rule;
+    double             tolerance;
+    cairo_clip_path_t  *prev;
+};

I think tolerance should not be captured in this structure, rather the
tolerance should come from the environment in which the clip is used.
Right?

+_cairo_surface_set_clip_path (cairo_surface_t  *surface,
+                             cairo_clip_path_t *clip_path,
+                             unsigned int      serial);

I assume this sets the whole mess at once and avoids having to call
_cairo_surface_clip_path multiple times?  Is this a useful change?

-    if (surface->backend->clip_path) {
-       status = surface->backend->clip_path (surface, NULL);
+
+    if (surface->backend->intersect_clip_path) {
+       status = surface->backend->intersect_clip_path (surface,
+                                                       NULL,
+                                                       CAIRO_FILL_RULE_WINDING,
+                                                       0);
 
and in this case, the call is 'intersect_clip_path' instead of
'clip_path'.  Is there some need to make the name longer?
And, the '0' at the end is marking tolerance, I think this is probably
the right place to have tolerance set.  I think we can simply fetch it
from the gstate above and pass it along, right?  Oh, and I'd like to see
0.0 for double constants...

Should the backend see the private clip structure so that we don't have
to pass fill_rule along here?

I don't have any specific comments about the internals of the PDF
implementation; it's all greek to me.

-keith

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050613/44f24dd8/attachment.pgp


More information about the cairo mailing list