wined3d: Use SetRect() instead of open coding it.

Signed-off-by: Michael Stefaniuc <mstefani@redhat.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2016-07-30 22:00:33 +02:00 committed by Alexandre Julliard
parent b62f4139ed
commit 0d001e3e1c
3 changed files with 5 additions and 16 deletions

View File

@ -4271,10 +4271,7 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
state->viewport.max_z = 1.0f;
wined3d_cs_emit_set_viewport(device->cs, &state->viewport);
state->scissor_rect.top = 0;
state->scissor_rect.left = 0;
state->scissor_rect.right = view->width;
state->scissor_rect.bottom = view->height;
SetRect(&state->scissor_rect, 0, 0, view->width, view->height);
wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect);
}
@ -4928,10 +4925,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
state->viewport.height = view->height;
wined3d_cs_emit_set_viewport(device->cs, &state->viewport);
state->scissor_rect.top = 0;
state->scissor_rect.left = 0;
state->scissor_rect.right = view->width;
state->scissor_rect.bottom = view->height;
SetRect(&state->scissor_rect, 0, 0, view->width, view->height);
wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect);
}

View File

@ -216,10 +216,8 @@ static void surface_get_rect(const struct wined3d_surface *surface, const RECT *
{
const struct wined3d_texture *texture = surface->container;
rect_out->left = 0;
rect_out->top = 0;
rect_out->right = wined3d_texture_get_level_width(texture, surface->texture_level);
rect_out->bottom = wined3d_texture_get_level_height(texture, surface->texture_level);
SetRect(rect_out, 0, 0, wined3d_texture_get_level_width(texture, surface->texture_level),
wined3d_texture_get_level_height(texture, surface->texture_level));
}
}

View File

@ -2602,10 +2602,7 @@ HRESULT CDECL wined3d_texture_set_overlay_position(struct wined3d_texture *textu
surface = sub_resource->u.surface;
w = surface->overlay_destrect.right - surface->overlay_destrect.left;
h = surface->overlay_destrect.bottom - surface->overlay_destrect.top;
surface->overlay_destrect.left = x;
surface->overlay_destrect.top = y;
surface->overlay_destrect.right = x + w;
surface->overlay_destrect.bottom = y + h;
SetRect(&surface->overlay_destrect, x, y, x + w, y + h);
return WINED3D_OK;
}