Contents of /trunk/vnc/patches/vnc-render.patch
Parent Directory | Revision Log
Revision 153 -
(show annotations)
(download)
Tue May 8 20:52:56 2007 UTC (17 years, 5 months ago) by niro
File size: 5284 byte(s)
Tue May 8 20:52:56 2007 UTC (17 years, 5 months ago) by niro
File size: 5284 byte(s)
-import
1 | --- unix/xc/programs/Xserver/vnc/vncHooks.cc.render 2006-05-15 18:56:20.000000000 +0200 |
2 | +++ unix/xc/programs/Xserver/vnc/vncHooks.cc 2007-03-02 15:56:06.000000000 +0100 |
3 | @@ -29,6 +29,9 @@ |
4 | #include "regionstr.h" |
5 | #include "dixfontstr.h" |
6 | #include "colormapst.h" |
7 | +#ifdef RENDER |
8 | +#include "../../render/picturestr.h" |
9 | +#endif |
10 | |
11 | #ifdef GC_HAS_COMPOSITE_CLIP |
12 | #define COMPOSITE_CLIP(gc) ((gc)->pCompositeClip) |
13 | @@ -74,6 +77,9 @@ |
14 | StoreColorsProcPtr StoreColors; |
15 | DisplayCursorProcPtr DisplayCursor; |
16 | ScreenBlockHandlerProcPtr BlockHandler; |
17 | +#ifdef RENDER |
18 | + CompositeProcPtr Composite; |
19 | +#endif |
20 | } vncHooksScreenRec, *vncHooksScreenPtr; |
21 | |
22 | typedef struct { |
23 | @@ -104,6 +110,13 @@ |
24 | static Bool vncHooksDisplayCursor(ScreenPtr pScreen, CursorPtr cursor); |
25 | static void vncHooksBlockHandler(int i, pointer blockData, pointer pTimeout, |
26 | pointer pReadmask); |
27 | +#ifdef RENDER |
28 | +static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, |
29 | + PicturePtr pDst, INT16 xSrc, INT16 ySrc, |
30 | + INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, |
31 | + CARD16 width, CARD16 height); |
32 | +#endif |
33 | + |
34 | |
35 | // GC "funcs" |
36 | |
37 | @@ -229,6 +242,13 @@ |
38 | vncHooksScreen->StoreColors = pScreen->StoreColors; |
39 | vncHooksScreen->DisplayCursor = pScreen->DisplayCursor; |
40 | vncHooksScreen->BlockHandler = pScreen->BlockHandler; |
41 | +#ifdef RENDER |
42 | + PictureScreenPtr ps; |
43 | + ps = GetPictureScreenIfSet(pScreen); |
44 | + if (ps) { |
45 | + vncHooksScreen->Composite = ps->Composite; |
46 | + } |
47 | +#endif |
48 | |
49 | pScreen->CloseScreen = vncHooksCloseScreen; |
50 | pScreen->CreateGC = vncHooksCreateGC; |
51 | @@ -241,6 +261,11 @@ |
52 | pScreen->StoreColors = vncHooksStoreColors; |
53 | pScreen->DisplayCursor = vncHooksDisplayCursor; |
54 | pScreen->BlockHandler = vncHooksBlockHandler; |
55 | +#ifdef RENDER |
56 | + if (ps) { |
57 | + ps->Composite = vncHooksComposite; |
58 | + } |
59 | +#endif |
60 | |
61 | return TRUE; |
62 | } |
63 | @@ -470,6 +495,38 @@ |
64 | SCREEN_REWRAP(BlockHandler); |
65 | } |
66 | |
67 | +// Composite - needed for RENDER |
68 | + |
69 | +#ifdef RENDER |
70 | +void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, |
71 | + PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, |
72 | + INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, |
73 | + CARD16 height) |
74 | +{ |
75 | + ScreenPtr pScreen = pDst->pDrawable->pScreen; |
76 | + vncHooksScreenPtr vncHooksScreen = \ |
77 | + ((vncHooksScreenPtr)pScreen->devPrivates[vncHooksScreenIndex].ptr); |
78 | + BoxRec box; |
79 | + PictureScreenPtr ps = GetPictureScreen(pScreen); |
80 | + |
81 | + if ((xDst >= 0) && (yDst >= 0)) { |
82 | + box.x1 = pDst->pDrawable->x + xDst; |
83 | + box.y1 = pDst->pDrawable->y + yDst; |
84 | + box.x2 = box.x1 + width; |
85 | + box.y2 = box.y1 + height; |
86 | + |
87 | + RegionHelper changed(pScreen, &box, 0); |
88 | + vncHooksScreen->desktop->add_changed(changed.reg); |
89 | + } |
90 | + |
91 | + ps->Composite = vncHooksScreen->Composite; |
92 | + (*ps->Composite)(op, pSrc, pMask, pDst, xSrc, ySrc, |
93 | + xMask, yMask, xDst, yDst, width, height); |
94 | + ps->Composite = vncHooksComposite; |
95 | +} |
96 | + |
97 | +#endif /* RENDER */ |
98 | + |
99 | |
100 | |
101 | ///////////////////////////////////////////////////////////////////////////// |
102 | --- unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc.render 2007-03-02 15:56:06.000000000 +0100 |
103 | +++ unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc 2007-03-02 15:56:37.000000000 +0100 |
104 | @@ -130,6 +130,7 @@ |
105 | static Bool vfbPixmapDepths[33]; |
106 | static char needswap = 0; |
107 | static int lastScreen = -1; |
108 | +static Bool Render = TRUE; |
109 | |
110 | static bool displaySpecified = false; |
111 | static bool wellKnownSocketsCreated = false; |
112 | @@ -221,6 +222,10 @@ |
113 | VENDOR_STRING); |
114 | ErrorF("-screen scrn WxHxD set screen's width, height, depth\n"); |
115 | ErrorF("-pixdepths list-of-int support given pixmap depths\n"); |
116 | +#ifdef RENDER |
117 | + ErrorF("+/-render turn on/off RENDER extension support" |
118 | + "(default on)\n"); |
119 | +#endif |
120 | ErrorF("-linebias n adjust thin line pixelization\n"); |
121 | ErrorF("-blackpixel n pixel value for black\n"); |
122 | ErrorF("-whitepixel n pixel value for white\n"); |
123 | @@ -317,6 +322,20 @@ |
124 | return ret; |
125 | } |
126 | |
127 | +#ifdef RENDER |
128 | + if (strcmp (argv[i], "+render") == 0) /* +render */ |
129 | + { |
130 | + Render = TRUE; |
131 | + return 1; |
132 | + } |
133 | + |
134 | + if (strcmp (argv[i], "-render") == 0) /* -render */ |
135 | + { |
136 | + Render = FALSE; |
137 | + return 1; |
138 | + } |
139 | +#endif |
140 | + |
141 | if (strcmp (argv[i], "-blackpixel") == 0) /* -blackpixel n */ |
142 | { |
143 | Pixel pix; |
144 | @@ -817,7 +836,12 @@ |
145 | if (!fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height, |
146 | dpi, dpi, pvfb->paddedWidth, pvfb->bitsPerPixel)) |
147 | return FALSE; |
148 | -#else |
149 | + |
150 | +#ifdef RENDER |
151 | + if (ret && Render) |
152 | + fbPictureInit(pScreen, 0, 0); |
153 | +#endif /* RENDER */ |
154 | +#else /* VNC_USE_FB */ |
155 | switch (pvfb->bitsPerPixel) |
156 | { |
157 | case 1: |
158 | @@ -938,6 +962,19 @@ |
159 | vfbPixmapDepths[vfbScreens[i].depth] = TRUE; |
160 | } |
161 | |
162 | +#ifdef RENDER |
163 | + /* RENDER needs a good set of pixmaps. */ |
164 | + if (Render) { |
165 | + vfbPixmapDepths[1] = TRUE; |
166 | + vfbPixmapDepths[4] = TRUE; |
167 | + vfbPixmapDepths[8] = TRUE; |
168 | +/* vfbPixmapDepths[15] = TRUE; */ |
169 | + vfbPixmapDepths[16] = TRUE; |
170 | + vfbPixmapDepths[24] = TRUE; |
171 | + vfbPixmapDepths[32] = TRUE; |
172 | + } |
173 | +#endif |
174 | + |
175 | for (i = 1; i <= 32; i++) |
176 | { |
177 | if (vfbPixmapDepths[i]) |