summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/xorg
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-04-13 19:32:49 +0200
committerChristian König <[email protected]>2011-04-13 19:32:49 +0200
commitefaf024f8c7c1000af06e54a85378818d55c5160 (patch)
treedbf9cc9ae38e9c018302f274fea4139f663fbe9c /src/gallium/state_trackers/xorg
parentc7b65dcaffeb9d0760c8ecad052f4c79297bfc8a (diff)
xvmc: use a pipe_video_rect for subpicture src & dst
Diffstat (limited to 'src/gallium/state_trackers/xorg')
-rw-r--r--src/gallium/state_trackers/xorg/xvmc/subpicture.c13
-rw-r--r--src/gallium/state_trackers/xorg/xvmc/surface.c7
-rw-r--r--src/gallium/state_trackers/xorg/xvmc/xvmc_private.h9
3 files changed, 13 insertions, 16 deletions
diff --git a/src/gallium/state_trackers/xorg/xvmc/subpicture.c b/src/gallium/state_trackers/xorg/xvmc/subpicture.c
index 31b1a96512f..68519c08885 100644
--- a/src/gallium/state_trackers/xorg/xvmc/subpicture.c
+++ b/src/gallium/state_trackers/xorg/xvmc/subpicture.c
@@ -417,6 +417,9 @@ Status XvMCBlendSubpicture(Display *dpy, XvMCSurface *target_surface, XvMCSubpic
short subx, short suby, unsigned short subw, unsigned short subh,
short surfx, short surfy, unsigned short surfw, unsigned short surfh)
{
+ struct pipe_video_rect src_rect = {subx, suby, subw, subh};
+ struct pipe_video_rect dst_rect = {surfx, surfy, surfw, surfh};
+
XvMCSurfacePrivate *surface_priv;
XvMCSubpicturePrivate *subpicture_priv;
@@ -439,16 +442,10 @@ Status XvMCBlendSubpicture(Display *dpy, XvMCSurface *target_surface, XvMCSubpic
subpicture_priv = subpicture->privData;
/* TODO: Assert rects are within bounds? Or clip? */
+ subpicture_priv->src_rect = src_rect;
+ subpicture_priv->dst_rect = dst_rect;
surface_priv->subpicture = subpicture;
- surface_priv->subx = subx;
- surface_priv->suby = suby;
- surface_priv->subw = subw;
- surface_priv->subh = subh;
- surface_priv->surfx = surfx;
- surface_priv->surfy = surfy;
- surface_priv->surfw = surfw;
- surface_priv->surfh = surfh;
subpicture_priv->surface = target_surface;
return Success;
diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c b/src/gallium/state_trackers/xorg/xvmc/surface.c
index c8c8638e581..f22d315c90d 100644
--- a/src/gallium/state_trackers/xorg/xvmc/surface.c
+++ b/src/gallium/state_trackers/xorg/xvmc/surface.c
@@ -431,14 +431,13 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable,
compositor->set_buffer_layer(compositor, 0, surface_priv->video_buffer, &src_rect, NULL);
if (subpicture_priv) {
- struct pipe_video_rect src_rect = {surface_priv->subx, surface_priv->suby, surface_priv->subw, surface_priv->subh};
- struct pipe_video_rect dst_rect = {surface_priv->surfx, surface_priv->surfy, surface_priv->surfw, surface_priv->surfh};
-
XVMC_MSG(XVMC_TRACE, "[XvMC] Surface %p has subpicture %p.\n", surface, surface_priv->subpicture);
assert(subpicture_priv->surface == surface);
+
if (subpicture_priv->palette)
- compositor->set_palette_layer(compositor, 1, subpicture_priv->sampler, subpicture_priv->palette, &src_rect, &dst_rect);
+ compositor->set_palette_layer(compositor, 1, subpicture_priv->sampler, subpicture_priv->palette,
+ &subpicture_priv->src_rect, &subpicture_priv->dst_rect);
else
compositor->set_rgba_layer(compositor, 1, subpicture_priv->sampler, &src_rect, &dst_rect);
diff --git a/src/gallium/state_trackers/xorg/xvmc/xvmc_private.h b/src/gallium/state_trackers/xorg/xvmc/xvmc_private.h
index b902d7d2817..056bdfc2f3c 100644
--- a/src/gallium/state_trackers/xorg/xvmc/xvmc_private.h
+++ b/src/gallium/state_trackers/xorg/xvmc/xvmc_private.h
@@ -31,6 +31,8 @@
#include <X11/Xlib.h>
#include <X11/extensions/XvMClib.h>
+#include <pipe/p_video_state.h>
+
#include <util/u_debug.h>
#include <util/u_math.h>
@@ -77,10 +79,6 @@ typedef struct
/* The subpicture associated with this surface, if any. */
XvMCSubpicture *subpicture;
- short subx, suby;
- unsigned short subw, subh;
- short surfx, surfy;
- unsigned short surfw, surfh;
/* Some XvMC functions take a surface but not a context,
so we keep track of which context each surface belongs to. */
@@ -94,6 +92,9 @@ typedef struct
/* optional palette for this subpicture */
struct pipe_sampler_view *palette;
+ struct pipe_video_rect src_rect;
+ struct pipe_video_rect dst_rect;
+
/* The surface this subpicture is currently associated with, if any. */
XvMCSurface *surface;