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
82666af8
Commit
82666af8
authored
Jan 07, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Simplify wined3d_surface_set_mem.
parent
2a012ba1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
43 deletions
+18
-43
surface.c
dlls/wined3d/surface.c
+18
-43
No files found.
dlls/wined3d/surface.c
View file @
82666af8
...
...
@@ -2619,54 +2619,29 @@ HRESULT CDECL wined3d_surface_set_mem(struct wined3d_surface *surface, void *mem
return
WINED3DERR_INVALIDCALL
;
}
if
(
mem
&&
mem
!=
surface
->
user_memory
)
if
(
surface
->
flags
&
SFLAG_DIBSECTION
)
{
/* Do I have to copy the old surface content? */
if
(
surface
->
flags
&
SFLAG_DIBSECTION
)
{
DeleteDC
(
surface
->
hDC
);
DeleteObject
(
surface
->
dib
.
DIBsection
);
surface
->
dib
.
bitmap_data
=
NULL
;
surface
->
resource
.
allocatedMemory
=
NULL
;
surface
->
hDC
=
NULL
;
surface
->
flags
&=
~
SFLAG_DIBSECTION
;
}
else
if
(
!
(
surface
->
flags
&
SFLAG_USERPTR
))
{
wined3d_resource_free_sysmem
(
&
surface
->
resource
);
surface
->
resource
.
allocatedMemory
=
NULL
;
}
surface
->
user_memory
=
mem
;
surface
->
flags
|=
SFLAG_USERPTR
;
/* Now the surface memory is most up do date. Invalidate drawable and texture. */
surface_validate_location
(
surface
,
SFLAG_INSYSMEM
);
surface_invalidate_location
(
surface
,
~
SFLAG_INSYSMEM
);
/* For client textures OpenGL has to be notified. */
if
(
surface
->
flags
&
SFLAG_CLIENT
)
surface_release_client_storage
(
surface
);
DeleteDC
(
surface
->
hDC
);
DeleteObject
(
surface
->
dib
.
DIBsection
);
surface
->
dib
.
bitmap_data
=
NULL
;
surface
->
resource
.
allocatedMemory
=
NULL
;
surface
->
hDC
=
NULL
;
surface
->
flags
&=
~
SFLAG_DIBSECTION
;
}
else
if
(
surface
->
flags
&
SFLAG_USERPTR
)
else
if
(
!
(
surface
->
flags
&
SFLAG_USERPTR
)
)
{
/* heap_memory should be NULL already. */
if
(
surface
->
resource
.
heap_memory
)
ERR
(
"User pointer surface has heap memory allocated.
\n
"
);
if
(
!
mem
)
{
surface
->
user_memory
=
NULL
;
surface
->
flags
&=
~
(
SFLAG_USERPTR
|
SFLAG_INSYSMEM
);
if
(
surface
->
flags
&
SFLAG_CLIENT
)
surface_release_client_storage
(
surface
);
wined3d_resource_free_sysmem
(
&
surface
->
resource
);
surface
->
resource
.
allocatedMemory
=
NULL
;
}
surface_prepare_system_memory
(
surface
);
}
surface
->
user_memory
=
mem
;
surface
->
flags
|=
SFLAG_USERPTR
;
surface_validate_location
(
surface
,
SFLAG_INSYSMEM
);
surface_invalidate_location
(
surface
,
~
SFLAG_INSYSMEM
);
surface_validate_location
(
surface
,
SFLAG_INSYSMEM
);
surface_invalidate_location
(
surface
,
~
SFLAG_INSYSMEM
);
}
/* For client textures OpenGL has to be notified. */
if
(
surface
->
flags
&
SFLAG_CLIENT
)
surface_release_client_storage
(
surface
);
surface
->
pitch
=
pitch
;
...
...
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