diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-03-06 15:49:04 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-03-16 10:53:29 +0000 |
commit | d6b7f96fde1add92fd11f5a75869ae6fc688bf77 (patch) | |
tree | b1be185b912e456396850e0bacc4514e13f79785 /src/i915_render.c | |
parent | 910fd171a00227025abc8bcc286a740f5bae895b (diff) |
Fill alpha on xrgb images.
Do not try to fixup the alpha in the ff/shaders as this has the
side-effect of overriding the alpha value of the border color, causing
images to be padded with black rather than transparent. This can
generate large and obnoxious visual artefacts.
Fixes:
Bug 17933 - x8r8g8b8 doesn't sample alpha=0 outside surface bounds
http://bugs.freedesktop.org/show_bug.cgi?id=17933
and many related cairo test suite failures.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/i915_render.c')
-rw-r--r-- | src/i915_render.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/i915_render.c b/src/i915_render.c index 37af72b9..c4aa9a44 100644 --- a/src/i915_render.c +++ b/src/i915_render.c @@ -385,8 +385,9 @@ i915_prepare_composite(int op, PicturePtr source_picture, source_picture->format, PICT_a8r8g8b8, &intel->render_source_solid)) - return FALSE; - } else if (!intel_check_pitch_3d(source)) + intel->render_source_is_solid = FALSE; + } + if (!intel->render_source_is_solid && !intel_check_pitch_3d(source)) return FALSE; @@ -402,8 +403,9 @@ i915_prepare_composite(int op, PicturePtr source_picture, mask_picture->format, PICT_a8r8g8b8, &intel->render_mask_solid)) - return FALSE; - } else if (!intel_check_pitch_3d(mask)) + intel->render_mask_is_solid = FALSE; + } + if (!intel->render_mask_is_solid && !intel_check_pitch_3d(mask)) return FALSE; } @@ -475,7 +477,6 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn) { intel_screen_private *intel = intel_get_screen_private(scrn); int op = intel->i915_render_state.op; - PicturePtr source_picture = intel->render_source_picture; PicturePtr mask_picture = intel->render_mask_picture; PicturePtr dest_picture = intel->render_dest_picture; PixmapPtr mask = intel->render_mask; @@ -589,7 +590,6 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn) OUT_BATCH(0x00000000); } - OUT_BATCH(MI_NOOP); ADVANCE_BATCH(); { @@ -629,10 +629,6 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn) i915_fs_texldp(FS_R0, FS_S0, FS_T0); } - /* If the texture lacks an alpha channel, force the alpha to 1. */ - if (PICT_FORMAT_A(source_picture->format) == 0) - i915_fs_mov_masked(FS_R0, MASK_W, i915_fs_operand_one()); - src_reg = FS_R0; } @@ -647,11 +643,6 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn) } else { i915_fs_texldp(FS_R1, FS_S0 + t, FS_T0 + t); } - /* If the texture lacks an alpha channel, force the alpha to 1. - */ - if (PICT_FORMAT_A(mask_picture->format) == 0) - i915_fs_mov_masked(FS_R1, MASK_W, - i915_fs_operand_one()); mask_reg = FS_R1; } |