diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2013-07-21 23:30:39 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2013-07-21 23:30:39 -0700 |
commit | 1f84c36ddd9803ae328713960bac4694374382ab (patch) | |
tree | a600a1078d573914f6e0a6909fc5312195f62991 /xorg/server/module | |
parent | c176208133d7da718ca1f580ad2604982ba0d05a (diff) | |
download | xrdp-proprietary-1f84c36ddd9803ae328713960bac4694374382ab.tar.gz xrdp-proprietary-1f84c36ddd9803ae328713960bac4694374382ab.zip |
xorg driver, added rdpPixmap.c/h
Diffstat (limited to 'xorg/server/module')
-rw-r--r-- | xorg/server/module/Makefile | 2 | ||||
-rw-r--r-- | xorg/server/module/rdpDraw.c | 64 | ||||
-rw-r--r-- | xorg/server/module/rdpDraw.h | 8 | ||||
-rw-r--r-- | xorg/server/module/rdpPixmap.c | 99 | ||||
-rw-r--r-- | xorg/server/module/rdpPixmap.h | 36 |
5 files changed, 136 insertions, 73 deletions
diff --git a/xorg/server/module/Makefile b/xorg/server/module/Makefile index 66b09f91..eb8f1e29 100644 --- a/xorg/server/module/Makefile +++ b/xorg/server/module/Makefile @@ -5,7 +5,7 @@ rdpPolyRectangle.o rdpPolyArc.o rdpFillPolygon.o rdpPolyFillRect.o \ rdpPolyFillArc.o rdpPolyText8.o rdpPolyText16.o rdpImageText8.o \ rdpImageText16.o rdpImageGlyphBlt.o rdpPolyGlyphBlt.o rdpPushPixels.o \ rdpCursor.o rdpMain.o rdpRandR.o rdpMisc.o rdpReg.o \ -rdpComposite.o rdpGlyphs.o +rdpComposite.o rdpGlyphs.o rdpPixmap.o CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 diff --git a/xorg/server/module/rdpDraw.c b/xorg/server/module/rdpDraw.c index 7abcb406..462d7a13 100644 --- a/xorg/server/module/rdpDraw.c +++ b/xorg/server/module/rdpDraw.c @@ -39,70 +39,6 @@ misc draw calls #include "rdp.h" -/******************************************************************************/ -#define LOG_LEVEL 1 -#define LLOGLN(_level, _args) \ - do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) - -/*****************************************************************************/ -PixmapPtr -rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, - unsigned usage_hint) -{ - ScrnInfoPtr pScrn; - rdpPtr dev; - PixmapPtr rv; - - LLOGLN(10, ("rdpCreatePixmap: width %d height %d depth %d", - width, height, depth)); - pScrn = xf86Screens[pScreen->myNum]; - dev = XRDPPTR(pScrn); - pScreen->CreatePixmap = dev->CreatePixmap; - rv = pScreen->CreatePixmap(pScreen, width, height, depth, usage_hint); - pScreen->CreatePixmap = rdpCreatePixmap; - return rv; -} - -/******************************************************************************/ -Bool -rdpDestroyPixmap(PixmapPtr pPixmap) -{ - Bool rv; - ScreenPtr pScreen; - rdpPtr dev; - ScrnInfoPtr pScrn; - - LLOGLN(10, ("rdpDestroyPixmap: refcnt %d", pPixmap->refcnt)); - pScreen = pPixmap->drawable.pScreen; - pScrn = xf86Screens[pScreen->myNum]; - dev = XRDPPTR(pScrn); - pScreen->DestroyPixmap = dev->DestroyPixmap; - rv = pScreen->DestroyPixmap(pPixmap); - pScreen->DestroyPixmap = rdpDestroyPixmap; - return rv; -} - -/******************************************************************************/ -Bool -rdpModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, - int bitsPerPixel, int devKind, pointer pPixData) -{ - Bool rv; - ScreenPtr pScreen; - rdpPtr dev; - ScrnInfoPtr pScrn; - - LLOGLN(10, ("rdpModifyPixmapHeader:")); - pScreen = pPixmap->drawable.pScreen; - pScrn = xf86Screens[pScreen->myNum]; - dev = XRDPPTR(pScrn); - pScreen->ModifyPixmapHeader = dev->ModifyPixmapHeader; - rv = pScreen->ModifyPixmapHeader(pPixmap, width, height, depth, bitsPerPixel, - devKind, pPixData); - pScreen->ModifyPixmapHeader = rdpModifyPixmapHeader; - return rv; -} - /*****************************************************************************/ void rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) diff --git a/xorg/server/module/rdpDraw.h b/xorg/server/module/rdpDraw.h index ba696541..0b77abde 100644 --- a/xorg/server/module/rdpDraw.h +++ b/xorg/server/module/rdpDraw.h @@ -52,14 +52,6 @@ do { \ extern GCOps g_rdpGCOps; /* in rdpGC.c */ -PixmapPtr -rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, - unsigned usage_hint); -Bool -rdpDestroyPixmap(PixmapPtr pPixmap); -Bool -rdpModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, - int bitsPerPixel, int devKind, pointer pPixData); void rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion); Bool diff --git a/xorg/server/module/rdpPixmap.c b/xorg/server/module/rdpPixmap.c new file mode 100644 index 00000000..191bb9e9 --- /dev/null +++ b/xorg/server/module/rdpPixmap.c @@ -0,0 +1,99 @@ +/* +Copyright 2005-2013 Jay Sorg + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +pixmap calls + +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +/* this should be before all X11 .h files */ +#include <xorg-server.h> + +/* all driver need this */ +#include <xf86.h> +#include <xf86_OSproc.h> + +#include "rdp.h" + +/******************************************************************************/ +#define LOG_LEVEL 1 +#define LLOGLN(_level, _args) \ + do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) + +/*****************************************************************************/ +PixmapPtr +rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, + unsigned usage_hint) +{ + ScrnInfoPtr pScrn; + rdpPtr dev; + PixmapPtr rv; + + LLOGLN(10, ("rdpCreatePixmap: width %d height %d depth %d", + width, height, depth)); + pScrn = xf86Screens[pScreen->myNum]; + dev = XRDPPTR(pScrn); + pScreen->CreatePixmap = dev->CreatePixmap; + rv = pScreen->CreatePixmap(pScreen, width, height, depth, usage_hint); + pScreen->CreatePixmap = rdpCreatePixmap; + return rv; +} + +/******************************************************************************/ +Bool +rdpDestroyPixmap(PixmapPtr pPixmap) +{ + Bool rv; + ScreenPtr pScreen; + rdpPtr dev; + ScrnInfoPtr pScrn; + + LLOGLN(10, ("rdpDestroyPixmap: refcnt %d", pPixmap->refcnt)); + pScreen = pPixmap->drawable.pScreen; + pScrn = xf86Screens[pScreen->myNum]; + dev = XRDPPTR(pScrn); + pScreen->DestroyPixmap = dev->DestroyPixmap; + rv = pScreen->DestroyPixmap(pPixmap); + pScreen->DestroyPixmap = rdpDestroyPixmap; + return rv; +} + +/******************************************************************************/ +Bool +rdpModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, + int bitsPerPixel, int devKind, pointer pPixData) +{ + Bool rv; + ScreenPtr pScreen; + rdpPtr dev; + ScrnInfoPtr pScrn; + + LLOGLN(10, ("rdpModifyPixmapHeader:")); + pScreen = pPixmap->drawable.pScreen; + pScrn = xf86Screens[pScreen->myNum]; + dev = XRDPPTR(pScrn); + pScreen->ModifyPixmapHeader = dev->ModifyPixmapHeader; + rv = pScreen->ModifyPixmapHeader(pPixmap, width, height, depth, bitsPerPixel, + devKind, pPixData); + pScreen->ModifyPixmapHeader = rdpModifyPixmapHeader; + return rv; +} diff --git a/xorg/server/module/rdpPixmap.h b/xorg/server/module/rdpPixmap.h new file mode 100644 index 00000000..8456593f --- /dev/null +++ b/xorg/server/module/rdpPixmap.h @@ -0,0 +1,36 @@ +/* +Copyright 2005-2013 Jay Sorg + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +pixmap calls + +*/ + +#ifndef __RDPPIXMAP_H +#define __RDPPIXAMP_H + +PixmapPtr +rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, + unsigned usage_hint); +Bool +rdpDestroyPixmap(PixmapPtr pPixmap); +Bool +rdpModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, + int bitsPerPixel, int devKind, pointer pPixData); + +#endif |