summaryrefslogtreecommitdiff
path: root/hw/xfree86/common
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2014-04-05 09:07:18 +0100
committerEric Anholt <eric@anholt.net>2014-08-06 20:12:20 -0700
commitea3f3b0786d58b2ba6a9bbf0a32e734670f54b73 (patch)
tree1d093302d634e618d6f3685989f0805cee8901a1 /hw/xfree86/common
parentb01cfe5f23766b9c13ed6bd889263d5d7a8a351d (diff)
xv: Move xf86 XV color key helper to core.
Color key overlay implementations want to reuse this code, and XF86's had bugs (to be fixed in the next commit). Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw/xfree86/common')
-rw-r--r--hw/xfree86/common/xf86xv.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index 3e31046b7..1c250b33c 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -1736,34 +1736,11 @@ void
xf86XVFillKeyHelperDrawable(DrawablePtr pDraw, CARD32 key, RegionPtr fillboxes)
{
ScreenPtr pScreen = pDraw->pScreen;
- ChangeGCVal pval[2];
- BoxPtr pbox = RegionRects(fillboxes);
- int i, nbox = RegionNumRects(fillboxes);
- xRectangle *rects;
- GCPtr gc;
if (!xf86ScreenToScrn(pScreen)->vtSema)
return;
- gc = GetScratchGC(pDraw->depth, pScreen);
- pval[0].val = key;
- pval[1].val = IncludeInferiors;
- (void) ChangeGC(NullClient, gc, GCForeground | GCSubwindowMode, pval);
- ValidateGC(pDraw, gc);
-
- rects = malloc(nbox * sizeof(xRectangle));
-
- for (i = 0; i < nbox; i++, pbox++) {
- rects[i].x = pbox->x1 - pDraw->x;
- rects[i].y = pbox->y1 - pDraw->y;
- rects[i].width = pbox->x2 - pbox->x1;
- rects[i].height = pbox->y2 - pbox->y1;
- }
-
- (*gc->ops->PolyFillRect) (pDraw, gc, nbox, rects);
-
- free(rects);
- FreeScratchGC(gc);
+ XvFillColorKey(pDraw, key, fillboxes);
}
void