Module: wine Branch: master Commit: dd462052c62c3bca78dc51f6bcaa91dec0dfa59f URL: http://source.winehq.org/git/wine.git/?a=commit;h=dd462052c62c3bca78dc51f6bc...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Tue Aug 30 21:20:40 2011 +0200
wined3d: Use the resource size for copying between a surface's DIB and PBO.
---
dlls/wined3d/surface.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index ed047f2..48a5038 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1052,7 +1052,7 @@ static HRESULT surface_getdc(struct wined3d_surface *surface) /* Sync the DIB with the PBO. This can't be done earlier because Map() * activates the allocatedMemory. */ if (surface->flags & SFLAG_PBO) - memcpy(surface->dib.bitmap_data, surface->resource.allocatedMemory, surface->dib.bitmap_size); + memcpy(surface->dib.bitmap_data, surface->resource.allocatedMemory, surface->resource.size);
return hr; } @@ -3813,11 +3813,9 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) return WINEDDERR_NODC; }
+ /* Copy the contents of the DIB over to the PBO. */ if ((surface->flags & SFLAG_PBO) && surface->resource.allocatedMemory) - { - /* Copy the contents of the DIB over to the PBO. */ - memcpy(surface->resource.allocatedMemory, surface->dib.bitmap_data, surface->dib.bitmap_size); - } + memcpy(surface->resource.allocatedMemory, surface->dib.bitmap_data, surface->resource.size);
/* We locked first, so unlock now. */ wined3d_surface_unmap(surface);