# HG changeset patch # User Sam Lantinga # Date 1297054581 28800 # Node ID b0797947dd1cd4ae1b978e38f6b51a3906d0f89b # Parent 25ad4a50d34fb46551cace4ea79a31d4a44d946f You don't need to copy the pixels into the streaming texture's pixel data. This behavior is defined specifically to optimize the UpdateTexture path. diff -r 25ad4a50d34f -r b0797947dd1c Xcode-iPhoneOS/Demos/src/happy.c --- a/Xcode-iPhoneOS/Demos/src/happy.c Sun Feb 06 19:12:55 2011 -0800 +++ b/Xcode-iPhoneOS/Demos/src/happy.c Sun Feb 06 20:56:21 2011 -0800 @@ -164,7 +164,7 @@ } else if (delay > MILLESECONDS_PER_FRAME) { delay = MILLESECONDS_PER_FRAME; } - //SDL_Delay(delay); + SDL_Delay(delay); } /* cleanup */ diff -r 25ad4a50d34f -r b0797947dd1c src/render/opengles2/SDL_render_gles2.c --- a/src/render/opengles2/SDL_render_gles2.c Sun Feb 06 19:12:55 2011 -0800 +++ b/src/render/opengles2/SDL_render_gles2.c Sun Feb 06 20:56:21 2011 -0800 @@ -389,35 +389,13 @@ tdata->pixel_format, tdata->pixel_type, src); + SDL_free(blob); + if (glGetError() != GL_NO_ERROR) { SDL_SetError("Failed to update texture"); return -1; } - - /* Update the (streaming) texture buffer, in one pass if possible */ - if (tdata->pixel_data) - { - dest = (Uint8 *)tdata->pixel_data + - (tdata->pitch * rect->y) + - (SDL_BYTESPERPIXEL(texture->format) * rect->x); - if (rect->w == texture->w) - { - SDL_memcpy(dest, src, srcPitch * rect->h); - } - else - { - for (y = 0; y < rect->h; ++y) - { - SDL_memcpy(dest, src, srcPitch); - src += srcPitch; - dest += tdata->pitch; - } - } - } - - /* Clean up and return */ - SDL_free(blob); return 0; }