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
23094bfa
Commit
23094bfa
authored
Jan 19, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 19, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: Allow dxgi_surface to be aggregated.
parent
bb0e940e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
8 deletions
+51
-8
device.c
dlls/dxgi/device.c
+2
-0
dxgi_private.h
dlls/dxgi/dxgi_private.h
+3
-0
surface.c
dlls/dxgi/surface.c
+46
-8
No files found.
dlls/dxgi/device.c
View file @
23094bfa
...
...
@@ -164,7 +164,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_CreateSurface(IWineDXGIDevice *ifac
}
object
->
vtbl
=
&
dxgi_surface_vtbl
;
object
->
inner_unknown_vtbl
=
&
dxgi_surface_inner_unknown_vtbl
;
object
->
refcount
=
1
;
object
->
outer_unknown
=
(
IUnknown
*
)
&
object
->
inner_unknown_vtbl
;
surface
[
i
]
=
(
IDXGISurface
*
)
object
;
TRACE
(
"Created IDXGISurface %p (%u/%u)
\n
"
,
object
,
i
+
1
,
surface_count
);
...
...
dlls/dxgi/dxgi_private.h
View file @
23094bfa
...
...
@@ -81,9 +81,12 @@ struct dxgi_swapchain
/* IDXGISurface */
extern
const
struct
IDXGISurfaceVtbl
dxgi_surface_vtbl
;
extern
const
struct
IUnknownVtbl
dxgi_surface_inner_unknown_vtbl
;
struct
dxgi_surface
{
const
struct
IDXGISurfaceVtbl
*
vtbl
;
const
struct
IUnknownVtbl
*
inner_unknown_vtbl
;
IUnknown
*
outer_unknown
;
LONG
refcount
;
};
...
...
dlls/dxgi/surface.c
View file @
23094bfa
...
...
@@ -24,10 +24,17 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dxgi
);
/* IUnknown methods */
/* I
nner I
Unknown methods */
static
HRESULT
STDMETHODCALLTYPE
dxgi_surface_QueryInterface
(
IDXGISurface
*
iface
,
REFIID
riid
,
void
**
object
)
static
inline
struct
dxgi_surface
*
dxgi_surface_from_inner_unknown
(
IUnknown
*
iface
)
{
return
(
struct
dxgi_surface
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
struct
dxgi_surface
,
inner_unknown_vtbl
));
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_surface_inner_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
object
)
{
struct
dxgi_surface
*
This
=
dxgi_surface_from_inner_unknown
(
iface
);
TRACE
(
"iface %p, riid %s, object %p
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
if
(
IsEqualGUID
(
riid
,
&
IID_IDXGISurface
)
...
...
@@ -35,8 +42,8 @@ static HRESULT STDMETHODCALLTYPE dxgi_surface_QueryInterface(IDXGISurface *iface
||
IsEqualGUID
(
riid
,
&
IID_IDXGIObject
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
IUnknown_AddRef
(
iface
);
*
object
=
iface
;
IUnknown_AddRef
(
(
IUnknown
*
)
This
);
*
object
=
This
;
return
S_OK
;
}
...
...
@@ -46,9 +53,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_surface_QueryInterface(IDXGISurface *iface
return
E_NOINTERFACE
;
}
static
ULONG
STDMETHODCALLTYPE
dxgi_surface_
AddRef
(
IDXGISurface
*
iface
)
static
ULONG
STDMETHODCALLTYPE
dxgi_surface_
inner_AddRef
(
IUnknown
*
iface
)
{
struct
dxgi_surface
*
This
=
(
struct
dxgi_surface
*
)
iface
;
struct
dxgi_surface
*
This
=
dxgi_surface_from_inner_unknown
(
iface
)
;
ULONG
refcount
=
InterlockedIncrement
(
&
This
->
refcount
);
TRACE
(
"%p increasing refcount to %u
\n
"
,
This
,
refcount
);
...
...
@@ -56,9 +63,9 @@ static ULONG STDMETHODCALLTYPE dxgi_surface_AddRef(IDXGISurface *iface)
return
refcount
;
}
static
ULONG
STDMETHODCALLTYPE
dxgi_surface_
Release
(
IDXGISurface
*
iface
)
static
ULONG
STDMETHODCALLTYPE
dxgi_surface_
inner_Release
(
IUnknown
*
iface
)
{
struct
dxgi_surface
*
This
=
(
struct
dxgi_surface
*
)
iface
;
struct
dxgi_surface
*
This
=
dxgi_surface_from_inner_unknown
(
iface
)
;
ULONG
refcount
=
InterlockedDecrement
(
&
This
->
refcount
);
TRACE
(
"%p decreasing refcount to %u
\n
"
,
This
,
refcount
);
...
...
@@ -71,6 +78,29 @@ static ULONG STDMETHODCALLTYPE dxgi_surface_Release(IDXGISurface *iface)
return
refcount
;
}
/* IUnknown methods */
static
HRESULT
STDMETHODCALLTYPE
dxgi_surface_QueryInterface
(
IDXGISurface
*
iface
,
REFIID
riid
,
void
**
object
)
{
struct
dxgi_surface
*
This
=
(
struct
dxgi_surface
*
)
iface
;
TRACE
(
"Forwarding to outer IUnknown
\n
"
);
return
IUnknown_QueryInterface
(
This
->
outer_unknown
,
riid
,
object
);
}
static
ULONG
STDMETHODCALLTYPE
dxgi_surface_AddRef
(
IDXGISurface
*
iface
)
{
struct
dxgi_surface
*
This
=
(
struct
dxgi_surface
*
)
iface
;
TRACE
(
"Forwarding to outer IUnknown
\n
"
);
return
IUnknown_AddRef
(
This
->
outer_unknown
);
}
static
ULONG
STDMETHODCALLTYPE
dxgi_surface_Release
(
IDXGISurface
*
iface
)
{
struct
dxgi_surface
*
This
=
(
struct
dxgi_surface
*
)
iface
;
TRACE
(
"Forwarding to outer IUnknown
\n
"
);
return
IUnknown_Release
(
This
->
outer_unknown
);
}
/* IDXGIObject methods */
static
HRESULT
STDMETHODCALLTYPE
dxgi_surface_SetPrivateData
(
IDXGISurface
*
iface
,
...
...
@@ -153,3 +183,11 @@ const struct IDXGISurfaceVtbl dxgi_surface_vtbl =
dxgi_surface_Map
,
dxgi_surface_Unmap
,
};
const
struct
IUnknownVtbl
dxgi_surface_inner_unknown_vtbl
=
{
/* IUnknown methods */
dxgi_surface_inner_QueryInterface
,
dxgi_surface_inner_AddRef
,
dxgi_surface_inner_Release
,
};
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