summaryrefslogtreecommitdiffstats
path: root/xorg/server/module/rdpPolyArc.c
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2014-01-24 10:00:52 -0800
committerJay Sorg <jay.sorg@gmail.com>2014-01-24 10:00:52 -0800
commitf39ba98a4ff48a2e6a12cb27027a0b06d139c55a (patch)
tree56706101981867986ea9c4b1f1ee0d78e15588ed /xorg/server/module/rdpPolyArc.c
parent320ce8ba47d3d7c344b5de84844d1fa90e346fde (diff)
downloadxrdp-proprietary-f39ba98a4ff48a2e6a12cb27027a0b06d139c55a.tar.gz
xrdp-proprietary-f39ba98a4ff48a2e6a12cb27027a0b06d139c55a.zip
xorg: work on xorg driver
Diffstat (limited to 'xorg/server/module/rdpPolyArc.c')
-rw-r--r--xorg/server/module/rdpPolyArc.c86
1 files changed, 84 insertions, 2 deletions
diff --git a/xorg/server/module/rdpPolyArc.c b/xorg/server/module/rdpPolyArc.c
index fb7abee0..c3d6bef9 100644
--- a/xorg/server/module/rdpPolyArc.c
+++ b/xorg/server/module/rdpPolyArc.c
@@ -32,13 +32,24 @@ 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
+static void
+rdpPolyArcPre(rdpPtr dev, rdpClientCon *clientCon,
+ int cd, RegionPtr clip_reg,
+ DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs,
+ RegionPtr reg)
+{
+}
+
+/******************************************************************************/
+static void
rdpPolyArcOrg(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
{
GC_OP_VARS;
@@ -49,10 +60,81 @@ rdpPolyArcOrg(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
}
/******************************************************************************/
+static void
+rdpPolyArcPost(rdpPtr dev, rdpClientCon *clientCon,
+ int cd, RegionPtr clip_reg,
+ DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs,
+ RegionPtr reg)
+{
+ if (cd == XRDP_CD_NODRAW)
+ {
+ return;
+ }
+ if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable))
+ {
+ return;
+ }
+ if (cd == XRDP_CD_CLIP)
+ {
+ rdpRegionIntersect(reg, clip_reg, reg);
+ }
+ rdpClientConAddDirtyScreenReg(dev, clientCon, reg);
+}
+
+/******************************************************************************/
void
rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
{
- LLOGLN(0, ("rdpPolyArc:"));
+ rdpPtr dev;
+ rdpClientCon *clientCon;
+ BoxRec box;
+ int index;
+ int cd;
+ int lw;
+ int extra;
+ RegionRec clip_reg;
+ RegionRec reg;
+
+ LLOGLN(10, ("rdpPolyArc:"));
+ dev = rdpGetDevFromScreen(pGC->pScreen);
+ dev->counts.rdpPolyArcCallCount++;
+ rdpRegionInit(&reg, NullBox, 0);
+ if (narcs > 0)
+ {
+ lw = pGC->lineWidth;
+ if (lw == 0)
+ {
+ lw = 1;
+ }
+ extra = lw / 2;
+ for (index = 0; index < narcs; index++)
+ {
+ box.x1 = (parcs[index].x - extra) + pDrawable->x;
+ box.y1 = (parcs[index].y - extra) + pDrawable->y;
+ box.x2 = box.x1 + parcs[index].width + lw;
+ box.y2 = box.y1 + parcs[index].height + lw;
+ rdpRegionUnionRect(&reg, &box);
+ }
+ }
+ rdpRegionInit(&clip_reg, NullBox, 0);
+ cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
+ LLOGLN(10, ("rdpPolyArc: cd %d", cd));
+ clientCon = dev->clientConHead;
+ while (clientCon != NULL)
+ {
+ rdpPolyArcPre(dev, clientCon, cd, &clip_reg, pDrawable, pGC,
+ narcs, parcs, &reg);
+ clientCon = clientCon->next;
+ }
/* do original call */
rdpPolyArcOrg(pDrawable, pGC, narcs, parcs);
+ clientCon = dev->clientConHead;
+ while (clientCon != NULL)
+ {
+ rdpPolyArcPost(dev, clientCon, cd, &clip_reg, pDrawable, pGC,
+ narcs, parcs, &reg);
+ clientCon = clientCon->next;
+ }
+ rdpRegionUninit(&reg);
+ rdpRegionUninit(&clip_reg);
}