diff src/video/SDL_renderer_sw.c @ 1992:7387e0514595

Take advantage of the existing SDL blitters for normal copy blits.
author Sam Lantinga <slouken@libsdl.org>
date Tue, 29 Aug 2006 08:24:16 +0000
parents 5b5f5de5433f
children 3ee59c43d784
line wrap: on
line diff
--- a/src/video/SDL_renderer_sw.c	Mon Aug 28 17:35:15 2006 +0000
+++ b/src/video/SDL_renderer_sw.c	Tue Aug 29 08:24:16 2006 +0000
@@ -421,9 +421,18 @@
     SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
     SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
 
-    surface->userdata =
-        SDL_GetRenderCopyFunc(texture->format, data->format, texture->modMode,
-                              texture->blendMode, texture->scaleMode);
+    /* We only need a special copy function for advanced features */
+    if (texture->modMode
+        || (texture->
+            blendMode & (SDL_TEXTUREBLENDMODE_ADD | SDL_TEXTUREBLENDMODE_MOD))
+        || texture->scaleMode) {
+        surface->userdata =
+            SDL_GetRenderCopyFunc(texture->format, data->format,
+                                  texture->modMode, texture->blendMode,
+                                  texture->scaleMode);
+    } else {
+        surface->userdata = NULL;
+    }
 }
 
 static int