mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-09 06:08:02 +02:00
qt: Make flush() robust.
Hanno Meyer-Thurow reported in http://bugs.freedesktop.org/show_bug.cgi?id=26063 [PATCH] various fixes to cairo-qt a few issues related to _cairo_qt_surface_flush() where firefox was crashing after being built to use cairo-qt. This is an amalgam of those patches that hopefully address the issue.
This commit is contained in:
parent
4e315d8472
commit
6950b233e4
1 changed files with 26 additions and 7 deletions
|
|
@ -485,7 +485,7 @@ _cairo_qt_surface_finish (void *abstract_surface)
|
|||
if (qs->image || qs->pixmap)
|
||||
delete qs->p;
|
||||
else
|
||||
qs->p->restore();
|
||||
qs->p->restore ();
|
||||
|
||||
if (qs->image_equiv)
|
||||
cairo_surface_destroy (qs->image_equiv);
|
||||
|
|
@ -1553,11 +1553,30 @@ static cairo_status_t
|
|||
_cairo_qt_surface_flush (void *abstract_surface)
|
||||
{
|
||||
cairo_qt_surface_t *qs = (cairo_qt_surface_t *) abstract_surface;
|
||||
|
||||
QPaintDevice * dev = qs->p->device();
|
||||
qs->p->end();
|
||||
qs->p->begin(dev);
|
||||
|
||||
|
||||
if (qs->p == NULL)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
if (qs->image || qs->pixmap) {
|
||||
qs->p->end ();
|
||||
qs->p->begin (qs->p->device ());
|
||||
} else {
|
||||
qs->p->restore ();
|
||||
}
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_qt_surface_mark_dirty (void *abstract_surface,
|
||||
int x, int y,
|
||||
int width, int height)
|
||||
{
|
||||
cairo_qt_surface_t *qs = (cairo_qt_surface_t *) abstract_surface;
|
||||
|
||||
if (qs->p && !(qs->image || qs->pixmap))
|
||||
qs->p->save ();
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -1586,7 +1605,7 @@ static const cairo_surface_backend_t cairo_qt_surface_backend = {
|
|||
NULL, /* old_show_glyphs */
|
||||
NULL, /* get_font_options */
|
||||
_cairo_qt_surface_flush,
|
||||
NULL, /* mark_dirty_rectangle */
|
||||
_cairo_qt_surface_mark_dirty,
|
||||
NULL, /* scaled_font_fini */
|
||||
NULL, /* scaled_glyph_fini */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue