xorg driver, added rdpPixmap.c/h

ulab-next
Jay Sorg 11 years ago
parent c176208133
commit 1f84c36ddd

@ -5,7 +5,7 @@ rdpPolyRectangle.o rdpPolyArc.o rdpFillPolygon.o rdpPolyFillRect.o \
rdpPolyFillArc.o rdpPolyText8.o rdpPolyText16.o rdpImageText8.o \ rdpPolyFillArc.o rdpPolyText8.o rdpPolyText16.o rdpImageText8.o \
rdpImageText16.o rdpImageGlyphBlt.o rdpPolyGlyphBlt.o rdpPushPixels.o \ rdpImageText16.o rdpImageGlyphBlt.o rdpPolyGlyphBlt.o rdpPushPixels.o \
rdpCursor.o rdpMain.o rdpRandR.o rdpMisc.o rdpReg.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 CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1

@ -39,70 +39,6 @@ misc draw calls
#include "rdp.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;
}
/*****************************************************************************/ /*****************************************************************************/
void void
rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion)

@ -52,14 +52,6 @@ do { \
extern GCOps g_rdpGCOps; /* in rdpGC.c */ 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 void
rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion); rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion);
Bool Bool

@ -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;
}

@ -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

@ -47,6 +47,7 @@ This is the main driver file
#include "rdpMisc.h" #include "rdpMisc.h"
#include "rdpComposite.h" #include "rdpComposite.h"
#include "rdpGlyphs.h" #include "rdpGlyphs.h"
#include "rdpPixmap.h"
#define XRDP_DRIVER_NAME "XRDPDEV" #define XRDP_DRIVER_NAME "XRDPDEV"
#define XRDP_NAME "XRDPDEV" #define XRDP_NAME "XRDPDEV"
@ -413,7 +414,7 @@ rdpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
miClearVisualTypes(); miClearVisualTypes();
miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth),
pScrn->rgbBits, TrueColor); pScrn->rgbBits, TrueColor);
miSetPixmapDepths(); miSetPixmapDepths();
LLOGLN(0, ("rdpScreenInit: virtualX %d virtualY %d rgbBits %d depth %d", LLOGLN(0, ("rdpScreenInit: virtualX %d virtualY %d rgbBits %d depth %d",
pScrn->virtualX, pScrn->virtualY, pScrn->rgbBits, pScrn->depth)); pScrn->virtualX, pScrn->virtualY, pScrn->rgbBits, pScrn->depth));

Loading…
Cancel
Save