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
a2e5881d
Commit
a2e5881d
authored
Mar 17, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Handle NULL rectangles in wined3d_swapchain_present().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
240912c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
30 deletions
+25
-30
swapchain.c
dlls/wined3d/swapchain.c
+25
-30
No files found.
dlls/wined3d/swapchain.c
View file @
a2e5881d
...
...
@@ -135,6 +135,8 @@ void CDECL wined3d_swapchain_set_window(struct wined3d_swapchain *swapchain, HWN
HRESULT
CDECL
wined3d_swapchain_present
(
struct
wined3d_swapchain
*
swapchain
,
const
RECT
*
src_rect
,
const
RECT
*
dst_rect
,
HWND
dst_window_override
,
DWORD
flags
)
{
RECT
s
,
d
;
TRACE
(
"swapchain %p, src_rect %s, dst_rect %s, dst_window_override %p, flags %#x.
\n
"
,
swapchain
,
wine_dbgstr_rect
(
src_rect
),
wine_dbgstr_rect
(
dst_rect
),
dst_window_override
,
flags
);
...
...
@@ -148,6 +150,19 @@ HRESULT CDECL wined3d_swapchain_present(struct wined3d_swapchain *swapchain,
return
WINED3DERR_INVALIDCALL
;
}
if
(
!
src_rect
)
{
SetRect
(
&
s
,
0
,
0
,
swapchain
->
desc
.
backbuffer_width
,
swapchain
->
desc
.
backbuffer_height
);
src_rect
=
&
s
;
}
if
(
!
dst_rect
)
{
GetClientRect
(
swapchain
->
win_handle
,
&
d
);
dst_rect
=
&
d
;
}
wined3d_cs_emit_present
(
swapchain
->
device
->
cs
,
swapchain
,
src_rect
,
dst_rect
,
dst_window_override
,
flags
);
...
...
@@ -467,7 +482,7 @@ static void wined3d_swapchain_rotate(struct wined3d_swapchain *swapchain, struct
}
static
void
swapchain_gl_present
(
struct
wined3d_swapchain
*
swapchain
,
const
RECT
*
src_rect
_in
,
const
RECT
*
dst_rect_in
,
DWORD
flags
)
const
RECT
*
src_rect
,
const
RECT
*
dst_rect
,
DWORD
flags
)
{
struct
wined3d_surface
*
back_buffer
=
surface_from_resource
(
wined3d_texture_get_sub_resource
(
swapchain
->
back_buffers
[
0
],
0
));
...
...
@@ -475,7 +490,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
const
struct
wined3d_gl_info
*
gl_info
;
struct
wined3d_context
*
context
;
struct
wined3d_surface
*
front
;
RECT
src_rect
,
dst_rect
;
BOOL
render_to_fbo
;
context
=
context_acquire
(
swapchain
->
device
,
back_buffer
);
...
...
@@ -530,32 +544,13 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
TRACE
(
"Presenting HDC %p.
\n
"
,
context
->
hdc
);
render_to_fbo
=
swapchain
->
render_to_fbo
;
if
(
src_rect_in
)
{
src_rect
=
*
src_rect_in
;
if
(
!
render_to_fbo
&&
(
src_rect
.
left
||
src_rect
.
top
||
src_rect
.
right
!=
swapchain
->
desc
.
backbuffer_width
||
src_rect
.
bottom
!=
swapchain
->
desc
.
backbuffer_height
))
{
render_to_fbo
=
TRUE
;
}
}
else
{
SetRect
(
&
src_rect
,
0
,
0
,
swapchain
->
desc
.
backbuffer_width
,
swapchain
->
desc
.
backbuffer_height
);
}
if
(
dst_rect_in
)
dst_rect
=
*
dst_rect_in
;
else
GetClientRect
(
swapchain
->
win_handle
,
&
dst_rect
);
if
(
!
render_to_fbo
&&
(
dst_rect
.
left
||
dst_rect
.
top
||
dst_rect
.
right
!=
swapchain
->
desc
.
backbuffer_width
||
dst_rect
.
bottom
!=
swapchain
->
desc
.
backbuffer_height
))
if
(
!
(
render_to_fbo
=
swapchain
->
render_to_fbo
)
&&
(
src_rect
->
left
||
src_rect
->
top
||
src_rect
->
right
!=
swapchain
->
desc
.
backbuffer_width
||
src_rect
->
bottom
!=
swapchain
->
desc
.
backbuffer_height
||
dst_rect
->
left
||
dst_rect
->
top
||
dst_rect
->
right
!=
swapchain
->
desc
.
backbuffer_width
||
dst_rect
->
bottom
!=
swapchain
->
desc
.
backbuffer_height
))
render_to_fbo
=
TRUE
;
/* Rendering to a window of different size, presenting partial rectangles,
...
...
@@ -584,7 +579,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
if
(
swapchain
->
desc
.
swap_effect
==
WINED3D_SWAP_EFFECT_FLIP
&&
!
once
++
)
FIXME
(
"WINED3D_SWAP_EFFECT_FLIP not implemented.
\n
"
);
swapchain_blit
(
swapchain
,
context
,
&
src_rect
,
&
dst_rect
);
swapchain_blit
(
swapchain
,
context
,
src_rect
,
dst_rect
);
}
if
(
swapchain
->
num_contexts
>
1
)
...
...
@@ -709,7 +704,7 @@ static void swapchain_gdi_frontbuffer_updated(struct wined3d_swapchain *swapchai
}
static
void
swapchain_gdi_present
(
struct
wined3d_swapchain
*
swapchain
,
const
RECT
*
src_rect
_in
,
const
RECT
*
dst_rect_in
,
DWORD
flags
)
const
RECT
*
src_rect
,
const
RECT
*
dst_rect
,
DWORD
flags
)
{
struct
wined3d_surface
*
front
,
*
back
;
...
...
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