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
fad461ee
Commit
fad461ee
authored
Nov 30, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move the PrivateData structure to resource.c.
parent
fa12dd98
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
26 deletions
+26
-26
resource.c
dlls/wined3d/resource.c
+26
-9
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-17
No files found.
dlls/wined3d/resource.c
View file @
fad461ee
...
...
@@ -27,6 +27,22 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d
);
struct
private_data
{
struct
list
entry
;
GUID
tag
;
DWORD
flags
;
/* DDSPD_* */
union
{
void
*
data
;
IUnknown
*
object
;
}
ptr
;
DWORD
size
;
};
HRESULT
resource_init
(
IWineD3DResource
*
iface
,
WINED3DRESOURCETYPE
resource_type
,
IWineD3DDeviceImpl
*
device
,
UINT
size
,
DWORD
usage
,
const
struct
wined3d_format
*
format
,
WINED3DPOOL
pool
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
...
...
@@ -80,8 +96,8 @@ HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type
void
resource_cleanup
(
IWineD3DResource
*
iface
)
{
IWineD3DResourceImpl
*
This
=
(
IWineD3DResourceImpl
*
)
iface
;
struct
private_data
*
data
;
struct
list
*
e1
,
*
e2
;
PrivateData
*
data
;
HRESULT
hr
;
TRACE
(
"(%p) Cleaning up resource
\n
"
,
This
);
...
...
@@ -90,8 +106,9 @@ void resource_cleanup(IWineD3DResource *iface)
WineD3DAdapterChangeGLRam
(
This
->
resource
.
device
,
-
This
->
resource
.
size
);
}
LIST_FOR_EACH_SAFE
(
e1
,
e2
,
&
This
->
resource
.
privateData
)
{
data
=
LIST_ENTRY
(
e1
,
PrivateData
,
entry
);
LIST_FOR_EACH_SAFE
(
e1
,
e2
,
&
This
->
resource
.
privateData
)
{
data
=
LIST_ENTRY
(
e1
,
struct
private_data
,
entry
);
hr
=
resource_free_private_data
(
iface
,
&
data
->
tag
);
if
(
hr
!=
WINED3D_OK
)
{
ERR
(
"Failed to free private data when destroying resource %p, hr = %08x
\n
"
,
This
,
hr
);
...
...
@@ -111,15 +128,15 @@ void resource_unload(IWineD3DResourceImpl *resource)
resource
->
resource
.
resourceType
);
}
static
PrivateData
*
resource_find_private_data
(
IWineD3DResourceImpl
*
This
,
REFGUID
tag
)
static
struct
private_data
*
resource_find_private_data
(
IWineD3DResourceImpl
*
This
,
REFGUID
tag
)
{
PrivateD
ata
*
data
;
struct
private_d
ata
*
data
;
struct
list
*
entry
;
TRACE
(
"Searching for private data %s
\n
"
,
debugstr_guid
(
tag
));
LIST_FOR_EACH
(
entry
,
&
This
->
resource
.
privateData
)
{
data
=
LIST_ENTRY
(
entry
,
PrivateD
ata
,
entry
);
data
=
LIST_ENTRY
(
entry
,
struct
private_d
ata
,
entry
);
if
(
IsEqualGUID
(
&
data
->
tag
,
tag
))
{
TRACE
(
"Found %p
\n
"
,
data
);
return
data
;
...
...
@@ -133,7 +150,7 @@ HRESULT resource_set_private_data(IWineD3DResource *iface, REFGUID refguid,
const
void
*
pData
,
DWORD
SizeOfData
,
DWORD
flags
)
{
IWineD3DResourceImpl
*
This
=
(
IWineD3DResourceImpl
*
)
iface
;
PrivateD
ata
*
data
;
struct
private_d
ata
*
data
;
TRACE
(
"iface %p, riid %s, data %p, data_size %u, flags %#x.
\n
"
,
iface
,
debugstr_guid
(
refguid
),
pData
,
SizeOfData
,
flags
);
...
...
@@ -177,7 +194,7 @@ HRESULT resource_set_private_data(IWineD3DResource *iface, REFGUID refguid,
HRESULT
resource_get_private_data
(
IWineD3DResource
*
iface
,
REFGUID
refguid
,
void
*
pData
,
DWORD
*
pSizeOfData
)
{
IWineD3DResourceImpl
*
This
=
(
IWineD3DResourceImpl
*
)
iface
;
PrivateD
ata
*
data
;
struct
private_d
ata
*
data
;
TRACE
(
"(%p) : %p %p %p
\n
"
,
This
,
refguid
,
pData
,
pSizeOfData
);
data
=
resource_find_private_data
(
This
,
refguid
);
...
...
@@ -208,7 +225,7 @@ HRESULT resource_get_private_data(IWineD3DResource *iface, REFGUID refguid, void
HRESULT
resource_free_private_data
(
IWineD3DResource
*
iface
,
REFGUID
refguid
)
{
IWineD3DResourceImpl
*
This
=
(
IWineD3DResourceImpl
*
)
iface
;
PrivateD
ata
*
data
;
struct
private_d
ata
*
data
;
TRACE
(
"(%p) : %s
\n
"
,
This
,
debugstr_guid
(
refguid
));
data
=
resource_find_private_data
(
This
,
refguid
);
...
...
dlls/wined3d/wined3d_private.h
View file @
fad461ee
...
...
@@ -1795,23 +1795,6 @@ static inline BOOL isStateDirty(struct wined3d_context *context, DWORD state)
return
context
->
isStateDirty
[
idx
]
&
(
1
<<
shift
);
}
/* Support for IWineD3DResource ::Set/Get/FreePrivateData. */
typedef
struct
PrivateData
{
struct
list
entry
;
GUID
tag
;
DWORD
flags
;
/* DDSPD_* */
union
{
LPVOID
data
;
LPUNKNOWN
object
;
}
ptr
;
DWORD
size
;
}
PrivateData
;
/*****************************************************************************
* IWineD3DResource implementation structure
*/
...
...
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