OSDN Git Service

Fix the alpha mask at getting derive images
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Fri, 3 Jun 2016 10:48:09 +0000 (12:48 +0200)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 22 Aug 2016 04:05:33 +0000 (12:05 +0800)
The alpha mask is set to 0x0 when getting derived images, regardless the
alpha channel in the RGB format. But,

When RGBx, the x means an alpha mask of 0x00000000
When RGBA, the A means an alpha mask of 0xff000000

This patch set the alpha mask correctly.

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
(cherry picked from commit e656d84dc512dc899dda4b9a8121b48f5148fc4b)

src/i965_drv_video.c

index 6c88be7..efac5a5 100644 (file)
@@ -4351,14 +4351,12 @@ VAStatus i965_DeriveImage(VADriverContextP ctx,
             image->format.red_mask = 0x000000ff;
             image->format.green_mask = 0x0000ff00;
             image->format.blue_mask = 0x00ff0000;
-            image->format.alpha_mask = 0x00000000;
             break;
         case VA_FOURCC_BGRA:
         case VA_FOURCC_BGRX:
             image->format.red_mask = 0x00ff0000;
             image->format.green_mask = 0x0000ff00;
             image->format.blue_mask = 0x000000ff;
-            image->format.alpha_mask = 0x00000000;
             break;
         default:
             goto error;
@@ -4367,10 +4365,12 @@ VAStatus i965_DeriveImage(VADriverContextP ctx,
         switch (image->format.fourcc) {
         case VA_FOURCC_RGBA:
         case VA_FOURCC_BGRA:
+            image->format.alpha_mask = 0xff000000;
             image->format.depth = 32;
             break;
         case VA_FOURCC_RGBX:
         case VA_FOURCC_BGRX:
+            image->format.alpha_mask = 0x00000000;
             image->format.depth = 24;
             break;
         default: