[Bug 15372] New: Accelerating component alpha

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Apr 5 18:25:27 PDT 2008


http://bugs.freedesktop.org/show_bug.cgi?id=15372

           Summary: Accelerating component alpha
           Product: xorg
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Driver/Radeon
        AssignedTo: xorg-driver-ati at lists.x.org
        ReportedBy: otaylor at redhat.com
         QAContact: xorg-team at lists.x.org


Just wanted to throw a couple of ideas down in writing for getting
subpixel-anti-aliased text accelerated.

Looking at:

        if (pMaskPicture->componentAlpha) {
            /* Check if it's component alpha that relies on a source alpha and
             * on the source value.  We can only get one of those into the
             * single source value that we get to blend with.
             */
            if (RadeonBlendOp[op].src_alpha &&
                (RadeonBlendOp[op].blend_cntl & RADEON_SRC_BLEND_MASK) !=
                RADEON_SRC_BLEND_GL_ZERO) {
                RADEON_FALLBACK(("Component alpha not supported with source "
                                 "alpha and source value blending.\n"));
            }
        }

That makes sense: the blend function is being applied after whatever
fanciness we do to compute the source value ... *but* almost all text 
that is drawn has very special source values ... it's either black or 
white. If we set the source value to be the mask, then a black source with 
PictOpOver is:

 src_factor=ZERO, dest_factor=ONE_MINUS_SRC_COLOR

And a white source with PictOpOver is:

 src_factor=SRC_COLOR, dest_factor=ONE_MINUS_SRC_COLOR

The second idea is that, unless I'm mistaken, we can do arbitrary
colors with two passes: Do the first pass with the source color
being the mask and:

 src_factor=ZERO, dest_factor=ONE_MINUS_SRC_COLOR

And the second pass with the source value as the the source modulated
with the mask and:

 src_factor=SRC_COLOR, dest_factor=GL_ONE

To avoid weird visual effects you might want to only do the multipass
rendering when rendering to a pixmap and not to the front buffer, but
nobody in their right mind is rendering to the front buffer these
days.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the xorg-driver-ati mailing list