Annotation of ntddk/src/video/displays/vga256/stretch.c, revision 1.1.1.1

1.1       root        1: 
                      2: /******************************Module*Header*******************************\
                      3: * Module Name: stretch.c
                      4: *
                      5: * DrvStretchBlt
                      6: *
                      7: * Copyright (c) 1993 Microsoft Corporation
                      8: \**************************************************************************/
                      9: 
                     10: #include "driver.h"
                     11: 
                     12: //@@@ This should become a VOID when all cases are handled in the stretching
                     13: //@@@ code, and should go in driver.h
                     14: INT vStretchBlt8bpp(PPDEV ppdev, PBYTE pSrc, LONG lSrcNext,
                     15:                     PRECTL prclSrc, PRECTL prclDest, PRECTL prclDestClip,
                     16:                     PULONG pulXlatVector);
                     17: 
                     18: BOOL DrvStretchBlt(
                     19: SURFOBJ         *psoDest,
                     20: SURFOBJ         *psoSrc,
                     21: SURFOBJ         *psoMask,
                     22: CLIPOBJ         *pco,
                     23: XLATEOBJ        *pxlo,
                     24: COLORADJUSTMENT *pca,
                     25: POINTL          *pptlBrushOrg,
                     26: RECTL           *prclDest,
                     27: RECTL           *prclSrc,
                     28: POINTL          *pptlMask,
                     29: ULONG            iMode)
                     30: {
                     31:     PPDEV  ppdev = (PPDEV) psoDest->dhpdev;
                     32:     PULONG pulXlatVector;
                     33:     INT    iClipping;
                     34: 
                     35:     // Handle only cases where the source is a DIB and the destination is
                     36:     // the VGA surface (which is always the case here if the source is a
                     37:     // DIB). Also, halftoning and masking aren't handled by the special-case
                     38:     // code. We only handle the case where a single source pixel is mapped onto
                     39:     // each destination pixel
                     40:     if ((iMode == COLORONCOLOR) &&
                     41:         (psoSrc->iType == STYPE_BITMAP) &&
                     42:         (psoMask == NULL)) {
                     43: 
                     44:         // We don't special case X or Y inversion for now
                     45:         if ((prclDest->left < prclDest->right) &&
                     46:             (prclDest->top < prclDest->bottom)) {
                     47: 
                     48:             // We don't special-case cases where the source has to be clipped
                     49:             // to the source bitmap extent
                     50:             if ((prclSrc->left >= 0) &&
                     51:                 (prclSrc->top >= 0)  &&
                     52:                 (prclSrc->right <= psoSrc->sizlBitmap.cx) &&
                     53:                 (prclSrc->bottom <= psoSrc->sizlBitmap.cy)) {
                     54: 
                     55:                 // Set up the clipping type
                     56:                 if (pco == (CLIPOBJ *) NULL) {
                     57:                     // No CLIPOBJ provided, so we don't have to worry about
                     58:                     // clipping
                     59:                     iClipping = DC_TRIVIAL;
                     60:                 } else {
                     61:                     // Use the CLIPOBJ-provided clipping
                     62:                     iClipping = pco->iDComplexity;
                     63:                 }
                     64: 
                     65:                 // We don't special-case clipping for now
                     66:                 if (iClipping != DC_COMPLEX) {
                     67: 
                     68:                     switch(psoSrc->iBitmapFormat) {
                     69:                         case BMF_1BPP:
                     70:                             break;
                     71: 
                     72:                         case BMF_4BPP:
                     73:                             break;
                     74: 
                     75:                         case BMF_8BPP:
                     76: 
                     77:                             // Set up the color translation, if any
                     78:                             if ((pxlo == NULL) ||
                     79:                                     (pxlo->flXlate & XO_TRIVIAL)) {
                     80:                                 pulXlatVector = NULL;
                     81:                             } else {
                     82:                                 if (pxlo->pulXlate != NULL) {
                     83:                                     pulXlatVector = pxlo->pulXlate;
                     84:                                 } else {
                     85:                                     if ((pulXlatVector =
                     86:                                             XLATEOBJ_piVector(pxlo)) == NULL) {
                     87:                                         return FALSE;
                     88:                                     }
                     89:                                 }
                     90:                             }
                     91: 
                     92:                             //@@@ won't need to test return code once both
                     93:                             //@@@ expand cases are also handled in the
                     94:                             //@@@ stretching code
                     95:                             if (vStretchBlt8bpp(ppdev,
                     96:                                     psoSrc->pvScan0,
                     97:                                     psoSrc->lDelta,
                     98:                                     prclSrc,
                     99:                                     prclDest,
                    100:                                     (iClipping == DC_TRIVIAL) ? NULL :
                    101:                                      &pco->rclBounds,
                    102:                                     pulXlatVector)) {
                    103: 
                    104:                                 return TRUE;
                    105:                             }
                    106:                             break;
                    107: 
                    108:                         case BMF_16BPP:
                    109:                             break;
                    110: 
                    111:                         case BMF_24BPP:
                    112:                             break;
                    113: 
                    114:                         case BMF_32BPP:
                    115:                             break;
                    116: 
                    117:                         default:
                    118:                             break;
                    119:                     }
                    120:                 }
                    121:             }
                    122:         }
                    123:     }
                    124: 
                    125:     return(EngStretchBlt(psoDest,
                    126:                          psoSrc,
                    127:                          psoMask,
                    128:                          pco,
                    129:                          pxlo,
                    130:                          pca,
                    131:                          pptlBrushOrg,
                    132:                          prclDest,
                    133:                          prclSrc,
                    134:                          pptlMask,
                    135:                          iMode));
                    136: }
                    137: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.