A potential issue in cairo-recording-surface.c

Zozó Teki <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CAE+APxggyZnO-4460LR3EP2p2A8Wy+jasH848xAR_VJ=4CmPSg@mail.gmail.com>
Hi,

I have noticed that some of my objects were  lost when drawing them on
a recording surface and playing them back. After doing some debugging
I found that they are not properly added to the bbtree during
playback. (Later elements with the same extents as a prior one tend to
disappear from the chain of headers having similar extents.)

I have prepared the below patch (against 1.12.8), which fixes the
issue for me. (It properly prepends “header” with its full chain to
“bbt->chain”.)

I am not a regular cairo contributor, this is the first time I am
submitting a patch, so I am not sure this is the proper way or whom to
contact to discuss this issue.

Zoltan


--- src/cairo-recording-surface.c original
+++ src/cairo-recording-surface.c updated
@@ -210,7 +210,10 @@
     if (box->p1.x == bbt->extents.p1.x && box->p1.y == bbt->extents.p1.y &&
               box->p2.x == bbt->extents.p2.x && box->p2.y == bbt->extents.p2.y)
     {
-              header->chain = bbt->chain;
+    cairo_command_header_t *last = header;
+    while (last->chain)
+        last = last->chain;
+             last->chain = bbt->chain;
               bbt->chain = header;
               return CAIRO_STATUS_SUCCESS;
     }
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.