=?UTF-8?Q?Stefan=20D=C3=B6singer=20?=: wined3d: Remove the DIB extra line hack.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Feb 16 09:54:58 CST 2016
Module: wine
Branch: master
Commit: 1bb4b7ece78140fff51dd9d41e393221f71f8105
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1bb4b7ece78140fff51dd9d41e393221f71f8105
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Mon Feb 15 18:18:06 2016 +0100
wined3d: Remove the DIB extra line hack.
Our surface pitch alignment should take care of any writes past unaligned
widths.
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/surface.c | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index a335a82..c1d7b18 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -361,9 +361,7 @@ HRESULT surface_create_dib_section(struct wined3d_surface *surface)
const struct wined3d_format *format = surface->resource.format;
unsigned int format_flags = surface->container->resource.format_flags;
unsigned int row_pitch, slice_pitch;
- SYSTEM_INFO sysInfo;
BITMAPINFO *b_info;
- int extraline = 0;
DWORD *masks;
TRACE("surface %p.\n", surface);
@@ -396,24 +394,11 @@ HRESULT surface_create_dib_section(struct wined3d_surface *surface)
if (!b_info)
return E_OUTOFMEMORY;
- /* Some applications access the surface in via DWORDs, and do not take
- * the necessary care at the end of the surface. So we need at least
- * 4 extra bytes at the end of the surface. Check against the page size,
- * if the last page used for the surface has at least 4 spare bytes we're
- * safe, otherwise add an extra line to the DIB section. */
- GetSystemInfo(&sysInfo);
- if( ((surface->resource.size + 3) % sysInfo.dwPageSize) < 4)
- {
- extraline = 1;
- TRACE("Adding an extra line to the DIB section.\n");
- }
-
b_info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- /* TODO: Is there a nicer way to force a specific alignment? (8 byte for ddraw) */
wined3d_texture_get_pitch(surface->container, surface->texture_level, &row_pitch, &slice_pitch);
b_info->bmiHeader.biWidth = row_pitch / format->byte_count;
- b_info->bmiHeader.biHeight = 0 - surface->resource.height - extraline;
- b_info->bmiHeader.biSizeImage = (surface->resource.height + extraline) * row_pitch;
+ b_info->bmiHeader.biHeight = 0 - surface->resource.height;
+ b_info->bmiHeader.biSizeImage = slice_pitch;
b_info->bmiHeader.biPlanes = 1;
b_info->bmiHeader.biBitCount = format->byte_count * 8;
More information about the wine-cvs
mailing list