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
7f1f61e2
Commit
7f1f61e2
authored
Mar 30, 2010
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Mar 31, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use RECT instead of WINED3DRECT in fb_copy_to_texture_direct.
parent
ae26d9de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
surface.c
dlls/wined3d/surface.c
+14
-14
No files found.
dlls/wined3d/surface.c
View file @
7f1f61e2
...
...
@@ -3409,7 +3409,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Flip(IWineD3DSurface *iface, IWineD3DS
* with single pixel copy calls
*/
static
inline
void
fb_copy_to_texture_direct
(
IWineD3DSurfaceImpl
*
This
,
IWineD3DSurface
*
SrcSurface
,
const
WINED3DRECT
*
srect
,
const
WINED3DRECT
*
d
rect
,
BOOL
upsidedown
,
WINED3DTEXTUREFILTERTYPE
Filter
)
const
RECT
*
src_rect
,
const
RECT
*
dst_
rect
,
BOOL
upsidedown
,
WINED3DTEXTUREFILTERTYPE
Filter
)
{
IWineD3DDeviceImpl
*
myDevice
=
This
->
resource
.
device
;
float
xrel
,
yrel
;
...
...
@@ -3436,8 +3436,8 @@ static inline void fb_copy_to_texture_direct(IWineD3DSurfaceImpl *This, IWineD3D
}
checkGLcall
(
"glReadBuffer"
);
xrel
=
(
float
)
(
sr
ect
->
x2
-
srect
->
x1
)
/
(
float
)
(
drect
->
x2
-
drect
->
x1
);
yrel
=
(
float
)
(
sr
ect
->
y2
-
srect
->
y1
)
/
(
float
)
(
drect
->
y2
-
drect
->
y1
);
xrel
=
(
float
)
(
sr
c_rect
->
right
-
src_rect
->
left
)
/
(
float
)
(
dst_rect
->
right
-
dst_rect
->
left
);
yrel
=
(
float
)
(
sr
c_rect
->
bottom
-
src_rect
->
top
)
/
(
float
)
(
dst_rect
->
bottom
-
dst_rect
->
top
);
if
((
xrel
-
1
.
0
f
<
-
eps
)
||
(
xrel
-
1
.
0
f
>
eps
))
{
...
...
@@ -3460,18 +3460,18 @@ static inline void fb_copy_to_texture_direct(IWineD3DSurfaceImpl *This, IWineD3D
/* Upside down copy without stretching is nice, one glCopyTexSubImage call will do */
glCopyTexSubImage2D
(
This
->
texture_target
,
This
->
texture_level
,
d
rect
->
x1
/*xoffset */
,
drect
->
y1
/* y offset */
,
sr
ect
->
x1
,
Src
->
currentDesc
.
Height
-
srect
->
y2
,
d
rect
->
x2
-
drect
->
x1
,
drect
->
y2
-
drect
->
y1
);
d
st_rect
->
left
/*xoffset */
,
dst_rect
->
top
/* y offset */
,
sr
c_rect
->
left
,
Src
->
currentDesc
.
Height
-
src_rect
->
bottom
,
d
st_rect
->
right
-
dst_rect
->
left
,
dst_rect
->
bottom
-
dst_rect
->
top
);
}
else
{
UINT
yoffset
=
Src
->
currentDesc
.
Height
-
sr
ect
->
y1
+
drect
->
y1
-
1
;
UINT
yoffset
=
Src
->
currentDesc
.
Height
-
sr
c_rect
->
top
+
dst_rect
->
top
-
1
;
/* I have to process this row by row to swap the image,
* otherwise it would be upside down, so stretching in y direction
* doesn't cost extra time
*
* However, stretching in x direction can be avoided if not necessary
*/
for
(
row
=
d
rect
->
y1
;
row
<
drect
->
y2
;
row
++
)
{
for
(
row
=
d
st_rect
->
top
;
row
<
dst_rect
->
bottom
;
row
++
)
{
if
((
xrel
-
1
.
0
f
<
-
eps
)
||
(
xrel
-
1
.
0
f
>
eps
))
{
/* Well, that stuff works, but it's very slow.
...
...
@@ -3479,15 +3479,15 @@ static inline void fb_copy_to_texture_direct(IWineD3DSurfaceImpl *This, IWineD3D
*/
UINT
col
;
for
(
col
=
d
rect
->
x1
;
col
<
drect
->
x2
;
col
++
)
{
for
(
col
=
d
st_rect
->
left
;
col
<
dst_rect
->
right
;
col
++
)
{
glCopyTexSubImage2D
(
This
->
texture_target
,
This
->
texture_level
,
d
rect
->
x1
+
col
/* x offset */
,
row
/* y offset */
,
sr
ect
->
x1
+
col
*
xrel
,
yoffset
-
(
int
)
(
row
*
yrel
),
1
,
1
);
d
st_rect
->
left
+
col
/* x offset */
,
row
/* y offset */
,
sr
c_rect
->
left
+
col
*
xrel
,
yoffset
-
(
int
)
(
row
*
yrel
),
1
,
1
);
}
}
else
{
glCopyTexSubImage2D
(
This
->
texture_target
,
This
->
texture_level
,
d
rect
->
x1
/* x offset */
,
row
/* y offset */
,
sr
ect
->
x1
,
yoffset
-
(
int
)
(
row
*
yrel
),
drect
->
x2
-
drect
->
x1
,
1
);
d
st_rect
->
left
/* x offset */
,
row
/* y offset */
,
sr
c_rect
->
left
,
yoffset
-
(
int
)
(
row
*
yrel
),
dst_rect
->
right
-
dst_rect
->
left
,
1
);
}
}
}
...
...
@@ -3994,7 +3994,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
}
else
if
((
!
stretchx
)
||
dst_rect
.
right
-
dst_rect
.
left
>
Src
->
currentDesc
.
Width
||
dst_rect
.
bottom
-
dst_rect
.
top
>
Src
->
currentDesc
.
Height
)
{
TRACE
(
"No stretching in x direction, using direct framebuffer -> texture copy
\n
"
);
fb_copy_to_texture_direct
(
This
,
SrcSurface
,
(
WINED3DRECT
*
)
&
src_rect
,
(
WINED3DRECT
*
)
&
dst_rect
,
upsideDown
,
Filter
);
fb_copy_to_texture_direct
(
This
,
SrcSurface
,
&
src_rect
,
&
dst_rect
,
upsideDown
,
Filter
);
}
else
{
TRACE
(
"Using hardware stretching to flip / stretch the texture
\n
"
);
fb_copy_to_texture_hwstretch
(
This
,
SrcSurface
,
srcSwapchain
,
(
WINED3DRECT
*
)
&
src_rect
,
(
WINED3DRECT
*
)
&
dst_rect
,
upsideDown
,
Filter
);
...
...
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