[cairo-bugs] [Bug 101751] New: Replaying recording surface in a script surface results in different output the second time

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Jul 11 10:38:48 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=101751

            Bug ID: 101751
           Summary: Replaying recording surface in a script surface
                    results in different output the second time
           Product: cairo
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
          Assignee: chris at chris-wilson.co.uk
          Reporter: reiter.christoph at gmail.com
        QA Contact: cairo-bugs at cairographics.org

This was originally filed with pycairo:
https://github.com/pygobject/pycairo/issues/49

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;
}

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo-bugs/attachments/20170711/606ca002/attachment.html>


More information about the cairo-bugs mailing list