wined3d: Remove surface->dirtyRect.

This commit is contained in:
Stefan Dösinger 2013-11-20 12:33:32 +01:00 committed by Alexandre Julliard
parent 047ce3af6e
commit 0ff0a6e9bc
3 changed files with 6 additions and 46 deletions

View File

@ -850,22 +850,7 @@ static void surface_map(struct wined3d_surface *surface, const RECT *rect, DWORD
} }
if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
{ surface_set_dirty(surface);
if (!rect)
surface_add_dirty_rect(surface, NULL);
else
{
struct wined3d_box b;
b.left = rect->left;
b.top = rect->top;
b.right = rect->right;
b.bottom = rect->bottom;
b.front = 0;
b.back = 1;
surface_add_dirty_rect(surface, &b);
}
}
} }
static void surface_unmap(struct wined3d_surface *surface) static void surface_unmap(struct wined3d_surface *surface)
@ -904,19 +889,10 @@ static void surface_unmap(struct wined3d_surface *surface)
} }
if (surface->swapchain && surface->swapchain->front_buffer == surface) if (surface->swapchain && surface->swapchain->front_buffer == surface)
{
surface_load_location(surface, surface->draw_binding); surface_load_location(surface, surface->draw_binding);
surface->dirtyRect.left = surface->resource.width;
surface->dirtyRect.top = surface->resource.height;
surface->dirtyRect.right = 0;
surface->dirtyRect.bottom = 0;
}
else if (surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) else if (surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL))
{
FIXME("Depth / stencil buffer locking is not implemented.\n"); FIXME("Depth / stencil buffer locking is not implemented.\n");
} }
}
static BOOL surface_is_full_rect(const struct wined3d_surface *surface, const RECT *r) static BOOL surface_is_full_rect(const struct wined3d_surface *surface, const RECT *r)
{ {
@ -2314,9 +2290,9 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface)
} }
/* Slightly inefficient way to handle multiple dirty rects but it works :) */ /* Slightly inefficient way to handle multiple dirty rects but it works :) */
void surface_add_dirty_rect(struct wined3d_surface *surface, const struct wined3d_box *dirty_rect) void surface_set_dirty(struct wined3d_surface *surface)
{ {
TRACE("surface %p, dirty_rect %p.\n", surface, dirty_rect); TRACE("surface %p.\n", surface);
if (!(surface->flags & SFLAG_INSYSMEM) && (surface->flags & SFLAG_INTEXTURE)) if (!(surface->flags & SFLAG_INSYSMEM) && (surface->flags & SFLAG_INTEXTURE))
surface_load_location(surface, SFLAG_INSYSMEM); surface_load_location(surface, SFLAG_INSYSMEM);
@ -2324,21 +2300,6 @@ void surface_add_dirty_rect(struct wined3d_surface *surface, const struct wined3
surface_validate_location(surface, SFLAG_INSYSMEM); surface_validate_location(surface, SFLAG_INSYSMEM);
surface_invalidate_location(surface, ~SFLAG_INSYSMEM); surface_invalidate_location(surface, ~SFLAG_INSYSMEM);
if (dirty_rect)
{
surface->dirtyRect.left = min(surface->dirtyRect.left, dirty_rect->left);
surface->dirtyRect.top = min(surface->dirtyRect.top, dirty_rect->top);
surface->dirtyRect.right = max(surface->dirtyRect.right, dirty_rect->right);
surface->dirtyRect.bottom = max(surface->dirtyRect.bottom, dirty_rect->bottom);
}
else
{
surface->dirtyRect.left = 0;
surface->dirtyRect.top = 0;
surface->dirtyRect.right = surface->resource.width;
surface->dirtyRect.bottom = surface->resource.height;
}
wined3d_texture_set_dirty(surface->container); wined3d_texture_set_dirty(surface->container);
} }
@ -6635,7 +6596,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
surface->flags |= SFLAG_DYNLOCK; surface->flags |= SFLAG_DYNLOCK;
/* Mark the texture as dirty so that it gets loaded first time around. */ /* Mark the texture as dirty so that it gets loaded first time around. */
surface_add_dirty_rect(surface, NULL); surface_set_dirty(surface);
list_init(&surface->renderbuffers); list_init(&surface->renderbuffers);
TRACE("surface %p, memory %p, size %u\n", TRACE("surface %p, memory %p, size %u\n",

View File

@ -689,7 +689,7 @@ static void texture2d_preload(struct wined3d_texture *texture,
static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub_resource, static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub_resource,
const struct wined3d_box *dirty_region) const struct wined3d_box *dirty_region)
{ {
surface_add_dirty_rect(surface_from_resource(sub_resource), dirty_region); surface_set_dirty(surface_from_resource(sub_resource));
} }
static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource) static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource)

View File

@ -2202,7 +2202,6 @@ struct wined3d_surface
GLenum texture_target; GLenum texture_target;
RECT lockedRect; RECT lockedRect;
RECT dirtyRect;
int lockCount; int lockCount;
/* For GetDC */ /* For GetDC */
@ -2242,7 +2241,7 @@ static inline GLuint surface_get_texture_name(const struct wined3d_surface *surf
? surface->container->texture_srgb.name : surface->container->texture_rgb.name; ? surface->container->texture_srgb.name : surface->container->texture_rgb.name;
} }
void surface_add_dirty_rect(struct wined3d_surface *surface, const struct wined3d_box *dirty_rect) DECLSPEC_HIDDEN; void surface_set_dirty(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
HRESULT surface_color_fill(struct wined3d_surface *s, HRESULT surface_color_fill(struct wined3d_surface *s,
const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN;
GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN; GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN;