1
/* $XdotOrg: xserver/xorg/mi/miexpose.c,v 1.6 2005/07/03 08:53:51 daniels Exp $ */
2
/* $XFree86: xc/programs/Xserver/mi/miexpose.c,v 3.9tsi Exp $ */
3
/***********************************************************
5
Copyright 1987, 1998 The Open Group
7
Permission to use, copy, modify, distribute, and sell this software and its
8
documentation for any purpose is hereby granted without fee, provided that
9
the above copyright notice appear in all copies and that both that
10
copyright notice and this permission notice appear in supporting
13
The above copyright notice and this permission notice shall be included in
14
all copies or substantial portions of the Software.
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
Except as contained in this notice, the name of The Open Group shall not be
24
used in advertising or otherwise to promote the sale, use or other dealings
25
in this Software without prior written authorization from The Open Group.
28
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
32
Permission to use, copy, modify, and distribute this software and its
33
documentation for any purpose and without fee is hereby granted,
34
provided that the above copyright notice appear in all copies and that
35
both that copyright notice and this permission notice appear in
36
supporting documentation, and that the name of Digital not be
37
used in advertising or publicity pertaining to distribution of the
38
software without specific, written prior permission.
40
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
41
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
42
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
43
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
44
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
45
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
48
******************************************************************/
49
/*****************************************************************
51
Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
53
Permission is hereby granted, free of charge, to any person obtaining a copy
54
of this software and associated documentation files (the "Software"), to deal
55
in the Software without restriction, including without limitation the rights
56
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
57
copies of the Software.
59
The above copyright notice and this permission notice shall be included in
60
all copies or substantial portions of the Software.
62
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
63
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
64
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
65
DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
66
BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
67
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
68
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
70
Except as contained in this notice, the name of Digital Equipment Corporation
71
shall not be used in advertising or otherwise to promote the sale, use or other
72
dealings in this Software without prior written authorization from Digital
73
Equipment Corporation.
75
******************************************************************/
77
/* $Xorg: miexpose.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */
79
#ifdef HAVE_DIX_CONFIG_H
80
#include <dix-config.h>
85
#include <X11/Xproto.h>
86
#include <X11/Xprotostr.h>
89
#include "regionstr.h"
90
#include "scrnintstr.h"
92
#include "windowstr.h"
96
#include "dixstruct.h"
103
#include "panoramiX.h"
104
#include "panoramiXsrv.h"
108
machine-independent graphics exposure code. any device that uses
109
the region package can call this.
113
#define RECTLIMIT 25 /* pick a number, any number > 8 */
117
generate a region for exposures for areas that were copied from obscured or
118
non-existent areas to non-obscured areas of the destination. Paint the
119
background for the region, if the destination is a window.
122
this should generally be called, even if graphicsExposures is false,
123
because this is where bits get recovered from backing store.
126
added argument 'plane' is used to indicate how exposures from backing
127
store should be accomplished. If plane is 0 (i.e. no bit plane), CopyArea
128
should be used, else a CopyPlane of the indicated plane will be used. The
129
exposing is done by the backing store's GraphicsExpose function, of course.
134
miHandleExposures(pSrcDrawable, pDstDrawable,
135
pGC, srcx, srcy, width, height, dstx, dsty, plane)
136
register DrawablePtr pSrcDrawable;
137
register DrawablePtr pDstDrawable;
144
register ScreenPtr pscr;
145
RegionPtr prgnSrcClip; /* drawable-relative source clip */
147
RegionPtr prgnDstClip; /* drawable-relative dest clip */
149
BoxRec srcBox; /* unclipped source */
150
RegionRec rgnExposed; /* exposed region, calculated source-
151
relative, made dst relative to
152
intersect with visible parts of
153
dest and send events to client,
154
and then screen relative to paint
155
the window background
161
/* This prevents warning about pscr not being used. */
162
pGC->pScreen = pscr = pGC->pScreen;
164
/* avoid work if we can */
165
if (!pGC->graphicsExposures &&
166
(pDstDrawable->type == DRAWABLE_PIXMAP) &&
167
((pSrcDrawable->type == DRAWABLE_PIXMAP) ||
168
(((WindowPtr)pSrcDrawable)->backStorage == NULL)))
173
srcBox.x2 = srcx+width;
174
srcBox.y2 = srcy+height;
176
if (pSrcDrawable->type != DRAWABLE_PIXMAP)
180
TsrcBox.x1 = srcx + pSrcDrawable->x;
181
TsrcBox.y1 = srcy + pSrcDrawable->y;
182
TsrcBox.x2 = TsrcBox.x1 + width;
183
TsrcBox.y2 = TsrcBox.y1 + height;
184
pSrcWin = (WindowPtr) pSrcDrawable;
185
if (pGC->subWindowMode == IncludeInferiors)
187
prgnSrcClip = NotClippedByChildren (pSrcWin);
188
if ((RECT_IN_REGION(pscr, prgnSrcClip, &TsrcBox)) == rgnIN)
190
REGION_DESTROY(pscr, prgnSrcClip);
196
if ((RECT_IN_REGION(pscr, &pSrcWin->clipList, &TsrcBox)) == rgnIN)
198
prgnSrcClip = &rgnSrcRec;
199
REGION_NULL(pscr, prgnSrcClip);
200
REGION_COPY(pscr, prgnSrcClip, &pSrcWin->clipList);
202
REGION_TRANSLATE(pscr, prgnSrcClip,
203
-pSrcDrawable->x, -pSrcDrawable->y);
209
if ((srcBox.x1 >= 0) && (srcBox.y1 >= 0) &&
210
(srcBox.x2 <= pSrcDrawable->width) &&
211
(srcBox.y2 <= pSrcDrawable->height))
216
box.x2 = pSrcDrawable->width;
217
box.y2 = pSrcDrawable->height;
218
prgnSrcClip = &rgnSrcRec;
219
REGION_INIT(pscr, prgnSrcClip, &box, 1);
220
pSrcWin = (WindowPtr)NULL;
223
if (pDstDrawable == pSrcDrawable)
225
prgnDstClip = prgnSrcClip;
227
else if (pDstDrawable->type != DRAWABLE_PIXMAP)
229
if (pGC->subWindowMode == IncludeInferiors)
231
prgnDstClip = NotClippedByChildren((WindowPtr)pDstDrawable);
235
prgnDstClip = &rgnDstRec;
236
REGION_NULL(pscr, prgnDstClip);
237
REGION_COPY(pscr, prgnDstClip,
238
&((WindowPtr)pDstDrawable)->clipList);
240
REGION_TRANSLATE(pscr, prgnDstClip,
241
-pDstDrawable->x, -pDstDrawable->y);
249
box.x2 = pDstDrawable->width;
250
box.y2 = pDstDrawable->height;
251
prgnDstClip = &rgnDstRec;
252
REGION_INIT(pscr, prgnDstClip, &box, 1);
255
/* drawable-relative source region */
256
REGION_INIT(pscr, &rgnExposed, &srcBox, 1);
258
/* now get the hidden parts of the source box*/
259
REGION_SUBTRACT(pscr, &rgnExposed, &rgnExposed, prgnSrcClip);
261
if (pSrcWin && pSrcWin->backStorage)
264
* Copy any areas from the source backing store. Modifies
267
(* pSrcWin->drawable.pScreen->ExposeCopy) ((WindowPtr)pSrcDrawable,
276
/* move them over the destination */
277
REGION_TRANSLATE(pscr, &rgnExposed, dstx-srcx, dsty-srcy);
279
/* intersect with visible areas of dest */
280
REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, prgnDstClip);
283
* If we have LOTS of rectangles, we decide to take the extents
284
* and force an exposure on that. This should require much less
285
* work overall, on both client and server. This is cheating, but
286
* isn't prohibited by the protocol ("spontaneous combustion" :-)
289
extents = pGC->graphicsExposures &&
290
(REGION_NUM_RECTS(&rgnExposed) > RECTLIMIT) &&
291
(pDstDrawable->type != DRAWABLE_PIXMAP);
296
if (!(region = wClipShape (pSrcWin)))
297
region = wBoundingShape (pSrcWin);
299
* If you try to CopyArea the extents of a shaped window, compacting the
300
* exposed region will undo all our work!
302
if (extents && pSrcWin && region &&
303
(RECT_IN_REGION(pscr, region, &srcBox) != rgnIN))
309
WindowPtr pWin = (WindowPtr)pDstDrawable;
311
expBox = *REGION_EXTENTS(pscr, &rgnExposed);
312
REGION_RESET(pscr, &rgnExposed, &expBox);
313
/* need to clear out new areas of backing store */
314
if (pWin->backStorage)
315
(void) (* pWin->drawable.pScreen->ClearBackingStore)(
319
expBox.x2 - expBox.x1,
320
expBox.y2 - expBox.y1,
323
if ((pDstDrawable->type != DRAWABLE_PIXMAP) &&
324
(((WindowPtr)pDstDrawable)->backgroundState != None))
326
WindowPtr pWin = (WindowPtr)pDstDrawable;
328
/* make the exposed area screen-relative */
329
REGION_TRANSLATE(pscr, &rgnExposed,
330
pDstDrawable->x, pDstDrawable->y);
334
/* PaintWindowBackground doesn't clip, so we have to */
335
REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, &pWin->clipList);
337
(*pWin->drawable.pScreen->PaintWindowBackground)(
338
(WindowPtr)pDstDrawable, &rgnExposed, PW_BACKGROUND);
342
REGION_RESET(pscr, &rgnExposed, &expBox);
345
REGION_TRANSLATE(pscr, &rgnExposed,
346
-pDstDrawable->x, -pDstDrawable->y);
348
if (prgnDstClip == &rgnDstRec)
350
REGION_UNINIT(pscr, prgnDstClip);
352
else if (prgnDstClip != prgnSrcClip)
354
REGION_DESTROY(pscr, prgnDstClip);
357
if (prgnSrcClip == &rgnSrcRec)
359
REGION_UNINIT(pscr, prgnSrcClip);
363
REGION_DESTROY(pscr, prgnSrcClip);
366
if (pGC->graphicsExposures)
369
RegionPtr exposed = REGION_CREATE(pscr, NullBox, 0);
370
*exposed = rgnExposed;
375
REGION_UNINIT(pscr, &rgnExposed);
380
/* send GraphicsExpose events, or a NoExpose event, based on the region */
383
miSendGraphicsExpose (client, pRgn, drawable, major, minor)
390
if (pRgn && !REGION_NIL(pRgn))
394
register BoxPtr pBox;
398
numRects = REGION_NUM_RECTS(pRgn);
399
pBox = REGION_RECTS(pRgn);
400
if(!(pEvent = (xEvent *)ALLOCATE_LOCAL(numRects * sizeof(xEvent))))
404
for (i=1; i<=numRects; i++, pe++, pBox++)
406
pe->u.u.type = GraphicsExpose;
407
pe->u.graphicsExposure.drawable = drawable;
408
pe->u.graphicsExposure.x = pBox->x1;
409
pe->u.graphicsExposure.y = pBox->y1;
410
pe->u.graphicsExposure.width = pBox->x2 - pBox->x1;
411
pe->u.graphicsExposure.height = pBox->y2 - pBox->y1;
412
pe->u.graphicsExposure.count = numRects - i;
413
pe->u.graphicsExposure.majorEvent = major;
414
pe->u.graphicsExposure.minorEvent = minor;
416
TryClientEvents(client, pEvent, numRects,
417
(Mask)0, NoEventMask, NullGrab);
418
DEALLOCATE_LOCAL(pEvent);
423
event.u.u.type = NoExpose;
424
event.u.noExposure.drawable = drawable;
425
event.u.noExposure.majorEvent = major;
426
event.u.noExposure.minorEvent = minor;
427
TryClientEvents(client, &event, 1,
428
(Mask)0, NoEventMask, NullGrab);
434
miSendExposures(pWin, pRgn, dx, dy)
439
register BoxPtr pBox;
441
register xEvent *pEvent, *pe;
444
pBox = REGION_RECTS(pRgn);
445
numRects = REGION_NUM_RECTS(pRgn);
446
if(!(pEvent = (xEvent *) ALLOCATE_LOCAL(numRects * sizeof(xEvent))))
449
for (i=numRects, pe = pEvent; --i >= 0; pe++, pBox++)
451
pe->u.u.type = Expose;
452
pe->u.expose.window = pWin->drawable.id;
453
pe->u.expose.x = pBox->x1 - dx;
454
pe->u.expose.y = pBox->y1 - dy;
455
pe->u.expose.width = pBox->x2 - pBox->x1;
456
pe->u.expose.height = pBox->y2 - pBox->y1;
457
pe->u.expose.count = i;
461
if(!noPanoramiXExtension) {
462
int scrnum = pWin->drawable.pScreen->myNum;
467
x = panoramiXdataPtr[scrnum].x;
468
y = panoramiXdataPtr[scrnum].y;
469
pWin = WindowTable[0];
470
realWin = pWin->drawable.id;
473
win = PanoramiXFindIDByScrnum(XRT_WINDOW,
474
pWin->drawable.id, scrnum);
476
DEALLOCATE_LOCAL(pEvent);
479
realWin = win->info[0].id;
480
pWin = LookupIDByType(realWin, RT_WINDOW);
483
for (i = 0; i < numRects; i++) {
484
pEvent[i].u.expose.window = realWin;
485
pEvent[i].u.expose.x += x;
486
pEvent[i].u.expose.y += y;
491
DeliverEvents(pWin, pEvent, numRects, NullWindow);
493
DEALLOCATE_LOCAL(pEvent);
497
miWindowExposures(pWin, prgn, other_exposed)
499
register RegionPtr prgn, other_exposed;
501
RegionPtr exposures = prgn;
502
if (pWin->backStorage && prgn)
504
* in some cases, backing store will cause a different
505
* region to be exposed than needs to be repainted
506
* (like when a window is mapped). RestoreAreas is
507
* allowed to return a region other than prgn,
508
* in which case this routine will free the resultant
509
* region. If exposures is null, then no events will
510
* be sent to the client; if prgn is empty
511
* no areas will be repainted.
513
exposures = (*pWin->drawable.pScreen->RestoreAreas)(pWin, prgn);
514
if ((prgn && !REGION_NIL(prgn)) ||
515
(exposures && !REGION_NIL(exposures)) || other_exposed)
518
int clientInterested;
521
* Restore from backing-store FIRST.
523
clientInterested = (pWin->eventMask|wOtherEventMasks(pWin)) & ExposureMask;
528
REGION_UNION(pWin->drawable.pScreen, other_exposed,
531
if (exposures != prgn)
532
REGION_DESTROY(pWin->drawable.pScreen, exposures);
534
exposures = other_exposed;
536
if (clientInterested && exposures && (REGION_NUM_RECTS(exposures) > RECTLIMIT))
539
* If we have LOTS of rectangles, we decide to take the extents
540
* and force an exposure on that. This should require much less
541
* work overall, on both client and server. This is cheating, but
542
* isn't prohibited by the protocol ("spontaneous combustion" :-).
546
box = *REGION_EXTENTS( pWin->drawable.pScreen, exposures);
547
if (exposures == prgn) {
549
REGION_INIT( pWin->drawable.pScreen, exposures, &box, 1);
550
REGION_RESET( pWin->drawable.pScreen, prgn, &box);
552
REGION_RESET( pWin->drawable.pScreen, exposures, &box);
553
REGION_UNION( pWin->drawable.pScreen, prgn, prgn, exposures);
555
/* PaintWindowBackground doesn't clip, so we have to */
556
REGION_INTERSECT( pWin->drawable.pScreen, prgn, prgn, &pWin->clipList);
557
/* need to clear out new areas of backing store, too */
558
if (pWin->backStorage)
559
(void) (* pWin->drawable.pScreen->ClearBackingStore)(
561
box.x1 - pWin->drawable.x,
562
box.y1 - pWin->drawable.y,
567
if (prgn && !REGION_NIL(prgn))
568
(*pWin->drawable.pScreen->PaintWindowBackground)(pWin, prgn, PW_BACKGROUND);
569
if (clientInterested && exposures && !REGION_NIL(exposures))
570
miSendExposures(pWin, exposures,
571
pWin->drawable.x, pWin->drawable.y);
572
if (exposures == &expRec)
574
REGION_UNINIT( pWin->drawable.pScreen, exposures);
576
else if (exposures && exposures != prgn && exposures != other_exposed)
577
REGION_DESTROY( pWin->drawable.pScreen, exposures);
579
REGION_EMPTY( pWin->drawable.pScreen, prgn);
581
else if (exposures && exposures != prgn)
582
REGION_DESTROY( pWin->drawable.pScreen, exposures);
587
this code is highly unlikely. it is not haile selassie.
589
there is some hair here. we can't just use the window's
590
clip region as it is, because if we are painting the border,
591
the border is not in the client area and so we will be excluded
592
when we validate the GC, and if we are painting a parent-relative
593
background, the area we want to paint is in some other window.
594
since we trust the code calling us to tell us to paint only areas
595
that are really ours, we will temporarily give the window a
596
clipList the size of the whole screen and an origin at (0,0).
597
this more or less assumes that ddX code will do translation
598
based on the window's absolute position, and that ValidateGC will
599
look at clipList, and that no other fields from the
600
window will be used. it's not possible to just draw
601
in the root because it may be a different depth.
603
to get the tile to align correctly we set the GC's tile origin to
604
be the (x,y) of the window's upper left corner, after which we
605
get the right bits when drawing into the root.
607
because the clip_mask is being set to None, we may call DoChangeGC with
608
fPointer set true, thus we no longer need to install the background or
609
border tile in the resource table.
612
static RESTYPE ResType = 0;
613
static int numGCs = 0;
614
static GCPtr screenContext[MAXSCREENS];
622
GCPtr pGC = (GCPtr)value;
623
screenContext[pGC->pScreen->myNum] = (GCPtr)NULL;
634
miPaintWindow(pWin, prgn, what)
635
register WindowPtr pWin;
641
Bool usingScratchGC = FALSE;
654
ChangeGCVal gcval[7];
655
ChangeGCVal newValues [COUNT_BITS];
657
BITS32 gcmask, index, mask;
659
DDXPointRec oldCorner;
664
register BoxPtr pbox;
665
register ScreenPtr pScreen = pWin->drawable.pScreen;
666
register xRectangle *prect;
671
if (what == PW_BACKGROUND)
673
switch (pWin->backgroundState) {
677
(*pWin->parent->drawable.pScreen->PaintWindowBackground)(pWin->parent, prgn, what);
679
case BackgroundPixel:
680
newValues[FOREGROUND].val = pWin->background.pixel;
681
newValues[FILLSTYLE].val = FillSolid;
682
gcmask |= GCForeground | GCFillStyle;
684
case BackgroundPixmap:
685
newValues[TILE].ptr = (pointer)pWin->background.pixmap;
686
newValues[FILLSTYLE].val = FillTiled;
687
gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin;
693
if (pWin->borderIsPixel)
695
newValues[FOREGROUND].val = pWin->border.pixel;
696
newValues[FILLSTYLE].val = FillSolid;
697
gcmask |= GCForeground | GCFillStyle;
701
newValues[TILE].ptr = (pointer)pWin->border.pixmap;
702
newValues[FILLSTYLE].val = FillTiled;
703
gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin;
707
prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(prgn) *
712
newValues[FUNCTION].val = GXcopy;
713
gcmask |= GCFunction | GCClipMask;
716
pRoot = WindowTable[i];
719
if (what == PW_BORDER)
721
while (pBgWin->backgroundState == ParentRelative)
722
pBgWin = pBgWin->parent;
725
if ((pWin->drawable.depth != pRoot->drawable.depth) ||
726
(pWin->drawable.bitsPerPixel != pRoot->drawable.bitsPerPixel))
728
usingScratchGC = TRUE;
729
pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen);
732
DEALLOCATE_LOCAL(prect);
736
* mash the clip list so we can paint the border by
737
* mangling the window in place, pretending it
738
* spans the entire screen
740
if (what == PW_BORDER)
742
prgnWin = pWin->clipList;
743
oldCorner.x = pWin->drawable.x;
744
oldCorner.y = pWin->drawable.y;
745
pWin->drawable.x = pWin->drawable.y = 0;
748
box.x2 = pScreen->width;
749
box.y2 = pScreen->height;
750
REGION_INIT(pScreen, &pWin->clipList, &box, 1);
751
pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
752
newValues[ABSX].val = pBgWin->drawable.x;
753
newValues[ABSY].val = pBgWin->drawable.y;
757
newValues[ABSX].val = 0;
758
newValues[ABSY].val = 0;
762
* draw the background to the root window
764
if (screenContext[i] == (GCPtr)NULL)
766
if (!ResType && !(ResType = CreateNewResourceType(tossGC)))
768
screenContext[i] = CreateGC((DrawablePtr)pWin, (BITS32) 0,
769
(XID *)NULL, &status);
770
if (!screenContext[i])
773
if (!AddResource(FakeClientID(0), ResType,
774
(pointer)screenContext[i]))
777
pGC = screenContext[i];
778
newValues[SUBWINDOW].val = IncludeInferiors;
779
newValues[ABSX].val = pBgWin->drawable.x;
780
newValues[ABSY].val = pBgWin->drawable.y;
781
gcmask |= GCSubwindowMode;
785
if (pWin->backStorage)
786
(*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeVisBack);
792
index = lowbit (mask);
796
if (pGC->alu != newValues[FUNCTION].val) {
798
gcval[i++].val = newValues[FUNCTION].val;
801
case GCTileStipXOrigin:
802
if ( pGC->patOrg.x != newValues[ABSX].val) {
804
gcval[i++].val = newValues[ABSX].val;
807
case GCTileStipYOrigin:
808
if ( pGC->patOrg.y != newValues[ABSY].val) {
810
gcval[i++].val = newValues[ABSY].val;
814
if ( pGC->clientClipType != CT_NONE) {
816
gcval[i++].val = CT_NONE;
819
case GCSubwindowMode:
820
if ( pGC->subWindowMode != newValues[SUBWINDOW].val) {
822
gcval[i++].val = newValues[SUBWINDOW].val;
826
if (pGC->tileIsPixel || pGC->tile.pixmap != newValues[TILE].ptr)
829
gcval[i++].ptr = newValues[TILE].ptr;
833
if ( pGC->fillStyle != newValues[FILLSTYLE].val) {
835
gcval[i++].val = newValues[FILLSTYLE].val;
839
if ( pGC->fgPixel != newValues[FOREGROUND].val) {
841
gcval[i++].val = newValues[FOREGROUND].val;
848
dixChangeGC(NullClient, pGC, gcmask, NULL, gcval);
850
if (pWin->drawable.serialNumber != pGC->serialNumber)
851
ValidateGC((DrawablePtr)pWin, pGC);
853
numRects = REGION_NUM_RECTS(prgn);
854
pbox = REGION_RECTS(prgn);
855
for (i= numRects; --i >= 0; pbox++, prect++)
857
prect->x = pbox->x1 - pWin->drawable.x;
858
prect->y = pbox->y1 - pWin->drawable.y;
859
prect->width = pbox->x2 - pbox->x1;
860
prect->height = pbox->y2 - pbox->y1;
863
(*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect);
864
DEALLOCATE_LOCAL(prect);
866
if (pWin->backStorage)
867
(*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeNothing);
871
if (what == PW_BORDER)
873
REGION_UNINIT(pScreen, &pWin->clipList);
874
pWin->clipList = prgnWin;
875
pWin->drawable.x = oldCorner.x;
876
pWin->drawable.y = oldCorner.y;
877
pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
884
/* MICLEARDRAWABLE -- sets the entire drawable to the background color of
885
* the GC. Useful when we have a scratch drawable and need to initialize
888
miClearDrawable(pDraw, pGC)
892
XID fg = pGC->fgPixel;
893
XID bg = pGC->bgPixel;
898
rect.width = pDraw->width;
899
rect.height = pDraw->height;
900
DoChangeGC(pGC, GCForeground, &bg, 0);
901
ValidateGC(pDraw, pGC);
902
(*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect);
903
DoChangeGC(pGC, GCForeground, &fg, 0);
904
ValidateGC(pDraw, pGC);