wined3d: Use IsRectEmpty() 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-05-03 21:48:05 +02:00 committed by Alexandre Julliard
parent ecb5a74b36
commit 128e6b5975
1 changed files with 3 additions and 6 deletions

View File

@ -1147,8 +1147,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
wined3d_texture_get_level_height(src_texture, src_surface->texture_level));
src_rect = &r;
}
else if (src_rect->left < 0 || src_rect->left >= src_rect->right
|| src_rect->top < 0 || src_rect->top >= src_rect->bottom)
else if (src_rect->left < 0 || src_rect->top < 0 || IsRectEmpty(src_rect))
{
WARN("Invalid source rectangle.\n");
return WINED3DERR_INVALIDCALL;
@ -4032,8 +4031,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
dst_w = wined3d_texture_get_level_width(dst_texture, dst_surface->texture_level);
dst_h = wined3d_texture_get_level_height(dst_texture, dst_surface->texture_level);
if (dst_rect->left >= dst_rect->right || dst_rect->top >= dst_rect->bottom
|| dst_rect->left > dst_w || dst_rect->left < 0
if (IsRectEmpty(dst_rect) || dst_rect->left > dst_w || dst_rect->left < 0
|| dst_rect->top > dst_h || dst_rect->top < 0
|| dst_rect->right > dst_w || dst_rect->right < 0
|| dst_rect->bottom > dst_h || dst_rect->bottom < 0)
@ -4046,8 +4044,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
{
src_w = wined3d_texture_get_level_width(src_texture, src_surface->texture_level);
src_h = wined3d_texture_get_level_height(src_texture, src_surface->texture_level);
if (src_rect->left >= src_rect->right || src_rect->top >= src_rect->bottom
|| src_rect->left > src_w || src_rect->left < 0
if (IsRectEmpty(src_rect) || src_rect->left > src_w || src_rect->left < 0
|| src_rect->top > src_h || src_rect->top < 0
|| src_rect->right > src_w || src_rect->right < 0
|| src_rect->bottom > src_h || src_rect->bottom < 0)