[PATCH xf86-video-ati resend 2/2] EXA/6xx/7xx: accelerate PictOpOver with component alpha
Michel Dänzer
michel at daenzer.net
Tue May 31 09:06:55 UTC 2016
On 27.05.2016 18:05, Tan Hu wrote:
> Subpixel text rendering is typically done with a solid src and
> a pixmap mask. Traditionally, this cannot be accelerated in a single
> pass and requires two passes [1]. However, we can cheat a little
> with a constant blend color.
>
> We can use:
> const.A = src.A / src.A
> const.R = src.R / src.A
> const.G = src.G / src.A
> const.B = src.B / src.A
>
> dst.A = const.A * (src.A * mask.A) + (1 - (src.A * mask.A)) * dst.A
> dst.R = const.R * (src.A * mask.R) + (1 - (src.A * mask.R)) * dst.R
> dst.G = const.G * (src.A * mask.G) + (1 - (src.A * mask.G)) * dst.G
> dst.B = const.B * (src.A * mask.B) + (1 - (src.A * mask.B)) * dst.B
>
> This only needs a single source value. src.A is cancelled down in
> the right places.
>
> [1] http://anholt.livejournal.com/32058.html
>
> r6xx still be used on some machine,
> Ported from commit 4375a6e75e5d41139be7031a0dee58c057ecbd07.
>
> Signed-off-by: Tan Hu <tan.hu at zte.com.cn>
[...]
> if (R600BlendOp[op].src_alpha &&
> (R600BlendOp[op].blend_cntl & COLOR_SRCBLEND_mask) !=
> (BLEND_ZERO << COLOR_SRCBLEND_shift)) {
> - RADEON_FALLBACK(("Component alpha not supported with source "
> - "alpha and source value blending.\n"));
> + if (pSrcPicture->pDrawable || op != PictOpOver)
This if is indented by 3 tabs, should be 2 tabs plus 4 spaces.
> + RADEON_FALLBACK(("Component alpha not supported with source "
Then, this line should be indented by 3 instead of 4 tabs.
> + "alpha and source value blending.\n"));
Finally, this line should be aligned with the opening parenthesis. If I
counted correctly, it needs to be intended by one more space for that.
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the xorg-driver-ati
mailing list