aboutsummaryrefslogtreecommitdiffstats
path: root/xc
diff options
context:
space:
mode:
authorPeter Åstrand <astrand@cendio.se>2005-03-10 13:28:04 +0000
committerPeter Åstrand <astrand@cendio.se>2005-03-10 13:28:04 +0000
commitf1794c33a48403018f80c840179614d4a3597274 (patch)
tree9d7e368ca48e4099ee5b45473c0be06d43159ac8 /xc
parent5caee41f2365cafded34005d9bfa886899b7705b (diff)
downloadtigervnc-f1794c33a48403018f80c840179614d4a3597274.tar.gz
tigervnc-f1794c33a48403018f80c840179614d4a3597274.zip
Implemented Composite hook. This solves the problem with menu text in OpenOffice when using the RENDER extension.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@237 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'xc')
-rw-r--r--xc/programs/Xserver/vnc/Imakefile2
-rw-r--r--xc/programs/Xserver/vnc/module/Imakefile2
-rw-r--r--xc/programs/Xserver/vnc/vncHooks.cc50
3 files changed, 52 insertions, 2 deletions
diff --git a/xc/programs/Xserver/vnc/Imakefile b/xc/programs/Xserver/vnc/Imakefile
index 7e618701..1c8132d9 100644
--- a/xc/programs/Xserver/vnc/Imakefile
+++ b/xc/programs/Xserver/vnc/Imakefile
@@ -18,7 +18,7 @@ XCOMM CXXDEBUGFLAGS = -g
SRCS = vncExtInit.cc vncHooks.cc XserverDesktop.cc
OBJS = vncExtInit.o vncHooks.o XserverDesktop.o
INCLUDES = -I../include -I$(EXTINCSRC) -I$(XINCLUDESRC) -I$(FONTINCSRC) \
- -I../mfb -I../mi $(VNCINCLUDE)
+ -I../render $(VNCINCLUDE)
#if defined(XFree86Version) && XFree86Version >= 4000
VNCDEFINES = -DGC_HAS_COMPOSITE_CLIP
#endif
diff --git a/xc/programs/Xserver/vnc/module/Imakefile b/xc/programs/Xserver/vnc/module/Imakefile
index 60117814..7b317438 100644
--- a/xc/programs/Xserver/vnc/module/Imakefile
+++ b/xc/programs/Xserver/vnc/module/Imakefile
@@ -12,7 +12,7 @@
OBJS = vncExtInit.o vncHooks.o xf86vncModule.o XserverDesktop.o
INCLUDES = -I.. -I../../include -I$(EXTINCSRC) -I$(XINCLUDESRC) \
-I$(FONTINCSRC) -I$(XF86COMSRC) \
- $(VNCINCLUDE)
+ -I../../render $(VNCINCLUDE)
DEFINES = $(STD_DEFINES) -DGC_HAS_COMPOSITE_CLIP -DXFree86LOADER
LinkSourceFile(vncExtInit.cc,..)
diff --git a/xc/programs/Xserver/vnc/vncHooks.cc b/xc/programs/Xserver/vnc/vncHooks.cc
index d52a4971..1321bf32 100644
--- a/xc/programs/Xserver/vnc/vncHooks.cc
+++ b/xc/programs/Xserver/vnc/vncHooks.cc
@@ -29,6 +29,9 @@ extern "C" {
#include "regionstr.h"
#include "dixfontstr.h"
#include "colormapst.h"
+#ifdef RENDER
+#include "picturestr.h"
+#endif
#ifdef GC_HAS_COMPOSITE_CLIP
#define COMPOSITE_CLIP(gc) ((gc)->pCompositeClip)
@@ -74,6 +77,9 @@ typedef struct {
StoreColorsProcPtr StoreColors;
DisplayCursorProcPtr DisplayCursor;
ScreenBlockHandlerProcPtr BlockHandler;
+#ifdef RENDER
+ CompositeProcPtr Composite;
+#endif
} vncHooksScreenRec, *vncHooksScreenPtr;
typedef struct {
@@ -104,6 +110,11 @@ static void vncHooksStoreColors(ColormapPtr pColormap, int ndef,
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 +240,13 @@ Bool vncHooksInit(ScreenPtr pScreen, XserverDesktop* desktop)
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 +259,11 @@ Bool vncHooksInit(ScreenPtr pScreen, XserverDesktop* desktop)
pScreen->StoreColors = vncHooksStoreColors;
pScreen->DisplayCursor = vncHooksDisplayCursor;
pScreen->BlockHandler = vncHooksBlockHandler;
+#ifdef RENDER
+ if (ps) {
+ ps->Composite = vncHooksComposite;
+ }
+#endif
return TRUE;
}
@@ -470,6 +493,33 @@ static void vncHooksBlockHandler(int i, pointer blockData, pointer pTimeout,
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);
+
+ 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 */
/////////////////////////////////////////////////////////////////////////////