diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2014-01-24 10:00:52 -0800 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2014-01-24 10:00:52 -0800 |
commit | f39ba98a4ff48a2e6a12cb27027a0b06d139c55a (patch) | |
tree | 56706101981867986ea9c4b1f1ee0d78e15588ed /xorg/server/module/rdpFillPolygon.c | |
parent | 320ce8ba47d3d7c344b5de84844d1fa90e346fde (diff) | |
download | xrdp-proprietary-f39ba98a4ff48a2e6a12cb27027a0b06d139c55a.tar.gz xrdp-proprietary-f39ba98a4ff48a2e6a12cb27027a0b06d139c55a.zip |
xorg: work on xorg driver
Diffstat (limited to 'xorg/server/module/rdpFillPolygon.c')
-rw-r--r-- | xorg/server/module/rdpFillPolygon.c | 98 |
1 files changed, 97 insertions, 1 deletions
diff --git a/xorg/server/module/rdpFillPolygon.c b/xorg/server/module/rdpFillPolygon.c index 405e50df..c97690d1 100644 --- a/xorg/server/module/rdpFillPolygon.c +++ b/xorg/server/module/rdpFillPolygon.c @@ -32,6 +32,8 @@ 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) \ @@ -39,6 +41,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /******************************************************************************/ void +rdpFillPolygonPre(rdpPtr dev, rdpClientCon *clientCon, + int cd, RegionPtr clip_reg, + DrawablePtr pDrawable, GCPtr pGC, + int shape, int mode, int count, + DDXPointPtr pPts, BoxPtr box) +{ +} + +/******************************************************************************/ +void rdpFillPolygonOrg(DrawablePtr pDrawable, GCPtr pGC, int shape, int mode, int count, DDXPointPtr pPts) @@ -52,11 +64,95 @@ rdpFillPolygonOrg(DrawablePtr pDrawable, GCPtr pGC, /******************************************************************************/ void +rdpFillPolygonPost(rdpPtr dev, rdpClientCon *clientCon, + int cd, RegionPtr clip_reg, + DrawablePtr pDrawable, GCPtr pGC, + int shape, int mode, int count, + DDXPointPtr pPts, BoxPtr box) +{ + RegionRec reg; + + if (cd == XRDP_CD_NODRAW) + { + return; + } + if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable)) + { + return; + } + rdpRegionInit(®, box, 0); + if (cd == XRDP_CD_CLIP) + { + rdpRegionIntersect(®, clip_reg, ®); + } + rdpClientConAddDirtyScreenReg(dev, clientCon, ®); + rdpRegionUninit(®); +} + +/******************************************************************************/ +void rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, int mode, int count, DDXPointPtr pPts) { - LLOGLN(0, ("rdpFillPolygon:")); + rdpPtr dev; + rdpClientCon *clientCon; + RegionRec clip_reg; + int cd; + int maxx; + int maxy; + int minx; + int miny; + int index; + int x; + int y; + BoxRec box; + + LLOGLN(10, ("rdpFillPolygon:")); + dev = rdpGetDevFromScreen(pGC->pScreen); + dev->counts.rdpFillPolygonCallCount++; + box.x1 = 0; + box.y1 = 0; + box.x2 = 0; + box.y2 = 0; + if (count > 0) + { + maxx = pPts[0].x; + maxy = pPts[0].y; + minx = maxx; + miny = maxy; + for (index = 1; index < count; index++) + { + x = pPts[index].x; + y = pPts[index].y; + maxx = RDPMAX(x, maxx); + minx = RDPMIN(x, minx); + maxy = RDPMAX(y, maxy); + miny = RDPMIN(y, miny); + } + box.x1 = pDrawable->x + minx; + box.y1 = pDrawable->y + miny; + box.x2 = pDrawable->x + maxx + 1; + box.y2 = pDrawable->y + maxy + 1; + } + rdpRegionInit(&clip_reg, NullBox, 0); + cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); + LLOGLN(10, ("rdpFillPolygon: cd %d", cd)); + clientCon = dev->clientConHead; + while (clientCon != NULL) + { + rdpFillPolygonPre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, + shape, mode, count, pPts, &box); + clientCon = clientCon->next; + } /* do original call */ rdpFillPolygonOrg(pDrawable, pGC, shape, mode, count, pPts); + clientCon = dev->clientConHead; + while (clientCon != NULL) + { + rdpFillPolygonPost(dev, clientCon, cd, &clip_reg, pDrawable, pGC, + shape, mode, count, pPts, &box); + clientCon = clientCon->next; + } + rdpRegionUninit(&clip_reg); } |