Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
eb379608
Commit
eb379608
authored
Mar 07, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 07, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of the SFLAG_LOCKED hack in flush_to_framebuffer_drawpixels().
parent
90592714
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
22 deletions
+19
-22
surface.c
dlls/wined3d/surface.c
+19
-22
No files found.
dlls/wined3d/surface.c
View file @
eb379608
...
...
@@ -1925,39 +1925,36 @@ lock_end:
return
IWineD3DBaseSurfaceImpl_Map
(
iface
,
pLockedRect
,
pRect
,
flags
);
}
static
void
flush_to_framebuffer_drawpixels
(
IWineD3DSurfaceImpl
*
This
,
GLenum
fmt
,
GLenum
type
,
UINT
bpp
,
const
BYTE
*
mem
)
static
void
flush_to_framebuffer_drawpixels
(
IWineD3DSurfaceImpl
*
surface
,
const
RECT
*
rect
,
GLenum
fmt
,
GLenum
type
,
UINT
bpp
,
const
BYTE
*
mem
)
{
UINT
pitch
=
IWineD3DSurface_GetPitch
((
IWineD3DSurface
*
)
This
);
/* target is argb, 4 byte */
IWineD3DDeviceImpl
*
device
=
This
->
resource
.
device
;
UINT
pitch
=
IWineD3DSurface_GetPitch
((
IWineD3DSurface
*
)
surface
);
/* target is argb, 4 byte */
IWineD3DDeviceImpl
*
device
=
surface
->
resource
.
device
;
const
struct
wined3d_gl_info
*
gl_info
;
struct
wined3d_context
*
context
;
RECT
rect
;
RECT
local_
rect
;
UINT
w
,
h
;
if
(
This
->
flags
&
SFLAG_LOCKED
)
rect
=
This
->
lockedRect
;
else
SetRect
(
&
rect
,
0
,
0
,
This
->
currentDesc
.
Width
,
This
->
currentDesc
.
Height
);
surface_get_rect
(
surface
,
rect
,
&
local_rect
);
mem
+=
rect
.
top
*
pitch
+
rect
.
left
*
bpp
;
w
=
rect
.
right
-
rect
.
left
;
h
=
rect
.
bottom
-
rect
.
top
;
mem
+=
local_rect
.
top
*
pitch
+
local_
rect
.
left
*
bpp
;
w
=
local_rect
.
right
-
local_
rect
.
left
;
h
=
local_rect
.
bottom
-
local_
rect
.
top
;
/* Activate the correct context for the render target */
context
=
context_acquire
(
device
,
This
);
context
=
context_acquire
(
device
,
surface
);
context_apply_blit_state
(
context
,
device
);
gl_info
=
context
->
gl_info
;
ENTER_GL
();
if
(
!
surface_is_offscreen
(
This
))
if
(
!
surface_is_offscreen
(
surface
))
{
GLenum
buffer
=
surface_get_gl_buffer
(
This
);
GLenum
buffer
=
surface_get_gl_buffer
(
surface
);
TRACE
(
"Unlocking %#x buffer.
\n
"
,
buffer
);
context_set_draw_buffer
(
context
,
buffer
);
surface_translate_drawable_coords
(
This
,
context
->
win_handle
,
&
rect
);
surface_translate_drawable_coords
(
surface
,
context
->
win_handle
,
&
local_
rect
);
glPixelZoom
(
1
.
0
f
,
-
1
.
0
f
);
}
else
...
...
@@ -1969,22 +1966,22 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This,
glPixelZoom
(
1
.
0
f
,
1
.
0
f
);
}
glRasterPos3i
(
rect
.
left
,
rect
.
top
,
1
);
glRasterPos3i
(
local_rect
.
left
,
local_
rect
.
top
,
1
);
checkGLcall
(
"glRasterPos3i"
);
/* If not fullscreen, we need to skip a number of bytes to find the next row of data */
glPixelStorei
(
GL_UNPACK_ROW_LENGTH
,
This
->
currentDesc
.
Width
);
glPixelStorei
(
GL_UNPACK_ROW_LENGTH
,
surface
->
currentDesc
.
Width
);
if
(
This
->
flags
&
SFLAG_PBO
)
if
(
surface
->
flags
&
SFLAG_PBO
)
{
GL_EXTCALL
(
glBindBufferARB
(
GL_PIXEL_UNPACK_BUFFER_ARB
,
This
->
pbo
));
GL_EXTCALL
(
glBindBufferARB
(
GL_PIXEL_UNPACK_BUFFER_ARB
,
surface
->
pbo
));
checkGLcall
(
"glBindBufferARB"
);
}
glDrawPixels
(
w
,
h
,
fmt
,
type
,
mem
);
checkGLcall
(
"glDrawPixels"
);
if
(
This
->
flags
&
SFLAG_PBO
)
if
(
surface
->
flags
&
SFLAG_PBO
)
{
GL_EXTCALL
(
glBindBufferARB
(
GL_PIXEL_UNPACK_BUFFER_ARB
,
0
));
checkGLcall
(
"glBindBufferARB"
);
...
...
@@ -4509,7 +4506,7 @@ HRESULT surface_load_location(IWineD3DSurfaceImpl *surface, DWORD flag, const RE
byte_count
=
format
.
byte_count
;
}
flush_to_framebuffer_drawpixels
(
surface
,
format
.
glFormat
,
format
.
glType
,
byte_count
,
mem
);
flush_to_framebuffer_drawpixels
(
surface
,
rect
,
format
.
glFormat
,
format
.
glType
,
byte_count
,
mem
);
/* Don't delete PBO memory */
if
((
mem
!=
surface
->
resource
.
allocatedMemory
)
&&
!
(
surface
->
flags
&
SFLAG_PBO
))
...
...
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