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
e35b6aa1
Commit
e35b6aa1
authored
Nov 01, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Change surface_translate_frontbuffer_coords() to handle all drawable coordinates.
parent
b9e7c349
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
41 deletions
+28
-41
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+3
-14
surface.c
dlls/wined3d/surface.c
+24
-26
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/arb_program_shader.c
View file @
e35b6aa1
...
...
@@ -7153,21 +7153,8 @@ HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_
context
=
context_acquire
(
device
,
dst_surface
);
context_apply_blit_state
(
context
,
device
);
/* The coordinates of the ddraw front buffer are always fullscreen ('screen coordinates',
* while OpenGL coordinates are window relative.
* Also beware of the origin difference(top left vs bottom left).
* Also beware that the front buffer's surface size is screen width x screen height,
* whereas the real gl drawable size is the size of the window. */
dst_swapchain
=
dst_surface
->
container
.
type
==
WINED3D_CONTAINER_SWAPCHAIN
?
dst_surface
->
container
.
u
.
swapchain
:
NULL
;
if
(
!
surface_is_offscreen
(
dst_surface
))
{
if
(
dst_swapchain
&&
dst_surface
==
dst_swapchain
->
front_buffer
)
surface_translate_frontbuffer_coords
(
dst_surface
,
context
->
win_handle
,
&
dst_rect
);
dst_rect
.
top
=
dst_surface
->
currentDesc
.
Height
-
dst_rect
.
top
;
dst_rect
.
bottom
=
dst_surface
->
currentDesc
.
Height
-
dst_rect
.
bottom
;
}
surface_translate_drawable_coords
(
dst_surface
,
context
->
win_handle
,
&
dst_rect
);
arbfp_blit_set
((
IWineD3DDevice
*
)
device
,
src_surface
);
...
...
@@ -7181,6 +7168,8 @@ HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_
/* Leave the opengl state valid for blitting */
arbfp_blit_unset
((
IWineD3DDevice
*
)
device
);
dst_swapchain
=
dst_surface
->
container
.
type
==
WINED3D_CONTAINER_SWAPCHAIN
?
dst_surface
->
container
.
u
.
swapchain
:
NULL
;
if
(
wined3d_settings
.
strict_draw_ordering
||
(
dst_swapchain
&&
(
dst_surface
==
dst_swapchain
->
front_buffer
||
dst_swapchain
->
num_contexts
>
1
)))
...
...
dlls/wined3d/surface.c
View file @
e35b6aa1
...
...
@@ -3176,15 +3176,29 @@ static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum blit_
* drawable is limited to the window's client area. The sysmem and texture
* copies do have the full screen size. Note that GL has a bottom-left
* origin, while D3D has a top-left origin. */
void
surface_translate_
frontbuffer
_coords
(
IWineD3DSurfaceImpl
*
surface
,
HWND
window
,
RECT
*
rect
)
void
surface_translate_
drawable
_coords
(
IWineD3DSurfaceImpl
*
surface
,
HWND
window
,
RECT
*
rect
)
{
POINT
offset
=
{
0
,
surface
->
currentDesc
.
Height
};
RECT
windowsize
;
UINT
drawable_height
;
GetClientRect
(
window
,
&
windowsize
);
offset
.
y
-=
windowsize
.
bottom
-
windowsize
.
top
;
ScreenToClient
(
window
,
&
offset
);
OffsetRect
(
rect
,
offset
.
x
,
offset
.
y
);
if
(
surface
->
container
.
type
==
WINED3D_CONTAINER_SWAPCHAIN
&&
surface
==
surface
->
container
.
u
.
swapchain
->
front_buffer
)
{
POINT
offset
=
{
0
,
0
};
RECT
windowsize
;
ScreenToClient
(
window
,
&
offset
);
OffsetRect
(
rect
,
offset
.
x
,
offset
.
y
);
GetClientRect
(
window
,
&
windowsize
);
drawable_height
=
windowsize
.
bottom
-
windowsize
.
top
;
}
else
{
drawable_height
=
surface
->
currentDesc
.
Height
;
}
rect
->
top
=
drawable_height
-
rect
->
top
;
rect
->
bottom
=
drawable_height
-
rect
->
bottom
;
}
static
BOOL
surface_is_full_rect
(
IWineD3DSurfaceImpl
*
surface
,
const
RECT
*
r
)
...
...
@@ -3262,11 +3276,7 @@ static void surface_blt_fbo(IWineD3DDeviceImpl *device, const WINED3DTEXTUREFILT
TRACE
(
"Source surface %p is onscreen.
\n
"
,
src_surface
);
if
(
buffer
==
GL_FRONT
)
surface_translate_frontbuffer_coords
(
src_surface
,
context
->
win_handle
,
&
src_rect
);
src_rect
.
top
=
src_surface
->
currentDesc
.
Height
-
src_rect
.
top
;
src_rect
.
bottom
=
src_surface
->
currentDesc
.
Height
-
src_rect
.
bottom
;
surface_translate_drawable_coords
(
src_surface
,
context
->
win_handle
,
&
src_rect
);
ENTER_GL
();
context_bind_fbo
(
context
,
GL_READ_FRAMEBUFFER
,
NULL
);
...
...
@@ -3289,11 +3299,7 @@ static void surface_blt_fbo(IWineD3DDeviceImpl *device, const WINED3DTEXTUREFILT
TRACE
(
"Destination surface %p is onscreen.
\n
"
,
dst_surface
);
if
(
buffer
==
GL_FRONT
)
surface_translate_frontbuffer_coords
(
dst_surface
,
context
->
win_handle
,
&
dst_rect
);
dst_rect
.
top
=
dst_surface
->
currentDesc
.
Height
-
dst_rect
.
top
;
dst_rect
.
bottom
=
dst_surface
->
currentDesc
.
Height
-
dst_rect
.
bottom
;
surface_translate_drawable_coords
(
dst_surface
,
context
->
win_handle
,
&
dst_rect
);
ENTER_GL
();
context_bind_fbo
(
context
,
GL_DRAW_FRAMEBUFFER
,
NULL
);
...
...
@@ -3353,15 +3359,7 @@ static void surface_blt_to_drawable(IWineD3DDeviceImpl *device,
context_apply_blit_state
(
context
,
device
);
if
(
!
surface_is_offscreen
(
dst_surface
))
{
if
(
swapchain
&&
dst_surface
==
swapchain
->
front_buffer
)
{
surface_translate_frontbuffer_coords
(
dst_surface
,
context
->
win_handle
,
&
dst_rect
);
}
dst_rect
.
top
=
dst_surface
->
currentDesc
.
Height
-
dst_rect
.
top
;
dst_rect
.
bottom
=
dst_surface
->
currentDesc
.
Height
-
dst_rect
.
bottom
;
}
surface_translate_drawable_coords
(
dst_surface
,
context
->
win_handle
,
&
dst_rect
);
device
->
blitter
->
set_shader
((
IWineD3DDevice
*
)
device
,
src_surface
);
...
...
dlls/wined3d/wined3d_private.h
View file @
e35b6aa1
...
...
@@ -2178,7 +2178,7 @@ void surface_set_container(IWineD3DSurfaceImpl *surface,
enum
wined3d_container_type
type
,
IWineD3DBase
*
container
)
DECLSPEC_HIDDEN
;
void
surface_set_texture_name
(
IWineD3DSurfaceImpl
*
surface
,
GLuint
name
,
BOOL
srgb_name
)
DECLSPEC_HIDDEN
;
void
surface_set_texture_target
(
IWineD3DSurfaceImpl
*
surface
,
GLenum
target
)
DECLSPEC_HIDDEN
;
void
surface_translate_
frontbuffer
_coords
(
IWineD3DSurfaceImpl
*
surface
,
HWND
window
,
RECT
*
rect
)
DECLSPEC_HIDDEN
;
void
surface_translate_
drawable
_coords
(
IWineD3DSurfaceImpl
*
surface
,
HWND
window
,
RECT
*
rect
)
DECLSPEC_HIDDEN
;
/* Predeclare the shared Surface functions */
HRESULT
WINAPI
IWineD3DBaseSurfaceImpl_QueryInterface
(
IWineD3DSurface
*
iface
,
...
...
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