Added the SDL_VIDEO_YUV_DIRECT hack for better performance when the
authorSam Lantinga <slouken@lokigames.com>
Mon, 25 Jun 2001 22:16:44 +0000
changeset 811a2723474f12
parent 80 8806bc1eb80e
child 82 2bddc38a9f5d
Added the SDL_VIDEO_YUV_DIRECT hack for better performance when the
requested video mode is 16 bpp but the real video mode is 32 bpp.
src/video/SDL_yuv.c
     1.1 --- a/src/video/SDL_yuv.c	Sat Jun 23 22:02:27 2001 +0000
     1.2 +++ b/src/video/SDL_yuv.c	Mon Jun 25 22:16:44 2001 +0000
     1.3 @@ -48,13 +48,13 @@
     1.4  	overlay = NULL;
     1.5  
     1.6  	/* Display directly on video surface, if possible */
     1.7 -#if 0
     1.8 -	if ( (display == SDL_PublicSurface) &&
     1.9 -	     ((SDL_VideoSurface->format->BytesPerPixel == 2) ||
    1.10 -	      (SDL_VideoSurface->format->BytesPerPixel == 4)) ) {
    1.11 -		display = SDL_VideoSurface;
    1.12 +	if ( getenv("SDL_VIDEO_YUV_DIRECT") ) {
    1.13 +		if ( (display == SDL_PublicSurface) &&
    1.14 +		     ((SDL_VideoSurface->format->BytesPerPixel == 2) ||
    1.15 +		      (SDL_VideoSurface->format->BytesPerPixel == 4)) ) {
    1.16 +			display = SDL_VideoSurface;
    1.17 +		}
    1.18  	}
    1.19 -#endif
    1.20          yuv_hwaccel = getenv("SDL_VIDEO_YUV_HWACCEL");
    1.21  	if ( ((display == SDL_VideoSurface) && video->CreateYUVOverlay) &&
    1.22  	     (!yuv_hwaccel || (atoi(yuv_hwaccel) > 0)) ) {