~sbeattie/ubuntu/lucid/vnc4/lp556147

« back to all changes in this revision

Viewing changes to unix/xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbgcunder.c

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbgcunder.c,v 1.5 2001/12/14 19:59:52 dawes Exp $ */
 
2
/***********************************************************
 
3
 
 
4
Copyright 1987, 1998  The Open Group
 
5
 
 
6
Permission to use, copy, modify, distribute, and sell this software and its
 
7
documentation for any purpose is hereby granted without fee, provided that
 
8
the above copyright notice appear in all copies and that both that
 
9
copyright notice and this permission notice appear in supporting
 
10
documentation.
 
11
 
 
12
The above copyright notice and this permission notice shall be included in
 
13
all copies or substantial portions of the Software.
 
14
 
 
15
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
16
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
17
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
 
18
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 
19
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 
20
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
21
 
 
22
Except as contained in this notice, the name of The Open Group shall not be
 
23
used in advertising or otherwise to promote the sale, use or other dealings
 
24
in this Software without prior written authorization from The Open Group.
 
25
 
 
26
 
 
27
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
 
28
 
 
29
                        All Rights Reserved
 
30
 
 
31
Permission to use, copy, modify, and distribute this software and its 
 
32
documentation for any purpose and without fee is hereby granted, 
 
33
provided that the above copyright notice appear in all copies and that
 
34
both that copyright notice and this permission notice appear in 
 
35
supporting documentation, and that the name of Digital not be
 
36
used in advertising or publicity pertaining to distribution of the
 
37
software without specific, written prior permission.  
 
38
 
 
39
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
 
40
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
 
41
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
 
42
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 
43
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 
44
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 
45
SOFTWARE.
 
46
 
 
47
******************************************************************/
 
48
#define PSZ 32
 
49
 
 
50
#include "X.h"
 
51
#include "Xmd.h"
 
52
#include "Xproto.h"
 
53
#include "cfb.h"
 
54
#include "fontstruct.h"
 
55
#include "dixfontstr.h"
 
56
#include "gcstruct.h"
 
57
#include "windowstr.h"
 
58
#include "pixmapstr.h"
 
59
#include "scrnintstr.h"
 
60
#include "region.h"
 
61
 
 
62
#include "mistruct.h"
 
63
#include "mibstore.h"
 
64
#include "migc.h"
 
65
#include "mioverlay.h"
 
66
 
 
67
#include "cfbmskbits.h"
 
68
#include "cfb8bit.h"
 
69
 
 
70
#ifdef WriteBitGroup
 
71
#  define useTEGlyphBlt cfbImageGlyphBlt8
 
72
#else
 
73
#  define useTEGlyphBlt cfbTEGlyphBlt
 
74
#endif
 
75
 
 
76
#ifdef WriteBitGroup
 
77
# define useImageGlyphBlt       cfbImageGlyphBlt8
 
78
# define usePolyGlyphBlt        cfbPolyGlyphBlt8
 
79
#else
 
80
# define useImageGlyphBlt       miImageGlyphBlt
 
81
# define usePolyGlyphBlt        miPolyGlyphBlt
 
82
#endif
 
83
 
 
84
#ifdef FOUR_BIT_CODE
 
85
# define usePushPixels  cfbPushPixels8
 
86
#else
 
87
#ifndef LOWMEMFTPT
 
88
# define usePushPixels  mfbPushPixels
 
89
#else
 
90
# define usePushPixels  miPushPixels
 
91
#endif /* ifndef LOWMEMFTPT */
 
92
#endif
 
93
 
 
94
#ifdef PIXEL_ADDR
 
95
# define ZeroPolyArc    cfbZeroPolyArcSS8Copy
 
96
#else
 
97
# define ZeroPolyArc    miZeroPolyArc
 
98
#endif
 
99
 
 
100
 
 
101
static GCOps cfbTEOps1Rect = {
 
102
    cfbSolidSpansCopy,
 
103
    cfbSetSpans,
 
104
    cfbPutImage,
 
105
    cfbCopyArea,
 
106
    cfbCopyPlane,
 
107
    cfbPolyPoint,
 
108
#ifdef PIXEL_ADDR
 
109
    cfb8LineSS1Rect,
 
110
    cfb8SegmentSS1Rect,
 
111
#else
 
112
    cfbLineSS,
 
113
    cfbSegmentSS,
 
114
#endif
 
115
    miPolyRectangle,
 
116
    ZeroPolyArc,
 
117
    cfbFillPoly1RectCopy,
 
118
    cfbPolyFillRect,
 
119
    cfbPolyFillArcSolidCopy,
 
120
    miPolyText8,
 
121
    miPolyText16,
 
122
    miImageText8,
 
123
    miImageText16,
 
124
    useTEGlyphBlt,
 
125
    usePolyGlyphBlt,
 
126
    usePushPixels
 
127
#ifdef NEED_LINEHELPER
 
128
    ,NULL
 
129
#endif
 
130
};
 
131
 
 
132
static GCOps cfbNonTEOps1Rect = {
 
133
    cfbSolidSpansCopy,
 
134
    cfbSetSpans,
 
135
    cfbPutImage,
 
136
    cfbCopyArea,
 
137
    cfbCopyPlane,
 
138
    cfbPolyPoint,
 
139
#ifdef PIXEL_ADDR
 
140
    cfb8LineSS1Rect,
 
141
    cfb8SegmentSS1Rect,
 
142
#else
 
143
    cfbLineSS,
 
144
    cfbSegmentSS,
 
145
#endif
 
146
    miPolyRectangle,
 
147
    ZeroPolyArc,
 
148
    cfbFillPoly1RectCopy,
 
149
    cfbPolyFillRect,
 
150
    cfbPolyFillArcSolidCopy,
 
151
    miPolyText8,
 
152
    miPolyText16,
 
153
    miImageText8,
 
154
    miImageText16,
 
155
    useImageGlyphBlt,
 
156
    usePolyGlyphBlt,
 
157
    usePushPixels
 
158
#ifdef NEED_LINEHELPER
 
159
    ,NULL
 
160
#endif
 
161
};
 
162
 
 
163
static GCOps cfbTEOps = {
 
164
    cfbSolidSpansCopy,
 
165
    cfbSetSpans,
 
166
    cfbPutImage,
 
167
    cfbCopyArea,
 
168
    cfbCopyPlane,
 
169
    cfbPolyPoint,
 
170
    cfbLineSS,
 
171
    cfbSegmentSS,
 
172
    miPolyRectangle,
 
173
    ZeroPolyArc,
 
174
    miFillPolygon,
 
175
    cfbPolyFillRect,
 
176
    cfbPolyFillArcSolidCopy,
 
177
    miPolyText8,
 
178
    miPolyText16,
 
179
    miImageText8,
 
180
    miImageText16,
 
181
    useTEGlyphBlt,
 
182
    usePolyGlyphBlt,
 
183
    usePushPixels
 
184
#ifdef NEED_LINEHELPER
 
185
    ,NULL
 
186
#endif
 
187
};
 
188
 
 
189
static GCOps cfbNonTEOps = {
 
190
    cfbSolidSpansCopy,
 
191
    cfbSetSpans,
 
192
    cfbPutImage,
 
193
    cfbCopyArea,
 
194
    cfbCopyPlane,
 
195
    cfbPolyPoint,
 
196
    cfbLineSS,
 
197
    cfbSegmentSS,
 
198
    miPolyRectangle,
 
199
#ifdef PIXEL_ADDR
 
200
    cfbZeroPolyArcSS8Copy,
 
201
#else
 
202
    miZeroPolyArc,
 
203
#endif
 
204
    miFillPolygon,
 
205
    cfbPolyFillRect,
 
206
    cfbPolyFillArcSolidCopy,
 
207
    miPolyText8,
 
208
    miPolyText16,
 
209
    miImageText8,
 
210
    miImageText16,
 
211
    useImageGlyphBlt,
 
212
    usePolyGlyphBlt,
 
213
    usePushPixels
 
214
#ifdef NEED_LINEHELPER
 
215
    ,NULL
 
216
#endif
 
217
};
 
218
 
 
219
static GCOps *
 
220
cfb32MatchCommon_Underlay (pGC, devPriv)
 
221
    GCPtr           pGC;
 
222
    cfbPrivGCPtr    devPriv;
 
223
{
 
224
    if (pGC->lineWidth != 0)
 
225
        return 0;
 
226
    if (pGC->lineStyle != LineSolid)
 
227
        return 0;
 
228
    if (pGC->fillStyle != FillSolid)
 
229
        return 0;
 
230
    if (devPriv->rop != GXcopy)
 
231
        return 0;
 
232
    if (pGC->font &&
 
233
        FONTMAXBOUNDS(pGC->font,rightSideBearing) -
 
234
        FONTMINBOUNDS(pGC->font,leftSideBearing) <= 32 &&
 
235
        FONTMINBOUNDS(pGC->font,characterWidth) >= 0)
 
236
    {
 
237
        if (TERMINALFONT(pGC->font)
 
238
#ifdef FOUR_BIT_CODE
 
239
            && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
 
240
#endif
 
241
        )
 
242
#ifdef NO_ONE_RECT
 
243
            return &cfbTEOps1Rect;
 
244
#else
 
245
            if (devPriv->oneRect)
 
246
                return &cfbTEOps1Rect;
 
247
            else
 
248
                return &cfbTEOps;
 
249
#endif
 
250
        else
 
251
#ifdef NO_ONE_RECT
 
252
            return &cfbNonTEOps1Rect;
 
253
#else
 
254
            if (devPriv->oneRect)
 
255
                return &cfbNonTEOps1Rect;
 
256
            else
 
257
                return &cfbNonTEOps;
 
258
#endif
 
259
    }
 
260
    return 0;
 
261
}
 
262
 
 
263
 
 
264
void
 
265
cfb32ValidateGC_Underlay(
 
266
    GCPtr  pGC,
 
267
    unsigned long   changes,
 
268
    DrawablePtr     pDrawable
 
269
){
 
270
    int         mask;           /* stateChanges */
 
271
    int         index;          /* used for stepping through bitfields */
 
272
    int         new_rrop;
 
273
    int         new_line, new_text, new_fillspans, new_fillarea;
 
274
    /* flags for changing the proc vector */
 
275
    cfbPrivGCPtr devPriv;
 
276
    int         oneRect;
 
277
 
 
278
    pGC->lastWinOrg.x = pDrawable->x;
 
279
    pGC->lastWinOrg.y = pDrawable->y;
 
280
    devPriv = cfbGetGCPrivate(pGC);
 
281
 
 
282
    new_rrop = FALSE;
 
283
    new_line = FALSE;
 
284
    new_text = FALSE;
 
285
    new_fillspans = FALSE;
 
286
    new_fillarea = FALSE;
 
287
 
 
288
    /*
 
289
     * if the client clip is different or moved OR the subwindowMode has
 
290
     * changed OR the window's clip has changed since the last validation
 
291
     * we need to recompute the composite clip 
 
292
     */
 
293
 
 
294
    if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
 
295
        (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS))
 
296
        )
 
297
    {
 
298
        if(pDrawable->type == DRAWABLE_WINDOW)
 
299
            miOverlayComputeCompositeClip (pGC, (WindowPtr)pDrawable);
 
300
        else
 
301
            miComputeCompositeClip (pGC, pDrawable);
 
302
#ifdef NO_ONE_RECT
 
303
        devPriv->oneRect = FALSE;
 
304
#else
 
305
        oneRect = REGION_NUM_RECTS(pGC->pCompositeClip) == 1;
 
306
        if (oneRect != devPriv->oneRect)
 
307
            new_line = TRUE;
 
308
        devPriv->oneRect = oneRect;
 
309
#endif
 
310
    }
 
311
 
 
312
    mask = changes;
 
313
    while (mask) {
 
314
        index = lowbit (mask);
 
315
        mask &= ~index;
 
316
 
 
317
        switch (index) {
 
318
        case GCFunction:
 
319
        case GCForeground:
 
320
            new_rrop = TRUE;
 
321
            break;
 
322
        case GCPlaneMask:
 
323
            new_rrop = TRUE;
 
324
            new_text = TRUE;
 
325
            break;
 
326
        case GCBackground:
 
327
            break;
 
328
        case GCLineStyle:
 
329
        case GCLineWidth:
 
330
            new_line = TRUE;
 
331
            break;
 
332
        case GCJoinStyle:
 
333
        case GCCapStyle:
 
334
            break;
 
335
        case GCFillStyle:
 
336
            new_text = TRUE;
 
337
            new_fillspans = TRUE;
 
338
            new_line = TRUE;
 
339
            new_fillarea = TRUE;
 
340
            break;
 
341
        case GCFillRule:
 
342
            break;
 
343
        case GCTile:
 
344
            new_fillspans = TRUE;
 
345
            new_fillarea = TRUE;
 
346
            break;
 
347
        case GCStipple:
 
348
            new_fillspans = TRUE;
 
349
            new_fillarea = TRUE;
 
350
            break;
 
351
        case GCTileStipXOrigin:
 
352
        case GCTileStipYOrigin:
 
353
            break;
 
354
        case GCFont:
 
355
            new_text = TRUE;
 
356
            break;
 
357
        case GCSubwindowMode:
 
358
        case GCGraphicsExposures:
 
359
        case GCClipXOrigin:
 
360
        case GCClipYOrigin:
 
361
        case GCClipMask:
 
362
        case GCDashOffset:
 
363
        case GCDashList:
 
364
        case GCArcMode:
 
365
        default:
 
366
            break;
 
367
        }
 
368
    }
 
369
 
 
370
    /*
 
371
     * If the drawable has changed,  ensure suitable
 
372
     * entries are in the proc vector. 
 
373
     */
 
374
    if (pDrawable->serialNumber != (pGC->serialNumber & (DRAWABLE_SERIAL_BITS)))
 
375
        new_fillspans = TRUE;   /* deal with FillSpans later */
 
376
 
 
377
    if (new_rrop)
 
378
    {
 
379
        int old_rrop;
 
380
 
 
381
        old_rrop = devPriv->rop;
 
382
        devPriv->rop = cfbReduceRasterOp (pGC->alu, pGC->fgPixel,
 
383
                                           pGC->planemask,
 
384
                                           &devPriv->and, &devPriv->xor);
 
385
        if (old_rrop == devPriv->rop)
 
386
            new_rrop = FALSE;
 
387
        else
 
388
        {
 
389
#ifdef PIXEL_ADDR
 
390
            new_line = TRUE;
 
391
#endif
 
392
#ifdef WriteBitGroup
 
393
            new_text = TRUE;
 
394
#endif
 
395
            new_fillspans = TRUE;
 
396
            new_fillarea = TRUE;
 
397
        }
 
398
    }
 
399
 
 
400
    if(!pGC->ops)
 
401
        pGC->ops = & cfbNonTEOps;
 
402
 
 
403
 
 
404
    if (new_rrop || new_fillspans || new_text || new_fillarea || new_line)
 
405
    {
 
406
        GCOps   *newops;
 
407
 
 
408
        if ((newops = cfb32MatchCommon_Underlay (pGC, devPriv)))
 
409
        {
 
410
            if (pGC->ops->devPrivate.val)
 
411
                miDestroyGCOps (pGC->ops);
 
412
            pGC->ops = newops;
 
413
            new_rrop = new_line = new_fillspans = new_text = new_fillarea = 0;
 
414
        }
 
415
        else
 
416
        {
 
417
            if (!pGC->ops->devPrivate.val)
 
418
            {
 
419
                pGC->ops = miCreateGCOps (pGC->ops);
 
420
                pGC->ops->devPrivate.val = 1;
 
421
            }
 
422
        }
 
423
    }
 
424
 
 
425
    /* deal with the changes we've collected */
 
426
    if (new_line)
 
427
    {
 
428
        pGC->ops->FillPolygon = miFillPolygon;
 
429
#ifdef NO_ONE_RECT
 
430
        if (pGC->fillStyle == FillSolid)
 
431
        {
 
432
            switch (devPriv->rop) {
 
433
            case GXcopy:
 
434
                pGC->ops->FillPolygon = cfbFillPoly1RectCopy;
 
435
                break;
 
436
            default:
 
437
                pGC->ops->FillPolygon = cfbFillPoly1RectGeneral;
 
438
                break;
 
439
            }
 
440
        }
 
441
#else
 
442
        if (devPriv->oneRect && pGC->fillStyle == FillSolid)
 
443
        {
 
444
            switch (devPriv->rop) {
 
445
            case GXcopy:
 
446
                pGC->ops->FillPolygon = cfbFillPoly1RectCopy;
 
447
                break;
 
448
            default:
 
449
                pGC->ops->FillPolygon = cfbFillPoly1RectGeneral;
 
450
                break;
 
451
            }
 
452
        }
 
453
#endif
 
454
        if (pGC->lineWidth == 0)
 
455
        {
 
456
#ifdef PIXEL_ADDR
 
457
            if ((pGC->lineStyle == LineSolid) && (pGC->fillStyle == FillSolid))
 
458
            {
 
459
                switch (devPriv->rop)
 
460
                {
 
461
                case GXxor:
 
462
                    pGC->ops->PolyArc = cfbZeroPolyArcSS8Xor;
 
463
                    break;
 
464
                case GXcopy:
 
465
                    pGC->ops->PolyArc = cfbZeroPolyArcSS8Copy;
 
466
                    break;
 
467
                default:
 
468
                    pGC->ops->PolyArc = cfbZeroPolyArcSS8General;
 
469
                    break;
 
470
                }
 
471
            }
 
472
            else
 
473
#endif
 
474
                pGC->ops->PolyArc = miZeroPolyArc;
 
475
        }
 
476
        else
 
477
            pGC->ops->PolyArc = miPolyArc;
 
478
        pGC->ops->PolySegment = miPolySegment;
 
479
        switch (pGC->lineStyle)
 
480
        {
 
481
        case LineSolid:
 
482
            if(pGC->lineWidth == 0)
 
483
            {
 
484
                if (pGC->fillStyle == FillSolid)
 
485
                {
 
486
#if defined(PIXEL_ADDR) && !defined(NO_ONE_RECT)
 
487
                    if (devPriv->oneRect &&
 
488
                        ((pDrawable->x >= pGC->pScreen->width - 32768) &&
 
489
                         (pDrawable->y >= pGC->pScreen->height - 32768)))
 
490
                    {
 
491
                        pGC->ops->Polylines = cfb8LineSS1Rect;
 
492
                        pGC->ops->PolySegment = cfb8SegmentSS1Rect;
 
493
                    } else
 
494
#endif
 
495
#ifdef NO_ONE_RECT
 
496
                    {
 
497
                        pGC->ops->Polylines = cfb8LineSS1Rect;
 
498
                        pGC->ops->PolySegment = cfb8SegmentSS1Rect;
 
499
                    }
 
500
#else
 
501
                    {
 
502
                        pGC->ops->Polylines = cfbLineSS;
 
503
                        pGC->ops->PolySegment = cfbSegmentSS;
 
504
                    }
 
505
#endif
 
506
                }
 
507
                else
 
508
                    pGC->ops->Polylines = miZeroLine;
 
509
            }
 
510
            else
 
511
                pGC->ops->Polylines = miWideLine;
 
512
            break;
 
513
        case LineOnOffDash:
 
514
        case LineDoubleDash:
 
515
            if (pGC->lineWidth == 0 && pGC->fillStyle == FillSolid)
 
516
            {
 
517
                pGC->ops->Polylines = cfbLineSD;
 
518
                pGC->ops->PolySegment = cfbSegmentSD;
 
519
            } else
 
520
                pGC->ops->Polylines = miWideDash;
 
521
            break;
 
522
        }
 
523
    }
 
524
 
 
525
    if (new_text && (pGC->font))
 
526
    {
 
527
        if (FONTMAXBOUNDS(pGC->font,rightSideBearing) -
 
528
            FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 ||
 
529
            FONTMINBOUNDS(pGC->font,characterWidth) < 0)
 
530
        {
 
531
            pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
 
532
            pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
 
533
        }
 
534
        else
 
535
        {
 
536
#ifdef WriteBitGroup
 
537
            if (pGC->fillStyle == FillSolid)
 
538
            {
 
539
                if (devPriv->rop == GXcopy)
 
540
                    pGC->ops->PolyGlyphBlt = cfbPolyGlyphBlt8;
 
541
                else
 
542
#ifdef FOUR_BIT_CODE
 
543
                    pGC->ops->PolyGlyphBlt = cfbPolyGlyphRop8;
 
544
#else
 
545
                    pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
 
546
#endif
 
547
            }
 
548
            else
 
549
#endif
 
550
                pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
 
551
            /* special case ImageGlyphBlt for terminal emulator fonts */
 
552
#if !defined(WriteBitGroup) || PSZ == 8
 
553
            if (TERMINALFONT(pGC->font) &&
 
554
                (pGC->planemask & PMSK) == PMSK
 
555
#ifdef FOUR_BIT_CODE
 
556
                && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
 
557
#endif
 
558
                )
 
559
            {
 
560
                pGC->ops->ImageGlyphBlt = useTEGlyphBlt;
 
561
            }
 
562
            else
 
563
#endif
 
564
            {
 
565
#ifdef WriteBitGroup
 
566
                if (devPriv->rop == GXcopy &&
 
567
                    pGC->fillStyle == FillSolid &&
 
568
                    (pGC->planemask & PMSK) == PMSK)
 
569
                    pGC->ops->ImageGlyphBlt = cfbImageGlyphBlt8;
 
570
                else
 
571
#endif
 
572
                    pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
 
573
            }
 
574
        }
 
575
    }    
 
576
 
 
577
 
 
578
    if (new_fillspans) {
 
579
        switch (pGC->fillStyle) {
 
580
        case FillSolid:
 
581
            switch (devPriv->rop) {
 
582
            case GXcopy:
 
583
                pGC->ops->FillSpans = cfbSolidSpansCopy;
 
584
                break;
 
585
            case GXxor:
 
586
                pGC->ops->FillSpans = cfbSolidSpansXor;
 
587
                break;
 
588
            default:
 
589
                pGC->ops->FillSpans = cfbSolidSpansGeneral;
 
590
                break;
 
591
            }
 
592
            break;
 
593
        case FillTiled:
 
594
            pGC->ops->FillSpans = cfbUnnaturalTileFS;
 
595
            break;
 
596
        case FillStippled:
 
597
        case FillOpaqueStippled:
 
598
            pGC->ops->FillSpans = cfbUnnaturalStippleFS;
 
599
            break;
 
600
        default:
 
601
            FatalError("cfbValidateGC: illegal fillStyle\n");
 
602
        }
 
603
    } /* end of new_fillspans */
 
604
 
 
605
    if (new_fillarea) {
 
606
#ifndef FOUR_BIT_CODE
 
607
        pGC->ops->PolyFillRect = miPolyFillRect;
 
608
        if (pGC->fillStyle == FillSolid || pGC->fillStyle == FillTiled)
 
609
        {
 
610
            pGC->ops->PolyFillRect = cfbPolyFillRect;
 
611
        }
 
612
#endif
 
613
#ifdef FOUR_BIT_CODE
 
614
#ifndef LOWMEMFTPT
 
615
        pGC->ops->PushPixels = mfbPushPixels;
 
616
#else
 
617
        pGC->ops->PushPixels = miPushPixels;
 
618
#endif /* ifndef LOWMEMFTPT */
 
619
        if (pGC->fillStyle == FillSolid && devPriv->rop == GXcopy)
 
620
            pGC->ops->PushPixels = cfbPushPixels8;
 
621
#endif
 
622
        pGC->ops->PolyFillArc = miPolyFillArc;
 
623
        if (pGC->fillStyle == FillSolid)
 
624
        {
 
625
            switch (devPriv->rop)
 
626
            {
 
627
            case GXcopy:
 
628
                pGC->ops->PolyFillArc = cfbPolyFillArcSolidCopy;
 
629
                break;
 
630
            default:
 
631
                pGC->ops->PolyFillArc = cfbPolyFillArcSolidGeneral;
 
632
                break;
 
633
            }
 
634
        }
 
635
    }
 
636
}