Commits : Individual Commit

  Analyzed 6 days ago based on code collected 6 days ago.

Commit ID 7a2e0f7b30cb08905820efc1d53878e12674dac6

Anon80 Contributor: Sam Lantinga Files Modified: 1
Date: 21-February-2012 at 01:55 Lines Added: 8
Repository: http://hg.libsdl.org/SDL Lines Removed: 0
Commit Comment: Fixed bug 1424 - Handling of alpha channel in Altivec accelerated blit functions

evilbite 2012-02-19 09:38:21 PST

There is only one Altivec accelerated blit function
(ConvertAltivec32to32_prefetch() or ConvertAltivec32to32_noprefetch(),
depending on the CPU used) that is supposed to handle all alpha combinations.
This works as follows for every pixel line:
1. Blit single pixels until an aligned address is reached
2. Accelerated blit as far as possible
3. Blit single remaining pixels
Part 2. is set up correctly to handle different combinations of the alpha
channels of the participating surfaces. Parts 1. and 3. only do a simple copy
of all the pixel's components from souce to destination. But when the source
surface has no alpha channel (Amask is 0, e.g. the video surface) the surface's
alpha value must be used instead. Otherwise crap (uninitialized data) is being
copied to the destiniation's alpha channel.

The attached patch is a quick'n'dirty solution to the problem. A more
sophisticated solution might require separate functions for different
combinations of the alpha channels of the participating surfaces.
 

Changes by Language

Language Code Added Code Removed Comments Added Comment Removed Blanks Added Blanks Removed
  C 8 0 0 0 0 0

Changes by File

Showing page 1 of 1
File Language Code Added Code Removed Comments Added Comment Removed Blanks Added Blanks Removed
src/video/SDL_blit_N.c C 8 0 0 0 0 0
 
 
 

Creative Commons License Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.