Re: [PATCH] gl: Fix bug in cairo_surface_create_similar().
王明 <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <CAFu4+mUtSvPm-3fCAoBKCj37GcGHq8G85RF5f=u1qcvvo4wwvw@mail.gmail.com> |
Well, only using glBlendFuncSeperate is not enough to assure alpha value of destination surface to be 1.0. For example, if both alpha value of source and destination surface is 0, then the result alpha is 0. But after this commit 6b472e12ae11f7b68289cdfd616e765be9a25a98<http://cgit.freedesktop.org/cairo/commit/?id=6b472e12ae11f7b68289cdfd616e765be9a25a98>, the CONTENT_COLOR similar surface is explicitly cleared to (0, 0, 0, 1). 2011/12/6 Chris Wilson <[email protected]> > On Tue, 6 Dec 2011 15:36:06 +0800, Chuanbo Weng <[email protected]> wrote: > > When use cairo_surface_create_similar() to create a CAIRO_CONTENT_COLOR > > surface within gl backend, the result surface is transparent, fail. > > Since we use use GL_RGBA when create CAIRO_CONTENT_COLOR surface, we > > should make sure the final alpha value is 1.0. So we set alpha value > > of solid source operand to be 1.0, then the final surface is black, > > fixed. > > Peculiar. The output alpha value from the blender is hardcoded to 1 for > a CAIRO_CONTENT_COLOR destination surface using glBlendFuncSeperate. Not > only that but the CONTENT_COLOR similar surface is explicitly cleared to > (0, 0, 0, 1) during creation. > -Chris > > -- > Chris Wilson, Intel Open Source Technology Centre > -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo