Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ace241ad
Commit
ace241ad
authored
Aug 01, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Resolve source and destination rectangles in wined3d_surface_blt().
parent
5512c248
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
28 deletions
+28
-28
surface.c
dlls/wined3d/surface.c
+28
-28
No files found.
dlls/wined3d/surface.c
View file @
ace241ad
...
@@ -1281,15 +1281,15 @@ static HRESULT wined3d_surface_depth_blt(struct wined3d_surface *src_surface, co
...
@@ -1281,15 +1281,15 @@ static HRESULT wined3d_surface_depth_blt(struct wined3d_surface *src_surface, co
}
}
/* Do not call while under the GL lock. */
/* Do not call while under the GL lock. */
static
HRESULT
surface_blt
(
struct
wined3d_surface
*
dst_surface
,
const
RECT
*
dst_rect
_in
,
static
HRESULT
surface_blt
(
struct
wined3d_surface
*
dst_surface
,
const
RECT
*
dst_rect
,
struct
wined3d_surface
*
src_surface
,
const
RECT
*
src_rect
_in
,
DWORD
flags
,
struct
wined3d_surface
*
src_surface
,
const
RECT
*
src_rect
,
DWORD
flags
,
const
WINEDDBLTFX
*
fx
,
WINED3DTEXTUREFILTERTYPE
filter
)
const
WINEDDBLTFX
*
fx
,
WINED3DTEXTUREFILTERTYPE
filter
)
{
{
struct
wined3d_device
*
device
=
dst_surface
->
resource
.
device
;
struct
wined3d_device
*
device
=
dst_surface
->
resource
.
device
;
DWORD
src_ds_flags
,
dst_ds_flags
;
DWORD
src_ds_flags
,
dst_ds_flags
;
TRACE
(
"dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.
\n
"
,
TRACE
(
"dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.
\n
"
,
dst_surface
,
wine_dbgstr_rect
(
dst_rect
_in
),
src_surface
,
wine_dbgstr_rect
(
src_rect_in
),
dst_surface
,
wine_dbgstr_rect
(
dst_rect
),
src_surface
,
wine_dbgstr_rect
(
src_rect
),
flags
,
fx
,
debug_d3dtexturefiltertype
(
filter
));
flags
,
fx
,
debug_d3dtexturefiltertype
(
filter
));
TRACE
(
"Usage is %s.
\n
"
,
debug_d3dusage
(
dst_surface
->
resource
.
usage
));
TRACE
(
"Usage is %s.
\n
"
,
debug_d3dusage
(
dst_surface
->
resource
.
usage
));
...
@@ -1310,22 +1310,17 @@ static HRESULT surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_
...
@@ -1310,22 +1310,17 @@ static HRESULT surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_
if
(
flags
&
WINEDDBLT_DEPTHFILL
)
if
(
flags
&
WINEDDBLT_DEPTHFILL
)
{
{
float
depth
;
float
depth
;
RECT
rect
;
TRACE
(
"Depth fill.
\n
"
);
TRACE
(
"Depth fill.
\n
"
);
surface_get_rect
(
dst_surface
,
dst_rect_in
,
&
rect
);
if
(
!
surface_convert_depth_to_float
(
dst_surface
,
fx
->
u5
.
dwFillDepth
,
&
depth
))
if
(
!
surface_convert_depth_to_float
(
dst_surface
,
fx
->
u5
.
dwFillDepth
,
&
depth
))
return
WINED3DERR_INVALIDCALL
;
return
WINED3DERR_INVALIDCALL
;
if
(
SUCCEEDED
(
wined3d_surface_depth_fill
(
dst_surface
,
&
rect
,
depth
)))
if
(
SUCCEEDED
(
wined3d_surface_depth_fill
(
dst_surface
,
dst_
rect
,
depth
)))
return
WINED3D_OK
;
return
WINED3D_OK
;
}
}
else
else
{
{
RECT
src_rect
,
dst_rect
;
/* Accessing depth / stencil surfaces is supposed to fail while in
/* Accessing depth / stencil surfaces is supposed to fail while in
* a scene, except for fills, which seem to work. */
* a scene, except for fills, which seem to work. */
if
(
device
->
inScene
)
if
(
device
->
inScene
)
...
@@ -1340,21 +1335,21 @@ static HRESULT surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_
...
@@ -1340,21 +1335,21 @@ static HRESULT surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_
return
WINED3DERR_INVALIDCALL
;
return
WINED3DERR_INVALIDCALL
;
}
}
if
(
src_rect
_in
&&
(
src_rect_in
->
top
||
src_rect_in
->
left
if
(
src_rect
->
top
||
src_rect
->
left
||
src_rect
_in
->
bottom
!=
src_surface
->
resource
.
height
||
src_rect
->
bottom
!=
src_surface
->
resource
.
height
||
src_rect
_in
->
right
!=
src_surface
->
resource
.
width
)
)
||
src_rect
->
right
!=
src_surface
->
resource
.
width
)
{
{
WARN
(
"Rejecting depth / stencil blit with invalid source rect %s.
\n
"
,
WARN
(
"Rejecting depth / stencil blit with invalid source rect %s.
\n
"
,
wine_dbgstr_rect
(
src_rect
_in
));
wine_dbgstr_rect
(
src_rect
));
return
WINED3DERR_INVALIDCALL
;
return
WINED3DERR_INVALIDCALL
;
}
}
if
(
dst_rect
_in
&&
(
dst_rect_in
->
top
||
dst_rect_in
->
left
if
(
dst_rect
->
top
||
dst_rect
->
left
||
dst_rect
_in
->
bottom
!=
dst_surface
->
resource
.
height
||
dst_rect
->
bottom
!=
dst_surface
->
resource
.
height
||
dst_rect
_in
->
right
!=
dst_surface
->
resource
.
width
)
)
||
dst_rect
->
right
!=
dst_surface
->
resource
.
width
)
{
{
WARN
(
"Rejecting depth / stencil blit with invalid destination rect %s.
\n
"
,
WARN
(
"Rejecting depth / stencil blit with invalid destination rect %s.
\n
"
,
wine_dbgstr_rect
(
src_rect
_in
));
wine_dbgstr_rect
(
src_rect
));
return
WINED3DERR_INVALIDCALL
;
return
WINED3DERR_INVALIDCALL
;
}
}
...
@@ -1365,10 +1360,7 @@ static HRESULT surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_
...
@@ -1365,10 +1360,7 @@ static HRESULT surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_
return
WINED3DERR_INVALIDCALL
;
return
WINED3DERR_INVALIDCALL
;
}
}
surface_get_rect
(
src_surface
,
src_rect_in
,
&
src_rect
);
if
(
SUCCEEDED
(
wined3d_surface_depth_blt
(
src_surface
,
src_rect
,
dst_surface
,
dst_rect
)))
surface_get_rect
(
dst_surface
,
dst_rect_in
,
&
dst_rect
);
if
(
SUCCEEDED
(
wined3d_surface_depth_blt
(
src_surface
,
&
src_rect
,
dst_surface
,
&
dst_rect
)))
return
WINED3D_OK
;
return
WINED3D_OK
;
}
}
}
}
...
@@ -1377,15 +1369,15 @@ static HRESULT surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_
...
@@ -1377,15 +1369,15 @@ static HRESULT surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_
if
((
dst_surface
->
resource
.
usage
&
WINED3DUSAGE_RENDERTARGET
)
if
((
dst_surface
->
resource
.
usage
&
WINED3DUSAGE_RENDERTARGET
)
||
(
src_surface
&&
(
src_surface
->
resource
.
usage
&
WINED3DUSAGE_RENDERTARGET
)))
||
(
src_surface
&&
(
src_surface
->
resource
.
usage
&
WINED3DUSAGE_RENDERTARGET
)))
{
{
if
(
SUCCEEDED
(
IWineD3DSurfaceImpl_BltOverride
(
dst_surface
,
dst_rect
_in
,
if
(
SUCCEEDED
(
IWineD3DSurfaceImpl_BltOverride
(
dst_surface
,
dst_rect
,
src_surface
,
src_rect
_in
,
flags
,
fx
,
filter
)))
src_surface
,
src_rect
,
flags
,
fx
,
filter
)))
return
WINED3D_OK
;
return
WINED3D_OK
;
}
}
/* For the rest call the X11 surface implementation. For render targets
/* For the rest call the X11 surface implementation. For render targets
* this should be implemented OpenGL accelerated in BltOverride, other
* this should be implemented OpenGL accelerated in BltOverride, other
* blits are rather rare. */
* blits are rather rare. */
return
surface_cpu_blt
(
dst_surface
,
dst_rect
_in
,
src_surface
,
src_rect_in
,
flags
,
fx
,
filter
);
return
surface_cpu_blt
(
dst_surface
,
dst_rect
,
src_surface
,
src_rect
,
flags
,
fx
,
filter
);
}
}
/* Do not call while under the GL lock. */
/* Do not call while under the GL lock. */
...
@@ -3410,16 +3402,24 @@ do { \
...
@@ -3410,16 +3402,24 @@ do { \
}
}
/* Do not call while under the GL lock. */
/* Do not call while under the GL lock. */
HRESULT
CDECL
wined3d_surface_blt
(
struct
wined3d_surface
*
dst_surface
,
const
RECT
*
dst_rect
,
HRESULT
CDECL
wined3d_surface_blt
(
struct
wined3d_surface
*
dst_surface
,
const
RECT
*
dst_rect
_in
,
struct
wined3d_surface
*
src_surface
,
const
RECT
*
src_rect
,
DWORD
flags
,
struct
wined3d_surface
*
src_surface
,
const
RECT
*
src_rect
_in
,
DWORD
flags
,
const
WINEDDBLTFX
*
fx
,
WINED3DTEXTUREFILTERTYPE
filter
)
const
WINEDDBLTFX
*
fx
,
WINED3DTEXTUREFILTERTYPE
filter
)
{
{
RECT
src_rect
,
dst_rect
;
TRACE
(
"dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.
\n
"
,
TRACE
(
"dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.
\n
"
,
dst_surface
,
wine_dbgstr_rect
(
dst_rect
),
src_surface
,
wine_dbgstr_rect
(
src_rect
),
dst_surface
,
wine_dbgstr_rect
(
dst_rect
_in
),
src_surface
,
wine_dbgstr_rect
(
src_rect_in
),
flags
,
fx
,
debug_d3dtexturefiltertype
(
filter
));
flags
,
fx
,
debug_d3dtexturefiltertype
(
filter
));
surface_get_rect
(
dst_surface
,
dst_rect_in
,
&
dst_rect
);
if
(
src_surface
)
surface_get_rect
(
src_surface
,
src_rect_in
,
&
src_rect
);
else
memset
(
&
src_rect
,
0
,
sizeof
(
src_rect
));
return
dst_surface
->
surface_ops
->
surface_blt
(
dst_surface
,
return
dst_surface
->
surface_ops
->
surface_blt
(
dst_surface
,
dst_rect
,
src_surface
,
src_rect
,
flags
,
fx
,
filter
);
&
dst_rect
,
src_surface
,
&
src_rect
,
flags
,
fx
,
filter
);
}
}
/* Do not call while under the GL lock. */
/* Do not call while under the GL lock. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment