diff src/video/dummy/SDL_nullrender.c @ 1907:06c27a737b7a

Streamlined the API a bit and optimized the software renderer.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 15 Jul 2006 09:46:36 +0000
parents 0c49855a7a3e
children e079dafea2bf
line wrap: on
line diff
--- a/src/video/dummy/SDL_nullrender.c	Fri Jul 14 08:24:43 2006 +0000
+++ b/src/video/dummy/SDL_nullrender.c	Sat Jul 15 09:46:36 2006 +0000
@@ -31,12 +31,6 @@
                                               Uint32 flags);
 static int SDL_DUMMY_CreateTexture(SDL_Renderer * renderer,
                                    SDL_Texture * texture);
-static int SDL_DUMMY_RenderReadPixels(SDL_Renderer * renderer,
-                                      const SDL_Rect * rect, void *pixels,
-                                      int pitch);
-static int SDL_DUMMY_RenderWritePixels(SDL_Renderer * renderer,
-                                       const SDL_Rect * rect,
-                                       const void *pixels, int pitch);
 static void SDL_DUMMY_RenderPresent(SDL_Renderer * renderer);
 static void SDL_DUMMY_DestroyRenderer(SDL_Renderer * renderer);
 
@@ -45,8 +39,7 @@
     SDL_DUMMY_CreateRenderer,
     {
      "dummy",
-     (SDL_Renderer_Minimal | SDL_Renderer_PresentDiscard |
-      SDL_Renderer_PresentCopy),
+     (SDL_Renderer_PresentDiscard | SDL_Renderer_PresentCopy),
      SDL_TextureBlendMode_None,
      SDL_TextureScaleMode_None,
      0,
@@ -91,8 +84,6 @@
     }
     SDL_zerop(data);
 
-    renderer->RenderReadPixels = SDL_DUMMY_RenderReadPixels;
-    renderer->RenderWritePixels = SDL_DUMMY_RenderWritePixels;
     renderer->RenderPresent = SDL_DUMMY_RenderPresent;
     renderer->DestroyRenderer = SDL_DUMMY_DestroyRenderer;
     renderer->info = SDL_DUMMY_RenderDriver.info;
@@ -111,54 +102,6 @@
     return renderer;
 }
 
-int
-SDL_DUMMY_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                           void *pixels, int pitch)
-{
-    SDL_DUMMY_RenderData *data =
-        (SDL_DUMMY_RenderData *) renderer->driverdata;
-    SDL_Surface *surface = data->surface;
-    Uint8 *src, *dst;
-    int row;
-    size_t length;
-
-    src =
-        (Uint8 *) surface->pixels + rect->y * surface->pitch +
-        rect->x * surface->format->BytesPerPixel;
-    dst = (Uint8 *) pixels;
-    length = rect->w * surface->format->BytesPerPixel;
-    for (row = 0; row < rect->h; ++row) {
-        SDL_memcpy(dst, src, length);
-        src += surface->pitch;
-        dst += pitch;
-    }
-    return 0;
-}
-
-int
-SDL_DUMMY_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                            const void *pixels, int pitch)
-{
-    SDL_DUMMY_RenderData *data =
-        (SDL_DUMMY_RenderData *) renderer->driverdata;
-    SDL_Surface *surface = data->surface;
-    Uint8 *src, *dst;
-    int row;
-    size_t length;
-
-    src = (Uint8 *) pixels;
-    dst =
-        (Uint8 *) surface->pixels + rect->y * surface->pitch +
-        rect->x * surface->format->BytesPerPixel;
-    length = rect->w * surface->format->BytesPerPixel;
-    for (row = 0; row < rect->h; ++row) {
-        SDL_memcpy(dst, src, length);
-        src += pitch;
-        dst += surface->pitch;
-    }
-    return 0;
-}
-
 void
 SDL_DUMMY_RenderPresent(SDL_Renderer * renderer)
 {