[cairo] [PATCH] gl: Fix bug in cairo_surface_create_similar().

王明 strgnm at gmail.com
Wed Dec 7 04:20:33 PST 2011


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 <chris at chris-wilson.co.uk>

> On Tue,  6 Dec 2011 15:36:06 +0800, Chuanbo Weng <strgnm at gmail.com> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20111207/85c5b943/attachment.html>


More information about the cairo mailing list