src/render/software/SDL_render_sw.c
changeset 11223 62db9336e07b
parent 10737 3406a0f8b041
child 11281 42b62c737891
     1.1 --- a/src/render/software/SDL_render_sw.c	Fri Aug 11 11:32:00 2017 -0700
     1.2 +++ b/src/render/software/SDL_render_sw.c	Fri Aug 11 11:54:24 2017 -0700
     1.3 @@ -833,19 +833,14 @@
     1.4      SDL_Surface *surface = SW_ActivateRenderer(renderer);
     1.5      Uint32 src_format;
     1.6      void *src_pixels;
     1.7 -    SDL_Rect final_rect;
     1.8  
     1.9      if (!surface) {
    1.10          return -1;
    1.11      }
    1.12  
    1.13 -    if (renderer->viewport.x || renderer->viewport.y) {
    1.14 -        final_rect.x = renderer->viewport.x + rect->x;
    1.15 -        final_rect.y = renderer->viewport.y + rect->y;
    1.16 -        final_rect.w = rect->w;
    1.17 -        final_rect.h = rect->h;
    1.18 -        rect = &final_rect;
    1.19 -    }
    1.20 +    /* NOTE: The rect is already adjusted according to the viewport by
    1.21 +     * SDL_RenderReadPixels.
    1.22 +     */
    1.23  
    1.24      if (rect->x < 0 || rect->x+rect->w > surface->w ||
    1.25          rect->y < 0 || rect->y+rect->h > surface->h) {