summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/vl
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-07-15 17:20:55 +0200
committerChristian König <[email protected]>2011-07-15 17:36:02 +0200
commit2cbf532ae13513c3cbc7dad8ae41beeff931529e (patch)
treeb8154a4482045e352b74990524c388b367094f43 /src/gallium/auxiliary/vl
parenta3d23a4868e0d95971086df17e04ed9f9f5f3121 (diff)
g3dvl: correctly distinct dst area and clip area in the compositor
Otherwise xine won't scale correctly.
Diffstat (limited to 'src/gallium/auxiliary/vl')
-rw-r--r--src/gallium/auxiliary/vl/vl_compositor.c28
-rw-r--r--src/gallium/auxiliary/vl/vl_compositor.h1
2 files changed, 19 insertions, 10 deletions
diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c
index 0bd1baef41e..8018d061d54 100644
--- a/src/gallium/auxiliary/vl/vl_compositor.c
+++ b/src/gallium/auxiliary/vl/vl_compositor.c
@@ -239,8 +239,6 @@ init_pipe_state(struct vl_compositor *c)
c->viewport.scale[2] = 1;
c->viewport.scale[3] = 1;
- c->viewport.translate[0] = 0;
- c->viewport.translate[1] = 0;
c->viewport.translate[2] = 0;
c->viewport.translate[3] = 0;
@@ -653,6 +651,7 @@ vl_compositor_render(struct vl_compositor *c,
enum pipe_mpeg12_picture_type picture_type,
struct pipe_surface *dst_surface,
struct pipe_video_rect *dst_area,
+ struct pipe_video_rect *dst_clip,
struct pipe_fence_handle **fence)
{
struct pipe_scissor_state scissor;
@@ -663,15 +662,24 @@ vl_compositor_render(struct vl_compositor *c,
c->fb_state.width = dst_surface->width;
c->fb_state.height = dst_surface->height;
c->fb_state.cbufs[0] = dst_surface;
-
- c->viewport.scale[0] = dst_surface->width;
- c->viewport.scale[1] = dst_surface->height;
-
+
if (dst_area) {
- scissor.minx = dst_area->x;
- scissor.miny = dst_area->y;
- scissor.maxx = dst_area->x + dst_area->w;
- scissor.maxy = dst_area->y + dst_area->h;
+ c->viewport.scale[0] = dst_area->w;
+ c->viewport.scale[1] = dst_area->h;
+ c->viewport.translate[0] = dst_area->x;
+ c->viewport.translate[1] = dst_area->y;
+ } else {
+ c->viewport.scale[0] = dst_surface->width;
+ c->viewport.scale[1] = dst_surface->height;
+ c->viewport.translate[0] = 0;
+ c->viewport.translate[1] = 0;
+ }
+
+ if (dst_clip) {
+ scissor.minx = dst_clip->x;
+ scissor.miny = dst_clip->y;
+ scissor.maxx = dst_clip->x + dst_clip->w;
+ scissor.maxy = dst_clip->y + dst_clip->h;
} else {
scissor.minx = 0;
scissor.miny = 0;
diff --git a/src/gallium/auxiliary/vl/vl_compositor.h b/src/gallium/auxiliary/vl/vl_compositor.h
index df662db4d91..08ddc672b3b 100644
--- a/src/gallium/auxiliary/vl/vl_compositor.h
+++ b/src/gallium/auxiliary/vl/vl_compositor.h
@@ -158,6 +158,7 @@ vl_compositor_render(struct vl_compositor *compositor,
enum pipe_mpeg12_picture_type picture_type,
struct pipe_surface *dst_surface,
struct pipe_video_rect *dst_area,
+ struct pipe_video_rect *dst_clip,
struct pipe_fence_handle **fence);
/**