From 055c577f5497b55fd7bb597c7303aa1236b39d61 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Tue, 21 Jan 2014 01:45:30 -0800 Subject: xorg: work on xorg driver --- xorg/server/module/rdpPutImage.c | 73 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) (limited to 'xorg/server/module/rdpPutImage.c') diff --git a/xorg/server/module/rdpPutImage.c b/xorg/server/module/rdpPutImage.c index 9a7d49b2..45849c6e 100644 --- a/xorg/server/module/rdpPutImage.c +++ b/xorg/server/module/rdpPutImage.c @@ -32,11 +32,22 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "rdp.h" #include "rdpDraw.h" +#include "rdpClientCon.h" +#include "rdpReg.h" #define LOG_LEVEL 1 #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) +/******************************************************************************/ +void +rdpPutImagePre(rdpPtr dev, rdpClientCon *clientCon, + int cd, RegionPtr clip_reg, + DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, + int w, int h, int leftPad, int format, char *pBits) +{ +} + /******************************************************************************/ static void rdpPutImageOrg(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, @@ -50,12 +61,74 @@ rdpPutImageOrg(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, GC_OP_EPILOGUE(pGC); } +/******************************************************************************/ +void +rdpPutImagePost(rdpPtr dev, rdpClientCon *clientCon, + int cd, RegionPtr clip_reg, + DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, + int w, int h, int leftPad, int format, char *pBits) +{ + WindowPtr pDstWnd; + BoxRec box; + RegionRec reg; + + if (cd == 0) + { + return; + } + if (pDst->type != DRAWABLE_WINDOW) + { + return; + } + pDstWnd = (WindowPtr) pDst; + if (pDstWnd->viewable == FALSE) + { + return; + } + box.x1 = x + pDst->x; + box.y1 = y + pDst->y; + box.x2 = box.x1 + w; + box.y2 = box.y1 + h; + rdpRegionInit(®, &box, 0); + if (cd == 2) + { + rdpRegionIntersect(®, clip_reg, ®); + } + rdpClientConAddDirtyScreenReg(dev, clientCon, ®); + RegionUninit(®); +} + /******************************************************************************/ void rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *pBits) { + rdpPtr dev; + rdpClientCon *clientCon; + RegionRec clip_reg; + int cd; + LLOGLN(10, ("rdpPutImage:")); + dev = rdpGetDevFromScreen(pGC->pScreen); + rdpRegionInit(&clip_reg, NullBox, 0); + cd = rdpDrawGetClip(dev, &clip_reg, pDst, pGC); + LLOGLN(10, ("rdpPutImage: cd %d", cd)); + clientCon = dev->clientConHead; + while (clientCon != NULL) + { + rdpPutImagePre(dev, clientCon, cd, &clip_reg, pDst, pGC, depth, x, y, + w, h, leftPad, format, pBits); + clientCon = clientCon->next; + } + /* do original call */ rdpPutImageOrg(pDst, pGC, depth, x, y, w, h, leftPad, format, pBits); + clientCon = dev->clientConHead; + while (clientCon != NULL) + { + rdpPutImagePost(dev, clientCon, cd, &clip_reg, pDst, pGC, depth, x, y, + w, h, leftPad, format, pBits); + clientCon = clientCon->next; + } + RegionUninit(&clip_reg); } -- cgit v1.2.1