| 1797 | #endif /* SDL_HAVE_YUV */ |
| 1798 | |
| 1799 | static void |
| 1800 | SDL_UnlockTextureNative(SDL_Texture * texture) |
| 1801 | { |
| 1802 | SDL_Texture *native = texture->native; |
| 1803 | void *native_pixels = NULL; |
| 1804 | int native_pitch = 0; |
| 1805 | const SDL_Rect *rect = &texture->locked_rect; |
| 1806 | const void* pixels = (void *) ((Uint8 *) texture->pixels + |
| 1807 | rect->y * texture->pitch + |
| 1808 | rect->x * SDL_BYTESPERPIXEL(texture->format)); |
| 1809 | int pitch = texture->pitch; |
| 1810 | |
| 1811 | if (SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) { |
| 1812 | return; |
| 1813 | } |
| 1814 | SDL_ConvertPixels(rect->w, rect->h, |
| 1815 | texture->format, pixels, pitch, |
| 1816 | native->format, native_pixels, native_pitch); |
| 1817 | SDL_UnlockTexture(native); |
| 1818 | } |
| 1819 | |
| 1820 | void |
| 1821 | SDL_UnlockTexture(SDL_Texture * texture) |
no test coverage detected