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
d0d094de
Commit
d0d094de
authored
Jan 18, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Respect SFLAG_PIN_SYSMEM when creating a surface DIB section.
parent
e1cd2453
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
surface.c
dlls/wined3d/surface.c
+16
-7
No files found.
dlls/wined3d/surface.c
View file @
d0d094de
...
...
@@ -514,9 +514,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
surface
->
flags
|=
SFLAG_DIBSECTION
;
HeapFree
(
GetProcessHeap
(),
0
,
surface
->
resource
.
heapMemory
);
surface
->
resource
.
heapMemory
=
NULL
;
return
WINED3D_OK
;
}
...
...
@@ -1986,9 +1983,17 @@ static void gdi_surface_map(struct wined3d_surface *surface, const RECT *rect, D
if
(
!
(
surface
->
flags
&
SFLAG_DIBSECTION
))
{
HRESULT
hr
;
/* This happens on gdi surfaces if the application set a user pointer
* and resets it. Recreate the DIB section. */
surface_create_dib_section
(
surface
);
if
(
FAILED
(
hr
=
surface_create_dib_section
(
surface
)))
{
ERR
(
"Failed to create dib section, hr %#x.
\n
"
,
hr
);
return
;
}
HeapFree
(
GetProcessHeap
(),
0
,
surface
->
resource
.
heapMemory
);
surface
->
resource
.
heapMemory
=
NULL
;
surface
->
resource
.
allocatedMemory
=
surface
->
dib
.
bitmap_data
;
}
}
...
...
@@ -3843,8 +3848,12 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
return
WINED3DERR_INVALIDCALL
;
/* Use the DIB section from now on if we are not using a PBO. */
if
(
!
(
surface
->
flags
&
SFLAG_PBO
))
if
(
!
(
surface
->
flags
&
(
SFLAG_PBO
|
SFLAG_PIN_SYSMEM
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
surface
->
resource
.
heapMemory
);
surface
->
resource
.
heapMemory
=
NULL
;
surface
->
resource
.
allocatedMemory
=
surface
->
dib
.
bitmap_data
;
}
}
/* Map the surface. */
...
...
@@ -3857,7 +3866,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
/* Sync the DIB with the PBO. This can't be done earlier because Map()
* activates the allocatedMemory. */
if
(
surface
->
flags
&
SFLAG_PBO
)
if
(
surface
->
flags
&
(
SFLAG_PBO
|
SFLAG_PIN_SYSMEM
)
)
memcpy
(
surface
->
dib
.
bitmap_data
,
surface
->
resource
.
allocatedMemory
,
surface
->
resource
.
size
);
if
(
surface
->
resource
.
format
->
id
==
WINED3DFMT_P8_UINT
...
...
@@ -3920,7 +3929,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
}
/* Copy the contents of the DIB over to the PBO. */
if
((
surface
->
flags
&
SFLAG_PBO
)
&&
surface
->
resource
.
allocatedMemory
)
if
((
surface
->
flags
&
(
SFLAG_PBO
|
SFLAG_PIN_SYSMEM
)
)
&&
surface
->
resource
.
allocatedMemory
)
memcpy
(
surface
->
resource
.
allocatedMemory
,
surface
->
dib
.
bitmap_data
,
surface
->
resource
.
size
);
/* We locked first, so unlock now. */
...
...
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