# HG changeset patch # User Thinker K.F. Li # Date 1291527433 -28800 # Node ID e1a76d10953e37574adda5dc3ef67986425a431e # Parent fb79175e6cc34fa269961f81b2f603c14efebeb8 Fix black window output for Cairo graphic engine. The window is always black for Cairo graphic engine. it is caused by incorrect implementation of mbe_copy_source(). diff -r fb79175e6cc3 -r e1a76d10953e include/mb_graph_engine_cairo.h --- a/include/mb_graph_engine_cairo.h Sun Dec 05 12:23:29 2010 +0800 +++ b/include/mb_graph_engine_cairo.h Sun Dec 05 13:37:13 2010 +0800 @@ -93,6 +93,7 @@ int stop_cnt); extern mbe_pattern_t *mbe_pattern_create_image(mb_img_data_t *img); extern void mbe_scissoring(mbe_t *canvas, int n_areas, area_t **areas); +extern void mbe_copy_source(mbe_t *src, mbe_t *dst); static void mbe_pattern_set_matrix(mbe_pattern_t *ptn, @@ -112,21 +113,6 @@ cairo_set_operator(canvas, old_op); } -static void mbe_copy_source(mbe_t *src, mbe_t *dst) { - cairo_operator_t saved_op; - cairo_surface_t *surf; - cairo_pattern_t *ptn; - - surf = cairo_get_target(src); - ptn = cairo_pattern_create_for_surface(surf); - cairo_set_source(src, ptn); - cairo_pattern_destroy(ptn); - saved_op = cairo_get_operator(dst); - cairo_set_operator(dst, CAIRO_OPERATOR_SOURCE); - cairo_paint(dst); - cairo_set_operator(dst, saved_op); -} - static mbe_scaled_font_t * mbe_scaled_font_create(mbe_font_face_t *face, co_aix fnt_mtx[6], co_aix ctm[6]) { diff -r fb79175e6cc3 -r e1a76d10953e src/graph_engine_cairo.c --- a/src/graph_engine_cairo.c Sun Dec 05 12:23:29 2010 +0800 +++ b/src/graph_engine_cairo.c Sun Dec 05 13:37:13 2010 +0800 @@ -204,3 +204,19 @@ cairo_clip(canvas); } + +void +mbe_copy_source(mbe_t *src, mbe_t *dst) { + cairo_operator_t saved_op; + cairo_surface_t *surf; + cairo_pattern_t *ptn; + + surf = cairo_get_target(src); + ptn = cairo_pattern_create_for_surface(surf); + cairo_set_source(dst, ptn); + cairo_pattern_destroy(ptn); + saved_op = cairo_get_operator(dst); + cairo_set_operator(dst, CAIRO_OPERATOR_SOURCE); + cairo_paint(dst); + cairo_set_operator(dst, saved_op); +}