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
a2ef0143
Commit
a2ef0143
authored
Apr 26, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 27, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Merge the IWineD3DSurface::Release() implementations.
parent
d9ace3c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
80 deletions
+45
-80
surface.c
dlls/wined3d/surface.c
+44
-80
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/surface.c
View file @
a2ef0143
...
...
@@ -775,6 +775,7 @@ static const struct wined3d_resource_ops surface_resource_ops =
static
const
struct
wined3d_surface_ops
surface_ops
=
{
surface_private_setup
,
surface_cleanup
,
surface_realize_palette
,
surface_draw_overlay
,
};
...
...
@@ -895,6 +896,7 @@ static HRESULT gdi_surface_draw_overlay(IWineD3DSurfaceImpl *surface)
static
const
struct
wined3d_surface_ops
gdi_surface_ops
=
{
gdi_surface_private_setup
,
surface_gdi_cleanup
,
gdi_surface_realize_palette
,
gdi_surface_draw_overlay
,
};
...
...
@@ -1747,6 +1749,45 @@ static ULONG WINAPI IWineD3DBaseSurfaceImpl_AddRef(IWineD3DSurface *iface)
return
refcount
;
}
/* Do not call while under the GL lock. */
static
ULONG
WINAPI
IWineD3DBaseSurfaceImpl_Release
(
IWineD3DSurface
*
iface
)
{
IWineD3DSurfaceImpl
*
surface
=
(
IWineD3DSurfaceImpl
*
)
iface
;
ULONG
refcount
;
TRACE
(
"Surface %p, container %p of type %#x.
\n
"
,
surface
,
surface
->
container
.
u
.
base
,
surface
->
container
.
type
);
switch
(
surface
->
container
.
type
)
{
case
WINED3D_CONTAINER_TEXTURE
:
return
wined3d_texture_decref
(
surface
->
container
.
u
.
texture
);
case
WINED3D_CONTAINER_SWAPCHAIN
:
return
wined3d_swapchain_decref
(
surface
->
container
.
u
.
swapchain
);
default:
ERR
(
"Unhandled container type %#x.
\n
"
,
surface
->
container
.
type
);
case
WINED3D_CONTAINER_NONE
:
break
;
}
refcount
=
InterlockedDecrement
(
&
surface
->
resource
.
ref
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
surface
,
refcount
);
if
(
!
refcount
)
{
surface_cleanup
(
surface
);
surface
->
surface_ops
->
surface_cleanup
(
surface
);
surface
->
resource
.
parent_ops
->
wined3d_object_destroyed
(
surface
->
resource
.
parent
);
TRACE
(
"Destroyed surface %p.
\n
"
,
surface
);
HeapFree
(
GetProcessHeap
(),
0
,
surface
);
}
return
refcount
;
}
static
HRESULT
WINAPI
IWineD3DBaseSurfaceImpl_SetPrivateData
(
IWineD3DSurface
*
iface
,
REFGUID
riid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
flags
)
{
...
...
@@ -3439,43 +3480,6 @@ static HRESULT WINAPI IWineD3DBaseSurfaceImpl_Map(IWineD3DSurface *iface,
return
WINED3D_OK
;
}
/* Do not call while under the GL lock. */
static
ULONG
WINAPI
IWineD3DSurfaceImpl_Release
(
IWineD3DSurface
*
iface
)
{
IWineD3DSurfaceImpl
*
surface
=
(
IWineD3DSurfaceImpl
*
)
iface
;
ULONG
refcount
;
TRACE
(
"Surface %p, container %p of type %#x.
\n
"
,
surface
,
surface
->
container
.
u
.
base
,
surface
->
container
.
type
);
switch
(
surface
->
container
.
type
)
{
case
WINED3D_CONTAINER_TEXTURE
:
return
wined3d_texture_decref
(
surface
->
container
.
u
.
texture
);
case
WINED3D_CONTAINER_SWAPCHAIN
:
return
wined3d_swapchain_decref
(
surface
->
container
.
u
.
swapchain
);
default:
ERR
(
"Unhandled container type %#x.
\n
"
,
surface
->
container
.
type
);
case
WINED3D_CONTAINER_NONE
:
break
;
}
refcount
=
InterlockedDecrement
(
&
surface
->
resource
.
ref
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
surface
,
refcount
);
if
(
!
refcount
)
{
surface_cleanup
(
surface
);
surface
->
resource
.
parent_ops
->
wined3d_object_destroyed
(
surface
->
resource
.
parent
);
TRACE
(
"Destroyed surface %p.
\n
"
,
surface
);
HeapFree
(
GetProcessHeap
(),
0
,
surface
);
}
return
refcount
;
}
/* ****************************************************
IWineD3DSurface IWineD3DResource parts follow
...
...
@@ -6920,7 +6924,7 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
/* IUnknown */
IWineD3DBaseSurfaceImpl_QueryInterface
,
IWineD3DBaseSurfaceImpl_AddRef
,
IWineD3DSurfaceImpl_Release
,
IWineD3D
Base
SurfaceImpl_Release
,
/* IWineD3DResource */
IWineD3DBaseSurfaceImpl_GetParent
,
IWineD3DBaseSurfaceImpl_SetPrivateData
,
...
...
@@ -7202,43 +7206,6 @@ static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum wined
return
TRUE
;
}
static
ULONG
WINAPI
IWineGDISurfaceImpl_Release
(
IWineD3DSurface
*
iface
)
{
IWineD3DSurfaceImpl
*
surface
=
(
IWineD3DSurfaceImpl
*
)
iface
;
ULONG
refcount
;
TRACE
(
"Surface %p, container %p of type %#x.
\n
"
,
surface
,
surface
->
container
.
u
.
base
,
surface
->
container
.
type
);
switch
(
surface
->
container
.
type
)
{
case
WINED3D_CONTAINER_TEXTURE
:
return
wined3d_texture_decref
(
surface
->
container
.
u
.
texture
);
case
WINED3D_CONTAINER_SWAPCHAIN
:
return
wined3d_swapchain_decref
(
surface
->
container
.
u
.
swapchain
);
default:
ERR
(
"Unhandled container type %#x.
\n
"
,
surface
->
container
.
type
);
case
WINED3D_CONTAINER_NONE
:
break
;
}
refcount
=
InterlockedDecrement
(
&
surface
->
resource
.
ref
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
surface
,
refcount
);
if
(
!
refcount
)
{
surface_gdi_cleanup
(
surface
);
surface
->
resource
.
parent_ops
->
wined3d_object_destroyed
(
surface
->
resource
.
parent
);
TRACE
(
"Destroyed surface %p.
\n
"
,
surface
);
HeapFree
(
GetProcessHeap
(),
0
,
surface
);
}
return
refcount
;
}
static
void
WINAPI
IWineGDISurfaceImpl_PreLoad
(
IWineD3DSurface
*
iface
)
{
ERR
(
"(%p): PreLoad is not supported on X11 surfaces!
\n
"
,
iface
);
...
...
@@ -7499,7 +7466,7 @@ static const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl =
/* IUnknown */
IWineD3DBaseSurfaceImpl_QueryInterface
,
IWineD3DBaseSurfaceImpl_AddRef
,
IWine
GDI
SurfaceImpl_Release
,
IWine
D3DBase
SurfaceImpl_Release
,
/* IWineD3DResource */
IWineD3DBaseSurfaceImpl_GetParent
,
IWineD3DBaseSurfaceImpl_SetPrivateData
,
...
...
@@ -7543,7 +7510,6 @@ HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type,
{
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
const
struct
wined3d_format
*
format
=
wined3d_get_format
(
gl_info
,
format_id
);
void
(
*
cleanup
)(
IWineD3DSurfaceImpl
*
This
);
unsigned
int
resource_size
;
HRESULT
hr
;
...
...
@@ -7605,13 +7571,11 @@ HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type,
case
SURFACE_OPENGL
:
surface
->
lpVtbl
=
&
IWineD3DSurface_Vtbl
;
surface
->
surface_ops
=
&
surface_ops
;
cleanup
=
surface_cleanup
;
break
;
case
SURFACE_GDI
:
surface
->
lpVtbl
=
&
IWineGDISurface_Vtbl
;
surface
->
surface_ops
=
&
gdi_surface_ops
;
cleanup
=
surface_gdi_cleanup
;
break
;
default:
...
...
@@ -7653,7 +7617,7 @@ HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type,
if
(
FAILED
(
hr
))
{
ERR
(
"Private setup failed, returning %#x
\n
"
,
hr
);
cleanup
(
surface
);
surface
->
surface_ops
->
surface_
cleanup
(
surface
);
return
hr
;
}
...
...
dlls/wined3d/wined3d_private.h
View file @
a2ef0143
...
...
@@ -2021,6 +2021,7 @@ struct wined3d_subresource_container
struct
wined3d_surface_ops
{
HRESULT
(
*
surface_private_setup
)(
struct
IWineD3DSurfaceImpl
*
surface
);
void
(
*
surface_cleanup
)(
struct
IWineD3DSurfaceImpl
*
surface
);
void
(
*
surface_realize_palette
)(
struct
IWineD3DSurfaceImpl
*
surface
);
HRESULT
(
*
surface_draw_overlay
)(
struct
IWineD3DSurfaceImpl
*
surface
);
};
...
...
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