<div dir="ltr">Hi! <div><div>i have some tearing in my app. And I think implement a double buffering.</div><div>My first idea is have two buffers and 1 cairo_surface but i don know if it's possible swap  the buffer once the cairo_surface has been created.</div></div><div><br></div><div>Example of idea:</div><div><span style="color:rgb(0,0,0);font-family:Arial;line-height:17.94px;white-space:pre-wrap">bufs</span>[0] = createBuffer();</div><div><span style="color:rgb(0,0,0);font-family:Arial;line-height:17.94px;white-space:pre-wrap">bufs</span>[1] = createBuffer();</div><div><span id="docs-internal-guid-e1f243b7-c7b6-a2ea-2394-f039a8db7eb3"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">surface = cairo_image_surface_create_for_data(<span style="line-height:17.94px">bufs</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:normal;white-space:normal">[0] </span>,</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">   </span><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span class="" style="white-space:pre"> </span></span><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span class="" style="white-space:pre">  </span></span><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"> CAIRO_FORMAT_RGB24, width, height,</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">   </span><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span class="" style="white-space:pre">       </span></span><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span class="" style="white-space:pre">  </span></span><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"> cairo_format_stride_for_width(CAIRO_FORMAT_RGB24,</span></p><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">   </span><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span class="" style="white-space:pre"> </span></span><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span class="" style="white-space:pre">  </span></span><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span class="" style="white-space:pre">  </span></span><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span class="" style="white-space:pre">  </span></span><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"> width));</span></span><br></div><div><span><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Update().</span></span></div><div><span><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">swap buffers in surface.</span></span></div><div><span><span style="font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><br></span></span></div><div><span><span style="vertical-align:baseline;background-color:transparent"><font color="#000000" face="Arial"><span style="white-space:pre-wrap">Is there some function that I can swap the data of a cairo_surface?</span></font><br></span></span></div><div><span><span style="vertical-align:baseline;background-color:transparent"><font color="#000000" face="Arial"><span style="white-space:pre-wrap">Is there any other alternative to implement double buffering?</span><br></font></span></span></div><div><br></div><div>Regards!</div><div><br></div></div>