comparison src/video/x11/SDL_x11video.c @ 270:37fa1484f71b

From: "Mattias Engdeg�rd" <f91-men@nada.kth.se> To: slouken@devolution.com Subject: Re: [SDL] Question about SDL_FillRect() I benchmarked with and without clipping UpdateRects and was unable to find any difference on my moderately slow machine. Anyway, I haven't added clipping in this patch, but fixed a couple of bugs and generally cleaned up some of the X11 image code. Most importantly, UpdateRects now checks for both zero height and width. Also, I eliminated the entire code to byteswap X11 images since X11 can do that automatically if you ask it nicely :-)
author Sam Lantinga <slouken@libsdl.org>
date Fri, 18 Jan 2002 22:02:03 +0000
parents e8157fcb3114
children f6ffac90895c
comparison
equal deleted inserted replaced
269:4125b9859c71 270:37fa1484f71b
402 XIO_handler = XSetIOErrorHandler(xio_errhandler); 402 XIO_handler = XSetIOErrorHandler(xio_errhandler);
403 403
404 /* use default screen (from $DISPLAY) */ 404 /* use default screen (from $DISPLAY) */
405 SDL_Screen = DefaultScreen(SDL_Display); 405 SDL_Screen = DefaultScreen(SDL_Display);
406 406
407 use_mitshm = 0;
407 #ifndef NO_SHARED_MEMORY 408 #ifndef NO_SHARED_MEMORY
408 /* Check for MIT shared memory extension */ 409 /* Check for MIT shared memory extension */
409 use_mitshm = 0;
410 if ( local_X11 ) { 410 if ( local_X11 ) {
411 use_mitshm = XShmQueryExtension(SDL_Display); 411 use_mitshm = XShmQueryExtension(SDL_Display);
412 } 412 }
413 #endif /* NO_SHARED_MEMORY */ 413 #endif /* NO_SHARED_MEMORY */
414
415 /* See whether or not we need to swap pixels */
416 swap_pixels = 0;
417 if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) {
418 if ( XImageByteOrder(SDL_Display) == MSBFirst ) {
419 swap_pixels = 1;
420 }
421 } else {
422 if ( XImageByteOrder(SDL_Display) == LSBFirst ) {
423 swap_pixels = 1;
424 }
425 }
426 414
427 /* Get the available video modes */ 415 /* Get the available video modes */
428 if(X11_GetVideoModes(this) < 0) 416 if(X11_GetVideoModes(this) < 0)
429 return -1; 417 return -1;
430 418