Don't render the target surface with background if alpha value is 0
authorXiang, Haihao <haihao.xiang@intel.com>
Wed, 30 May 2012 01:21:38 +0000 (09:21 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 30 May 2012 01:21:38 +0000 (09:21 +0800)
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
src/i965_post_processing.c

index b6038d2..de4c1f5 100755 (executable)
@@ -3724,7 +3724,7 @@ i965_vpp_clear_surface(VADriverContextP ctx,
     unsigned int blt_cmd, br13;
     unsigned int tiling = 0, swizzle = 0;
     int pitch;
-    unsigned char y, u, v, a;
+    unsigned char y, u, v, a = 0;
 
     /* Currently only support NV12 surface */
     if (!obj_surface || obj_surface->fourcc != VA_FOURCC('N', 'V', '1', '2'))
@@ -3732,6 +3732,9 @@ i965_vpp_clear_surface(VADriverContextP ctx,
 
     rgb_to_yuv(color, &y, &u, &v, &a);
 
+    if (a == 0)
+        return;
+
     dri_bo_get_tiling(obj_surface->bo, &tiling, &swizzle);
     blt_cmd = XY_COLOR_BLT_CMD;
     pitch = obj_surface->width;