|
|
1.1 root 1: /******************************Module*Header*******************************\
2: * Module Name: XGA Support.
3: *
4: * XGA specific support routines.
5: *
6: * Copyright (c) 1992 Microsoft Corporation
7: *
8: \**************************************************************************/
9:
10: #include "driver.h"
11:
12:
13: /*****************************************************************************
14: * bSetXgaClipping - Set Xga Clipping
15: *****************************************************************************/
16: BOOL bSetXgaClipping(PPDEV ppdev, CLIPOBJ *pco, PULONG pulXgaMask)
17: {
18: SHORT cxMask,
19: cyMask ;
20: BYTE iDComplexity ;
21:
22: // Take care of the clipping.
23: // If the clipping is DC_COMPLEX then let the engine take care of it.
24: // NOTE: As an acceleration we should cache the regions and
25: // use the mask bitmap to clip things. We will do this as we develope
26: // the memory manager for the off screen memory.
27:
28: // Default to no clipping.
29:
30: *pulXgaMask = MSK_DISABLE ;
31:
32: if (pco != NULL)
33: {
34:
35: iDComplexity = pco->iDComplexity ;
36:
37: // If it's complex just return to the engine.
38:
39: if (iDComplexity == DC_COMPLEX)
40: return(FALSE) ;
41:
42: // It's a simple rectangle, so set up to clip to it's
43: // Boundary.
44:
45: if (iDComplexity == DC_RECT)
46: {
47:
48: *pulXgaMask = MSK_BOUNDARY_ENABLE ;
49:
50: cxMask = (pco->rclBounds.right - pco->rclBounds.left) - 1 ;
51: cyMask = (pco->rclBounds.bottom - pco->rclBounds.top) - 1 ;
52:
53: ppdev->pXgaCpRegs->XGAPixelMapIndex = MASK_MAP ;
54: ppdev->pXgaCpRegs->XGAPixMapBasePtr = 0 ;
55: ppdev->pXgaCpRegs->XGAMaskMapOrgnX = LOWORD(pco->rclBounds.left) ;
56: ppdev->pXgaCpRegs->XGAMaskMapOrgnY = LOWORD(pco->rclBounds.top) ;
57: ppdev->pXgaCpRegs->XGAPixMapWidth = cxMask ;
58: ppdev->pXgaCpRegs->XGAPixMapHeight = cyMask ;
59: ppdev->pXgaCpRegs->XGAPixMapFormat = 0 ;
60:
61: }
62: }
63:
64: return (TRUE) ;
65: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.