- handle RENDER extension better (+ moved module_crash patch into render
patch)
- updated s390 patch to latest xorg
224 lines
7.4 KiB
Diff
224 lines
7.4 KiB
Diff
--- vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/vncHooks.cc.render 2007-06-07 15:50:16.000000000 +0200
|
|
+++ vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/vncHooks.cc 2007-06-07 15:57:54.000000000 +0200
|
|
@@ -20,6 +20,10 @@
|
|
#include "XserverDesktop.h"
|
|
#include "vncHooks.h"
|
|
|
|
+#ifdef HAVE_DIX_CONFIG_H
|
|
+#include <dix-config.h>
|
|
+#endif
|
|
+
|
|
extern "C" {
|
|
#define class c_class
|
|
#define private c_private
|
|
@@ -29,6 +33,9 @@ extern "C" {
|
|
#include "regionstr.h"
|
|
#include "dixfontstr.h"
|
|
#include "colormapst.h"
|
|
+#ifdef RENDER
|
|
+#include "../../render/picturestr.h"
|
|
+#endif
|
|
|
|
#ifdef GC_HAS_COMPOSITE_CLIP
|
|
#define COMPOSITE_CLIP(gc) ((gc)->pCompositeClip)
|
|
@@ -74,6 +81,10 @@ typedef struct {
|
|
StoreColorsProcPtr StoreColors;
|
|
DisplayCursorProcPtr DisplayCursor;
|
|
ScreenBlockHandlerProcPtr BlockHandler;
|
|
+#ifdef RENDER
|
|
+ CompositeProcPtr Composite;
|
|
+ GlyphsProcPtr Glyphs;
|
|
+#endif
|
|
} vncHooksScreenRec, *vncHooksScreenPtr;
|
|
|
|
typedef struct {
|
|
@@ -105,6 +116,15 @@ static Bool vncHooksDisplayCursor(Screen
|
|
static void vncHooksBlockHandler(int i, pointer blockData, pointer pTimeout,
|
|
pointer pReadmask);
|
|
|
|
+// RENDER support
|
|
+static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
|
|
+ INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask,
|
|
+ INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
|
|
+
|
|
+static void vncHooksGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
|
|
+ PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist,
|
|
+ GlyphListPtr list, GlyphPtr *glyphs);
|
|
+
|
|
// GC "funcs"
|
|
|
|
static void vncHooksValidateGC(GCPtr pGC, unsigned long changes,
|
|
@@ -230,6 +250,16 @@ Bool vncHooksInit(ScreenPtr pScreen, Xse
|
|
vncHooksScreen->DisplayCursor = pScreen->DisplayCursor;
|
|
vncHooksScreen->BlockHandler = pScreen->BlockHandler;
|
|
|
|
+#ifdef RENDER
|
|
+ PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
|
|
+ if (ps) {
|
|
+ vncHooksScreen->Composite = ps->Composite;
|
|
+ vncHooksScreen->Glyphs = ps->Glyphs;
|
|
+ ps->Composite = vncHooksComposite;
|
|
+ ps->Glyphs = vncHooksGlyphs;
|
|
+ }
|
|
+#endif
|
|
+
|
|
pScreen->CloseScreen = vncHooksCloseScreen;
|
|
pScreen->CreateGC = vncHooksCreateGC;
|
|
pScreen->PaintWindowBackground = vncHooksPaintWindowBackground;
|
|
@@ -1473,3 +1503,80 @@ static void vncHooksPushPixels(GCPtr pGC
|
|
|
|
vncHooksScreen->desktop->add_changed(changed.reg);
|
|
}
|
|
+
|
|
+#ifdef RENDER
|
|
+#define RENDER_MAKE_BOX(pDrawable,X,Y,W,H) { \
|
|
+ box.x1 = X + pDrawable->x; \
|
|
+ box.x2 = X + pDrawable->x + W; \
|
|
+ box.y1 = Y + pDrawable->y; \
|
|
+ box.y2 = Y + pDrawable->y + H; \
|
|
+}
|
|
+
|
|
+static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
|
|
+ INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask,
|
|
+ INT16 xDst, INT16 yDst, CARD16 width, CARD16 height)
|
|
+{
|
|
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
|
|
+ vncHooksScreenPtr vncHooksScreen = \
|
|
+ ((vncHooksScreenPtr)pScreen->devPrivates[vncHooksScreenIndex].ptr);
|
|
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
|
|
+ BoxRec box;
|
|
+
|
|
+ ps->Composite = vncHooksScreen->Composite;
|
|
+ (*ps->Composite)(op, pSrc, pMask, pDst, xSrc, ySrc,
|
|
+ xMask, yMask, xDst, yDst, width, height);
|
|
+ ps->Composite = vncHooksComposite;
|
|
+
|
|
+ if (pDst->pDrawable->type == DRAWABLE_WINDOW) {
|
|
+ RENDER_MAKE_BOX(pDst->pDrawable, xDst, yDst, width, height);
|
|
+ RegionHelper changed(pScreen, &box, 0);
|
|
+ vncHooksScreen->desktop->add_changed(changed.reg);
|
|
+ }
|
|
+}
|
|
+
|
|
+
|
|
+static void vncHooksGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
|
|
+ PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist,
|
|
+ GlyphListPtr list, GlyphPtr *glyphs)
|
|
+{
|
|
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
|
|
+ vncHooksScreenPtr vncHooksScreen = \
|
|
+ ((vncHooksScreenPtr)pScreen->devPrivates[vncHooksScreenIndex].ptr);
|
|
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
|
|
+ int x, y;
|
|
+ int n;
|
|
+ GlyphPtr glyph;
|
|
+ BoxRec box;
|
|
+
|
|
+ ps->Glyphs = vncHooksScreen->Glyphs;
|
|
+ (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc,
|
|
+ nlist, list, glyphs);
|
|
+ ps->Glyphs = vncHooksGlyphs;
|
|
+
|
|
+ if (pDst->pDrawable->type == DRAWABLE_WINDOW)
|
|
+ {
|
|
+ x = xSrc;
|
|
+ y = ySrc;
|
|
+ while (nlist--)
|
|
+ {
|
|
+ x += list->xOff;
|
|
+ y += list->yOff;
|
|
+ n = list->len;
|
|
+ while (n--)
|
|
+ {
|
|
+ glyph = *glyphs++;
|
|
+ RENDER_MAKE_BOX(pDst->pDrawable,
|
|
+ x - glyph->info.x, y - glyph->info.y,
|
|
+ glyph->info.width, glyph->info.height);
|
|
+ RegionHelper changed(pScreen, &box, 0);
|
|
+ vncHooksScreen->desktop->add_changed(changed.reg);
|
|
+
|
|
+ x += glyph->info.xOff;
|
|
+ y += glyph->info.yOff;
|
|
+ }
|
|
+ list++;
|
|
+ }
|
|
+ }
|
|
+}
|
|
+#endif
|
|
+
|
|
--- vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc.render 2007-06-07 15:49:32.000000000 +0200
|
|
+++ vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc 2007-06-07 15:49:32.000000000 +0200
|
|
@@ -130,6 +130,7 @@ static vfbScreenInfo vfbScreens[MAXSCREE
|
|
static Bool vfbPixmapDepths[33];
|
|
static char needswap = 0;
|
|
static int lastScreen = -1;
|
|
+static Bool Render = TRUE;
|
|
|
|
static bool displaySpecified = false;
|
|
static bool wellKnownSocketsCreated = false;
|
|
@@ -221,6 +222,10 @@ extern "C" {
|
|
VENDOR_STRING);
|
|
ErrorF("-screen scrn WxHxD set screen's width, height, depth\n");
|
|
ErrorF("-pixdepths list-of-int support given pixmap depths\n");
|
|
+#ifdef RENDER
|
|
+ ErrorF("+/-render turn on/off RENDER extension support"
|
|
+ "(default on)\n");
|
|
+#endif
|
|
ErrorF("-linebias n adjust thin line pixelization\n");
|
|
ErrorF("-blackpixel n pixel value for black\n");
|
|
ErrorF("-whitepixel n pixel value for white\n");
|
|
@@ -317,6 +322,20 @@ int ddxProcessArgument(int argc, char *a
|
|
return ret;
|
|
}
|
|
|
|
+#ifdef RENDER
|
|
+ if (strcmp (argv[i], "+render") == 0) /* +render */
|
|
+ {
|
|
+ Render = TRUE;
|
|
+ return 1;
|
|
+ }
|
|
+
|
|
+ if (strcmp (argv[i], "-render") == 0) /* -render */
|
|
+ {
|
|
+ Render = FALSE;
|
|
+ return 1;
|
|
+ }
|
|
+#endif
|
|
+
|
|
if (strcmp (argv[i], "-blackpixel") == 0) /* -blackpixel n */
|
|
{
|
|
Pixel pix;
|
|
@@ -817,7 +836,12 @@ static Bool vfbScreenInit(int index, Scr
|
|
if (!fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
|
|
dpi, dpi, pvfb->paddedWidth, pvfb->bitsPerPixel))
|
|
return FALSE;
|
|
-#else
|
|
+
|
|
+#ifdef RENDER
|
|
+ if (ret && Render)
|
|
+ fbPictureInit(pScreen, 0, 0);
|
|
+#endif /* RENDER */
|
|
+#else /* VNC_USE_FB */
|
|
switch (pvfb->bitsPerPixel)
|
|
{
|
|
case 1:
|
|
@@ -938,6 +962,19 @@ void InitOutput(ScreenInfo *screenInfo,
|
|
vfbPixmapDepths[vfbScreens[i].depth] = TRUE;
|
|
}
|
|
|
|
+#ifdef RENDER
|
|
+ /* RENDER needs a good set of pixmaps. */
|
|
+ if (Render) {
|
|
+ vfbPixmapDepths[1] = TRUE;
|
|
+ vfbPixmapDepths[4] = TRUE;
|
|
+ vfbPixmapDepths[8] = TRUE;
|
|
+/* vfbPixmapDepths[15] = TRUE; */
|
|
+ vfbPixmapDepths[16] = TRUE;
|
|
+ vfbPixmapDepths[24] = TRUE;
|
|
+ vfbPixmapDepths[32] = TRUE;
|
|
+ }
|
|
+#endif
|
|
+
|
|
for (i = 1; i <= 32; i++)
|
|
{
|
|
if (vfbPixmapDepths[i])
|