2
Copyright (C) 1999. The XFree86 Project Inc.
4
Written by Mark Vojkovich (mvojkovi@ucsd.edu)
7
/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_16bpp/cfbwindow.c,v 1.4tsi Exp $ */
9
#ifdef HAVE_XORG_CONFIG_H
10
#include <xorg-config.h>
14
#include "scrnintstr.h"
15
#include "windowstr.h"
22
#include "regionstr.h"
23
#include "cfbmskbits.h"
26
/* We don't bother with cfb's fastBackground/Border so we don't
27
need to use the Window privates */
31
cfb8_16CreateWindow(WindowPtr pWin)
33
cfbPrivWin *pPrivWin = cfbGetWindowPrivate(pWin);
35
pPrivWin->pRotatedBorder = NullPixmap;
36
pPrivWin->pRotatedBackground = NullPixmap;
37
pPrivWin->fastBackground = FALSE;
38
pPrivWin->fastBorder = FALSE;
39
pPrivWin->oldRotate.x = 0;
40
pPrivWin->oldRotate.y = 0;
47
cfb8_16DestroyWindow(WindowPtr pWin)
53
cfb8_16PositionWindow(
67
ScreenPtr pScreen = pWin->drawable.pScreen;
68
cfb8_16ScreenPtr pScreenPriv =
69
CFB8_16_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
70
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
71
DDXPointPtr ppt, pptSrc;
75
WindowPtr pRoot = WindowTable[pScreen->myNum];
77
REGION_NULL(pScreen, &rgnDst);
79
dx = ptOldOrg.x - pWin->drawable.x;
80
dy = ptOldOrg.y - pWin->drawable.y;
81
REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
82
REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
84
nbox = REGION_NUM_RECTS(&rgnDst);
86
(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
88
pbox = REGION_RECTS(&rgnDst);
89
for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
90
ppt->x = pbox->x1 + dx;
91
ppt->y = pbox->y1 + dy;
93
cfbDoBitbltCopy((DrawablePtr)pRoot, (DrawablePtr)pRoot,
94
GXcopy, &rgnDst, pptSrc, ~0L);
95
if(pWin->drawable.bitsPerPixel == 16)
96
cfb16DoBitbltCopy((DrawablePtr)pScreenPriv->pix16,
97
(DrawablePtr)pScreenPriv->pix16,
98
GXcopy, &rgnDst, pptSrc, ~0L);
100
DEALLOCATE_LOCAL(pptSrc);
103
REGION_UNINIT(pScreen, &rgnDst);
105
if(pWin->drawable.depth == 8) {
106
REGION_NULL(pScreen, &rgnDst);
107
miSegregateChildren(pWin, &rgnDst, pScrn->depth);
108
if(REGION_NOTEMPTY(pScreen, &rgnDst)) {
109
REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrc);
110
nbox = REGION_NUM_RECTS(&rgnDst);
112
(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))){
114
pbox = REGION_RECTS(&rgnDst);
115
for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
116
ppt->x = pbox->x1 + dx;
117
ppt->y = pbox->y1 + dy;
120
cfb16DoBitbltCopy((DrawablePtr)pScreenPriv->pix16,
121
(DrawablePtr)pScreenPriv->pix16,
122
GXcopy, &rgnDst, pptSrc, ~0L);
123
DEALLOCATE_LOCAL(pptSrc);
126
REGION_UNINIT(pScreen, &rgnDst);
131
cfb8_16ChangeWindowAttributes(
135
if (pWin->drawable.bitsPerPixel == 16)
136
return cfb16ChangeWindowAttributes(pWin,mask);
138
return cfbChangeWindowAttributes(pWin,mask);
142
cfb8_16WindowExposures(
148
if(REGION_NUM_RECTS(pReg) && (pWin->drawable.bitsPerPixel == 16)) {
149
cfb8_16ScreenPtr pScreenPriv =
150
CFB8_16_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
152
cfbFillBoxSolid((DrawablePtr)pScreenPriv->pix8,
153
REGION_NUM_RECTS(pReg), REGION_RECTS(pReg),
157
miWindowExposures(pWin, pReg, pOtherReg);
167
if(pWin->drawable.bitsPerPixel == 16) {
168
cfb16PaintWindow(pWin, pRegion, what);
169
if(what == PW_BORDER) {
170
cfb8_16ScreenPtr pScreenPriv =
171
CFB8_16_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
173
cfbFillBoxSolid((DrawablePtr)pScreenPriv->pix8,
174
REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion),
178
cfbPaintWindow(pWin, pRegion, what);