Rebase against upstream changes.

This commit is contained in:
Sebastian Lackner 2015-02-18 20:15:35 +01:00
parent 1078096afe
commit 9717d3f69e
12 changed files with 522 additions and 662 deletions

View File

@ -38,7 +38,7 @@ Wine. All those differences are also documented on the
Included bug fixes and improvements
===================================
**Bugfixes and features included in the next upcoming release [11]:**
**Bugfixes and features included in the next upcoming release [10]:**
* Add stub for ntoskrnl.ExAcquireResourceExclusiveLite
* Add stub for ntoskrnl.ExDeleteResourceLite
@ -48,7 +48,6 @@ Included bug fixes and improvements
* Basic handling of write watches triggered while we're on the signal stack.
* Do not access stack below ESP when restoring thread context.
* Implement D3DXGetShaderOutputSemantics
* Implement IApplicationAssociationRegistration::QueryCurrentDefault. ([Wine Bug #34654](https://bugs.winehq.org/show_bug.cgi?id=34654))
* Improve stubs for AEV_{Get,Set}MasterVolumeLevel
* Improve stubs for AEV_{Get,Set}Mute

View File

@ -2800,16 +2800,13 @@ fi
# Patchset shell32-ApplicationAssociationRegistration
# |
# | This patchset fixes the following Wine bugs:
# | * [#34654] Implement IApplicationAssociationRegistration::QueryCurrentDefault.
# |
# | Modified files:
# | * dlls/shell32/assoc.c, dlls/shell32/tests/assoc.c
# |
if test "$enable_shell32_ApplicationAssociationRegistration" -eq 1; then
patch_apply shell32-ApplicationAssociationRegistration/0001-shell32-Implement-IApplicationAssociationRegistratio.patch
patch_apply shell32-ApplicationAssociationRegistration/0001-shell32-Various-style-fixes-and-memory-leak-fix-in-I.patch
(
echo '+ { "Alistair Leslie-Hughes", "shell32: Implement IApplicationAssociationRegistration QueryCurrentDefault.", 7 },';
echo '+ { "Sebastian Lackner", "shell32: Various style fixes and memory leak fix in IApplicationAssociationRegistration.", 1 },';
) >> "$patchlist"
fi

View File

@ -1,239 +0,0 @@
From 417742abf41feab095fc2e642e535a16755237f4 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 13 Feb 2015 18:53:25 +1100
Subject: shell32: Implement IApplicationAssociationRegistration
QueryCurrentDefault (try 7)
Fixes: https://bugs.winehq.org/show_bug.cgi?id=34654
Changes by Sebastian Lackner <sebastian@fds-team.de>:
* Some coding style fixes
* Avoid using strlenW when we only check if a string is non-empty
* Fix leak when RegGetValueW fails
---
dlls/shell32/assoc.c | 100 +++++++++++++++++++++++++++++++++++++++++++--
dlls/shell32/tests/assoc.c | 66 +++++++++++++++++++++++-------
2 files changed, 149 insertions(+), 17 deletions(-)
diff --git a/dlls/shell32/assoc.c b/dlls/shell32/assoc.c
index f3c8e65..e79eeae 100644
--- a/dlls/shell32/assoc.c
+++ b/dlls/shell32/assoc.c
@@ -873,11 +873,105 @@ static ULONG WINAPI ApplicationAssociationRegistration_Release(IApplicationAssoc
return ref;
}
-static HRESULT WINAPI ApplicationAssociationRegistration_QueryCurrentDefault(IApplicationAssociationRegistration* This, LPCWSTR query,
+static HRESULT WINAPI ApplicationAssociationRegistration_QueryCurrentDefault(IApplicationAssociationRegistration *iface, LPCWSTR query,
ASSOCIATIONTYPE type, ASSOCIATIONLEVEL level, LPWSTR *association)
{
- FIXME("(%p)->(%s, %d, %d, %p)\n", This, debugstr_w(query), type, level, association);
- return E_NOTIMPL;
+ IApplicationAssociationRegistrationImpl *This = impl_from_IApplicationAssociationRegistration(iface);
+ static WCHAR urlassoc[] = {'U','r','l','A','s','s','o','c','i','a','t','i','o','n','s',0};
+ static WCHAR mimeassoc[] = {'M','I','M','E','A','s','s','o','c','i','a','t','i','o','n','s',0};
+ static WCHAR assocations[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
+ 'W','i','n','d','o','w','s','\\','S','h','e','l','l','\\',
+ 'A','s','s','o','c','i','a','t','i','o','n','s',0};
+ static WCHAR slash[] = {'\\',0};
+ static WCHAR choice[] = {'U','s','e','r','C','h','o','i','c','e',0};
+ static WCHAR propid[] = {'P','r','o','g','i','d',0};
+ WCHAR path[MAX_PATH] = {0};
+ DWORD ret, keytype, size;
+ HKEY hkey = NULL;
+ HRESULT hr = HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION);
+
+ TRACE("(%p)->(%s, %d, %d, %p)\n", This, debugstr_w(query), type, level, association);
+
+ if (!query || !association)
+ return E_INVALIDARG;
+
+ *association = NULL;
+
+ if (type == AT_FILEEXTENSION)
+ {
+ if (query[0] != '.')
+ return E_INVALIDARG;
+
+ ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, query, 0, KEY_READ, &hkey);
+ if (ret == ERROR_SUCCESS)
+ {
+ ret = RegGetValueW(hkey, NULL, NULL, RRF_RT_REG_SZ, &keytype, NULL, &size);
+ if (ret == ERROR_SUCCESS)
+ {
+ *association = CoTaskMemAlloc(size);
+ if (*association)
+ {
+ ret = RegGetValueW(hkey, NULL, NULL, RRF_RT_REG_SZ, &keytype, *association, &size);
+ if (ret == ERROR_SUCCESS)
+ hr = S_OK;
+ else
+ {
+ CoTaskMemFree(*association);
+ *association = NULL;
+ }
+ }
+ else
+ hr = E_OUTOFMEMORY;
+ }
+ }
+ }
+ else
+ {
+ if (type == AT_URLPROTOCOL && !query[0])
+ return E_INVALIDARG;
+
+ ret = RegOpenKeyExW(HKEY_CURRENT_USER, assocations, 0, KEY_READ, &hkey);
+ if (ret == ERROR_SUCCESS)
+ {
+ if (type == AT_URLPROTOCOL)
+ lstrcpyW(path, urlassoc);
+ else if (type == AT_MIMETYPE)
+ lstrcpyW(path, mimeassoc);
+ else
+ {
+ WARN("Unsupported type (%d).\n", type);
+ RegCloseKey(hkey);
+ return hr;
+ }
+
+ lstrcatW(path, slash);
+ lstrcatW(path, query);
+ lstrcatW(path, slash);
+ lstrcatW(path, choice);
+
+ ret = RegGetValueW(hkey, path, propid, RRF_RT_REG_SZ, &keytype, NULL, &size);
+ if (ret == ERROR_SUCCESS)
+ {
+ *association = CoTaskMemAlloc(size);
+ if (*association)
+ {
+ ret = RegGetValueW(hkey, path, propid, RRF_RT_REG_SZ, &keytype, *association, &size);
+ if (ret == ERROR_SUCCESS)
+ hr = S_OK;
+ else
+ {
+ CoTaskMemFree(*association);
+ *association = NULL;
+ }
+ }
+ else
+ hr = E_OUTOFMEMORY;
+ }
+ }
+ }
+
+ RegCloseKey(hkey);
+ return hr;
}
static HRESULT WINAPI ApplicationAssociationRegistration_QueryAppIsDefault(IApplicationAssociationRegistration* This, LPCWSTR query,
diff --git a/dlls/shell32/tests/assoc.c b/dlls/shell32/tests/assoc.c
index f35938b..0092081 100644
--- a/dlls/shell32/tests/assoc.c
+++ b/dlls/shell32/tests/assoc.c
@@ -57,22 +57,12 @@ static void test_IQueryAssociations_QueryInterface(void)
}
-static void test_IApplicationAssociationRegistration_QueryInterface(void)
+static void test_IApplicationAssociationRegistration_QueryInterface(IApplicationAssociationRegistration *appreg)
{
- IApplicationAssociationRegistration *appreg;
IApplicationAssociationRegistration *appreg2;
IUnknown *unk;
HRESULT hr;
- /* this works since Vista */
- hr = CoCreateInstance(&CLSID_ApplicationAssociationRegistration, NULL, CLSCTX_INPROC_SERVER,
- &IID_IApplicationAssociationRegistration, (LPVOID*)&appreg);
-
- if (FAILED(hr)) {
- skip("IApplicationAssociationRegistration not created: 0x%x\n", hr);
- return;
- }
-
hr = IApplicationAssociationRegistration_QueryInterface(appreg, &IID_IApplicationAssociationRegistration,
(void**)&appreg2);
ok(hr == S_OK, "QueryInterface (IApplicationAssociationRegistration) returned 0x%x\n", hr);
@@ -88,8 +78,6 @@ static void test_IApplicationAssociationRegistration_QueryInterface(void)
hr = IApplicationAssociationRegistration_QueryInterface(appreg, &IID_IUnknown, NULL);
ok(hr == E_POINTER, "got 0x%x (expected E_POINTER)\n", hr);
-
- IApplicationAssociationRegistration_Release(appreg);
}
struct assoc_getstring_test
@@ -189,9 +177,48 @@ static void test_IQueryAssociations_Init(void)
IQueryAssociations_Release(assoc);
}
+static void test_IApplicationAssociationRegistration_QueryCurrentDefault(IApplicationAssociationRegistration *appreg)
+{
+ static const WCHAR emptyW[] = {0};
+ static const WCHAR txtW[] = {'.','t','x','t',0};
+ static const WCHAR spacetxtW[] = {' ','.','t','x','t',0};
+ HRESULT hr;
+ LPWSTR assocprog = NULL;
+
+ hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, emptyW, AT_URLPROTOCOL, AL_EFFECTIVE, &assocprog);
+ ok(hr == E_INVALIDARG, "got 0x%x\n", hr);
+
+ hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, emptyW, AT_FILEEXTENSION, AL_EFFECTIVE, &assocprog);
+ ok(hr == E_INVALIDARG, "got 0x%x\n", hr);
+
+ hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, spacetxtW, AT_FILEEXTENSION, AL_EFFECTIVE, &assocprog);
+ ok(hr == E_INVALIDARG || hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) /* Win8 */, "got 0x%x\n", hr);
+
+ hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, httpW, AT_URLPROTOCOL, AL_EFFECTIVE, NULL);
+ ok(hr == E_INVALIDARG, "got 0x%x\n", hr);
+
+ /* AT_FILEEXTENSION must start with a period */
+ hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, txtW, AT_FILEEXTENSION, AL_EFFECTIVE, &assocprog);
+ ok(hr == S_OK, "got 0x%x\n", hr);
+ trace("%s\n", wine_dbgstr_w(assocprog));
+ CoTaskMemFree(assocprog);
+
+ hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, emptyW, AT_STARTMENUCLIENT, AL_EFFECTIVE, &assocprog);
+ ok(hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), "got 0x%x\n", hr);
+
+ hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, emptyW, AT_MIMETYPE, AL_EFFECTIVE, &assocprog);
+ ok(hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), "got 0x%x\n", hr);
+
+ hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, httpW, AT_URLPROTOCOL, AL_EFFECTIVE, &assocprog);
+ todo_wine ok(hr == S_OK, "got 0x%x\n", hr);
+ trace("%s\n", wine_dbgstr_w(assocprog));
+ CoTaskMemFree(assocprog);
+}
+
START_TEST(assoc)
{
IQueryAssociations *qa;
+ IApplicationAssociationRegistration *appreg;
HRESULT hr;
CoInitialize(NULL);
@@ -209,7 +236,18 @@ START_TEST(assoc)
else
win_skip("IQueryAssociations not supported, 0x%x\n", hr);
- test_IApplicationAssociationRegistration_QueryInterface();
+ /* this works since Vista */
+ hr = CoCreateInstance(&CLSID_ApplicationAssociationRegistration, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IApplicationAssociationRegistration, (LPVOID *)&appreg);
+ if (hr == S_OK)
+ {
+ test_IApplicationAssociationRegistration_QueryInterface(appreg);
+ test_IApplicationAssociationRegistration_QueryCurrentDefault(appreg);
+
+ IApplicationAssociationRegistration_Release(appreg);
+ }
+ else
+ win_skip("IApplicationAssociationRegistration not supported: 0x%x\n", hr);
CoUninitialize();
}
--
2.3.0

View File

@ -0,0 +1,151 @@
From 1fc8601b891e8dee2ff65d84f5459ede605e2a57 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 18 Feb 2015 20:02:38 +0100
Subject: shell32: Various style fixes and memory leak fix in
IApplicationAssociationRegistration.
---
dlls/shell32/assoc.c | 46 ++++++++++++++++++++++++++++------------------
dlls/shell32/tests/assoc.c | 7 +++----
2 files changed, 31 insertions(+), 22 deletions(-)
diff --git a/dlls/shell32/assoc.c b/dlls/shell32/assoc.c
index 528666e..e79eeae 100644
--- a/dlls/shell32/assoc.c
+++ b/dlls/shell32/assoc.c
@@ -892,30 +892,33 @@ static HRESULT WINAPI ApplicationAssociationRegistration_QueryCurrentDefault(IAp
TRACE("(%p)->(%s, %d, %d, %p)\n", This, debugstr_w(query), type, level, association);
- if(!association)
+ if (!query || !association)
return E_INVALIDARG;
*association = NULL;
- if((type == AT_URLPROTOCOL || type == AT_FILEEXTENSION) && !lstrlenW(query))
- return E_INVALIDARG;
- else if(type == AT_FILEEXTENSION && query[0] != '.')
- return E_INVALIDARG;
-
- if(type == AT_FILEEXTENSION)
+ if (type == AT_FILEEXTENSION)
{
+ if (query[0] != '.')
+ return E_INVALIDARG;
+
ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, query, 0, KEY_READ, &hkey);
- if(ret == ERROR_SUCCESS)
+ if (ret == ERROR_SUCCESS)
{
ret = RegGetValueW(hkey, NULL, NULL, RRF_RT_REG_SZ, &keytype, NULL, &size);
- if(ret == ERROR_SUCCESS)
+ if (ret == ERROR_SUCCESS)
{
*association = CoTaskMemAlloc(size);
- if(*association)
+ if (*association)
{
ret = RegGetValueW(hkey, NULL, NULL, RRF_RT_REG_SZ, &keytype, *association, &size);
- if(ret == ERROR_SUCCESS)
+ if (ret == ERROR_SUCCESS)
hr = S_OK;
+ else
+ {
+ CoTaskMemFree(*association);
+ *association = NULL;
+ }
}
else
hr = E_OUTOFMEMORY;
@@ -924,12 +927,15 @@ static HRESULT WINAPI ApplicationAssociationRegistration_QueryCurrentDefault(IAp
}
else
{
+ if (type == AT_URLPROTOCOL && !query[0])
+ return E_INVALIDARG;
+
ret = RegOpenKeyExW(HKEY_CURRENT_USER, assocations, 0, KEY_READ, &hkey);
- if(ret == ERROR_SUCCESS)
+ if (ret == ERROR_SUCCESS)
{
- if(type == AT_URLPROTOCOL)
+ if (type == AT_URLPROTOCOL)
lstrcpyW(path, urlassoc);
- else if(type == AT_MIMETYPE)
+ else if (type == AT_MIMETYPE)
lstrcpyW(path, mimeassoc);
else
{
@@ -944,14 +950,19 @@ static HRESULT WINAPI ApplicationAssociationRegistration_QueryCurrentDefault(IAp
lstrcatW(path, choice);
ret = RegGetValueW(hkey, path, propid, RRF_RT_REG_SZ, &keytype, NULL, &size);
- if(ret == ERROR_SUCCESS)
+ if (ret == ERROR_SUCCESS)
{
*association = CoTaskMemAlloc(size);
- if(*association)
+ if (*association)
{
ret = RegGetValueW(hkey, path, propid, RRF_RT_REG_SZ, &keytype, *association, &size);
- if(ret == ERROR_SUCCESS)
+ if (ret == ERROR_SUCCESS)
hr = S_OK;
+ else
+ {
+ CoTaskMemFree(*association);
+ *association = NULL;
+ }
}
else
hr = E_OUTOFMEMORY;
@@ -960,7 +971,6 @@ static HRESULT WINAPI ApplicationAssociationRegistration_QueryCurrentDefault(IAp
}
RegCloseKey(hkey);
-
return hr;
}
diff --git a/dlls/shell32/tests/assoc.c b/dlls/shell32/tests/assoc.c
index 8aa2535..0092081 100644
--- a/dlls/shell32/tests/assoc.c
+++ b/dlls/shell32/tests/assoc.c
@@ -192,7 +192,7 @@ static void test_IApplicationAssociationRegistration_QueryCurrentDefault(IApplic
ok(hr == E_INVALIDARG, "got 0x%x\n", hr);
hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, spacetxtW, AT_FILEEXTENSION, AL_EFFECTIVE, &assocprog);
- ok(hr == E_INVALIDARG || hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) /*Win8*/, "got 0x%x\n", hr);
+ ok(hr == E_INVALIDARG || hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) /* Win8 */, "got 0x%x\n", hr);
hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, httpW, AT_URLPROTOCOL, AL_EFFECTIVE, NULL);
ok(hr == E_INVALIDARG, "got 0x%x\n", hr);
@@ -212,14 +212,13 @@ static void test_IApplicationAssociationRegistration_QueryCurrentDefault(IApplic
hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, httpW, AT_URLPROTOCOL, AL_EFFECTIVE, &assocprog);
todo_wine ok(hr == S_OK, "got 0x%x\n", hr);
trace("%s\n", wine_dbgstr_w(assocprog));
-
CoTaskMemFree(assocprog);
}
START_TEST(assoc)
{
IQueryAssociations *qa;
- IApplicationAssociationRegistration *appreg = NULL;
+ IApplicationAssociationRegistration *appreg;
HRESULT hr;
CoInitialize(NULL);
@@ -239,7 +238,7 @@ START_TEST(assoc)
/* this works since Vista */
hr = CoCreateInstance(&CLSID_ApplicationAssociationRegistration, NULL, CLSCTX_INPROC_SERVER,
- &IID_IApplicationAssociationRegistration, (LPVOID*)&appreg);
+ &IID_IApplicationAssociationRegistration, (LPVOID *)&appreg);
if (hr == S_OK)
{
test_IApplicationAssociationRegistration_QueryInterface(appreg);
--
2.3.0

View File

@ -1 +0,0 @@
Fixes: [34654] Implement IApplicationAssociationRegistration::QueryCurrentDefault.

View File

@ -1,4 +1,4 @@
From 375b66512e4a731d4434e06036530581f9e3913f Mon Sep 17 00:00:00 2001
From 031999169c1d5006c62e4b4d722c361d57d5ed09 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 19 Sep 2013 14:22:24 +0200
Subject: wined3d: Merge get_pitch functions.
@ -97,7 +97,7 @@ index 205f074..3375c0f 100644
+ TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch);
+}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 0a96d6f..5efb65d 100644
index 677f876..8fa36e4 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -363,6 +363,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
@ -178,7 +178,7 @@ index 0a96d6f..5efb65d 100644
context_invalidate_active_texture(context);
@@ -2008,25 +2010,6 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface)
@@ -1983,25 +1985,6 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface)
return WINED3D_OK;
}
@ -204,7 +204,7 @@ index 0a96d6f..5efb65d 100644
HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y)
{
LONG w, h;
@@ -2207,12 +2190,13 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
@@ -2182,12 +2165,13 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY;
valid_location = WINED3D_LOCATION_USER_MEMORY;
}
@ -221,7 +221,7 @@ index 0a96d6f..5efb65d 100644
else
surface->resource.size = wined3d_format_calculate_size(texture_resource->format,
texture_resource->device->surface_alignment, width, height, 1);
@@ -2833,7 +2817,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2808,7 +2792,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH)
map_desc->row_pitch = surface->resource.width * format->byte_count;
else
@ -230,7 +230,7 @@ index 0a96d6f..5efb65d 100644
map_desc->slice_pitch = 0;
if (!rect)
@@ -2960,6 +2944,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
@@ -2935,6 +2919,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
int i;
BOOL srcIsUpsideDown;
struct wined3d_bo_address data;
@ -238,7 +238,7 @@ index 0a96d6f..5efb65d 100644
surface_get_memory(surface, &data, dst_location);
@@ -2996,8 +2981,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
@@ -2971,8 +2956,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
}
/* Setup pixel store pack state -- to glReadPixels into the correct place */
@ -249,7 +249,7 @@ index 0a96d6f..5efb65d 100644
checkGLcall("glPixelStorei");
gl_info->gl_ops.gl.p_glReadPixels(0, 0,
@@ -3014,7 +2999,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
@@ -2989,7 +2974,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
{
/* glReadPixels returns the image upside down, and there is no way to prevent this.
* Flip the lines in software. */
@ -260,7 +260,7 @@ index 0a96d6f..5efb65d 100644
if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch)))
goto error;
@@ -4245,7 +4232,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4220,7 +4207,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
const struct wined3d_color_key_conversion *conversion;
struct wined3d_texture *texture = surface->container;
struct wined3d_context *context;
@ -269,8 +269,8 @@ index 0a96d6f..5efb65d 100644
struct wined3d_bo_address data;
struct wined3d_format format;
POINT dst_point = {0, 0};
@@ -4340,7 +4327,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
else surface->flags &= ~SFLAG_GLCKEY;
@@ -4308,7 +4295,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
wined3d_texture_bind_and_dirtify(texture, context, srgb);
width = surface->resource.width;
- src_pitch = wined3d_surface_get_pitch(surface);
@ -278,7 +278,7 @@ index 0a96d6f..5efb65d 100644
format = *texture->resource.format;
if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE)))
@@ -4379,9 +4366,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4347,9 +4334,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
context_release(context);
return E_OUTOFMEMORY;
}
@ -290,13 +290,13 @@ index 0a96d6f..5efb65d 100644
data.addr = mem;
}
else if (conversion)
@@ -4401,14 +4388,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4369,14 +4356,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
if (texture->swapchain && texture->swapchain->palette)
palette = texture->swapchain->palette;
- conversion->convert(data.addr, src_pitch, mem, dst_pitch,
+ conversion->convert(data.addr, src_row_pitch, mem, dst_pitch,
width, height, palette, &texture->src_blt_color_key);
width, height, palette, &texture->gl_color_key);
- src_pitch = dst_pitch;
+ src_row_pitch = dst_pitch;
data.addr = mem;
@ -309,10 +309,10 @@ index 0a96d6f..5efb65d 100644
context_release(context);
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 57c8ef7..c501a13 100644
index 675ca9e..b5f64ba 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1243,7 +1243,7 @@ static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_reso
@@ -1266,7 +1266,7 @@ static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_reso
struct wined3d_const_bo_address addr;
unsigned int row_pitch, slice_pitch;
@ -375,7 +375,7 @@ index 0d13dd0..472427b 100644
if (!box)
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index afe8e82..a95d029 100644
index fb55abc..2d120f4 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -181,6 +181,7 @@
@ -395,7 +395,7 @@ index afe8e82..a95d029 100644
@ cdecl wined3d_surface_get_resource(ptr)
@ cdecl wined3d_surface_getdc(ptr ptr)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 3cae14e..d03f3e6 100644
index 01c0fc2..9c5134c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2112,6 +2112,7 @@ struct wined3d_resource
@ -406,7 +406,7 @@ index 3cae14e..d03f3e6 100644
struct list resource_list_entry;
void *parent;
@@ -2267,7 +2268,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) DECLSPEC_HIDDEN
@@ -2269,7 +2270,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) DECLSPEC_HIDDEN
HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc,
unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN;
void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN;
@ -414,7 +414,7 @@ index 3cae14e..d03f3e6 100644
void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context,
BOOL srgb_mode) DECLSPEC_HIDDEN;
void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN;
@@ -2317,7 +2317,6 @@ struct wined3d_surface
@@ -2319,7 +2319,6 @@ struct wined3d_surface
DWORD flags;
@ -423,10 +423,10 @@ index 3cae14e..d03f3e6 100644
UINT pow2Height;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 1dfa495..83e0557 100644
index bf4efe8..9707748 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2414,6 +2414,8 @@ static inline HRESULT wined3d_private_store_set_private_data(struct wined3d_priv
@@ -2416,6 +2416,8 @@ static inline HRESULT wined3d_private_store_set_private_data(struct wined3d_priv
void __cdecl wined3d_resource_get_desc(const struct wined3d_resource *resource,
struct wined3d_resource_desc *desc);
void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resource);
@ -435,7 +435,7 @@ index 1dfa495..83e0557 100644
DWORD __cdecl wined3d_resource_get_priority(const struct wined3d_resource *resource);
void __cdecl wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent);
DWORD __cdecl wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority);
@@ -2472,7 +2474,6 @@ HRESULT __cdecl wined3d_surface_get_blt_status(const struct wined3d_surface *sur
@@ -2474,7 +2476,6 @@ HRESULT __cdecl wined3d_surface_get_blt_status(const struct wined3d_surface *sur
HRESULT __cdecl wined3d_surface_get_flip_status(const struct wined3d_surface *surface, DWORD flags);
HRESULT __cdecl wined3d_surface_get_overlay_position(const struct wined3d_surface *surface, LONG *x, LONG *y);
void * __cdecl wined3d_surface_get_parent(const struct wined3d_surface *surface);
@ -444,5 +444,5 @@ index 1dfa495..83e0557 100644
struct wined3d_surface *render_target);
struct wined3d_resource * __cdecl wined3d_surface_get_resource(struct wined3d_surface *surface);
--
2.2.2
2.3.0

View File

@ -1,4 +1,4 @@
From c6a152077c4e86728448103b7fdc72463d723c7c Mon Sep 17 00:00:00 2001
From 803a1823ebff0c62c4ba50f561d4968d8ffbd8c1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 17 Nov 2013 20:19:24 +0100
Subject: wined3d: Pass a context to surface_load_location.
@ -7,17 +7,17 @@ Subject: wined3d: Pass a context to surface_load_location.
dlls/wined3d/context.c | 4 +-
dlls/wined3d/device.c | 20 +++----
dlls/wined3d/drawprim.c | 20 +++----
dlls/wined3d/surface.c | 122 +++++++++++++++++++++++++----------------
dlls/wined3d/surface.c | 120 +++++++++++++++++++++++++----------------
dlls/wined3d/swapchain.c | 8 +--
dlls/wined3d/texture.c | 7 ++-
dlls/wined3d/wined3d_private.h | 5 +-
7 files changed, 108 insertions(+), 78 deletions(-)
7 files changed, 107 insertions(+), 77 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 4da8c7d..1f34992 100644
index 843905a..8c5844a 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -2199,7 +2199,7 @@ static BOOL match_depth_stencil_format(const struct wined3d_format *existing,
@@ -2201,7 +2201,7 @@ static BOOL match_depth_stencil_format(const struct wined3d_format *existing,
return TRUE;
}
@ -26,7 +26,7 @@ index 4da8c7d..1f34992 100644
static void context_validate_onscreen_formats(struct wined3d_context *context,
const struct wined3d_rendertarget_view *depth_stencil)
{
@@ -2215,7 +2215,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context,
@@ -2217,7 +2217,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context,
WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n");
/* The currently active context is the necessary context to access the swapchain's onscreen buffers */
@ -36,7 +36,7 @@ index 4da8c7d..1f34992 100644
swapchain_update_draw_bindings(swapchain);
context_set_render_offscreen(context, TRUE);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 89ec00a..0b4c6f9 100644
index 649f324..c6c43bc 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -300,6 +300,15 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
@ -77,7 +77,7 @@ index 89ec00a..0b4c6f9 100644
{
render_offscreen = context->render_offscreen;
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 265942c..2d39a83 100644
index 98e7cf4..f7fd9a4 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -608,6 +608,15 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
@ -120,10 +120,10 @@ index 265942c..2d39a83 100644
{
/* Note that this depends on the context_acquire() call above to set
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index b37dca9..66956df 100644
index 9efc5a8..30e2a0f 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -753,7 +753,16 @@ static void surface_unmap(struct wined3d_surface *surface)
@@ -752,7 +752,16 @@ static void surface_unmap(struct wined3d_surface *surface)
}
if (surface->container->swapchain && surface->container->swapchain->front_buffer == surface->container)
@ -141,7 +141,7 @@ index b37dca9..66956df 100644
else if (surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL))
FIXME("Depth / stencil buffer locking is not implemented.\n");
}
@@ -806,12 +815,6 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
@@ -805,12 +814,6 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
if (src_mask & WINED3DFMT_FLAG_STENCIL)
gl_mask |= GL_STENCIL_BUFFER_BIT;
@ -154,7 +154,7 @@ index b37dca9..66956df 100644
context = context_acquire(device, NULL);
if (!context->valid)
{
@@ -820,6 +823,12 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
@@ -819,6 +822,12 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
return;
}
@ -167,7 +167,7 @@ index b37dca9..66956df 100644
gl_info = context->gl_info;
context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, NULL, src_surface, src_location);
@@ -907,9 +916,9 @@ static void surface_blt_fbo(const struct wined3d_device *device,
@@ -906,9 +915,9 @@ static void surface_blt_fbo(const struct wined3d_device *device,
* surface isn't required if the entire surface is overwritten. (And is
* in fact harmful if we're being called by surface_load_location() with
* the purpose of loading the destination surface.) */
@ -179,7 +179,7 @@ index b37dca9..66956df 100644
if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface;
else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface;
@@ -1199,6 +1208,9 @@ static void surface_unload(struct wined3d_resource *resource)
@@ -1198,6 +1207,9 @@ static void surface_unload(struct wined3d_resource *resource)
TRACE("surface %p.\n", surface);
@ -189,7 +189,7 @@ index b37dca9..66956df 100644
if (resource->pool == WINED3D_POOL_DEFAULT)
{
/* Default pool resources are supposed to be destroyed before Reset is called.
@@ -1224,13 +1236,10 @@ static void surface_unload(struct wined3d_resource *resource)
@@ -1223,13 +1235,10 @@ static void surface_unload(struct wined3d_resource *resource)
else
{
surface_prepare_map_memory(surface);
@ -204,7 +204,7 @@ index b37dca9..66956df 100644
/* Destroy PBOs, but load them into real sysmem before */
if (surface->pbo)
surface_remove_pbo(surface, gl_info);
@@ -1714,7 +1723,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -1713,7 +1722,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
if (update_w == dst_w && update_h == dst_h)
wined3d_texture_prepare_texture(dst_surface->container, context, FALSE);
else
@ -222,26 +222,17 @@ index b37dca9..66956df 100644
+void surface_load(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb)
{
DWORD location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB;
BOOL ck_changed;
@@ -1856,7 +1866,7 @@ void surface_load(struct wined3d_surface *surface, BOOL srgb)
* the surface. Make sure we have it. */
surface_prepare_map_memory(surface);
- surface_load_location(surface, surface->resource.map_binding);
+ surface_load_location(surface, context, surface->resource.map_binding);
surface_invalidate_location(surface, ~surface->resource.map_binding);
/* Switching color keying on / off may change the internal format. */
if (ck_changed)
@@ -1872,7 +1882,7 @@ void surface_load(struct wined3d_surface *surface, BOOL srgb)
return;
@@ -1847,7 +1857,7 @@ void surface_load(struct wined3d_surface *surface, BOOL srgb)
}
TRACE("Reloading because surface is dirty.\n");
- surface_load_location(surface, location);
+ surface_load_location(surface, context, location);
surface_evict_sysmem(surface);
}
@@ -2639,10 +2649,16 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2767,10 +2777,16 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
}
else
{
@ -259,7 +250,7 @@ index b37dca9..66956df 100644
}
if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
@@ -2724,6 +2740,8 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2852,6 +2868,8 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
{
HRESULT hr;
@ -268,7 +259,7 @@ index b37dca9..66956df 100644
TRACE("surface %p, dc %p.\n", surface, dc);
@@ -2735,26 +2753,36 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
@@ -2863,26 +2881,36 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
if (surface->resource.map_count)
return WINED3DERR_INVALIDCALL;
@ -308,7 +299,7 @@ index b37dca9..66956df 100644
surface->flags |= SFLAG_DCINUSE;
surface->resource.map_count++;
@@ -2792,8 +2820,16 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
@@ -2920,8 +2948,16 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
* copied back to the DIB in the next getdc call.
*
* The same consideration applies to user memory surfaces. */
@ -326,7 +317,7 @@ index b37dca9..66956df 100644
}
return WINED3D_OK;
@@ -4086,7 +4122,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
@@ -4215,7 +4251,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
}
if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED))
@ -335,7 +326,7 @@ index b37dca9..66956df 100644
/* Download the surface to system memory. */
if (surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
@@ -4122,7 +4158,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
@@ -4251,7 +4287,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
}
surface_get_rect(surface, NULL, &r);
@ -344,7 +335,7 @@ index b37dca9..66956df 100644
surface_blt_to_drawable(surface->resource.device, context,
WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r);
@@ -4195,7 +4231,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4324,7 +4360,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
/* Performance warning... */
FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface);
surface_prepare_map_memory(surface);
@ -353,7 +344,7 @@ index b37dca9..66956df 100644
}
}
else
@@ -4206,7 +4242,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4335,7 +4371,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
/* Performance warning... */
FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface);
surface_prepare_map_memory(surface);
@ -362,7 +353,7 @@ index b37dca9..66956df 100644
}
}
@@ -4215,7 +4251,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4344,7 +4380,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
WARN("Trying to load a texture from sysmem, but no simple location is valid.\n");
/* Lets hope we get it from somewhere... */
surface_prepare_system_memory(surface);
@ -371,7 +362,7 @@ index b37dca9..66956df 100644
}
wined3d_texture_prepare_texture(texture, context, srgb);
@@ -4248,7 +4284,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4370,7 +4406,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface->resource.map_binding = WINED3D_LOCATION_SYSMEM;
surface_prepare_map_memory(surface);
@ -380,7 +371,7 @@ index b37dca9..66956df 100644
surface_remove_pbo(surface, gl_info);
}
@@ -4316,11 +4352,10 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
@@ -4439,11 +4475,10 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect);
}
@ -394,7 +385,7 @@ index b37dca9..66956df 100644
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
@@ -4329,9 +4364,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
@@ -4452,9 +4487,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
if (location == WINED3D_LOCATION_TEXTURE_RGB
&& surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED))
{
@ -404,7 +395,7 @@ index b37dca9..66956df 100644
return WINED3D_OK;
}
else if (location & surface->locations
@@ -4375,33 +4408,22 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
@@ -4498,33 +4531,22 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
case WINED3D_LOCATION_USER_MEMORY:
case WINED3D_LOCATION_SYSMEM:
case WINED3D_LOCATION_BUFFER:
@ -441,7 +432,7 @@ index b37dca9..66956df 100644
return hr;
break;
@@ -5459,7 +5481,11 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5582,7 +5604,11 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, &src_rect)))
{
if (!wined3d_resource_is_offscreen(&dst_surface->container->resource))
@ -494,10 +485,10 @@ index 887143f..d742b11 100644
src_dc = front->hDC;
window = swapchain->win_handle;
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 6ecd414..c173518 100644
index b5f64ba..a7e6cca 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -819,16 +819,19 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
@@ -774,16 +774,19 @@ static void wined3d_texture_upload_data(struct wined3d_texture *texture, const s
static void texture2d_sub_resource_load(struct wined3d_resource *sub_resource,
struct wined3d_context *context, BOOL srgb)
{
@ -520,10 +511,10 @@ index 6ecd414..c173518 100644
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index abd8d2b..7115eca 100644
index 9c5134c..59e3eb2 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2350,11 +2350,12 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HID
@@ -2368,11 +2368,12 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HID
void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context,
unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN;
void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN;
@ -539,5 +530,5 @@ index abd8d2b..7115eca 100644
void surface_prepare_rb(struct wined3d_surface *surface,
const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN;
--
2.1.3
2.3.0

View File

@ -1,4 +1,4 @@
From ea0e273a5c7c53945e0de57fc877511555ed0627 Mon Sep 17 00:00:00 2001
From 6e6c9bc0fb30c4d0856b6c877a7f1c909e3301a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 21 Jan 2014 12:22:30 +0100
Subject: wined3d: Move surface locations into the resource.
@ -13,10 +13,10 @@ Subject: wined3d: Move surface locations into the resource.
6 files changed, 56 insertions(+), 56 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index bc66c4a..c1b3b6d 100644
index 688bdb7..2188d2d 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -7649,7 +7649,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
@@ -7651,7 +7651,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
/* Now load the surface */
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
@ -26,7 +26,7 @@ index bc66c4a..c1b3b6d 100644
&& !wined3d_resource_is_offscreen(&src_surface->container->resource))
{
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index df8789a..4ac9c3e 100644
index c6c43bc..7b66fcf 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -236,7 +236,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
@ -48,7 +48,7 @@ index df8789a..4ac9c3e 100644
ds->ds_current_size.cx,
ds->ds_current_size.cy);
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 2d39a83..7034b25 100644
index f7fd9a4..9ccc1b4 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -648,7 +648,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
@ -61,10 +61,10 @@ index 2d39a83..7034b25 100644
else
SetRectEmpty(&current_rect);
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 6927ea3..1ed3e46 100644
index c611261..09c446c 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -556,7 +556,7 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface)
@@ -555,7 +555,7 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface)
if (!wined3d_resource_allocate_sysmem(&surface->resource))
ERR("Failed to allocate system memory.\n");
@ -73,7 +73,7 @@ index 6927ea3..1ed3e46 100644
ERR("Surface without system memory has WINED3D_LOCATION_SYSMEM set.\n");
}
@@ -706,7 +706,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
@@ -705,7 +705,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
}
if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
@ -82,7 +82,7 @@ index 6927ea3..1ed3e46 100644
if (surface_use_pbo(surface))
surface->resource.map_binding = WINED3D_LOCATION_BUFFER;
@@ -746,7 +746,7 @@ static void surface_unmap(struct wined3d_surface *surface)
@@ -745,7 +745,7 @@ static void surface_unmap(struct wined3d_surface *surface)
ERR("Unexpected map binding %s.\n", wined3d_debug_location(surface->resource.map_binding));
}
@ -91,7 +91,7 @@ index 6927ea3..1ed3e46 100644
{
TRACE("Not dirtified, nothing to do.\n");
return;
@@ -1726,7 +1726,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -1725,7 +1725,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB);
wined3d_texture_bind(dst_surface->container, context, FALSE);
@ -100,16 +100,16 @@ index 6927ea3..1ed3e46 100644
wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch);
wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect,
@@ -1873,7 +1873,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
if (ck_changed)
wined3d_texture_force_reload(surface->container);
}
- else if (!(surface->locations & location))
+ else if (!(surface->resource.locations & location))
@@ -1850,7 +1850,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
if (surface->resource.pool == WINED3D_POOL_SCRATCH)
ERR("Not supported on scratch surfaces.\n");
- if (surface->locations & location)
+ if (surface->resource.locations & location)
{
TRACE("Reloading because surface is dirty.\n");
}
@@ -2187,7 +2187,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
TRACE("surface is already in texture\n");
return;
@@ -2161,7 +2161,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
create_dib = TRUE;
}
@ -118,7 +118,7 @@ index 6927ea3..1ed3e46 100644
wined3d_resource_free_sysmem(&surface->resource);
width = texture_resource->width;
@@ -3233,9 +3233,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back)
@@ -3218,9 +3218,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back)
back->flags = front->flags;
front->flags = tmp_flags;
@ -131,7 +131,7 @@ index 6927ea3..1ed3e46 100644
}
}
@@ -3414,7 +3414,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
@@ -3399,7 +3399,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
checkGLcall("glEnable(texture_target)");
/* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */
@ -140,7 +140,7 @@ index 6927ea3..1ed3e46 100644
}
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
@@ -4008,13 +4008,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface,
@@ -3992,13 +3992,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface,
{
TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h);
@ -158,7 +158,7 @@ index 6927ea3..1ed3e46 100644
}
/* Context activation is done by the caller. */
@@ -4029,7 +4030,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -4013,7 +4014,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
/* TODO: Make this work for modes other than FBO */
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return;
@ -167,7 +167,7 @@ index 6927ea3..1ed3e46 100644
{
w = surface->ds_current_size.cx;
h = surface->ds_current_size.cy;
@@ -4055,7 +4056,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -4039,7 +4040,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
return;
}
@ -176,7 +176,7 @@ index 6927ea3..1ed3e46 100644
{
TRACE("Surface was discarded, no need copy data.\n");
switch (location)
@@ -4072,17 +4073,17 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -4056,17 +4057,17 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
default:
FIXME("Unhandled location %#x\n", location);
}
@ -198,7 +198,7 @@ index 6927ea3..1ed3e46 100644
surface->ds_current_size.cx = surface->resource.width;
surface->ds_current_size.cy = surface->resource.height;
return;
@@ -4171,7 +4172,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -4155,7 +4156,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
ERR("Invalid location (%#x) specified.\n", location);
}
@ -207,7 +207,7 @@ index 6927ea3..1ed3e46 100644
surface->ds_current_size.cx = surface->resource.width;
surface->ds_current_size.cy = surface->resource.height;
}
@@ -4180,7 +4181,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location)
@@ -4164,7 +4165,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location)
{
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
@ -216,7 +216,7 @@ index 6927ea3..1ed3e46 100644
}
void surface_invalidate_location(struct wined3d_surface *surface, DWORD location)
@@ -4189,9 +4190,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location
@@ -4173,9 +4174,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location
if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
wined3d_texture_set_dirty(surface->container);
@ -228,7 +228,7 @@ index 6927ea3..1ed3e46 100644
ERR("Surface %p does not have any up to date location.\n", surface);
}
@@ -4227,7 +4228,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
@@ -4211,7 +4212,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
UINT size = surface->resource.size;
surface_get_memory(surface, &dst, location);
@ -237,7 +237,7 @@ index 6927ea3..1ed3e46 100644
if (dst.buffer_object)
{
@@ -4260,33 +4261,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
@@ -4244,33 +4245,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
{
const struct wined3d_gl_info *gl_info = context->gl_info;
@ -277,7 +277,7 @@ index 6927ea3..1ed3e46 100644
}
/* Context activation is done by the caller. */
@@ -4326,14 +4327,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4310,14 +4311,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
&& wined3d_resource_is_offscreen(&texture->resource)
@ -294,7 +294,7 @@ index 6927ea3..1ed3e46 100644
&& (surface->resource.format->flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)
&& fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT,
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format,
@@ -4349,13 +4350,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4333,13 +4334,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
return WINED3D_OK;
}
@ -310,7 +310,7 @@ index 6927ea3..1ed3e46 100644
WINED3D_LOCATION_RB_RESOLVED : WINED3D_LOCATION_RB_MULTISAMPLE;
DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB;
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
@@ -4370,7 +4371,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4354,7 +4355,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
if (srgb)
{
@ -319,7 +319,7 @@ index 6927ea3..1ed3e46 100644
== WINED3D_LOCATION_TEXTURE_RGB)
{
/* Performance warning... */
@@ -4381,7 +4382,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4365,7 +4366,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
else
{
@ -328,7 +328,7 @@ index 6927ea3..1ed3e46 100644
== WINED3D_LOCATION_TEXTURE_SRGB)
{
/* Performance warning... */
@@ -4391,7 +4392,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4375,7 +4376,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
}
@ -337,7 +337,7 @@ index 6927ea3..1ed3e46 100644
{
WARN("Trying to load a texture from sysmem, but no simple location is valid.\n");
/* Lets hope we get it from somewhere... */
@@ -4433,7 +4434,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4410,7 +4411,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface_remove_pbo(surface, gl_info);
}
@ -346,7 +346,7 @@ index 6927ea3..1ed3e46 100644
if (format.convert)
{
/* This code is entered for texture formats which need a fixup. */
@@ -4490,7 +4491,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
@@ -4467,7 +4468,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
{
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
@ -355,7 +355,7 @@ index 6927ea3..1ed3e46 100644
ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n",
surface);
@@ -4508,12 +4509,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4485,12 +4486,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
{
if (location == WINED3D_LOCATION_TEXTURE_RGB
@ -370,7 +370,7 @@ index 6927ea3..1ed3e46 100644
&& surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE)
{
/* Already up to date, nothing to do. */
@@ -4522,12 +4523,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4499,12 +4500,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
else
{
FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n",
@ -385,7 +385,7 @@ index 6927ea3..1ed3e46 100644
{
TRACE("Location already up to date.\n");
return;
@@ -4541,7 +4542,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4518,7 +4519,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
required_access, surface->resource.access_flags);
}
@ -394,7 +394,7 @@ index 6927ea3..1ed3e46 100644
{
ERR("Surface %p does not have any up to date location.\n", surface);
surface->flags |= SFLAG_LOST;
@@ -4580,7 +4581,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4557,7 +4558,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
surface_validate_location(surface, location);
@ -403,7 +403,7 @@ index 6927ea3..1ed3e46 100644
surface_evict_sysmem(surface);
return;
@@ -5585,8 +5586,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5562,8 +5563,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
{
/* In principle this would apply to depth blits as well, but we don't
* implement those in the CPU blitter at the moment. */
@ -414,7 +414,7 @@ index 6927ea3..1ed3e46 100644
{
if (scale)
TRACE("Not doing sysmem blit because of scaling.\n");
@@ -5613,8 +5614,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5590,8 +5591,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
TRACE("Color blit.\n");
/* Upload */
@ -426,10 +426,10 @@ index 6927ea3..1ed3e46 100644
if (scale)
TRACE("Not doing upload because of scaling.\n");
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index f984235..4d7eb32 100644
index d742b11..601d3ad 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -560,8 +560,8 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
@@ -555,8 +555,8 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
}
front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0));
@ -441,10 +441,10 @@ index f984235..4d7eb32 100644
/* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying
* Doesn't work with render_to_fbo because we're not flipping
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index edbc066..8203200 100644
index d9a4cdb..86f3c58 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2312,7 +2312,6 @@ struct wined3d_surface
@@ -2317,7 +2317,6 @@ struct wined3d_surface
const struct wined3d_surface_ops *surface_ops;
struct wined3d_texture *container;
void *user_memory;
@ -453,5 +453,5 @@ index edbc066..8203200 100644
DWORD flags;
--
1.9.1
2.3.0

View File

@ -1,4 +1,4 @@
From 6859a41049de6f77771cadb3d6be474d031545ce Mon Sep 17 00:00:00 2001
From a91d461c5fad6e7a651f8b485b8541f4d2cc2d55 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sat, 4 Jan 2014 01:02:15 +0100
Subject: wined3d: Remove surface_invalidate_location.
@ -8,17 +8,17 @@ Subject: wined3d: Remove surface_invalidate_location.
dlls/wined3d/context.c | 2 +-
dlls/wined3d/device.c | 2 +-
dlls/wined3d/drawprim.c | 2 +-
dlls/wined3d/surface.c | 47 ++++++++++++++++-----------------------
dlls/wined3d/swapchain.c | 12 +++++-----
dlls/wined3d/texture.c | 6 ++---
dlls/wined3d/surface.c | 45 ++++++++++++++++-----------------------
dlls/wined3d/swapchain.c | 12 +++++------
dlls/wined3d/texture.c | 6 ++----
dlls/wined3d/wined3d_private.h | 1 -
8 files changed, 31 insertions(+), 43 deletions(-)
8 files changed, 30 insertions(+), 42 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 93ecb99..f7bea42 100644
index 308e678..4bc4d3b 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -7687,7 +7687,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
@@ -7689,7 +7689,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
context_release(context);
wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
@ -28,7 +28,7 @@ index 93ecb99..f7bea42 100644
return WINED3D_OK;
}
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 13eebf1..068dfa9 100644
index 8c5844a..7e4b935 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -3161,7 +3161,7 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d
@ -41,7 +41,7 @@ index 13eebf1..068dfa9 100644
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index e61eba3..b8c444b 100644
index 2a62e8a..85771ba 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -393,7 +393,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
@ -54,7 +54,7 @@ index e61eba3..b8c444b 100644
}
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 7034b25..eef7e2c 100644
index 9ccc1b4..c05369e 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -626,7 +626,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
@ -67,7 +67,7 @@ index 7034b25..eef7e2c 100644
}
}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 968c39e..69cc9ca 100644
index aa6ae19..23e74b0 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -598,7 +598,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface)
@ -127,16 +127,7 @@ index 968c39e..69cc9ca 100644
return WINED3D_OK;
}
@@ -1873,7 +1876,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
surface_prepare_map_memory(surface);
surface_load_location(surface, context, surface->resource.map_binding);
- surface_invalidate_location(surface, ~surface->resource.map_binding);
+ wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
/* Switching color keying on / off may change the internal format. */
if (ck_changed)
wined3d_texture_force_reload(surface->container);
@@ -2821,7 +2824,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2796,7 +2799,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
}
if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
@ -145,7 +136,7 @@ index 968c39e..69cc9ca 100644
switch (surface->resource.map_binding)
{
@@ -2937,7 +2940,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
@@ -2912,7 +2915,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
}
surface_load_location(surface, context, WINED3D_LOCATION_DIB);
@ -154,7 +145,7 @@ index 968c39e..69cc9ca 100644
if (context)
context_release(context);
@@ -2986,7 +2989,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
@@ -2961,7 +2964,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
context = context_acquire(device, NULL);
surface_load_location(surface, context, surface->resource.map_binding);
@ -163,7 +154,7 @@ index 968c39e..69cc9ca 100644
if (context)
context_release(context);
}
@@ -3360,7 +3363,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
@@ -3337,7 +3340,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
/* The texture is now most up to date - If the surface is a render target
* and has a drawable, this path is never entered. */
wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
@ -172,7 +163,7 @@ index 968c39e..69cc9ca 100644
}
/* Uses the hardware to stretch and flip the image */
@@ -3428,7 +3431,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
@@ -3405,7 +3408,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
checkGLcall("glEnable(texture_target)");
/* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */
@ -181,7 +172,7 @@ index 968c39e..69cc9ca 100644
}
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
@@ -3633,7 +3636,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
@@ -3610,7 +3613,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
/* The texture is now most up to date - If the surface is a render target
* and has a drawable, this path is never entered. */
wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
@ -190,7 +181,7 @@ index 968c39e..69cc9ca 100644
}
/* Front buffer coordinates are always full screen coordinates, but our GL
@@ -3946,7 +3949,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
@@ -3923,7 +3926,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
(old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL);
wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
@ -199,7 +190,7 @@ index 968c39e..69cc9ca 100644
return WINED3D_OK;
}
@@ -4190,18 +4193,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -4167,18 +4170,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
surface->ds_current_size.cy = surface->resource.height;
}
@ -218,7 +209,7 @@ index 968c39e..69cc9ca 100644
static DWORD resource_access_from_location(DWORD location)
{
switch (location)
@@ -5681,7 +5672,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5651,7 +5642,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
context_release(context);
wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
@ -227,7 +218,7 @@ index 968c39e..69cc9ca 100644
return WINED3D_OK;
}
@@ -5810,7 +5801,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
@@ -5780,7 +5771,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
{
wined3d_resource_free_sysmem(&surface->resource);
wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DIB);
@ -287,10 +278,10 @@ index bdb4b67..e64715e 100644
/* MSDN says we're only allowed a single fullscreen swapchain per device,
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index b574123..5e8847c 100644
index 05fb248..8edae6d 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -764,7 +764,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub
@@ -787,7 +787,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub
context = context_acquire(surface->resource.device, NULL);
surface_load_location(surface, context, surface->resource.map_binding);
context_release(context);
@ -299,7 +290,7 @@ index b574123..5e8847c 100644
}
static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource)
@@ -776,9 +776,7 @@ static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource
@@ -799,9 +799,7 @@ static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource
static void texture2d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location)
{
@ -311,10 +302,10 @@ index b574123..5e8847c 100644
static void texture2d_sub_resource_validate_location(struct wined3d_resource *sub_resource, DWORD location)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index f64521c..bc4ca48 100644
index 3628834..f8ea878 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2366,7 +2366,6 @@ HRESULT surface_color_fill(struct wined3d_surface *s,
@@ -2368,7 +2368,6 @@ HRESULT surface_color_fill(struct wined3d_surface *s,
GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context,
unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN;
@ -323,5 +314,5 @@ index f64521c..bc4ca48 100644
void surface_load_ds_location(struct wined3d_surface *surface,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
--
2.2.1
2.3.0

View File

@ -1,4 +1,4 @@
From a1e69a04b1cb46aa0d16b4bc4b696321e0698972 Mon Sep 17 00:00:00 2001
From ac7d5335fde4c1a4cf0822814eaa168c1b701217 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 17 Nov 2013 20:33:17 +0100
Subject: wined3d: Replace surface_load_location with resource_load_location.
@ -8,17 +8,17 @@ FIXME: Check if this patch is complete enough to make sense.
dlls/wined3d/context.c | 2 +-
dlls/wined3d/device.c | 2 +-
dlls/wined3d/drawprim.c | 2 +-
dlls/wined3d/surface.c | 113 +++++++++++++----------------------------
dlls/wined3d/surface.c | 111 +++++++++++++----------------------------
dlls/wined3d/swapchain.c | 8 +--
dlls/wined3d/texture.c | 2 +-
dlls/wined3d/wined3d_private.h | 2 -
7 files changed, 44 insertions(+), 87 deletions(-)
7 files changed, 43 insertions(+), 86 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 61c074f..cc60348 100644
index 7e4b935..c08e0ce 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -2215,7 +2215,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context,
@@ -2217,7 +2217,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context,
WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n");
/* The currently active context is the necessary context to access the swapchain's onscreen buffers */
@ -28,7 +28,7 @@ index 61c074f..cc60348 100644
swapchain_update_draw_bindings(swapchain);
context_set_render_offscreen(context, TRUE);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 70a30f0..565a92c 100644
index 85771ba..22cf4b5 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -323,7 +323,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
@ -41,7 +41,7 @@ index 70a30f0..565a92c 100644
}
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index eef7e2c..62b7032 100644
index c05369e..31f346d 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -625,7 +625,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
@ -54,10 +54,10 @@ index eef7e2c..62b7032 100644
}
}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index de57d25..6154315 100644
index edf8b79..2fae26e 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -759,7 +759,7 @@ static void surface_unmap(struct wined3d_surface *surface)
@@ -758,7 +758,7 @@ static void surface_unmap(struct wined3d_surface *surface)
if (device->d3d_initialized)
context = context_acquire(device, surface);
@ -66,7 +66,7 @@ index de57d25..6154315 100644
if (context)
context_release(context);
}
@@ -825,9 +825,9 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
@@ -824,9 +824,9 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
/* Make sure the locations are up-to-date. Loading the destination
* surface isn't required if the entire surface is overwritten. */
@ -78,7 +78,7 @@ index de57d25..6154315 100644
gl_info = context->gl_info;
@@ -916,9 +916,9 @@ static void surface_blt_fbo(const struct wined3d_device *device,
@@ -915,9 +915,9 @@ static void surface_blt_fbo(const struct wined3d_device *device,
* surface isn't required if the entire surface is overwritten. (And is
* in fact harmful if we're being called by surface_load_location() with
* the purpose of loading the destination surface.) */
@ -90,7 +90,7 @@ index de57d25..6154315 100644
if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface;
else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface;
@@ -1236,7 +1236,7 @@ static void surface_unload(struct wined3d_resource *resource)
@@ -1235,7 +1235,7 @@ static void surface_unload(struct wined3d_resource *resource)
else
{
surface_prepare_map_memory(surface);
@ -99,7 +99,7 @@ index de57d25..6154315 100644
wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
}
@@ -1281,22 +1281,6 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour
@@ -1280,22 +1280,6 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour
wined3d_texture_set_dirty(surface->container);
}
@ -122,7 +122,7 @@ index de57d25..6154315 100644
static const struct wined3d_surface_ops surface_ops =
{
surface_private_setup,
@@ -1740,7 +1724,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -1739,7 +1723,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
if (update_w == dst_w && update_h == dst_h)
wined3d_texture_prepare_texture(dst_surface->container, context, FALSE);
else
@ -131,25 +131,16 @@ index de57d25..6154315 100644
wined3d_texture_bind(dst_surface->container, context, FALSE);
surface_get_memory(src_surface, &data, src_surface->resource.locations);
@@ -1883,7 +1867,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
* the surface. Make sure we have it. */
surface_prepare_map_memory(surface);
- surface_load_location(surface, context, surface->resource.map_binding);
+ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding);
wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
/* Switching color keying on / off may change the internal format. */
if (ck_changed)
@@ -1899,7 +1883,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
return;
@@ -1874,7 +1858,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
}
TRACE("Reloading because surface is dirty.\n");
- surface_load_location(surface, context, location);
+ wined3d_resource_load_location(&surface->resource, context, location);
surface_evict_sysmem(surface);
}
@@ -2673,7 +2657,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2801,7 +2785,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
if (surface->resource.device->d3d_initialized)
context = context_acquire(surface->resource.device, NULL);
@ -158,7 +149,7 @@ index de57d25..6154315 100644
if (context)
context_release(context);
}
@@ -2778,7 +2762,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
@@ -2906,7 +2890,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
{
if (surface->flags & SFLAG_CLIENT)
{
@ -167,7 +158,7 @@ index de57d25..6154315 100644
surface_release_client_storage(surface);
}
hr = surface_create_dib_section(surface);
@@ -2794,7 +2778,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
@@ -2922,7 +2906,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
surface->resource.map_binding = WINED3D_LOCATION_DIB;
}
@ -176,7 +167,7 @@ index de57d25..6154315 100644
wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DIB);
if (context)
@@ -2843,7 +2827,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
@@ -2971,7 +2955,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
if (device->d3d_initialized)
context = context_acquire(device, NULL);
@ -185,7 +176,7 @@ index de57d25..6154315 100644
wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB);
if (context)
context_release(context);
@@ -3555,8 +3539,8 @@ static void surface_blt_to_drawable(const struct wined3d_device *device,
@@ -3684,8 +3668,8 @@ static void surface_blt_to_drawable(const struct wined3d_device *device,
gl_info = context->gl_info;
/* Make sure the surface is up-to-date. This should probably use
@ -196,7 +187,7 @@ index de57d25..6154315 100644
wined3d_texture_load(src_surface->container, context, FALSE);
/* Activate the destination context, set it up for blitting */
@@ -4049,29 +4033,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -4178,29 +4162,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
surface->ds_current_size.cy = surface->resource.height;
}
@ -226,7 +217,7 @@ index de57d25..6154315 100644
static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD location)
{
struct wined3d_device *device = surface->resource.device;
@@ -4121,7 +4082,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
@@ -4250,7 +4211,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
}
if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED))
@ -235,7 +226,7 @@ index de57d25..6154315 100644
/* Download the surface to system memory. */
if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
@@ -4157,7 +4118,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
@@ -4286,7 +4247,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
}
surface_get_rect(surface, NULL, &r);
@ -244,7 +235,7 @@ index de57d25..6154315 100644
surface_blt_to_drawable(surface->resource.device, context,
WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r);
@@ -4230,7 +4191,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4359,7 +4320,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
/* Performance warning... */
FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface);
surface_prepare_map_memory(surface);
@ -253,7 +244,7 @@ index de57d25..6154315 100644
}
}
else
@@ -4241,7 +4202,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4370,7 +4331,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
/* Performance warning... */
FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface);
surface_prepare_map_memory(surface);
@ -262,7 +253,7 @@ index de57d25..6154315 100644
}
}
@@ -4250,7 +4211,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4379,7 +4340,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
WARN("Trying to load a texture from sysmem, but no simple location is valid.\n");
/* Lets hope we get it from somewhere... */
surface_prepare_system_memory(surface);
@ -271,7 +262,7 @@ index de57d25..6154315 100644
}
wined3d_texture_prepare_texture(texture, context, srgb);
@@ -4283,7 +4244,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4405,7 +4366,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface->resource.map_binding = WINED3D_LOCATION_SYSMEM;
surface_prepare_map_memory(surface);
@ -280,7 +271,7 @@ index de57d25..6154315 100644
surface_remove_pbo(surface, gl_info);
}
@@ -4351,9 +4312,11 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
@@ -4474,9 +4435,11 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect);
}
@ -294,7 +285,7 @@ index de57d25..6154315 100644
HRESULT hr;
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
@@ -4380,20 +4343,6 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4503,20 +4466,6 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
}
}
@ -315,7 +306,7 @@ index de57d25..6154315 100644
if (!surface->resource.locations)
{
ERR("Surface %p does not have any up to date location.\n", surface);
@@ -5482,7 +5431,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5605,7 +5554,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
if (!wined3d_resource_is_offscreen(&dst_surface->container->resource))
{
struct wined3d_context *context = context_acquire(device, dst_surface);
@ -325,7 +316,7 @@ index de57d25..6154315 100644
context_release(context);
}
return WINED3D_OK;
@@ -5557,6 +5507,15 @@ cpu:
@@ -5680,6 +5630,15 @@ cpu:
return surface_cpu_blt(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter);
}
@ -381,10 +372,10 @@ index 17f1afe..e1a5b8a 100644
src_dc = front->hDC;
window = swapchain->win_handle;
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index ea9eacc..48717d7 100644
index 4111ceb..87944b1 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -830,7 +830,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub
@@ -785,7 +785,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub
surface_prepare_map_memory(surface);
context = context_acquire(surface->resource.device, NULL);
@ -394,10 +385,10 @@ index ea9eacc..48717d7 100644
wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b1e4cb6..059310b 100644
index 159ba51..f484e18 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2358,8 +2358,6 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
@@ -2375,8 +2375,6 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
void surface_load_ds_location(struct wined3d_surface *surface,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN;
@ -407,5 +398,5 @@ index b1e4cb6..059310b 100644
void surface_prepare_rb(struct wined3d_surface *surface,
const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN;
--
2.1.3
2.3.0

View File

@ -1,20 +1,20 @@
From ee8e2567fab13b3f0f0d88d905d0fd8dc1cdb622 Mon Sep 17 00:00:00 2001
From 4345b09b18121021362ea09caa4232d1b97bcf37 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 21 Jan 2014 16:40:56 +0100
Subject: wined3d: Replace surface alloc functions with resource ones.
---
dlls/wined3d/resource.c | 10 +++++
dlls/wined3d/surface.c | 91 ++++--------------------------------------
dlls/wined3d/surface.c | 89 ++++--------------------------------------
dlls/wined3d/texture.c | 5 +--
dlls/wined3d/wined3d_private.h | 1 -
4 files changed, 20 insertions(+), 87 deletions(-)
4 files changed, 19 insertions(+), 86 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 78441e6..c6b3945 100644
index 9b87d6b..1da4da5 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -601,6 +601,16 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru
@@ -610,6 +610,16 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru
case WINED3D_LOCATION_SYSMEM:
return wined3d_resource_prepare_system_memory(resource);
@ -32,10 +32,10 @@ index 78441e6..c6b3945 100644
ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding));
return FALSE;
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index c65a723..48de325 100644
index 3bcf0ab..0a908b1 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -479,81 +479,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
@@ -478,81 +478,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
return WINED3D_OK;
}
@ -117,7 +117,7 @@ index c65a723..48de325 100644
static void surface_evict_sysmem(struct wined3d_surface *surface)
{
/* In some conditions the surface memory must not be freed:
@@ -1160,7 +1085,7 @@ static void surface_unload(struct wined3d_resource *resource)
@@ -1159,7 +1084,7 @@ static void surface_unload(struct wined3d_resource *resource)
}
else
{
@ -126,16 +126,7 @@ index c65a723..48de325 100644
wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding);
wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
}
@@ -1781,7 +1706,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
/* To perform the color key conversion we need a sysmem copy of
* the surface. Make sure we have it. */
- surface_prepare_map_memory(surface);
+ wined3d_resource_prepare_map_memory(&surface->resource, context);
wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding);
wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
/* Switching color keying on / off may change the internal format. */
@@ -2165,7 +2090,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
@@ -2139,7 +2064,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
if (!valid_location)
{
@ -144,7 +135,7 @@ index c65a723..48de325 100644
valid_location = WINED3D_LOCATION_SYSMEM;
}
@@ -2721,7 +2646,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2695,7 +2620,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
if (device->d3d_initialized)
context = context_acquire(device, NULL);
@ -153,7 +144,7 @@ index c65a723..48de325 100644
if (flags & WINED3D_MAP_DISCARD)
{
TRACE("WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n",
@@ -4251,7 +4176,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4226,7 +4151,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
{
/* Performance warning... */
FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface);
@ -162,7 +153,7 @@ index c65a723..48de325 100644
wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding);
}
}
@@ -4262,7 +4187,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4237,7 +4162,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
{
/* Performance warning... */
FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface);
@ -171,7 +162,7 @@ index c65a723..48de325 100644
wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding);
}
}
@@ -4271,7 +4196,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4246,7 +4171,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
{
WARN("Trying to load a texture from sysmem, but no simple location is valid.\n");
/* Lets hope we get it from somewhere... */
@ -180,7 +171,7 @@ index c65a723..48de325 100644
wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM);
}
@@ -4304,7 +4229,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4272,7 +4197,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
else
surface->resource.map_binding = WINED3D_LOCATION_SYSMEM;
@ -190,10 +181,10 @@ index c65a723..48de325 100644
surface_remove_pbo(surface, gl_info);
}
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index aee50f6..869c44f 100644
index 2ae36ef..8faeefa 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -851,8 +851,8 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub
@@ -783,8 +783,8 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub
struct wined3d_surface *surface = surface_from_resource(sub_resource);
struct wined3d_context *context;
@ -203,7 +194,7 @@ index aee50f6..869c44f 100644
wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding);
context_release(context);
wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
@@ -964,8 +964,7 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi
@@ -896,8 +896,7 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi
}
else
{
@ -214,10 +205,10 @@ index aee50f6..869c44f 100644
surface->flags |= SFLAG_CLIENT;
mem = surface->resource.heap_memory;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index e32d650..beaf9bc 100644
index 4540df1..bbf9128 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2394,7 +2394,6 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w
@@ -2397,7 +2397,6 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w
GLenum target, unsigned int level, unsigned int layer, DWORD flags,
struct wined3d_surface **surface) DECLSPEC_HIDDEN;
void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
@ -226,5 +217,5 @@ index e32d650..beaf9bc 100644
const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point,
BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN;
--
2.2.1
2.3.0

File diff suppressed because it is too large Load Diff