~ubuntu-branches/ubuntu/edgy/xorg-server/edgy-updates

« back to all changes in this revision

Viewing changes to miext/shadow/shrotpackYX.h

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Parra Novo
  • Date: 2006-07-25 20:06:28 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060725200628-gjmmd9gxfxdc4ejs
Tags: 1:1.1.1-0ubuntu1
* New Upstream version
* Changed Build-Depends from mesa-swrast-source to mesa-swx11-source,
  following Debian package nomenclature
* Re-did 12_security_policy_in_etc.diff for 1.1.1
* Dropped 15_security_allocate_local.diff (applied upstream)
* Dropped 16_SECURITY_setuid.diff (applied upstream)
* Dropped 000_ubuntu_fix_read_kernel_mapping.patch (applied upstream)
* Dropped 002_ubuntu_fix_for_certain_intel_chipsets.patch (applied upstream)
* Updated versioned Build-Depends on mesa-swx11-source to version
  6.5.0.cvs.20060725-0ubuntu1
* Added arrayobj.c, arrayobj.h, bitset.h & rbadaptors.h to
  GL/symlink-mesa.sh (linked from mesa-swx11-source)
* Added arrayobj.c to default build target on GL/mesa/main

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Id$
 
3
 *
 
4
 * Copyright © 2004 Philip Blundell
 
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, and that the name of Philip Blundell not be used in
 
11
 * advertising or publicity pertaining to distribution of the software without
 
12
 * specific, written prior permission.  Philip Blundell makes no
 
13
 * representations about the suitability of this software for any purpose.  It
 
14
 * is provided "as is" without express or implied warranty.
 
15
 *
 
16
 * PHILIP BLUNDELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 
17
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 
18
 * EVENT SHALL PHILIP BLUNDELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 
19
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 
20
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 
21
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 
22
 * PERFORMANCE OF THIS SOFTWARE.
 
23
 */
 
24
 
 
25
#include    <X11/X.h>
 
26
#include    "scrnintstr.h"
 
27
#include    "windowstr.h"
 
28
#include    "dixfontstr.h"
 
29
#include    "mi.h"
 
30
#include    "regionstr.h"
 
31
#include    "globals.h"
 
32
#include    "gcstruct.h"
 
33
#include    "shadow.h"
 
34
#include    "fb.h"
 
35
 
 
36
#if ROTATE == 270
 
37
 
 
38
#define WINSTEPX(stride)    (stride)
 
39
#define WINSTART(x,y)       (((pScreen->height - 1) - y) + (x * winStride))
 
40
#define WINSTEPY()          -1
 
41
 
 
42
#elif ROTATE == 90
 
43
 
 
44
#define WINSTEPX(stride)    (-stride)
 
45
#define WINSTEPY()          1
 
46
#define WINSTART(x,y)       (((pScreen->width - 1 - x) * winStride) + y)
 
47
 
 
48
#else
 
49
 
 
50
#error This rotation is not supported here
 
51
 
 
52
#endif
 
53
 
 
54
#ifdef __arm__
 
55
#define PREFETCH
 
56
#endif
 
57
 
 
58
void
 
59
FUNC (ScreenPtr     pScreen,
 
60
      shadowBufPtr  pBuf);
 
61
 
 
62
void
 
63
FUNC (ScreenPtr     pScreen,
 
64
      shadowBufPtr  pBuf)
 
65
{
 
66
    RegionPtr   damage = shadowDamage(pBuf);
 
67
    PixmapPtr   pShadow = pBuf->pPixmap;
 
68
    int         nbox = REGION_NUM_RECTS (damage);
 
69
    BoxPtr      pbox = REGION_RECTS (damage);
 
70
    FbBits      *shaBits;
 
71
    Data        *shaBase, *shaLine, *sha;
 
72
    FbStride    shaStride, winStride;
 
73
    int         shaBpp;
 
74
    int         shaXoff, shaYoff;   /* XXX assumed to be zero */
 
75
    int         x, y, w, h;
 
76
    Data        *winBase, *win, *winLine;
 
77
    CARD32      winSize;
 
78
 
 
79
    fbGetDrawable (&pShadow->drawable, shaBits, shaStride, shaBpp, shaXoff, shaYoff);
 
80
    shaBase = (Data *) shaBits;
 
81
    shaStride = shaStride * sizeof (FbBits) / sizeof (Data);
 
82
 
 
83
    winBase = (Data *) (*pBuf->window) (pScreen, 0, 0,
 
84
                                        SHADOW_WINDOW_WRITE,
 
85
                                        &winSize, pBuf->closure);
 
86
    winStride = (Data *) (*pBuf->window) (pScreen, 1, 0,
 
87
                                          SHADOW_WINDOW_WRITE,
 
88
                                          &winSize, pBuf->closure) - winBase;
 
89
 
 
90
    while (nbox--)
 
91
    {
 
92
        x = pbox->x1;
 
93
        y = pbox->y1;
 
94
        w = (pbox->x2 - pbox->x1);
 
95
        h = pbox->y2 - pbox->y1;
 
96
 
 
97
        shaLine = shaBase + (y * shaStride) + x;
 
98
#ifdef PREFETCH
 
99
        __builtin_prefetch (shaLine);
 
100
#endif
 
101
        winLine = winBase + WINSTART(x, y);
 
102
 
 
103
        while (h--)
 
104
        {
 
105
            sha = shaLine;
 
106
            win = winLine;
 
107
 
 
108
            while (sha < (shaLine + w - 16))
 
109
            {
 
110
#ifdef PREFETCH
 
111
                __builtin_prefetch (sha + shaStride);
 
112
#endif
 
113
                *win = *sha++;
 
114
                win += WINSTEPX(winStride);
 
115
                *win = *sha++;
 
116
                win += WINSTEPX(winStride);
 
117
                *win = *sha++;
 
118
                win += WINSTEPX(winStride);
 
119
                *win = *sha++;
 
120
                win += WINSTEPX(winStride);
 
121
 
 
122
                *win = *sha++;
 
123
                win += WINSTEPX(winStride);
 
124
                *win = *sha++;
 
125
                win += WINSTEPX(winStride);
 
126
                *win = *sha++;
 
127
                win += WINSTEPX(winStride);
 
128
                *win = *sha++;
 
129
                win += WINSTEPX(winStride);
 
130
 
 
131
                *win = *sha++;
 
132
                win += WINSTEPX(winStride);
 
133
                *win = *sha++;
 
134
                win += WINSTEPX(winStride);
 
135
                *win = *sha++;
 
136
                win += WINSTEPX(winStride);
 
137
                *win = *sha++;
 
138
                win += WINSTEPX(winStride);
 
139
 
 
140
                *win = *sha++;
 
141
                win += WINSTEPX(winStride);
 
142
                *win = *sha++;
 
143
                win += WINSTEPX(winStride);
 
144
                *win = *sha++;
 
145
                win += WINSTEPX(winStride);
 
146
                *win = *sha++;
 
147
                win += WINSTEPX(winStride);
 
148
            }
 
149
 
 
150
            while (sha < (shaLine + w))
 
151
            {
 
152
                *win = *sha++;
 
153
                win += WINSTEPX(winStride);
 
154
            }
 
155
 
 
156
            y++;
 
157
            shaLine += shaStride;
 
158
            winLine += WINSTEPY();
 
159
        }
 
160
        pbox++;
 
161
    } /*  nbox */
 
162
}