177 lines
5.2 KiB
Diff
177 lines
5.2 KiB
Diff
--- vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/vncHooks.cc.render 2006-05-15 18:56:20.000000000 +0200
|
|
+++ vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/vncHooks.cc 2007-03-02 15:56:06.000000000 +0100
|
|
@@ -29,6 +29,9 @@
|
|
#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 +77,9 @@
|
|
StoreColorsProcPtr StoreColors;
|
|
DisplayCursorProcPtr DisplayCursor;
|
|
ScreenBlockHandlerProcPtr BlockHandler;
|
|
+#ifdef RENDER
|
|
+ CompositeProcPtr Composite;
|
|
+#endif
|
|
} vncHooksScreenRec, *vncHooksScreenPtr;
|
|
|
|
typedef struct {
|
|
@@ -104,6 +110,13 @@
|
|
static Bool vncHooksDisplayCursor(ScreenPtr pScreen, CursorPtr cursor);
|
|
static void vncHooksBlockHandler(int i, pointer blockData, pointer pTimeout,
|
|
pointer pReadmask);
|
|
+#ifdef RENDER
|
|
+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);
|
|
+#endif
|
|
+
|
|
|
|
// GC "funcs"
|
|
|
|
@@ -229,6 +242,13 @@
|
|
vncHooksScreen->StoreColors = pScreen->StoreColors;
|
|
vncHooksScreen->DisplayCursor = pScreen->DisplayCursor;
|
|
vncHooksScreen->BlockHandler = pScreen->BlockHandler;
|
|
+#ifdef RENDER
|
|
+ PictureScreenPtr ps;
|
|
+ ps = GetPictureScreenIfSet(pScreen);
|
|
+ if (ps) {
|
|
+ vncHooksScreen->Composite = ps->Composite;
|
|
+ }
|
|
+#endif
|
|
|
|
pScreen->CloseScreen = vncHooksCloseScreen;
|
|
pScreen->CreateGC = vncHooksCreateGC;
|
|
@@ -241,6 +261,11 @@
|
|
pScreen->StoreColors = vncHooksStoreColors;
|
|
pScreen->DisplayCursor = vncHooksDisplayCursor;
|
|
pScreen->BlockHandler = vncHooksBlockHandler;
|
|
+#ifdef RENDER
|
|
+ if (ps) {
|
|
+ ps->Composite = vncHooksComposite;
|
|
+ }
|
|
+#endif
|
|
|
|
return TRUE;
|
|
}
|
|
@@ -470,6 +495,38 @@
|
|
SCREEN_REWRAP(BlockHandler);
|
|
}
|
|
|
|
+// Composite - needed for RENDER
|
|
+
|
|
+#ifdef RENDER
|
|
+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);
|
|
+ BoxRec box;
|
|
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
|
|
+
|
|
+ if ((xDst >= 0) && (yDst >= 0)) {
|
|
+ box.x1 = pDst->pDrawable->x + xDst;
|
|
+ box.y1 = pDst->pDrawable->y + yDst;
|
|
+ box.x2 = box.x1 + width;
|
|
+ box.y2 = box.y1 + height;
|
|
+
|
|
+ RegionHelper changed(pScreen, &box, 0);
|
|
+ vncHooksScreen->desktop->add_changed(changed.reg);
|
|
+ }
|
|
+
|
|
+ ps->Composite = vncHooksScreen->Composite;
|
|
+ (*ps->Composite)(op, pSrc, pMask, pDst, xSrc, ySrc,
|
|
+ xMask, yMask, xDst, yDst, width, height);
|
|
+ ps->Composite = vncHooksComposite;
|
|
+}
|
|
+
|
|
+#endif /* RENDER */
|
|
+
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
--- vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc.render 2007-03-02 15:56:06.000000000 +0100
|
|
+++ vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc 2007-03-02 15:56:37.000000000 +0100
|
|
@@ -130,6 +130,7 @@
|
|
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 @@
|
|
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 @@
|
|
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 @@
|
|
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 @@
|
|
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])
|