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
612ceee6
Commit
612ceee6
authored
Mar 05, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass a texture to surface_translate_drawable_coords().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
665c8c84
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
32 deletions
+32
-32
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+1
-1
surface.c
dlls/wined3d/surface.c
+3
-30
texture.c
dlls/wined3d/texture.c
+26
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-1
No files found.
dlls/wined3d/arb_program_shader.c
View file @
612ceee6
...
...
@@ -7847,7 +7847,7 @@ static DWORD arbfp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bl
if
(
dst_location
==
WINED3D_LOCATION_DRAWABLE
)
{
d
=
*
dst_rect
;
surface_translate_drawable_coords
(
dst_surfac
e
,
context
->
win_handle
,
&
d
);
wined3d_texture_translate_drawable_coords
(
dst_textur
e
,
context
->
win_handle
,
&
d
);
dst_rect
=
&
d
;
}
...
...
dlls/wined3d/surface.c
View file @
612ceee6
...
...
@@ -449,7 +449,7 @@ static void surface_blt_fbo(const struct wined3d_device *device,
{
TRACE
(
"Source surface %p is onscreen.
\n
"
,
src_surface
);
buffer
=
wined3d_texture_get_gl_buffer
(
src_texture
);
surface_translate_drawable_coords
(
src_surfac
e
,
context
->
win_handle
,
&
src_rect
);
wined3d_texture_translate_drawable_coords
(
src_textur
e
,
context
->
win_handle
,
&
src_rect
);
}
else
{
...
...
@@ -466,7 +466,7 @@ static void surface_blt_fbo(const struct wined3d_device *device,
{
TRACE
(
"Destination surface %p is onscreen.
\n
"
,
dst_surface
);
buffer
=
wined3d_texture_get_gl_buffer
(
dst_texture
);
surface_translate_drawable_coords
(
dst_surfac
e
,
context
->
win_handle
,
&
dst_rect
);
wined3d_texture_translate_drawable_coords
(
dst_textur
e
,
context
->
win_handle
,
&
dst_rect
);
}
else
{
...
...
@@ -2005,33 +2005,6 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
wined3d_texture_invalidate_location
(
dst_texture
,
dst_sub_resource_idx
,
~
WINED3D_LOCATION_TEXTURE_RGB
);
}
/* Front buffer coordinates are always full screen coordinates, but our GL
* 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_drawable_coords
(
const
struct
wined3d_surface
*
surface
,
HWND
window
,
RECT
*
rect
)
{
struct
wined3d_texture
*
texture
=
surface
->
container
;
POINT
offset
=
{
0
,
0
};
UINT
drawable_height
;
RECT
windowsize
;
if
(
!
texture
->
swapchain
)
return
;
if
(
texture
==
texture
->
swapchain
->
front_buffer
)
{
ScreenToClient
(
window
,
&
offset
);
OffsetRect
(
rect
,
offset
.
x
,
offset
.
y
);
}
GetClientRect
(
window
,
&
windowsize
);
drawable_height
=
windowsize
.
bottom
-
windowsize
.
top
;
rect
->
top
=
drawable_height
-
rect
->
top
;
rect
->
bottom
=
drawable_height
-
rect
->
bottom
;
}
static
HRESULT
surface_blt_special
(
struct
wined3d_surface
*
dst_surface
,
const
RECT
*
dst_rect
,
struct
wined3d_surface
*
src_surface
,
const
RECT
*
src_rect
,
DWORD
flags
,
const
struct
wined3d_blt_fx
*
fx
,
enum
wined3d_texture_filter_type
filter
)
...
...
@@ -2925,7 +2898,7 @@ static DWORD ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit
if
(
dst_location
==
WINED3D_LOCATION_DRAWABLE
)
{
r
=
*
dst_rect
;
surface_translate_drawable_coords
(
dst_surfac
e
,
context
->
win_handle
,
&
r
);
wined3d_texture_translate_drawable_coords
(
dst_textur
e
,
context
->
win_handle
,
&
r
);
dst_rect
=
&
r
;
}
...
...
dlls/wined3d/texture.c
View file @
612ceee6
...
...
@@ -48,6 +48,32 @@ static BOOL wined3d_texture_use_immutable_storage(const struct wined3d_texture *
&&
!
(
texture
->
resource
.
format_flags
&
WINED3DFMT_FLAG_HEIGHT_SCALE
);
}
/* Front buffer coordinates are always full screen coordinates, but our GL
* 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
wined3d_texture_translate_drawable_coords
(
const
struct
wined3d_texture
*
texture
,
HWND
window
,
RECT
*
rect
)
{
unsigned
int
drawable_height
;
POINT
offset
=
{
0
,
0
};
RECT
windowsize
;
if
(
!
texture
->
swapchain
)
return
;
if
(
texture
==
texture
->
swapchain
->
front_buffer
)
{
ScreenToClient
(
window
,
&
offset
);
OffsetRect
(
rect
,
offset
.
x
,
offset
.
y
);
}
GetClientRect
(
window
,
&
windowsize
);
drawable_height
=
windowsize
.
bottom
-
windowsize
.
top
;
rect
->
top
=
drawable_height
-
rect
->
top
;
rect
->
bottom
=
drawable_height
-
rect
->
bottom
;
}
GLenum
wined3d_texture_get_gl_buffer
(
const
struct
wined3d_texture
*
texture
)
{
const
struct
wined3d_swapchain
*
swapchain
=
texture
->
swapchain
;
...
...
dlls/wined3d/wined3d_private.h
View file @
612ceee6
...
...
@@ -3254,6 +3254,8 @@ void wined3d_texture_prepare_texture(struct wined3d_texture *texture,
void
wined3d_texture_set_map_binding
(
struct
wined3d_texture
*
texture
,
DWORD
map_binding
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_set_swapchain
(
struct
wined3d_texture
*
texture
,
struct
wined3d_swapchain
*
swapchain
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_translate_drawable_coords
(
const
struct
wined3d_texture
*
texture
,
HWND
window
,
RECT
*
rect
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_upload_data
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
const
struct
wined3d_context
*
context
,
const
struct
wined3d_box
*
box
,
const
struct
wined3d_const_bo_address
*
data
,
unsigned
int
row_pitch
,
unsigned
int
slice_pitch
)
DECLSPEC_HIDDEN
;
...
...
@@ -3338,7 +3340,6 @@ BOOL surface_load_location(struct wined3d_surface *surface,
struct
wined3d_context
*
context
,
DWORD
location
)
DECLSPEC_HIDDEN
;
void
surface_set_compatible_renderbuffer
(
struct
wined3d_surface
*
surface
,
const
struct
wined3d_rendertarget_info
*
rt
)
DECLSPEC_HIDDEN
;
void
surface_translate_drawable_coords
(
const
struct
wined3d_surface
*
surface
,
HWND
window
,
RECT
*
rect
)
DECLSPEC_HIDDEN
;
void
wined3d_surface_upload_data
(
struct
wined3d_surface
*
surface
,
const
struct
wined3d_gl_info
*
gl_info
,
const
struct
wined3d_format
*
format
,
const
RECT
*
src_rect
,
UINT
src_pitch
,
const
POINT
*
dst_point
,
BOOL
srgb
,
const
struct
wined3d_const_bo_address
*
data
)
DECLSPEC_HIDDEN
;
...
...
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