Hi,

On 3 March 2015 at 18:56, Jason Ekstrand <ja...@jlekstrand.net> wrote:
> On Tue, Mar 3, 2015 at 10:07 AM, Chad Versace <chad.vers...@intel.com>
> wrote:
>> On 02/23/2015 06:32 AM, Jonny Lamb wrote:
>> > +   static const EGLint argb_attrs[] = {
>> > +       EGL_TRANSPARENT_TYPE, EGL_TRANSPARENT_ALPHA_MESA,
>> > +       EGL_NONE
>> > +   };
>> >
>>
>> I tested this patch with X11 and Mesa, and it works as advertised. BUT...
>>
>> Pre-patch, Wayland applications who requested an EGLConfig with alpha
>> received one. The EGLSurface had compositor-transparent alpha, which
>> the application may not have expected. But the alpha configs *were*
>> available.
>>
>> Post-patch, existing Wayland applications that request an EGLConfig with
>> alpha will no longer receive one, because the existing applications
>> do not yet know about EGL_TRANSPARENT_ALPHA_MESA.
>>
>> I believe a correct solution is to continue create EGLConfigs
>> with EGL_ALPHA and without EGL_TRANSPARENT_TYPE, as Mesa does today,
>> but tell the compositor to ignore the alpha channel. The alpha channel
>> will be used for client-side alpha-blending but not for compositing.
>> Jason says that should be possible by telling the compositor that
>> the buffer format is WL_DRM_FORMAT_XRGB8888. And in addition to the
>> existing
>> EGLConfigs, also create new EGLConfigs with EGL_TRANSPARENT_ALPHA_MESA, as
>> this patch already does.
>
> Yes, XRGB8888 would be the correct *technical* way to handle that, but it
> still makes me wonder... What about Wayland apps that expect to get
> transparency by simply asking for alpha now?  Won't this break them?  I
> guess we have to break one class of apps or the other.

Yeah, it will break them. But then again, we had the same flag day for
X11 in that exact Bugzilla discussion, when X11 apps which requested
ALPHA_SIZE == 8 went from getting ARGB32 drawables which would be
blended by the compositor, to not - a change which was deemed totally
fine to enforce on people because it improved performance and matched
the spec.

Perhaps a better interim solution is to assume for Wayland that
EGL_TRANSPARENT_TYPE == EGL_DONT_CARE means that applications will get
a format determined by ALPHA_SIZE (i.e. size 8 means ARGB32, size 0
means XRGB32), but respect explicit demands for
TRANSPARENT_{NONE,ALPHA}.

Cheers,
Daniel
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to