Paint error with group

Wangming <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <A9604ADD7B6DB449BF5C8389492E25EC2308933B@SZXEML501-MBS.china.huawei.com>
Hi,

I am use cairo-6816f70da54e730e88b98c8592aa6fc84e082928.zip(latest cario versio, 2011-12-16) to develop application. And I am use the OpenGL ES2.0 backend for cairo.

I found that the composition result was incorrect if I use cairo_push_group and cairo_pop_group_to_source to generate the source. But the result will be correct if I do not use it.

Here is my code with incorrect result.

/************************code begin**************************************/
cairo_surface_t* cairosurf = cairo_gl_surface_create_for_egl_higo(1280, 720);
cairo_t* cr = cairo_create(cairosurf);


cairo_translate(cr, 0, 0);

cairo_set_source_rgba (cr, 0.0, 1.0, 0.0, 0.8);
cairo_rectangle(cr, 100, 100, 300 , 200);
cairo_fill (cr);

cairo_push_group (cr);

cairo_set_source_rgba (cr, 0.0, 0.0, 0.9, 0.4);
cairo_rectangle(cr, 150, 150, 600, 400);
cairo_fill (cr);

cairo_pop_group_to_source (cr);

cairo_set_operator (cr, CAIRO_OPERATOR_OVER);

cairo_paint (cr);
cairo_gl_higo_refresh();
/************************code end**************************************/

Here is my code with correct result.

/************************code begin**************************************/
cairo_surface_t* cairosurf = cairo_gl_surface_create_for_egl_higo(1280, 720);
cairo_t* cr = cairo_create(cairosurf);


cairo_translate(cr, 0, 0);

cairo_set_source_rgba (cr, 0.0, 1.0, 0.0, 0.8);
cairo_rectangle(cr, 100, 100, 300 , 200);
cairo_fill (cr);

cairo_set_operator (cr, CAIRO_OPERATOR_OVER);

cairo_set_source_rgba (cr, 0.0, 0.0, 0.9, 0.4);
cairo_rectangle(cr, 150, 150, 600, 400);
cairo_fill (cr);

cairo_paint (cr);
cairo_gl_higo_refresh();
/************************code end**************************************/

I used some method to get group source and paint its texture onto screen after call cairo_paint (cr). I found that the texture content is wrong.

Can anybody give me any suggestions to solve the problem?

Thanks in advance.

Best Regards
Ming

--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.