[Libva] [PATCH 4/4] i965_drv_video: fix subpic rendering with absolute screen coords.

Gwenole Beauchesne gb.devel at gmail.com
Mon Jun 27 21:42:06 PDT 2011


From: Gwenole Beauchesne <gwenole.beauchesne at intel.com>

---
 i965_drv_video/i965_render.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/i965_drv_video/i965_render.c b/i965_drv_video/i965_render.c
index 2cd5a14..e86464c 100644
--- a/i965_drv_video/i965_render.c
+++ b/i965_drv_video/i965_render.c
@@ -883,20 +883,15 @@ i965_subpic_render_upload_vertex(VADriverContextP ctx,
     struct i965_render_state *render_state = &i965->render_state;
     struct object_surface    *obj_surface  = SURFACE(surface);
     struct object_subpic     *obj_subpic   = SUBPIC(obj_surface->subpic);
-
-    const float sx = (float)output_rect->width  / obj_surface->orig_width;
-    const float sy = (float)output_rect->height / obj_surface->orig_height;
+    VARectangle dst_rect;
     float *vb, tx1, tx2, ty1, ty2, x1, x2, y1, y2;
     int i = 0;
 
-    VARectangle dst_rect;
-    if (obj_subpic->flags & VA_SUBPICTURE_DESTINATION_IS_SCREEN_COORD) {
-        dst_rect.x      = sx * obj_subpic->dst_rect.x;
-        dst_rect.y      = sy * obj_subpic->dst_rect.y;
-        dst_rect.width  = sx * obj_subpic->dst_rect.width;
-        dst_rect.height = sy * obj_subpic->dst_rect.height;
-    }
+    if (obj_subpic->flags & VA_SUBPICTURE_DESTINATION_IS_SCREEN_COORD)
+        dst_rect = obj_subpic->dst_rect;
     else {
+        const float sx  = (float)output_rect->width  / obj_surface->orig_width;
+        const float sy  = (float)output_rect->height / obj_surface->orig_height;
         dst_rect.x      = output_rect->x + sx * obj_subpic->dst_rect.x;
         dst_rect.y      = output_rect->y + sy * obj_subpic->dst_rect.y;
         dst_rect.width  = sx * obj_subpic->dst_rect.width;
-- 
1.7.4.1



More information about the Libva mailing list