cleanup in preview code
This commit is contained in:
parent
4322101f9b
commit
66a73e4e99
|
|
@ -201,6 +201,7 @@ static void reset_cairo(int create, int clear)
|
|||
/* save_sfc is based on pixmap and pixmaps are not resizeable, so on resize
|
||||
* we must destroy & recreate everything. sfc can be resized using cairo_*_surface_set_size
|
||||
* being based on window */
|
||||
cairo_destroy(cairo_save_ctx);
|
||||
cairo_surface_destroy(save_sfc);
|
||||
#if HAS_XRENDER==1
|
||||
#if HAS_XCB==1
|
||||
|
|
@ -217,6 +218,7 @@ static void reset_cairo(int create, int clear)
|
|||
fprintf(errfp, "ERROR: invalid cairo xcb surface\n");
|
||||
exit(-1);
|
||||
}
|
||||
cairo_save_ctx = cairo_create(save_sfc);
|
||||
cairo_set_line_width(cairo_save_ctx, 1);
|
||||
cairo_set_line_join(cairo_save_ctx, CAIRO_LINE_JOIN_ROUND);
|
||||
cairo_set_line_cap(cairo_save_ctx, CAIRO_LINE_CAP_ROUND);
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ void print_image()
|
|||
XSetTile(display, gctiled, xctx->save_pixmap);
|
||||
|
||||
#ifdef HAS_CAIRO
|
||||
cairo_destroy(cairo_save_ctx);
|
||||
cairo_surface_destroy(save_sfc);
|
||||
|
||||
#if HAS_XRENDER==1
|
||||
|
|
@ -124,6 +125,7 @@ void print_image()
|
|||
fprintf(errfp, "ERROR: invalid cairo xcb surface\n");
|
||||
exit(-1);
|
||||
}
|
||||
cairo_save_ctx = cairo_create(save_sfc);
|
||||
cairo_set_line_width(cairo_save_ctx, 1);
|
||||
cairo_set_line_join(cairo_save_ctx, CAIRO_LINE_JOIN_ROUND);
|
||||
cairo_set_line_cap(cairo_save_ctx, CAIRO_LINE_CAP_ROUND);
|
||||
|
|
@ -182,6 +184,7 @@ void print_image()
|
|||
|
||||
|
||||
#ifdef HAS_CAIRO
|
||||
cairo_destroy(cairo_save_ctx);
|
||||
cairo_surface_destroy(save_sfc);
|
||||
|
||||
#if HAS_XRENDER==1
|
||||
|
|
@ -198,6 +201,7 @@ void print_image()
|
|||
fprintf(errfp, "ERROR: invalid cairo xcb surface\n");
|
||||
exit(-1);
|
||||
}
|
||||
cairo_save_ctx = cairo_create(save_sfc);
|
||||
cairo_set_line_width(cairo_save_ctx, 1);
|
||||
cairo_set_line_join(cairo_save_ctx, CAIRO_LINE_JOIN_ROUND);
|
||||
cairo_set_line_cap(cairo_save_ctx, CAIRO_LINE_CAP_ROUND);
|
||||
|
|
|
|||
|
|
@ -636,6 +636,7 @@ void xwin_exit(void)
|
|||
if(has_x) {
|
||||
#ifdef HAS_CAIRO
|
||||
cairo_destroy(cairo_ctx);
|
||||
cairo_destroy(cairo_save_ctx);
|
||||
cairo_surface_destroy(sfc);
|
||||
cairo_surface_destroy(save_sfc);
|
||||
#endif
|
||||
|
|
@ -1383,7 +1384,7 @@ int Tcl_AppInit(Tcl_Interp *inter)
|
|||
return 1;
|
||||
}
|
||||
cairo_ctx = cairo_create(sfc);
|
||||
cairo_save_ctx = cairo_ctx;
|
||||
cairo_save_ctx = cairo_create(save_sfc);
|
||||
|
||||
#if 0
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue