mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-20 04:40:07 +01:00
[test] Add missing mark_dirty() calls to test cases.
A recent optimisation has added a flag to the image surface which is used to track whether the surface is clear or not. This makes it imperative that clients call cairo_surface_mark_dirty() if they use cairo to allocate their pixel buffers and then proceed to initialize them without telling cairo about it.
This commit is contained in:
parent
9ddf14cfd5
commit
b394240941
3 changed files with 4 additions and 0 deletions
|
|
@ -125,6 +125,7 @@ draw (cairo_t *cr, int dst_width, int dst_height)
|
|||
dst += stride;
|
||||
}
|
||||
}
|
||||
cairo_surface_mark_dirty (surface);
|
||||
|
||||
/* Paint background blue */
|
||||
cairo_set_source_rgb (cr, 0, 0, 1); /* blue */
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ draw (cairo_t *cr, int width, int height)
|
|||
data[x] = RED_MASK;
|
||||
data += stride;
|
||||
}
|
||||
cairo_surface_mark_dirty (surface);
|
||||
}
|
||||
|
||||
cairo_set_source_rgb (cr, 1, 0, 0); /* red */
|
||||
|
|
@ -81,6 +82,7 @@ draw (cairo_t *cr, int width, int height)
|
|||
data[x] = GREEN_MASK;
|
||||
data += stride;
|
||||
}
|
||||
cairo_surface_mark_dirty (surface);
|
||||
}
|
||||
|
||||
cairo_set_source_rgb (cr, 0, 1, 0); /* green */
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@ test_scaled_font_render_glyph (cairo_scaled_font_t *scaled_font,
|
|||
*data = CAIRO_BITSWAP8_IF_LITTLE_ENDIAN (byte);
|
||||
data += cairo_image_surface_get_stride (image);
|
||||
}
|
||||
cairo_surface_mark_dirty (image);
|
||||
|
||||
pattern = cairo_pattern_create_for_surface (image);
|
||||
cairo_surface_destroy (image);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue