Commit fc3f393a authored by Sam Lantinga's avatar Sam Lantinga

SDL_RenderReadPixels() needs to flush asynchronous operations before it reads.

The semantics are that it reads the back buffer, and those pixels may not be available once SDL_RenderPresent() has happened.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404207
parent 474b543c
...@@ -329,9 +329,6 @@ static int render_clearScreen (void) ...@@ -329,9 +329,6 @@ static int render_clearScreen (void)
return -1; return -1;
*/ */
/* Flush all asynchronous operations */
SDL_RenderPresent();
return 0; return 0;
} }
...@@ -413,9 +410,6 @@ static int render_testPrimitives (void) ...@@ -413,9 +410,6 @@ static int render_testPrimitives (void)
if (SDL_ATassert( "SDL_RenderLine", ret == 0)) if (SDL_ATassert( "SDL_RenderLine", ret == 0))
return -1; return -1;
/* Flush all asynchronous operations */
SDL_RenderPresent();
/* See if it's the same. */ /* See if it's the same. */
if (render_compare( "Primitives output not the same.", &img_primitives )) if (render_compare( "Primitives output not the same.", &img_primitives ))
return -1; return -1;
...@@ -533,9 +527,6 @@ static int render_testPrimitivesBlend (void) ...@@ -533,9 +527,6 @@ static int render_testPrimitivesBlend (void)
} }
} }
/* Flush all asynchronous operations */
SDL_RenderPresent();
/* See if it's the same. */ /* See if it's the same. */
if (render_compare( "Blended primitives output not the same.", &img_blend )) if (render_compare( "Blended primitives output not the same.", &img_blend ))
return -1; return -1;
...@@ -588,9 +579,6 @@ static int render_testBlit (void) ...@@ -588,9 +579,6 @@ static int render_testBlit (void)
/* Clean up. */ /* Clean up. */
SDL_DestroyTexture( tface ); SDL_DestroyTexture( tface );
/* Flush all asynchronous operations */
SDL_RenderPresent();
/* See if it's the same. */ /* See if it's the same. */
if (render_compare( "Blit output not the same.", &img_blit )) if (render_compare( "Blit output not the same.", &img_blit ))
return -1; return -1;
...@@ -648,9 +636,6 @@ static int render_testBlitColour (void) ...@@ -648,9 +636,6 @@ static int render_testBlitColour (void)
/* Clean up. */ /* Clean up. */
SDL_DestroyTexture( tface ); SDL_DestroyTexture( tface );
/* Flush all asynchronous operations */
SDL_RenderPresent();
/* See if it's the same. */ /* See if it's the same. */
if (render_compare( "Blit output not the same (using SDL_SetTextureColorMod).", if (render_compare( "Blit output not the same (using SDL_SetTextureColorMod).",
&img_blitColour )) &img_blitColour ))
...@@ -713,9 +698,6 @@ static int render_testBlitAlpha (void) ...@@ -713,9 +698,6 @@ static int render_testBlitAlpha (void)
/* Clean up. */ /* Clean up. */
SDL_DestroyTexture( tface ); SDL_DestroyTexture( tface );
/* Flush all asynchronous operations */
SDL_RenderPresent();
/* See if it's the same. */ /* See if it's the same. */
if (render_compare( "Blit output not the same (using SDL_SetSurfaceAlphaMod).", if (render_compare( "Blit output not the same (using SDL_SetSurfaceAlphaMod).",
&img_blitAlpha )) &img_blitAlpha ))
...@@ -763,9 +745,6 @@ static int render_testBlitBlendMode( SDL_TextureID tface, int mode ) ...@@ -763,9 +745,6 @@ static int render_testBlitBlendMode( SDL_TextureID tface, int mode )
} }
} }
/* Flush all asynchronous operations */
SDL_RenderPresent();
return 0; return 0;
} }
...@@ -883,9 +862,6 @@ static int render_testBlitBlend (void) ...@@ -883,9 +862,6 @@ static int render_testBlitBlend (void)
/* Clean up. */ /* Clean up. */
SDL_DestroyTexture( tface ); SDL_DestroyTexture( tface );
/* Flush all asynchronous operations */
SDL_RenderPresent();
/* Check to see if matches. */ /* Check to see if matches. */
if (render_compare( "Blit blending output not the same (using SDL_BLENDMODE_*).", if (render_compare( "Blit blending output not the same (using SDL_BLENDMODE_*).",
&img_blendAll )) &img_blendAll ))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment