diff options
author | marha <marha@users.sourceforge.net> | 2012-03-23 10:05:55 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-03-23 10:05:55 +0100 |
commit | 0f834b91a4768673833ab4917e87d86c237bb1a6 (patch) | |
tree | 363489504ed4b2d360259b8de4c9e392918e5d02 /xorg-server/hw/xfree86/xaa/xaaNonTEGlyph.c | |
parent | fc72edebf875378459368c5383d9023730cbca54 (diff) | |
download | vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.tar.gz vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.tar.bz2 vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.zip |
libX11 xserver fontconfig mesa pixman xkbcomp xkeyboard-config git update
23 Mar 2012
Diffstat (limited to 'xorg-server/hw/xfree86/xaa/xaaNonTEGlyph.c')
-rw-r--r-- | xorg-server/hw/xfree86/xaa/xaaNonTEGlyph.c | 194 |
1 files changed, 93 insertions, 101 deletions
diff --git a/xorg-server/hw/xfree86/xaa/xaaNonTEGlyph.c b/xorg-server/hw/xfree86/xaa/xaaNonTEGlyph.c index 7431ba2a0..bfe7f9a09 100644 --- a/xorg-server/hw/xfree86/xaa/xaaNonTEGlyph.c +++ b/xorg-server/hw/xfree86/xaa/xaaNonTEGlyph.c @@ -1,5 +1,4 @@ - #ifdef HAVE_XORG_CONFIG_H #include <xorg-config.h> #endif @@ -39,52 +38,52 @@ void #ifdef TRIPLE_BITS -EXPNAME(XAANonTEGlyphRenderer3)( + EXPNAME(XAANonTEGlyphRenderer3) ( #else -EXPNAME(XAANonTEGlyphRenderer)( + EXPNAME(XAANonTEGlyphRenderer) ( #endif - ScrnInfoPtr pScrn, - int xText, int wText, - int y, int h, int skipleft, int startline, - NonTEGlyphInfo *glyphp, - int fg, int rop, - unsigned int planemask ) -{ + ScrnInfoPtr pScrn, + int xText, int wText, + int y, int h, int skipleft, int startline, + NonTEGlyphInfo * glyphp, + int fg, int rop, unsigned int planemask) { XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - CARD32* base = (CARD32*)infoRec->ColorExpandBase; + CARD32 *base = (CARD32 *) infoRec->ColorExpandBase; + #ifdef TRIPLE_BITS int dwords = ((3 * wText + 31) >> 5) * h; #else int dwords = ((wText + 31) >> 5) * h; #endif - (*infoRec->SetupForCPUToScreenColorExpandFill)( - pScrn, fg, -1, rop, planemask); - (*infoRec->SubsequentCPUToScreenColorExpandFill)( - pScrn, xText, y, wText, h, 0); + (*infoRec->SetupForCPUToScreenColorExpandFill) (pScrn, fg, -1, rop, + planemask); + (*infoRec->SubsequentCPUToScreenColorExpandFill) (pScrn, xText, y, wText, h, + 0); #ifndef FIXEDBASE #ifdef TRIPLE_BITS - if((((3 * wText + 31) >> 5) * h) <= infoRec->ColorExpandRange) + if ((((3 * wText + 31) >> 5) * h) <= infoRec->ColorExpandRange) #else - if((((wText + 31) >> 5) * h) <= infoRec->ColorExpandRange) + if ((((wText + 31) >> 5) * h) <= infoRec->ColorExpandRange) #endif - while(h--) - base = NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft); + while (h--) + base = NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft); else #endif - while(h--) - NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft); + while (h--) + NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft); - if((infoRec->CPUToScreenColorExpandFillFlags & CPU_TRANSFER_PAD_QWORD) && - (dwords & 1)) { - base = (CARD32*)infoRec->ColorExpandBase; - base[0] = 0x00000000; + if ((infoRec->CPUToScreenColorExpandFillFlags & CPU_TRANSFER_PAD_QWORD) && + (dwords & 1)) { + base = (CARD32 *) infoRec->ColorExpandBase; + base[0] = 0x00000000; } - if(infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND) - (*infoRec->Sync)(pScrn); - else SET_SYNC_FLAG(infoRec); + if (infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND) + (*infoRec->Sync) (pScrn); + else + SET_SYNC_FLAG(infoRec); } #ifndef FIXEDBASE @@ -92,32 +91,31 @@ EXPNAME(XAANonTEGlyphRenderer)( void #ifdef TRIPLE_BITS -EXPNAME(XAANonTEGlyphRendererScanline3)( + EXPNAME(XAANonTEGlyphRendererScanline3) ( #else -EXPNAME(XAANonTEGlyphRendererScanline)( + EXPNAME(XAANonTEGlyphRendererScanline) ( #endif - ScrnInfoPtr pScrn, - int xText, int wText, - int y, int h, int skipleft, int startline, - NonTEGlyphInfo *glyphp, - int fg, int rop, - unsigned int planemask ) -{ + ScrnInfoPtr pScrn, + int xText, int wText, + int y, int h, int skipleft, + int startline, + NonTEGlyphInfo * glyphp, int fg, + int rop, unsigned int planemask) { XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); int bufferNo = 0; - CARD32* base; - - (*infoRec->SetupForScanlineCPUToScreenColorExpandFill)( - pScrn, fg, -1, rop, planemask); - (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)( - pScrn, xText, y, wText, h, 0); - - while(h--) { - base = (CARD32*)infoRec->ScanlineColorExpandBuffers[bufferNo]; - NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft); - (*infoRec->SubsequentColorExpandScanline)(pScrn, bufferNo++); - if(bufferNo >= infoRec->NumScanlineColorExpandBuffers) - bufferNo = 0; + CARD32 *base; + + (*infoRec->SetupForScanlineCPUToScreenColorExpandFill) (pScrn, fg, -1, rop, + planemask); + (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill) (pScrn, xText, y, + wText, h, 0); + + while (h--) { + base = (CARD32 *) infoRec->ScanlineColorExpandBuffers[bufferNo]; + NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft); + (*infoRec->SubsequentColorExpandScanline) (pScrn, bufferNo++); + if (bufferNo >= infoRec->NumScanlineColorExpandBuffers) + bufferNo = 0; } SET_SYNC_FLAG(infoRec); @@ -131,70 +129,64 @@ EXPNAME(XAANonTEGlyphRendererScanline)( ********************************************************************/ - -CARD32* -NonTEGlyphFunc( - CARD32 *base, - NonTEGlyphInfo *glyphp, - int line, int TotalWidth, int skipleft ) +CARD32 * +NonTEGlyphFunc(CARD32 *base, + NonTEGlyphInfo * glyphp, int line, int TotalWidth, int skipleft) { CARD32 bits = 0; - int shift = glyphp->width; + int shift = glyphp->width; - if(skipleft) { - if((line >= glyphp->firstline) && (line <= glyphp->lastline)) + if (skipleft) { + if ((line >= glyphp->firstline) && (line <= glyphp->lastline)) bits = SHIFT_R(glyphp->bitsp[line], skipleft); - shift -= skipleft; - } else if((line >= glyphp->firstline) && (line <= glyphp->lastline)) - bits = glyphp->bitsp[line]; - - - while(TotalWidth > 32) { - while(shift < 32) { - glyphp++; - if((line >= glyphp->firstline) && (line <= glyphp->lastline)) - bits |= SHIFT_L(glyphp->bitsp[line],shift); - shift += glyphp->width; - } + shift -= skipleft; + } + else if ((line >= glyphp->firstline) && (line <= glyphp->lastline)) + bits = glyphp->bitsp[line]; + + while (TotalWidth > 32) { + while (shift < 32) { + glyphp++; + if ((line >= glyphp->firstline) && (line <= glyphp->lastline)) + bits |= SHIFT_L(glyphp->bitsp[line], shift); + shift += glyphp->width; + } #ifdef TRIPLE_BITS - WRITE_BITS3(bits); + WRITE_BITS3(bits); #else - WRITE_BITS(bits); + WRITE_BITS(bits); #endif - shift &= 31; - if(shift && - (line >= glyphp->firstline) && (line <= glyphp->lastline)) - bits = SHIFT_R(glyphp->bitsp[line], glyphp->width - shift); - else bits = 0; - TotalWidth -= 32; + shift &= 31; + if (shift && (line >= glyphp->firstline) && (line <= glyphp->lastline)) + bits = SHIFT_R(glyphp->bitsp[line], glyphp->width - shift); + else + bits = 0; + TotalWidth -= 32; } - if(TotalWidth) { - TotalWidth -= shift; - while(TotalWidth > 0) { - glyphp++; - if((line >= glyphp->firstline) && (line <= glyphp->lastline)) - bits |= SHIFT_L(glyphp->bitsp[line], shift); - shift += glyphp->width; - TotalWidth -= glyphp->width; - } + if (TotalWidth) { + TotalWidth -= shift; + while (TotalWidth > 0) { + glyphp++; + if ((line >= glyphp->firstline) && (line <= glyphp->lastline)) + bits |= SHIFT_L(glyphp->bitsp[line], shift); + shift += glyphp->width; + TotalWidth -= glyphp->width; + } #ifdef TRIPLE_BITS - if (shift >= 22) { - WRITE_BITS3(bits); - } else if (shift >= 11) { - WRITE_BITS2(bits); - } else { - WRITE_BITS1(bits); - } + if (shift >= 22) { + WRITE_BITS3(bits); + } + else if (shift >= 11) { + WRITE_BITS2(bits); + } + else { + WRITE_BITS1(bits); + } #else - WRITE_BITS(bits); + WRITE_BITS(bits); #endif } - return base; } - - - - |