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
baff64a2
Commit
baff64a2
authored
Apr 04, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Properly determine the viewport size for front buffer blits in SetupForBlit().
parent
81ca5d09
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
12 deletions
+36
-12
context.c
dlls/wined3d/context.c
+36
-12
No files found.
dlls/wined3d/context.c
View file @
baff64a2
...
@@ -1638,6 +1638,26 @@ static void set_blit_dimension(UINT width, UINT height)
...
@@ -1638,6 +1638,26 @@ static void set_blit_dimension(UINT width, UINT height)
checkGLcall
(
"glViewport"
);
checkGLcall
(
"glViewport"
);
}
}
static
void
context_get_rt_size
(
const
struct
wined3d_context
*
context
,
SIZE
*
size
)
{
const
struct
wined3d_surface
*
rt
=
context
->
current_rt
;
if
(
rt
->
container
.
type
==
WINED3D_CONTAINER_SWAPCHAIN
&&
rt
->
container
.
u
.
swapchain
->
front_buffer
==
rt
)
{
RECT
window_size
;
GetClientRect
(
context
->
win_handle
,
&
window_size
);
size
->
cx
=
window_size
.
right
-
window_size
.
left
;
size
->
cy
=
window_size
.
bottom
-
window_size
.
top
;
return
;
}
size
->
cx
=
rt
->
resource
.
width
;
size
->
cy
=
rt
->
resource
.
height
;
}
/*****************************************************************************
/*****************************************************************************
* SetupForBlit
* SetupForBlit
*
*
...
@@ -1659,21 +1679,24 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con
...
@@ -1659,21 +1679,24 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con
{
{
int
i
;
int
i
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
UINT
width
=
context
->
current_rt
->
resource
.
width
;
UINT
height
=
context
->
current_rt
->
resource
.
height
;
DWORD
sampler
;
DWORD
sampler
;
SIZE
rt_size
;
TRACE
(
"Setting up context %p for blitting
\n
"
,
context
);
TRACE
(
"Setting up context %p for blitting
\n
"
,
context
);
if
(
context
->
last_was_blit
)
{
if
(
context
->
blit_w
!=
width
||
context
->
blit_h
!=
height
)
{
context_get_rt_size
(
context
,
&
rt_size
);
if
(
context
->
last_was_blit
)
{
if
(
context
->
blit_w
!=
rt_size
.
cx
||
context
->
blit_h
!=
rt_size
.
cy
)
{
ENTER_GL
();
ENTER_GL
();
set_blit_dimension
(
width
,
height
);
set_blit_dimension
(
rt_size
.
cx
,
rt_size
.
cy
);
LEAVE_GL
();
LEAVE_GL
();
context
->
blit_w
=
width
;
context
->
blit_h
=
height
;
context
->
blit_w
=
rt_size
.
cx
;
/* No need to dirtify here, the states are still dirtified because they weren't
context
->
blit_h
=
rt_size
.
cy
;
* applied since the last SetupForBlit call. Otherwise last_was_blit would not
/* No need to dirtify here, the states are still dirtified because
* be set
* they weren't applied since the last SetupForBlit() call. */
*/
}
}
TRACE
(
"Context is already set up for blitting, nothing to do
\n
"
);
TRACE
(
"Context is already set up for blitting, nothing to do
\n
"
);
return
;
return
;
...
@@ -1839,12 +1862,13 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con
...
@@ -1839,12 +1862,13 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con
glDisable
(
GL_CLIP_PLANE5
);
checkGLcall
(
"glDisable(clip plane 5)"
);
glDisable
(
GL_CLIP_PLANE5
);
checkGLcall
(
"glDisable(clip plane 5)"
);
context_invalidate_state
(
context
,
STATE_RENDER
(
WINED3D_RS_CLIPPING
));
context_invalidate_state
(
context
,
STATE_RENDER
(
WINED3D_RS_CLIPPING
));
set_blit_dimension
(
width
,
height
);
set_blit_dimension
(
rt_size
.
cx
,
rt_size
.
cy
);
device
->
frag_pipe
->
enable_extension
(
FALSE
);
device
->
frag_pipe
->
enable_extension
(
FALSE
);
LEAVE_GL
();
LEAVE_GL
();
context
->
blit_w
=
width
;
context
->
blit_h
=
height
;
context
->
blit_w
=
rt_size
.
cx
;
context
->
blit_h
=
rt_size
.
cy
;
context_invalidate_state
(
context
,
STATE_VIEWPORT
);
context_invalidate_state
(
context
,
STATE_VIEWPORT
);
context_invalidate_state
(
context
,
STATE_TRANSFORM
(
WINED3D_TS_PROJECTION
));
context_invalidate_state
(
context
,
STATE_TRANSFORM
(
WINED3D_TS_PROJECTION
));
}
}
...
...
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