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

Chuanbo Weng strgnm at gmail.com
Thu Jan 12 19:25:14 PST 2012


I find the reason now.
The surface is explicitly cleared to (0, 0, 0, 1) in
cairo_gl_surface_create()
using _cairo_gl_surface_clear(), but not cleared in
_cairo_gl_surface_create_similar(). However, now it's not neccessary
to do clearing in _cairo_gl_surface_create_similar() because of
restoration of "particular fast path". It will be more effective.

2011/12/7 Chris Wilson <chris at chris-wilson.co.uk>

> On Wed, 7 Dec 2011 20:20:33 +0800, 王明 <strgnm at gmail.com> wrote:
> > 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.
>
> Except that the blend equation for a CONTENT_COLOR destination is to always
> set the output alpha to 1.0.
>
> > But after this commit
> > 6b472e12ae11f7b68289cdfd616e765be9a25a98<
> http://cgit.freedesktop.org/cairo/commit/?id=6b472e12ae11f7b68289cdfd616e765be9a25a98
> >,
>
> I reiterate that cairo_surface_create_similar(CONTENT_COLOR) was already
> being explicitly cleared to (0, 0, 0, 1) prior to the restoration of
> that particular fast path. Whatever bug you are seeing is still present,
> just now papered over.
>  -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20120113/6763eb39/attachment.html>


More information about the cairo mailing list