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
a5febcf7
Commit
a5febcf7
authored
Apr 27, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Merge the IWineD3DSurface::ReleaseDC() implementations.
parent
dcaca722
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
54 deletions
+32
-54
surface.c
dlls/wined3d/surface.c
+32
-54
No files found.
dlls/wined3d/surface.c
View file @
a5febcf7
...
...
@@ -3979,6 +3979,36 @@ static HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC
return
WINED3D_OK
;
}
static
HRESULT
WINAPI
IWineD3DBaseSurfaceImpl_ReleaseDC
(
IWineD3DSurface
*
iface
,
HDC
dc
)
{
IWineD3DSurfaceImpl
*
surface
=
(
IWineD3DSurfaceImpl
*
)
iface
;
TRACE
(
"iface %p, dc %p.
\n
"
,
iface
,
dc
);
if
(
!
(
surface
->
flags
&
SFLAG_DCINUSE
))
return
WINEDDERR_NODC
;
if
(
surface
->
hDC
!=
dc
)
{
WARN
(
"Application tries to release invalid DC %p, surface DC is %p.
\n
"
,
dc
,
surface
->
hDC
);
return
WINEDDERR_NODC
;
}
if
((
surface
->
flags
&
SFLAG_PBO
)
&&
surface
->
resource
.
allocatedMemory
)
{
/* Copy the contents of the DIB over to the PBO. */
memcpy
(
surface
->
resource
.
allocatedMemory
,
surface
->
dib
.
bitmap_data
,
surface
->
dib
.
bitmap_size
);
}
/* We locked first, so unlock now. */
IWineD3DSurface_Unmap
(
iface
);
surface
->
flags
&=
~
SFLAG_DCINUSE
;
return
WINED3D_OK
;
}
/* ****************************************************
IWineD3DSurface IWineD3DResource parts follow
**************************************************** */
...
...
@@ -4469,34 +4499,6 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *surface,
context_release
(
context
);
}
static
HRESULT
WINAPI
IWineD3DSurfaceImpl_ReleaseDC
(
IWineD3DSurface
*
iface
,
HDC
hDC
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
hDC
);
if
(
!
(
This
->
flags
&
SFLAG_DCINUSE
))
return
WINEDDERR_NODC
;
if
(
This
->
hDC
!=
hDC
)
{
WARN
(
"Application tries to release an invalid DC(%p), surface dc is %p
\n
"
,
hDC
,
This
->
hDC
);
return
WINEDDERR_NODC
;
}
if
((
This
->
flags
&
SFLAG_PBO
)
&&
This
->
resource
.
allocatedMemory
)
{
/* Copy the contents of the DIB over to the PBO */
memcpy
(
This
->
resource
.
allocatedMemory
,
This
->
dib
.
bitmap_data
,
This
->
dib
.
bitmap_size
);
}
/* we locked first, so unlock now */
IWineD3DSurface_Unmap
(
iface
);
This
->
flags
&=
~
SFLAG_DCINUSE
;
return
WINED3D_OK
;
}
/* ******************************************************
IWineD3DSurface Internal (No mapping to directx api) parts follow
****************************************************** */
...
...
@@ -7033,7 +7035,7 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
IWineD3DBaseSurfaceImpl_Map
,
IWineD3DBaseSurfaceImpl_Unmap
,
IWineD3DBaseSurfaceImpl_GetDC
,
IWineD3DSurfaceImpl_ReleaseDC
,
IWineD3D
Base
SurfaceImpl_ReleaseDC
,
IWineD3DSurfaceImpl_Flip
,
IWineD3DSurfaceImpl_Blt
,
IWineD3DBaseSurfaceImpl_GetBltStatus
,
...
...
@@ -7333,30 +7335,6 @@ static HRESULT WINAPI IWineGDISurfaceImpl_Flip(IWineD3DSurface *iface, IWineD3DS
return
hr
;
}
static
HRESULT
WINAPI
IWineGDISurfaceImpl_ReleaseDC
(
IWineD3DSurface
*
iface
,
HDC
dc
)
{
IWineD3DSurfaceImpl
*
surface
=
(
IWineD3DSurfaceImpl
*
)
iface
;
TRACE
(
"iface %p, dc %p.
\n
"
,
iface
,
dc
);
if
(
!
(
surface
->
flags
&
SFLAG_DCINUSE
))
return
WINEDDERR_NODC
;
if
(
surface
->
hDC
!=
dc
)
{
WARN
(
"Application tries to release invalid DC %p, surface DC is %p.
\n
"
,
dc
,
surface
->
hDC
);
return
WINEDDERR_NODC
;
}
/* We locked first, so unlock now. */
IWineD3DSurface_Unmap
(
iface
);
surface
->
flags
&=
~
SFLAG_DCINUSE
;
return
WINED3D_OK
;
}
static
HRESULT
WINAPI
IWineGDISurfaceImpl_SetMem
(
IWineD3DSurface
*
iface
,
void
*
mem
)
{
IWineD3DSurfaceImpl
*
surface
=
(
IWineD3DSurfaceImpl
*
)
iface
;
...
...
@@ -7429,7 +7407,7 @@ static const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl =
IWineD3DBaseSurfaceImpl_Map
,
IWineD3DBaseSurfaceImpl_Unmap
,
IWineD3DBaseSurfaceImpl_GetDC
,
IWine
GDI
SurfaceImpl_ReleaseDC
,
IWine
D3DBase
SurfaceImpl_ReleaseDC
,
IWineGDISurfaceImpl_Flip
,
IWineD3DBaseSurfaceImpl_Blt
,
IWineD3DBaseSurfaceImpl_GetBltStatus
,
...
...
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