From d645dc65b6c5e7d46538e98208a703f0f7a5d20b Mon Sep 17 00:00:00 2001 From: Christian König Date: Sat, 25 Feb 2012 13:53:29 +0100 Subject: vl/compositor: replace pipe_video_rect with u_rect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So we support things like flipping also. Signed-off-by: Christian König --- src/gallium/state_trackers/vdpau/mixer.c | 2 +- src/gallium/state_trackers/vdpau/output.c | 5 ++--- src/gallium/state_trackers/vdpau/presentation.c | 19 +++++++++---------- src/gallium/state_trackers/vdpau/vdpau_private.h | 12 ++++++------ 4 files changed, 18 insertions(+), 20 deletions(-) (limited to 'src/gallium/state_trackers/vdpau') diff --git a/src/gallium/state_trackers/vdpau/mixer.c b/src/gallium/state_trackers/vdpau/mixer.c index ac0ce86beeb..ead9323eb8f 100644 --- a/src/gallium/state_trackers/vdpau/mixer.c +++ b/src/gallium/state_trackers/vdpau/mixer.c @@ -204,7 +204,7 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer, uint32_t layer_count, VdpLayer const *layers) { - struct pipe_video_rect src_rect, dst_rect, dst_clip; + struct u_rect src_rect, dst_rect, dst_clip; enum vl_compositor_deinterlace deinterlace; unsigned layer = 0; diff --git a/src/gallium/state_trackers/vdpau/output.c b/src/gallium/state_trackers/vdpau/output.c index 0583c52fe82..0ea502939c3 100644 --- a/src/gallium/state_trackers/vdpau/output.c +++ b/src/gallium/state_trackers/vdpau/output.c @@ -214,7 +214,7 @@ vlVdpOutputSurfacePutBitsIndexed(VdpOutputSurface surface, struct pipe_sampler_view *sv_idx = NULL, *sv_tbl = NULL; struct pipe_box box; - struct pipe_video_rect dst_rect; + struct u_rect dst_rect; vlsurface = vlGetDataHTAB(surface); if (!vlsurface) @@ -448,8 +448,7 @@ vlVdpOutputSurfaceRenderOutputSurface(VdpOutputSurface destination_surface, struct vl_compositor *compositor; struct vl_compositor_state *cstate; - struct pipe_video_rect src_rect; - struct pipe_video_rect dst_rect; + struct u_rect src_rect, dst_rect; void *blend; diff --git a/src/gallium/state_trackers/vdpau/presentation.c b/src/gallium/state_trackers/vdpau/presentation.c index 71447793f58..4d12bb3e700 100644 --- a/src/gallium/state_trackers/vdpau/presentation.c +++ b/src/gallium/state_trackers/vdpau/presentation.c @@ -202,8 +202,7 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue, struct pipe_context *pipe; struct pipe_resource *tex; struct pipe_surface surf_templ, *surf_draw; - struct pipe_video_rect src_rect, dst_clip; - struct u_rect *dirty_area; + struct u_rect src_rect, dst_clip, *dirty_area; struct vl_compositor *compositor; @@ -231,15 +230,15 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue, surf->timestamp = (vlVdpTime)earliest_presentation_time; - src_rect.x = 0; - src_rect.y = 0; - src_rect.w = surf_draw->width; - src_rect.h = surf_draw->height; + src_rect.x0 = 0; + src_rect.y0 = 0; + src_rect.x1 = surf_draw->width; + src_rect.y1 = surf_draw->height; - dst_clip.x = 0; - dst_clip.y = 0; - dst_clip.w = clip_width ? clip_width : surf_draw->width; - dst_clip.h = clip_height ? clip_height : surf_draw->height; + dst_clip.x0 = 0; + dst_clip.y0 = 0; + dst_clip.x1 = clip_width ? clip_width : surf_draw->width; + dst_clip.y1 = clip_height ? clip_height : surf_draw->height; vl_compositor_clear_layers(&pq->cstate); vl_compositor_set_rgba_layer(&pq->cstate, compositor, 0, surf->sampler_view, &src_rect, NULL); diff --git a/src/gallium/state_trackers/vdpau/vdpau_private.h b/src/gallium/state_trackers/vdpau/vdpau_private.h index e74c68187d2..1b617847d4a 100644 --- a/src/gallium/state_trackers/vdpau/vdpau_private.h +++ b/src/gallium/state_trackers/vdpau/vdpau_private.h @@ -270,14 +270,14 @@ PipeToProfile(enum pipe_video_profile p_profile) } } -static inline struct pipe_video_rect * -RectToPipe(const VdpRect *src, struct pipe_video_rect *dst) +static inline struct u_rect * +RectToPipe(const VdpRect *src, struct u_rect *dst) { if (src) { - dst->x = MIN2(src->x1, src->x0); - dst->y = MIN2(src->y1, src->y0); - dst->w = abs(src->x1 - src->x0); - dst->h = abs(src->y1 - src->y0); + dst->x0 = src->x0; + dst->y0 = src->y0; + dst->x1 = src->x1; + dst->y1 = src->y1; return dst; } return NULL; -- cgit v1.2.3