[PATCH 3/5] wined3d: Get rid of surface_set_dirty().

Henri Verbeet hverbeet at codeweavers.com
Mon Nov 25 05:31:21 CST 2013


---
 dlls/wined3d/surface.c |   14 --------------
 dlls/wined3d/texture.c |    7 +++++--
 2 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 8d18c42..3bf4926 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2240,20 +2240,6 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface)
     return GL_BACK;
 }
 
-/* Slightly inefficient way to handle multiple dirty rects but it works :) */
-void surface_set_dirty(struct wined3d_surface *surface)
-{
-    TRACE("surface %p.\n", surface);
-
-    if (!(surface->flags & SFLAG_INSYSMEM) && (surface->flags & SFLAG_INTEXTURE))
-        surface_load_location(surface, SFLAG_INSYSMEM);
-
-    surface_validate_location(surface, SFLAG_INSYSMEM);
-    surface_invalidate_location(surface, ~SFLAG_INSYSMEM);
-
-    wined3d_texture_set_dirty(surface->container);
-}
-
 void surface_load(struct wined3d_surface *surface, BOOL srgb)
 {
     DWORD flag = srgb ? SFLAG_INSRGBTEX : SFLAG_INTEXTURE;
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 6256b91..879a91a 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -658,7 +658,6 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
         return WINED3DERR_INVALIDCALL;
     }
 
-    wined3d_texture_set_dirty(texture);
     texture->texture_ops->texture_sub_resource_add_dirty_region(sub_resource, dirty_region);
 
     return WINED3D_OK;
@@ -673,7 +672,10 @@ static void texture2d_sub_resource_load(struct wined3d_resource *sub_resource,
 static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub_resource,
         const struct wined3d_box *dirty_region)
 {
-    surface_set_dirty(surface_from_resource(sub_resource));
+    struct wined3d_surface *surface = surface_from_resource(sub_resource);
+
+    surface_load_location(surface, SFLAG_INSYSMEM);
+    surface_invalidate_location(surface, ~SFLAG_INSYSMEM);
 }
 
 static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource)
@@ -996,6 +998,7 @@ static void texture3d_sub_resource_load(struct wined3d_resource *sub_resource,
 static void texture3d_sub_resource_add_dirty_region(struct wined3d_resource *sub_resource,
         const struct wined3d_box *dirty_region)
 {
+    wined3d_texture_set_dirty(volume_from_resource(sub_resource)->container);
 }
 
 static void texture3d_sub_resource_cleanup(struct wined3d_resource *sub_resource)
-- 
1.7.10.4




More information about the wine-patches mailing list