Merge branch 'devel' of github.com:neutrinolabs/xrdp into devel

ulab-next
Laxmikant Rashinkar 11 years ago
commit c36bc0c4e4

@ -17,17 +17,17 @@
* limitations under the License. * limitations under the License.
*/ */
#include <freerdp/settings.h>
#include <X11/Xlib.h>
#include "xrdp-neutrinordp.h" #include "xrdp-neutrinordp.h"
#include "xrdp-color.h" #include "xrdp-color.h"
#include "xrdp_rail.h" #include "xrdp_rail.h"
#include "log.h" #include "log.h"
#include <freerdp/settings.h>
#include <X11/Xlib.h>
#ifdef XRDP_DEBUG #ifdef XRDP_DEBUG
#define LOG_LEVEL 99 #define LOG_LEVEL 99
#else #else
#define LOG_LEVEL 1 #define LOG_LEVEL 10
#endif #endif
#define LLOG(_level, _args) \ #define LLOG(_level, _args) \
@ -1478,8 +1478,10 @@ lrail_WindowCreate(rdpContext *context, WINDOW_ORDER_INFO *orderInfo,
int index; int index;
struct mod *mod; struct mod *mod;
struct rail_window_state_order wso; struct rail_window_state_order wso;
UNICONV* uniconv;
LLOGLN(0, ("llrail_WindowCreate:")); LLOGLN(0, ("llrail_WindowCreate:"));
uniconv = freerdp_uniconv_new();
mod = ((struct mod_context *)context)->modi; mod = ((struct mod_context *)context)->modi;
memset(&wso, 0, sizeof(wso)); memset(&wso, 0, sizeof(wso));
/* copy the window state order */ /* copy the window state order */
@ -1490,7 +1492,8 @@ lrail_WindowCreate(rdpContext *context, WINDOW_ORDER_INFO *orderInfo,
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_TITLE) if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_TITLE)
{ {
freerdp_UnicodeToAsciiAlloc(window_state->titleInfo.string, &wso.title_info, window_state->titleInfo.length / 2); wso.title_info = freerdp_uniconv_in(uniconv,
window_state->titleInfo.string, window_state->titleInfo.length);
} }
LLOGLN(0, ("lrail_WindowCreate: %s", wso.title_info)); LLOGLN(0, ("lrail_WindowCreate: %s", wso.title_info));
@ -1616,9 +1619,10 @@ lrail_NotifyIconCreate(rdpContext *context, WINDOW_ORDER_INFO *orderInfo,
{ {
struct mod *mod; struct mod *mod;
struct rail_notify_state_order rnso; struct rail_notify_state_order rnso;
UNICONV* uniconv;
LLOGLN(0, ("lrail_NotifyIconCreate:")); LLOGLN(0, ("lrail_NotifyIconCreate:"));
uniconv = freerdp_uniconv_new();
mod = ((struct mod_context *)context)->modi; mod = ((struct mod_context *)context)->modi;
memset(&rnso, 0, sizeof(rnso)); memset(&rnso, 0, sizeof(rnso));
@ -1626,18 +1630,19 @@ lrail_NotifyIconCreate(rdpContext *context, WINDOW_ORDER_INFO *orderInfo,
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_NOTIFY_TIP) if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_NOTIFY_TIP)
{ {
freerdp_UnicodeToAsciiAlloc(notify_icon_state->toolTip.string, rnso.tool_tip = freerdp_uniconv_in(uniconv,
&rnso.tool_tip, notify_icon_state->toolTip.length / 2); notify_icon_state->toolTip.string, notify_icon_state->toolTip.length);
} }
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP) if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP)
{ {
rnso.infotip.timeout = notify_icon_state->infoTip.timeout; rnso.infotip.timeout = notify_icon_state->infoTip.timeout;
rnso.infotip.flags = notify_icon_state->infoTip.flags; rnso.infotip.flags = notify_icon_state->infoTip.flags;
freerdp_UnicodeToAsciiAlloc(notify_icon_state->infoTip.text.string, rnso.infotip.text = freerdp_uniconv_in(uniconv,
&rnso.infotip.text, notify_icon_state->infoTip.text.length / 2); notify_icon_state->infoTip.text.string,
freerdp_UnicodeToAsciiAlloc(notify_icon_state->infoTip.title.string, notify_icon_state->infoTip.text.length);
&rnso.infotip.title, notify_icon_state->infoTip.title.length / 2); rnso.infotip.title = freerdp_uniconv_in(uniconv,
notify_icon_state->infoTip.title.string,
notify_icon_state->infoTip.title.length);
} }
rnso.state = notify_icon_state->state; rnso.state = notify_icon_state->state;

@ -7,7 +7,8 @@ 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 rdpPixmap.o rdpInput.o rdpClientCon.o rdpCapture.o rdpComposite.o rdpGlyphs.o rdpPixmap.o rdpInput.o rdpClientCon.o rdpCapture.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 \
-I../../../common
LDFLAGS = LDFLAGS =

@ -26,6 +26,8 @@ Client connection to xrdp
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
/* this should be before all X11 .h files */ /* this should be before all X11 .h files */
#include <xorg-server.h> #include <xorg-server.h>
@ -39,6 +41,7 @@ Client connection to xrdp
#include "rdpClientCon.h" #include "rdpClientCon.h"
#include "rdpMisc.h" #include "rdpMisc.h"
#include "rdpInput.h" #include "rdpInput.h"
#include "rdpReg.h"
#define LOG_LEVEL 1 #define LOG_LEVEL 1
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
@ -149,6 +152,9 @@ rdpClientConGotConnection(ScreenPtr pScreen, rdpPtr dev)
dev->clientConTail->next = clientCon; dev->clientConTail->next = clientCon;
dev->clientConTail = clientCon; dev->clientConTail = clientCon;
} }
clientCon->dirtyRegion = rdpRegionCreate(NullBox, 0);
return 0; return 0;
} }
@ -241,19 +247,25 @@ rdpClientConDisconnect(rdpPtr dev, rdpClientCon *clientCon)
dev->clientConHead = pcli->next; dev->clientConHead = pcli->next;
if (dev->clientConHead == NULL) if (dev->clientConHead == NULL)
{ {
/* removed only */
dev->clientConTail = NULL; dev->clientConTail = NULL;
} }
} }
else else
{ {
plcli->next = pcli->next; plcli->next = pcli->next;
if (pcli == dev->clientConTail)
{
/* removed last */
dev->clientConTail = plcli;
}
} }
break; break;
} }
plcli = pcli; plcli = pcli;
pcli = pcli->next; pcli = pcli->next;
} }
rdpRegionDestroy(clientCon->dirtyRegion);
g_free(clientCon); g_free(clientCon);
return 0; return 0;
} }
@ -427,12 +439,17 @@ rdpClientConRecvMsg(rdpPtr dev, rdpClientCon *clientCon)
if (rv == 0) if (rv == 0)
{ {
s->end = s->data + 4;
in_uint32_le(s, len); in_uint32_le(s, len);
if (len > 3) if (len > 3)
{ {
init_stream(s, len); init_stream(s, len);
rv = rdpClientConRecv(dev, clientCon, s->data, len - 4); rv = rdpClientConRecv(dev, clientCon, s->data, len - 4);
if (rv == 0)
{
s->end = s->data + len;
}
} }
} }
} }
@ -508,6 +525,93 @@ rdpClientConProcessMsgVersion(rdpPtr dev, rdpClientCon *clientCon,
return 0; return 0;
} }
/******************************************************************************/
/*
this from miScreenInit
pScreen->mmWidth = (xsize * 254 + dpix * 5) / (dpix * 10);
pScreen->mmHeight = (ysize * 254 + dpiy * 5) / (dpiy * 10);
*/
static int
rdpClientConProcessScreenSizeMsg(rdpPtr dev, rdpClientCon *clientCon,
int width, int height, int bpp)
{
RRScreenSizePtr pSize;
int mmwidth;
int mmheight;
int bytes;
Bool ok;
LLOGLN(0, ("rdpClientConProcessScreenSizeMsg: set width %d height %d bpp %d",
width, height, bpp));
clientCon->rdp_width = width;
clientCon->rdp_height = height;
clientCon->rdp_bpp = bpp;
if (bpp < 15)
{
clientCon->rdp_Bpp = 1;
clientCon->rdp_Bpp_mask = 0xff;
}
else if (bpp == 15)
{
clientCon->rdp_Bpp = 2;
clientCon->rdp_Bpp_mask = 0x7fff;
}
else if (bpp == 16)
{
clientCon->rdp_Bpp = 2;
clientCon->rdp_Bpp_mask = 0xffff;
}
else if (bpp > 16)
{
clientCon->rdp_Bpp = 4;
clientCon->rdp_Bpp_mask = 0xffffff;
}
// todo
#if 0
if (g_use_shmem)
{
if (g_shmemptr != 0)
{
shmdt(g_shmemptr);
}
bytes = g_rdpScreen.rdp_width * g_rdpScreen.rdp_height *
g_rdpScreen.rdp_Bpp;
g_shmemid = shmget(IPC_PRIVATE, bytes, IPC_CREAT | 0777);
g_shmemptr = shmat(g_shmemid, 0, 0);
shmctl(g_shmemid, IPC_RMID, NULL);
LLOGLN(0, ("rdpClientConProcessScreenSizeMsg: g_shmemid %d g_shmemptr %p",
g_shmemid, g_shmemptr));
g_shmem_lineBytes = g_rdpScreen.rdp_Bpp * g_rdpScreen.rdp_width;
if (g_shm_reg != 0)
{
RegionDestroy(g_shm_reg);
}
g_shm_reg = RegionCreate(NullBox, 0);
}
#endif
mmwidth = PixelToMM(width);
mmheight = PixelToMM(height);
// todo
#if 0
pSize = RRRegisterSize(g_pScreen, width, height, mmwidth, mmheight);
RRSetCurrentConfig(g_pScreen, RR_Rotate_0, 0, pSize);
if ((g_rdpScreen.width != width) || (g_rdpScreen.height != height))
{
LLOGLN(0, (" calling RRScreenSizeSet"));
ok = RRScreenSizeSet(g_pScreen, width, height, mmwidth, mmheight);
LLOGLN(0, (" RRScreenSizeSet ok=[%d]", ok));
}
#endif
return 0;
}
/******************************************************************************/ /******************************************************************************/
static int static int
rdpClientConProcessMsgClientInput(rdpPtr dev, rdpClientCon *clientCon) rdpClientConProcessMsgClientInput(rdpPtr dev, rdpClientCon *clientCon)
@ -539,9 +643,14 @@ rdpClientConProcessMsgClientInput(rdpPtr dev, rdpClientCon *clientCon)
} }
else if (msg == 200) /* invalidate */ else if (msg == 200) /* invalidate */
{ {
rdpClientConBeginUpdate(dev, clientCon);
rdpClientConSetFgcolor(dev, clientCon, 0x00ff0000);
rdpClientConFillRect(dev, clientCon, 0, 0, dev->width, dev->height);
rdpClientConEndUpdate(dev, clientCon);
} }
else if (msg == 300) /* resize desktop */ else if (msg == 300) /* resize desktop */
{ {
rdpClientConProcessScreenSizeMsg(dev, clientCon, param1, param2, param3);
} }
else if (msg == 301) /* version */ else if (msg == 301) /* version */
{ {
@ -561,10 +670,89 @@ static int
rdpClientConProcessMsgClientInfo(rdpPtr dev, rdpClientCon *clientCon) rdpClientConProcessMsgClientInfo(rdpPtr dev, rdpClientCon *clientCon)
{ {
struct stream *s; struct stream *s;
int bytes;
int i1;
LLOGLN(0, ("rdpClientConProcessMsgClientInfo:")); LLOGLN(0, ("rdpClientConProcessMsgClientInfo:"));
s = clientCon->in_s; s = clientCon->in_s;
g_hexdump(s->p, s->end - s->p); in_uint32_le(s, bytes);
if (bytes > sizeof(clientCon->client_info))
{
bytes = sizeof(clientCon->client_info);
}
memcpy(&(clientCon->client_info), s->p - 4, bytes);
clientCon->client_info.size = bytes;
LLOGLN(0, (" got client info bytes %d", bytes));
LLOGLN(0, (" jpeg support %d", clientCon->client_info.jpeg));
i1 = clientCon->client_info.offscreen_support_level;
LLOGLN(0, (" offscreen support %d", i1));
i1 = clientCon->client_info.offscreen_cache_size;
LLOGLN(0, (" offscreen size %d", i1));
i1 = clientCon->client_info.offscreen_cache_entries;
LLOGLN(0, (" offscreen entries %d", i1));
if (clientCon->client_info.offscreen_support_level > 0)
{
if (clientCon->client_info.offscreen_cache_entries > 0)
{
clientCon->maxOsBitmaps = clientCon->client_info.offscreen_cache_entries;
g_free(clientCon->osBitmaps);
clientCon->osBitmaps = (struct rdpup_os_bitmap *)
g_malloc(sizeof(struct rdpup_os_bitmap) * clientCon->maxOsBitmaps, 1);
}
}
if (clientCon->client_info.orders[0x1b]) /* 27 NEG_GLYPH_INDEX_INDEX */
{
LLOGLN(0, (" client supports glyph cache but server disabled"));
//clientCon->doGlyphCache = 1;
}
if (clientCon->client_info.order_flags_ex & 0x100)
{
clientCon->doComposite = 1;
}
if (clientCon->doGlyphCache)
{
LLOGLN(0, (" using glyph cache"));
}
if (clientCon->doComposite)
{
LLOGLN(0, (" using client composite"));
}
LLOGLN(10, ("order_flags_ex 0x%x", clientCon->client_info.order_flags_ex));
if (clientCon->client_info.offscreen_cache_entries == 2000)
{
LLOGLN(0, (" client can do offscreen to offscreen blits"));
clientCon->canDoPixToPix = 1;
}
else
{
LLOGLN(0, (" client can not do offscreen to offscreen blits"));
clientCon->canDoPixToPix = 0;
}
if (clientCon->client_info.pointer_flags & 1)
{
LLOGLN(0, (" client can do new(color) cursor"));
}
else
{
LLOGLN(0, (" client can not do new(color) cursor"));
}
if (clientCon->client_info.monitorCount > 0)
{
LLOGLN(0, (" client can do multimon"));
LLOGLN(0, (" client monitor data, monitorCount= %d", clientCon->client_info.monitorCount));
clientCon->doMultimon = 1;
}
else
{
LLOGLN(0, (" client can not do multimon"));
clientCon->doMultimon = 0;
}
//rdpLoadLayout(g_rdpScreen.client_info.keylayout);
return 0; return 0;
} }
@ -613,14 +801,17 @@ rdpClientConProcessMsg(rdpPtr dev, rdpClientCon *clientCon)
static int static int
rdpClientConGotData(ScreenPtr pScreen, rdpPtr dev, rdpClientCon *clientCon) rdpClientConGotData(ScreenPtr pScreen, rdpPtr dev, rdpClientCon *clientCon)
{ {
int rv;
LLOGLN(10, ("rdpClientConGotData:")); LLOGLN(10, ("rdpClientConGotData:"));
if (rdpClientConRecvMsg(dev, clientCon) == 0) rv = rdpClientConRecvMsg(dev, clientCon);
if (rv == 0)
{ {
rdpClientConProcessMsg(dev, clientCon); rv = rdpClientConProcessMsg(dev, clientCon);
} }
return 0; return rv;
} }
/******************************************************************************/ /******************************************************************************/
@ -716,21 +907,36 @@ rdpClientConCheck(ScreenPtr pScreen)
{ {
if (FD_ISSET(LTOUI32(clientCon->sck), &rfds)) if (FD_ISSET(LTOUI32(clientCon->sck), &rfds))
{ {
rdpClientConGotData(pScreen, dev, clientCon); if (rdpClientConGotData(pScreen, dev, clientCon) != 0)
{
LLOGLN(0, ("rdpClientConCheck: rdpClientConGotData failed"));
clientCon = dev->clientConHead;
continue;
}
} }
} }
if (clientCon->sckControlListener > 0) if (clientCon->sckControlListener > 0)
{ {
if (FD_ISSET(LTOUI32(clientCon->sckControlListener), &rfds)) if (FD_ISSET(LTOUI32(clientCon->sckControlListener), &rfds))
{ {
rdpClientConGotControlConnection(pScreen, dev, clientCon); if (rdpClientConGotControlConnection(pScreen, dev, clientCon) != 0)
{
LLOGLN(0, ("rdpClientConCheck: rdpClientConGotControlConnection failed"));
clientCon = dev->clientConHead;
continue;
}
} }
} }
if (clientCon->sckControl > 0) if (clientCon->sckControl > 0)
{ {
if (FD_ISSET(LTOUI32(clientCon->sckControl), &rfds)) if (FD_ISSET(LTOUI32(clientCon->sckControl), &rfds))
{ {
rdpClientConGotControlData(pScreen, dev, clientCon); if (rdpClientConGotControlData(pScreen, dev, clientCon) != 0)
{
LLOGLN(0, ("rdpClientConCheck: rdpClientConGotControlData failed"));
clientCon = dev->clientConHead;
continue;
}
} }
} }
clientCon = clientCon->next; clientCon = clientCon->next;
@ -1612,3 +1818,72 @@ rdpClientConCheckDirtyScreen(rdpPtr dev, rdpClientCon *clientCon)
{ {
return 0; return 0;
} }
/******************************************************************************/
int
rdpClientConAddDirtyScreenReg(rdpPtr dev, rdpClientCon *clientCon,
RegionPtr reg)
{
rdpRegionUnion(clientCon->dirtyRegion, clientCon->dirtyRegion, reg);
return 0;
}
/******************************************************************************/
void
rdpClientConGetScreenImageRect(rdpPtr dev, rdpClientCon *clientCon,
struct image_data *id)
{
id->width = dev->width;
id->height = dev->height;
id->bpp = clientCon->rdp_bpp;
id->Bpp = clientCon->rdp_Bpp;
id->lineBytes = dev->paddedWidthInBytes;
id->pixels = dev->pfbMemory;
id->shmem_pixels = g_shmemptr;
id->shmem_id = g_shmemid;
id->shmem_offset = 0;
id->shmem_lineBytes = g_shmem_lineBytes;
}
/******************************************************************************/
void
rdpClientConGetPixmapImageRect(rdpPtr dev, rdpClientCon *clientCon,
PixmapPtr pPixmap, struct image_data *id)
{
id->width = pPixmap->drawable.width;
id->height = pPixmap->drawable.height;
id->bpp = g_rdpScreen.rdp_bpp;
id->Bpp = g_rdpScreen.rdp_Bpp;
id->lineBytes = pPixmap->devKind;
id->pixels = (char *)(pPixmap->devPrivate.ptr);
id->shmem_pixels = 0;
id->shmem_id = 0;
id->shmem_offset = 0;
id->shmem_lineBytes = 0;
}
/******************************************************************************/
void
rdpClientConSendArea(struct image_data *id, int x, int y, int w, int h)
{
struct image_data lid;
LLOGLN(10, ("rdpClientConSendArea: id %p x %d y %d w %d h %d", id, x, y, w, h));
if (id == 0)
{
rdpup_get_screen_image_rect(&lid);
id = &lid;
}
if (x >= id->width)
{
return;
}
if (y >= id->height)
{
return;
}
}

@ -21,6 +21,10 @@ Client connection to xrdp
*/ */
/* in xrdp/common */
#include "xrdp_client_info.h"
#include "xrdp_constants.h"
#ifndef _RDPCLIENTCON_H #ifndef _RDPCLIENTCON_H
#define _RDPCLIENTCON_H #define _RDPCLIENTCON_H
@ -63,9 +67,16 @@ struct _rdpClientCon
int osBitmapStamp; int osBitmapStamp;
int osBitmapAllocSize; int osBitmapAllocSize;
int osBitmapNumUsed; int osBitmapNumUsed;
int doComposite;
int doGlyphCache;
int canDoPixToPix;
int doMultimon;
int rdp_bpp; /* client depth */ int rdp_bpp; /* client depth */
int rdp_Bpp;
int rdp_Bpp_mask; int rdp_Bpp_mask;
int rdp_width;
int rdp_height;
int rdpIndex; /* current os target */ int rdpIndex; /* current os target */
@ -75,9 +86,22 @@ struct _rdpClientCon
struct font_cache font_cache[12][256]; struct font_cache font_cache[12][256];
int font_stamp; int font_stamp;
RegionPtr dirtyRegion;
struct xrdp_client_info client_info;
struct _rdpClientCon *next; struct _rdpClientCon *next;
}; };
int
rdpClientConBeginUpdate(rdpPtr dev, rdpClientCon *clientCon);
int
rdpClientConEndUpdate(rdpPtr dev, rdpClientCon *clientCon);
int
rdpClientConSetFgcolor(rdpPtr dev, rdpClientCon *clientCon, int fgcolor);
int
rdpClientConFillRect(rdpPtr dev, rdpClientCon *clientCon,
short x, short y, int cx, int cy);
int int
rdpClientConCheck(ScreenPtr pScreen); rdpClientConCheck(ScreenPtr pScreen);
int int
@ -95,6 +119,9 @@ void
rdpClientConScheduleDeferredUpdate(rdpPtr dev); rdpClientConScheduleDeferredUpdate(rdpPtr dev);
int int
rdpClientConCheckDirtyScreen(rdpPtr dev, rdpClientCon *clientCon); rdpClientConCheckDirtyScreen(rdpPtr dev, rdpClientCon *clientCon);
int
rdpClientConAddDirtyScreenReg(rdpPtr dev, rdpClientCon *clientCon,
RegionPtr reg);
#endif #endif

@ -48,6 +48,106 @@ misc draw calls
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
/******************************************************************************/
/* return 0, draw nothing */
/* return 1, draw with no clip */
/* return 2, draw using clip */
int
rdpDrawGetClip(rdpPtr dev, RegionPtr pRegion, DrawablePtr pDrawable, GCPtr pGC)
{
WindowPtr pWindow;
RegionPtr temp;
BoxRec box;
int rv;
rv = 0;
if (pDrawable->type == DRAWABLE_PIXMAP)
{
switch (pGC->clientClipType)
{
case CT_NONE:
rv = 1;
break;
case CT_REGION:
rv = 2;
rdpRegionCopy(pRegion, pGC->clientClip);
break;
default:
LLOGLN(0, ("rdpDrawGetClip: unimp clip type %d",
pGC->clientClipType));
break;
}
if (rv == 2) /* check if the clip is the entire pixmap */
{
box.x1 = 0;
box.y1 = 0;
box.x2 = pDrawable->width;
box.y2 = pDrawable->height;
if (rdpRegionContainsRect(pRegion, &box) == rgnIN)
{
rv = 1;
}
}
}
else if (pDrawable->type == DRAWABLE_WINDOW)
{
pWindow = (WindowPtr)pDrawable;
if (pWindow->viewable)
{
if (pGC->subWindowMode == IncludeInferiors)
{
temp = &pWindow->borderClip;
}
else
{
temp = &pWindow->clipList;
}
if (RegionNotEmpty(temp))
{
switch (pGC->clientClipType)
{
case CT_NONE:
rv = 2;
rdpRegionCopy(pRegion, temp);
break;
case CT_REGION:
rv = 2;
rdpRegionCopy(pRegion, pGC->clientClip);
rdpRegionTranslate(pRegion,
pDrawable->x + pGC->clipOrg.x,
pDrawable->y + pGC->clipOrg.y);
rdpRegionIntersect(pRegion, pRegion, temp);
break;
default:
LLOGLN(0, ("rdpDrawGetClip: unimp clip type %d",
pGC->clientClipType));
break;
}
if (rv == 2) /* check if the clip is the entire screen */
{
box.x1 = 0;
box.y1 = 0;
box.x2 = dev->width;
box.y2 = dev->height;
if (rdpRegionContainsRect(pRegion, &box) == rgnIN)
{
rv = 1;
}
}
}
}
}
return rv;
}
/******************************************************************************/ /******************************************************************************/
int int
rdpDrawItemAdd(rdpPtr dev, rdpPixmapRec *priv, struct rdp_draw_item *di) rdpDrawItemAdd(rdpPtr dev, rdpPixmapRec *priv, struct rdp_draw_item *di)

@ -50,6 +50,8 @@ do { \
extern GCOps g_rdpGCOps; /* in rdpGC.c */ extern GCOps g_rdpGCOps; /* in rdpGC.c */
int
rdpDrawGetClip(rdpPtr dev, RegionPtr pRegion, DrawablePtr pDrawable, GCPtr pGC);
int int
rdpDrawItemAdd(rdpPtr dev, rdpPixmapRec *priv, struct rdp_draw_item *di); rdpDrawItemAdd(rdpPtr dev, rdpPixmapRec *priv, struct rdp_draw_item *di);
int int

@ -33,6 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "rdp.h" #include "rdp.h"
#include "rdpDraw.h" #include "rdpDraw.h"
#include "rdpClientCon.h" #include "rdpClientCon.h"
#include "rdpReg.h"
#define LOG_LEVEL 1 #define LOG_LEVEL 1
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
@ -40,9 +41,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/******************************************************************************/ /******************************************************************************/
static void static void
rdpPolyFillRectPre(rdpClientCon *clientCon, rdpPolyFillRectPre(rdpPtr dev, rdpClientCon *clientCon,
DrawablePtr pDrawable, GCPtr pGC, int nrectFill, int cd, RegionPtr clip_reg,
xRectangle *prectInit) DrawablePtr pDrawable, GCPtr pGC, RegionPtr fill_reg)
{ {
} }
@ -60,10 +61,31 @@ rdpPolyFillRectOrg(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
/******************************************************************************/ /******************************************************************************/
static void static void
rdpPolyFillRectPost(rdpClientCon *clientCon, rdpPolyFillRectPost(rdpPtr dev, rdpClientCon *clientCon,
DrawablePtr pDrawable, GCPtr pGC, int nrectFill, int cd, RegionPtr clip_reg,
xRectangle *prectInit) DrawablePtr pDrawable, GCPtr pGC, RegionPtr fill_reg)
{
BoxRec box;
WindowPtr pDstWnd;
if (cd == 0)
{ {
return;
}
if (pDrawable->type != DRAWABLE_WINDOW)
{
return;
}
pDstWnd = (WindowPtr) pDrawable;
if (pDstWnd->viewable == FALSE)
{
return;
}
if (cd == 2)
{
rdpRegionIntersect(fill_reg, clip_reg, fill_reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, fill_reg);
} }
/******************************************************************************/ /******************************************************************************/
@ -73,13 +95,25 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
{ {
rdpPtr dev; rdpPtr dev;
rdpClientCon *clientCon; rdpClientCon *clientCon;
RegionRec clip_reg;
RegionPtr fill_reg;
int cd;
LLOGLN(10, ("rdpPolyFillRect:")); LLOGLN(10, ("rdpPolyFillRect:"));
dev = rdpGetDevFromScreen(pGC->pScreen); dev = rdpGetDevFromScreen(pGC->pScreen);
/* make a copy of rects */
fill_reg = rdpRegionFromRects(nrectFill, prectInit, CT_NONE);
rdpRegionTranslate(fill_reg, pDrawable->x, pDrawable->y);
rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(0, ("rdpPolyFillRect: cd %d", cd));
clientCon = dev->clientConHead; clientCon = dev->clientConHead;
while (clientCon != NULL) while (clientCon != NULL)
{ {
rdpPolyFillRectPre(clientCon, pDrawable, pGC, nrectFill, prectInit); rdpPolyFillRectPre(dev, clientCon, cd, &clip_reg, pDrawable,
pGC, fill_reg);
clientCon = clientCon->next; clientCon = clientCon->next;
} }
/* do original call */ /* do original call */
@ -87,7 +121,10 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
clientCon = dev->clientConHead; clientCon = dev->clientConHead;
while (clientCon != NULL) while (clientCon != NULL)
{ {
rdpPolyFillRectPost(clientCon, pDrawable, pGC, nrectFill, prectInit); rdpPolyFillRectPost(dev, clientCon, cd, &clip_reg, pDrawable,
pGC, fill_reg);
clientCon = clientCon->next; clientCon = clientCon->next;
} }
RegionUninit(&clip_reg);
rdpRegionDestroy(fill_reg);
} }

@ -1,7 +1,8 @@
OBJS = xrdpdev.o OBJS = xrdpdev.o
CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 -I../module CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 \
-I../module -I../../../common
LDFLAGS = LDFLAGS =

@ -542,6 +542,10 @@ rdpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
LLOGLN(0, ("rdpScreenInit: rdpClientConInit failed")); LLOGLN(0, ("rdpScreenInit: rdpClientConInit failed"));
} }
dev->Bpp_mask = 0x00FFFFFF;
dev->Bpp = 4;
dev->bitsPerPixel = 32;
LLOGLN(0, ("rdpScreenInit: out")); LLOGLN(0, ("rdpScreenInit: out"));
return TRUE; return TRUE;
} }

@ -1,7 +1,8 @@
OBJS = rdpKeyboard.o OBJS = rdpKeyboard.o
CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 -I../module CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 \
-I../module -I../../../common
LDFLAGS = LDFLAGS =

@ -1,7 +1,8 @@
OBJS = rdpMouse.o OBJS = rdpMouse.o
CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 -I../module CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 \
-I../module -I../../../common
LDFLAGS = LDFLAGS =

Loading…
Cancel
Save