<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Replaying recording surface in a script surface results in different output the second time"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=101751">101751</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Replaying recording surface in a script surface results in different output the second time
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>cairo
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>chris@chris-wilson.co.uk
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>reiter.christoph@gmail.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>cairo-bugs@cairographics.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This was originally filed with pycairo:
<a href="https://github.com/pygobject/pycairo/issues/49">https://github.com/pygobject/pycairo/issues/49</a>

1) compile the given problem
2) execute it
3) The files 1.txt and 2.txt should appear in the cwd
Expected: The two files should have the same content
Actual: They have different contents

// gcc example.c -o example $(pkg-config --cflags --libs cairo)
#include <cairo/cairo.h>
#include <cairo/cairo-script.h>
#include <stdlib.h>

int main(void) {
    cairo_t *ctx;
    cairo_surface_t * rec;
    cairo_device_t *dev1, *dev2;
    cairo_surface_t *script1, *script2;

    rec = cairo_recording_surface_create(CAIRO_CONTENT_COLOR_ALPHA, NULL);
    ctx = cairo_create(rec);
    cairo_set_source_rgb(ctx, 0.25, 0.5, 0.75);
    cairo_paint(ctx);
    cairo_destroy(ctx);

    dev1 = cairo_script_create("1.txt");
    script1 = cairo_script_surface_create(dev1, CAIRO_CONTENT_COLOR_ALPHA, 100,
100);
    ctx = cairo_create(script1);
    cairo_set_source_surface(ctx, rec, 0, 0);
    cairo_paint(ctx);
    cairo_destroy(ctx);
    cairo_device_destroy(dev1);
    cairo_surface_destroy(script1);

    dev2 = cairo_script_create("2.txt");
    script2 = cairo_script_surface_create(dev2, CAIRO_CONTENT_COLOR_ALPHA, 100,
100);
    ctx = cairo_create(script2);
    cairo_set_source_surface(ctx, rec, 0, 0);
    cairo_paint(ctx);
    cairo_destroy(ctx);
    cairo_device_destroy(dev2);
    cairo_surface_destroy(script2);

    cairo_surface_destroy(rec);

    return 0;
}</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>