summaryrefslogtreecommitdiffstats
path: root/xorg/server/module/rdpPolyFillArc.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg/server/module/rdpPolyFillArc.c')
-rw-r--r--xorg/server/module/rdpPolyFillArc.c85
1 files changed, 84 insertions, 1 deletions
diff --git a/xorg/server/module/rdpPolyFillArc.c b/xorg/server/module/rdpPolyFillArc.c
index 101ecdb0..438ed7b7 100644
--- a/xorg/server/module/rdpPolyFillArc.c
+++ b/xorg/server/module/rdpPolyFillArc.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
+rdpPolyFillArcPre(rdpPtr dev, rdpClientCon *clientCon,
+ int cd, RegionPtr clip_reg,
+ DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs,
+ RegionPtr reg)
+{
+}
+
+/******************************************************************************/
+static void
rdpPolyFillArcOrg(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
{
GC_OP_VARS;
@@ -49,10 +60,82 @@ rdpPolyFillArcOrg(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
}
/******************************************************************************/
+static void
+rdpPolyFillArcPost(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
rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
{
+ rdpPtr dev;
+ rdpClientCon *clientCon;
+ BoxRec box;
+ int index;
+ int cd;
+ int lw;
+ int extra;
+ RegionRec clip_reg;
+ RegionRec reg;
+
LLOGLN(0, ("rdpPolyFillArc:"));
+ dev = rdpGetDevFromScreen(pGC->pScreen);
+ dev->counts.rdpPolyFillArcCallCount++;
+ 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, ("rdpPolyFillArc: cd %d", cd));
+ clientCon = dev->clientConHead;
+ while (clientCon != NULL)
+ {
+ rdpPolyFillArcPre(dev, clientCon, cd, &clip_reg, pDrawable, pGC,
+ narcs, parcs, &reg);
+ clientCon = clientCon->next;
+ }
+
/* do original call */
rdpPolyFillArcOrg(pDrawable, pGC, narcs, parcs);
+ clientCon = dev->clientConHead;
+ while (clientCon != NULL)
+ {
+ rdpPolyFillArcPost(dev, clientCon, cd, &clip_reg, pDrawable, pGC,
+ narcs, parcs, &reg);
+ clientCon = clientCon->next;
+ }
+ rdpRegionUninit(&reg);
+ rdpRegionUninit(&clip_reg);
}