summaryrefslogtreecommitdiff
path: root/hw/kdrive
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-08-23 10:56:22 -0700
committerEric Anholt <eric@anholt.net>2013-09-03 14:35:21 -0700
commit090de17d361dc9828203a2562565d6499998db46 (patch)
tree05936f45053fc93d128c273bb87dbf7ae5f6de4b /hw/kdrive
parent347d0fa6961c2b3dc4efd4e7cca8ef98cd3ea06e (diff)
ephyr: Garbage collect some dead XV clipping code.
Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
Diffstat (limited to 'hw/kdrive')
-rw-r--r--hw/kdrive/ephyr/ephyrvideo.c117
1 files changed, 4 insertions, 113 deletions
diff --git a/hw/kdrive/ephyr/ephyrvideo.c b/hw/kdrive/ephyr/ephyrvideo.c
index f4fcf728c..4a05721af 100644
--- a/hw/kdrive/ephyr/ephyrvideo.c
+++ b/hw/kdrive/ephyr/ephyrvideo.c
@@ -60,8 +60,6 @@ struct _EphyrPortPriv {
};
typedef struct _EphyrPortPriv EphyrPortPriv;
-static Bool DoSimpleClip(BoxPtr a_dst_drw, BoxPtr a_clipper, BoxPtr a_result);
-
static Bool ephyrLocalAtomToHost(int a_local_atom, int *a_host_atom);
static EphyrXVPriv *ephyrXVPrivNew(void);
@@ -178,49 +176,6 @@ adaptor_has_flags(const xcb_xv_adaptor_info_t *adaptor, uint32_t flags)
}
static Bool
-DoSimpleClip(BoxPtr a_dst_box, BoxPtr a_clipper, BoxPtr a_result)
-{
- BoxRec dstClippedBox;
-
- EPHYR_RETURN_VAL_IF_FAIL(a_dst_box && a_clipper && a_result, FALSE);
-
- /*
- * setup the clipbox inside the destination.
- */
- dstClippedBox.x1 = a_dst_box->x1;
- dstClippedBox.x2 = a_dst_box->x2;
- dstClippedBox.y1 = a_dst_box->y1;
- dstClippedBox.y2 = a_dst_box->y2;
-
- /*
- * if the cliper leftmost edge is inside
- * the destination area then the leftmost edge of the resulting
- * clipped box is the leftmost edge of the cliper.
- */
- if (a_clipper->x1 > dstClippedBox.x1)
- dstClippedBox.x1 = a_clipper->x1;
-
- /*
- * if the cliper top edge is inside the destination area
- * then the bottom horizontal edge of the resulting clipped box
- * is the bottom edge of the cliper
- */
- if (a_clipper->y1 > dstClippedBox.y1)
- dstClippedBox.y1 = a_clipper->y1;
-
- /*ditto for right edge */
- if (a_clipper->x2 < dstClippedBox.x2)
- dstClippedBox.x2 = a_clipper->x2;
-
- /*ditto for bottom edge */
- if (a_clipper->y2 < dstClippedBox.y2)
- dstClippedBox.y2 = a_clipper->y2;
-
- memcpy(a_result, &dstClippedBox, sizeof(dstClippedBox));
- return TRUE;
-}
-
-static Bool
ephyrLocalAtomToHost(int a_local_atom, int *a_host_atom)
{
xcb_connection_t *conn = hostx_get_xcbconn();
@@ -1158,25 +1113,12 @@ ephyrPutVideo(KdScreenInfo * a_info,
xcb_connection_t *conn = hostx_get_xcbconn();
xcb_gcontext_t gc;
EphyrPortPriv *port_priv = a_port_priv;
- BoxRec clipped_area, dst_box;
- int result = BadImplementation;
EPHYR_RETURN_VAL_IF_FAIL(a_info->pScreen, BadValue);
EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue);
EPHYR_LOG("enter\n");
- dst_box.x1 = a_drw_x;
- dst_box.x2 = a_drw_x + a_drw_w;
- dst_box.y1 = a_drw_y;
- dst_box.y2 = a_drw_y + a_drw_h;
-
- if (!DoSimpleClip(&dst_box,
- RegionExtents(a_clipping_region), &clipped_area)) {
- EPHYR_LOG_ERROR("failed to simple clip\n");
- goto out;
- }
-
gc = xcb_generate_id(conn);
xcb_create_gc(conn, gc, scrpriv->win, 0, NULL);
xcb_xv_put_video(conn, port_priv->port_number,
@@ -1185,11 +1127,8 @@ ephyrPutVideo(KdScreenInfo * a_info,
a_drw_x, a_drw_y, a_drw_w, a_drw_h);
xcb_free_gc(conn, gc);
- result = Success;
-
- out:
EPHYR_LOG("leave\n");
- return result;
+ return Success;
}
static int
@@ -1205,25 +1144,12 @@ ephyrGetVideo(KdScreenInfo * a_info,
xcb_connection_t *conn = hostx_get_xcbconn();
xcb_gcontext_t gc;
EphyrPortPriv *port_priv = a_port_priv;
- BoxRec clipped_area, dst_box;
- int result = BadImplementation;
EPHYR_RETURN_VAL_IF_FAIL(a_info && a_info->pScreen, BadValue);
EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue);
EPHYR_LOG("enter\n");
- dst_box.x1 = a_drw_x;
- dst_box.x2 = a_drw_x + a_drw_w;
- dst_box.y1 = a_drw_y;
- dst_box.y2 = a_drw_y + a_drw_h;
-
- if (!DoSimpleClip(&dst_box,
- RegionExtents(a_clipping_region), &clipped_area)) {
- EPHYR_LOG_ERROR("failed to simple clip\n");
- goto out;
- }
-
gc = xcb_generate_id(conn);
xcb_create_gc(conn, gc, scrpriv->win, 0, NULL);
xcb_xv_get_video(conn, port_priv->port_number,
@@ -1233,11 +1159,8 @@ ephyrGetVideo(KdScreenInfo * a_info,
xcb_free_gc(conn, gc);
- result = Success;
-
- out:
EPHYR_LOG("leave\n");
- return result;
+ return Success;
}
static int
@@ -1253,25 +1176,12 @@ ephyrPutStill(KdScreenInfo * a_info,
xcb_connection_t *conn = hostx_get_xcbconn();
xcb_gcontext_t gc;
EphyrPortPriv *port_priv = a_port_priv;
- BoxRec clipped_area, dst_box;
- int result = BadImplementation;
EPHYR_RETURN_VAL_IF_FAIL(a_info && a_info->pScreen, BadValue);
EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue);
EPHYR_LOG("enter\n");
- dst_box.x1 = a_drw_x;
- dst_box.x2 = a_drw_x + a_drw_w;
- dst_box.y1 = a_drw_y;
- dst_box.y2 = a_drw_y + a_drw_h;
-
- if (!DoSimpleClip(&dst_box,
- RegionExtents(a_clipping_region), &clipped_area)) {
- EPHYR_LOG_ERROR("failed to simple clip\n");
- goto out;
- }
-
gc = xcb_generate_id(conn);
xcb_create_gc(conn, gc, scrpriv->win, 0, NULL);
xcb_xv_put_still(conn, port_priv->port_number,
@@ -1280,11 +1190,8 @@ ephyrPutStill(KdScreenInfo * a_info,
a_drw_x, a_drw_y, a_drw_w, a_drw_h);
xcb_free_gc(conn, gc);
- result = Success;
-
- out:
EPHYR_LOG("leave\n");
- return result;
+ return Success;
}
static int
@@ -1300,25 +1207,12 @@ ephyrGetStill(KdScreenInfo * a_info,
xcb_connection_t *conn = hostx_get_xcbconn();
xcb_gcontext_t gc;
EphyrPortPriv *port_priv = a_port_priv;
- BoxRec clipped_area, dst_box;
- int result = BadImplementation;
EPHYR_RETURN_VAL_IF_FAIL(a_info && a_info->pScreen, BadValue);
EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue);
EPHYR_LOG("enter\n");
- dst_box.x1 = a_drw_x;
- dst_box.x2 = a_drw_x + a_drw_w;
- dst_box.y1 = a_drw_y;
- dst_box.y2 = a_drw_y + a_drw_h;
-
- if (!DoSimpleClip(&dst_box,
- RegionExtents(a_clipping_region), &clipped_area)) {
- EPHYR_LOG_ERROR("failed to simple clip\n");
- goto out;
- }
-
gc = xcb_generate_id(conn);
xcb_create_gc(conn, gc, scrpriv->win, 0, NULL);
xcb_xv_get_still(conn, port_priv->port_number,
@@ -1327,11 +1221,8 @@ ephyrGetStill(KdScreenInfo * a_info,
a_drw_x, a_drw_y, a_drw_w, a_drw_h);
xcb_free_gc(conn, gc);
- result = Success;
-
- out:
EPHYR_LOG("leave\n");
- return result;
+ return Success;
}
static int