ReactOS 0.4.16-dev-92-g0c2cdca
surface.c File Reference
#include "config.h"
#include "d3d9_private.h"
Include dependency graph for surface.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3d9)
 
static struct d3d9_surfaceimpl_from_IDirect3DSurface9 (IDirect3DSurface9 *iface)
 
static HRESULT WINAPI d3d9_surface_QueryInterface (IDirect3DSurface9 *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3d9_surface_AddRef (IDirect3DSurface9 *iface)
 
static ULONG WINAPI d3d9_surface_Release (IDirect3DSurface9 *iface)
 
static HRESULT WINAPI d3d9_surface_GetDevice (IDirect3DSurface9 *iface, IDirect3DDevice9 **device)
 
static HRESULT WINAPI d3d9_surface_SetPrivateData (IDirect3DSurface9 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
 
static HRESULT WINAPI d3d9_surface_GetPrivateData (IDirect3DSurface9 *iface, REFGUID guid, void *data, DWORD *data_size)
 
static HRESULT WINAPI d3d9_surface_FreePrivateData (IDirect3DSurface9 *iface, REFGUID guid)
 
static DWORD WINAPI d3d9_surface_SetPriority (IDirect3DSurface9 *iface, DWORD priority)
 
static DWORD WINAPI d3d9_surface_GetPriority (IDirect3DSurface9 *iface)
 
static void WINAPI d3d9_surface_PreLoad (IDirect3DSurface9 *iface)
 
static D3DRESOURCETYPE WINAPI d3d9_surface_GetType (IDirect3DSurface9 *iface)
 
static HRESULT WINAPI d3d9_surface_GetContainer (IDirect3DSurface9 *iface, REFIID riid, void **container)
 
static HRESULT WINAPI d3d9_surface_GetDesc (IDirect3DSurface9 *iface, D3DSURFACE_DESC *desc)
 
static HRESULT WINAPI d3d9_surface_LockRect (IDirect3DSurface9 *iface, D3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
 
static HRESULT WINAPI d3d9_surface_UnlockRect (IDirect3DSurface9 *iface)
 
static HRESULT WINAPI d3d9_surface_GetDC (IDirect3DSurface9 *iface, HDC *dc)
 
static HRESULT WINAPI d3d9_surface_ReleaseDC (IDirect3DSurface9 *iface, HDC dc)
 
static void STDMETHODCALLTYPE surface_wined3d_object_destroyed (void *parent)
 
void surface_init (struct d3d9_surface *surface, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops)
 
static void STDMETHODCALLTYPE view_wined3d_object_destroyed (void *parent)
 
struct d3d9_deviced3d9_surface_get_device (const struct d3d9_surface *surface)
 
struct wined3d_rendertarget_viewd3d9_surface_acquire_rendertarget_view (struct d3d9_surface *surface)
 
void d3d9_surface_release_rendertarget_view (struct d3d9_surface *surface, struct wined3d_rendertarget_view *rtv)
 
struct d3d9_surfaceunsafe_impl_from_IDirect3DSurface9 (IDirect3DSurface9 *iface)
 

Variables

static const struct IDirect3DSurface9Vtbl d3d9_surface_vtbl
 
static const struct wined3d_parent_ops d3d9_surface_wined3d_parent_ops
 
static const struct wined3d_parent_ops d3d9_view_wined3d_parent_ops
 

Function Documentation

◆ d3d9_surface_acquire_rendertarget_view()

struct wined3d_rendertarget_view * d3d9_surface_acquire_rendertarget_view ( struct d3d9_surface surface)

Definition at line 407 of file surface.c.

408{
409 HRESULT hr;
410
411 /* The surface reference count can be equal to 0 when this function is
412 * called. In order to properly manage the render target view reference
413 * count, we temporarily increment the surface reference count. */
415
416 if (surface->wined3d_rtv)
417 return surface->wined3d_rtv;
418
420 surface->sub_resource_idx, surface, &d3d9_view_wined3d_parent_ops, &surface->wined3d_rtv)))
421 {
422 ERR("Failed to create rendertarget view, hr %#x.\n", hr);
424 return NULL;
425 }
426
427 if (surface->texture)
428 list_add_head(&surface->texture->rtv_list, &surface->rtv_entry);
429
430 return surface->wined3d_rtv;
431}
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
#define ERR(fmt,...)
Definition: precomp.h:57
#define NULL
Definition: types.h:112
static const struct wined3d_parent_ops d3d9_view_wined3d_parent_ops
Definition: surface.c:395
static ULONG WINAPI d3d9_surface_AddRef(IDirect3DSurface9 *iface)
Definition: surface.c:51
static ULONG WINAPI d3d9_surface_Release(IDirect3DSurface9 *iface)
Definition: surface.c:81
HRESULT CDECL wined3d_rendertarget_view_create_from_sub_resource(struct wined3d_texture *texture, unsigned int sub_resource_idx, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_rendertarget_view **view)
Definition: view.c:624
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hr
Definition: shlfolder.c:183
struct wined3d_texture * wined3d_texture
Definition: d3d9_private.h:161
struct list rtv_entry
Definition: d3d9_private.h:163
IDirect3DSurface9 IDirect3DSurface9_iface
Definition: d3d9_private.h:159
struct wined3d_rendertarget_view * wined3d_rtv
Definition: d3d9_private.h:164
struct d3d9_texture * texture
Definition: d3d9_private.h:167
unsigned int sub_resource_idx
Definition: d3d9_private.h:162

Referenced by d3d9_device_ColorFill(), d3d9_device_SetDepthStencilSurface(), and d3d9_device_SetRenderTarget().

◆ d3d9_surface_AddRef()

static ULONG WINAPI d3d9_surface_AddRef ( IDirect3DSurface9 *  iface)
static

Definition at line 51 of file surface.c.

52{
53 struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface);
54 ULONG refcount;
55
56 TRACE("iface %p.\n", iface);
57
58 if (surface->texture)
59 {
60 TRACE("Forwarding to %p.\n", surface->texture);
61 return IDirect3DBaseTexture9_AddRef(&surface->texture->IDirect3DBaseTexture9_iface);
62 }
63
64 refcount = InterlockedIncrement(&surface->resource.refcount);
65 TRACE("%p increasing refcount to %u.\n", iface, refcount);
66
67 if (refcount == 1)
68 {
69 if (surface->parent_device)
72 if (surface->wined3d_rtv)
76 }
77
78 return refcount;
79}
#define InterlockedIncrement
Definition: armddk.h:53
#define IDirect3DDevice9Ex_AddRef(p)
Definition: d3d9.h:1916
#define IDirect3DBaseTexture9_AddRef(p)
Definition: d3d9.h:834
static struct d3d9_surface * impl_from_IDirect3DSurface9(IDirect3DSurface9 *iface)
Definition: surface.c:27
ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture)
Definition: texture.c:994
ULONG CDECL wined3d_rendertarget_view_incref(struct wined3d_rendertarget_view *view)
Definition: view.c:318
#define TRACE(s)
Definition: solgame.cpp:4
IDirect3DDevice9Ex * parent_device
Definition: d3d9_private.h:165
struct d3d9_resource resource
Definition: d3d9_private.h:160
uint32_t ULONG
Definition: typedefs.h:59
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368

Referenced by d3d9_surface_acquire_rendertarget_view().

◆ d3d9_surface_FreePrivateData()

static HRESULT WINAPI d3d9_surface_FreePrivateData ( IDirect3DSurface9 *  iface,
REFGUID  guid 
)
static

Definition at line 158 of file surface.c.

159{
160 struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface);
161 TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
162
164}
HRESULT d3d9_resource_free_private_data(struct d3d9_resource *resource, const GUID *guid)
Definition: d3d9_main.c:160
#define debugstr_guid
Definition: kernel32.h:35
const GUID * guid

◆ d3d9_surface_get_device()

struct d3d9_device * d3d9_surface_get_device ( const struct d3d9_surface surface)

Definition at line 400 of file surface.c.

401{
402 IDirect3DDevice9Ex *device;
403 device = surface->texture ? surface->texture->parent_device : surface->parent_device;
405}
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289

Referenced by d3d9_device_SetRenderTarget().

◆ d3d9_surface_GetContainer()

static HRESULT WINAPI d3d9_surface_GetContainer ( IDirect3DSurface9 *  iface,
REFIID  riid,
void **  container 
)
static

Definition at line 196 of file surface.c.

197{
198 struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface);
199 HRESULT hr;
200
201 TRACE("iface %p, riid %s, container %p.\n", iface, debugstr_guid(riid), container);
202
203 if (!surface->container)
204 return E_NOINTERFACE;
205
206 hr = IUnknown_QueryInterface(surface->container, riid, container);
207
208 TRACE("Returning %p.\n", *container);
209
210 return hr;
211}
REFIID riid
Definition: atlbase.h:39
IUnknown * container
Definition: d3d9_private.h:166
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ d3d9_surface_GetDC()

static HRESULT WINAPI d3d9_surface_GetDC ( IDirect3DSurface9 *  iface,
HDC dc 
)
static

Definition at line 289 of file surface.c.

290{
291 struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface);
292 HRESULT hr;
293
294 TRACE("iface %p, dc %p.\n", iface, dc);
295
299
300 return hr;
301}
HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC *dc)
Definition: texture.c:3623
static const WCHAR dc[]

◆ d3d9_surface_GetDesc()

static HRESULT WINAPI d3d9_surface_GetDesc ( IDirect3DSurface9 *  iface,
D3DSURFACE_DESC desc 
)
static

Definition at line 213 of file surface.c.

214{
215 struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface);
216 struct wined3d_sub_resource_desc wined3d_desc;
217
218 TRACE("iface %p, desc %p.\n", iface, desc);
219
223
224 desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format);
225 desc->Type = D3DRTYPE_SURFACE;
226 desc->Usage = d3dusage_from_wined3dusage(wined3d_desc.usage);
227 desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage);
228 desc->MultiSampleType = wined3d_desc.multisample_type;
229 desc->MultiSampleQuality = wined3d_desc.multisample_quality;
230 desc->Width = wined3d_desc.width;
231 desc->Height = wined3d_desc.height;
232
233 return D3D_OK;
234}
D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN
Definition: device.c:44
static DWORD d3dusage_from_wined3dusage(unsigned int usage)
Definition: d3d8_private.h:280
static D3DPOOL d3dpool_from_wined3daccess(unsigned int access, unsigned int usage)
Definition: d3d8_private.h:285
@ D3DRTYPE_SURFACE
Definition: d3d8types.h:810
#define D3D_OK
Definition: d3d.h:106
HRESULT CDECL wined3d_texture_get_sub_resource_desc(const struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_sub_resource_desc *desc)
Definition: texture.c:3480
static const WCHAR desc[]
Definition: protectdata.c:36

◆ d3d9_surface_GetDevice()

static HRESULT WINAPI d3d9_surface_GetDevice ( IDirect3DSurface9 *  iface,
IDirect3DDevice9 **  device 
)
static

Definition at line 121 of file surface.c.

122{
123 struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface);
124
125 TRACE("iface %p, device %p.\n", iface, device);
126
127 if (surface->texture)
128 return IDirect3DBaseTexture9_GetDevice(&surface->texture->IDirect3DBaseTexture9_iface, device);
129
130 *device = (IDirect3DDevice9 *)surface->parent_device;
132
133 TRACE("Returning device %p.\n", *device);
134
135 return D3D_OK;
136}
#define IDirect3DBaseTexture9_GetDevice(p, a)
Definition: d3d9.h:837
#define IDirect3DDevice9_AddRef(p)
Definition: d3d9.h:1507

◆ d3d9_surface_GetPriority()

static DWORD WINAPI d3d9_surface_GetPriority ( IDirect3DSurface9 *  iface)
static

Definition at line 172 of file surface.c.

173{
174 TRACE("iface %p. Ignored on surfaces.\n", iface);
175 return 0;
176}

◆ d3d9_surface_GetPrivateData()

static HRESULT WINAPI d3d9_surface_GetPrivateData ( IDirect3DSurface9 *  iface,
REFGUID  guid,
void data,
DWORD data_size 
)
static

Definition at line 148 of file surface.c.

150{
151 struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface);
152 TRACE("iface %p, guid %s, data %p, data_size %p.\n",
153 iface, debugstr_guid(guid), data, data_size);
154
155 return d3d9_resource_get_private_data(&surface->resource, guid, data, data_size);
156}
HRESULT d3d9_resource_get_private_data(struct d3d9_resource *resource, const GUID *guid, void *data, DWORD *data_size)
Definition: d3d9_main.c:178
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

◆ d3d9_surface_GetType()

static D3DRESOURCETYPE WINAPI d3d9_surface_GetType ( IDirect3DSurface9 *  iface)
static

Definition at line 189 of file surface.c.

190{
191 TRACE("iface %p.\n", iface);
192
193 return D3DRTYPE_SURFACE;
194}

◆ d3d9_surface_LockRect()

static HRESULT WINAPI d3d9_surface_LockRect ( IDirect3DSurface9 *  iface,
D3DLOCKED_RECT locked_rect,
const RECT rect,
DWORD  flags 
)
static

Definition at line 236 of file surface.c.

238{
239 struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface);
240 struct wined3d_box box;
241 struct wined3d_map_desc map_desc;
242 HRESULT hr;
243
244 TRACE("iface %p, locked_rect %p, rect %s, flags %#x.\n",
245 iface, locked_rect, wine_dbgstr_rect(rect), flags);
246
247 if (rect)
248 wined3d_box_set(&box, rect->left, rect->top, rect->right, rect->bottom, 0, 1);
249
254
255 if (SUCCEEDED(hr))
256 {
257 locked_rect->Pitch = map_desc.row_pitch;
258 locked_rect->pBits = map_desc.data;
259 }
260
261 return hr;
262}
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
unsigned int wined3dmapflags_from_d3dmapflags(unsigned int flags) DECLSPEC_HIDDEN
Definition: device.c:144
HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
Definition: resource.c:344
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
GLbitfield flags
Definition: glext.h:7161
#define SUCCEEDED(hr)
Definition: intsafe.h:50
& rect
Definition: startmenu.cpp:1413
Definition: palette.c:468
static void wined3d_box_set(struct wined3d_box *box, unsigned int left, unsigned int top, unsigned int right, unsigned int bottom, unsigned int front, unsigned int back)
Definition: wined3d.h:2789

◆ d3d9_surface_PreLoad()

static void WINAPI d3d9_surface_PreLoad ( IDirect3DSurface9 *  iface)
static

Definition at line 178 of file surface.c.

179{
180 struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface);
181
182 TRACE("iface %p.\n", iface);
183
187}
void CDECL wined3d_resource_preload(struct wined3d_resource *resource)
Definition: resource.c:482

◆ d3d9_surface_QueryInterface()

static HRESULT WINAPI d3d9_surface_QueryInterface ( IDirect3DSurface9 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 32 of file surface.c.

33{
34 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
35
36 if (IsEqualGUID(riid, &IID_IDirect3DSurface9)
37 || IsEqualGUID(riid, &IID_IDirect3DResource9)
39 {
41 *out = iface;
42 return S_OK;
43 }
44
45 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
46
47 *out = NULL;
48 return E_NOINTERFACE;
49}
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
#define IDirect3DSurface9_AddRef(p)
Definition: d3d9.h:621
#define S_OK
Definition: intsafe.h:52
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
static FILE * out
Definition: regtests2xml.c:44

◆ d3d9_surface_Release()

static ULONG WINAPI d3d9_surface_Release ( IDirect3DSurface9 *  iface)
static

Definition at line 81 of file surface.c.

82{
83 struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface);
84 ULONG refcount;
85
86 TRACE("iface %p.\n", iface);
87
88 if (surface->texture)
89 {
90 TRACE("Forwarding to %p.\n", surface->texture);
91 return IDirect3DBaseTexture9_Release(&surface->texture->IDirect3DBaseTexture9_iface);
92 }
93
94 if (!surface->resource.refcount)
95 {
96 WARN("Surface does not have any references.\n");
97 return 0;
98 }
99
100 refcount = InterlockedDecrement(&surface->resource.refcount);
101 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
102
103 if (!refcount)
104 {
105 IDirect3DDevice9Ex *parent_device = surface->parent_device;
106
108 if (surface->wined3d_rtv)
112
113 /* Release the device last, as it may cause the device to be destroyed. */
114 if (parent_device)
116 }
117
118 return refcount;
119}
#define InterlockedDecrement
Definition: armddk.h:52
#define IDirect3DDevice9Ex_Release(p)
Definition: d3d9.h:1917
#define IDirect3DBaseTexture9_Release(p)
Definition: d3d9.h:835
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
Definition: texture.c:1023
ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *view)
Definition: view.c:348

Referenced by d3d9_surface_acquire_rendertarget_view(), and d3d9_surface_release_rendertarget_view().

◆ d3d9_surface_release_rendertarget_view()

void d3d9_surface_release_rendertarget_view ( struct d3d9_surface surface,
struct wined3d_rendertarget_view rtv 
)

Definition at line 433 of file surface.c.

435{
436 if (rtv)
438}

Referenced by d3d9_device_ColorFill(), d3d9_device_SetDepthStencilSurface(), and d3d9_device_SetRenderTarget().

◆ d3d9_surface_ReleaseDC()

static HRESULT WINAPI d3d9_surface_ReleaseDC ( IDirect3DSurface9 *  iface,
HDC  dc 
)
static

Definition at line 303 of file surface.c.

304{
305 struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface);
306 HRESULT hr;
307
308 TRACE("iface %p, dc %p.\n", iface, dc);
309
312 if (SUCCEEDED(hr) && surface->texture)
315
316 return hr;
317}
HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc)
Definition: texture.c:3671
void d3d9_texture_flag_auto_gen_mipmap(struct d3d9_texture *texture) DECLSPEC_HIDDEN
Definition: texture.c:108

◆ d3d9_surface_SetPriority()

static DWORD WINAPI d3d9_surface_SetPriority ( IDirect3DSurface9 *  iface,
DWORD  priority 
)
static

Definition at line 166 of file surface.c.

167{
168 TRACE("iface %p, priority %u. Ignored on surfaces.\n", iface, priority);
169 return 0;
170}
static int priority
Definition: timer.c:163

◆ d3d9_surface_SetPrivateData()

static HRESULT WINAPI d3d9_surface_SetPrivateData ( IDirect3DSurface9 *  iface,
REFGUID  guid,
const void data,
DWORD  data_size,
DWORD  flags 
)
static

Definition at line 138 of file surface.c.

140{
141 struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface);
142 TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
143 iface, debugstr_guid(guid), data, data_size, flags);
144
145 return d3d9_resource_set_private_data(&surface->resource, guid, data, data_size, flags);
146}
HRESULT d3d9_resource_set_private_data(struct d3d9_resource *resource, const GUID *guid, const void *data, DWORD data_size, DWORD flags)
Definition: d3d9_main.c:222

◆ d3d9_surface_UnlockRect()

static HRESULT WINAPI d3d9_surface_UnlockRect ( IDirect3DSurface9 *  iface)
static

Definition at line 264 of file surface.c.

265{
266 struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface);
267 HRESULT hr;
268
269 TRACE("iface %p.\n", iface);
270
273 if (SUCCEEDED(hr) && surface->texture)
276
277 if (hr == WINEDDERR_NOTLOCKED)
278 {
280 if (surface->texture)
281 type = IDirect3DBaseTexture9_GetType(&surface->texture->IDirect3DBaseTexture9_iface);
282 else
285 }
286 return hr;
287}
enum _D3DRESOURCETYPE D3DRESOURCETYPE
@ D3DRTYPE_TEXTURE
Definition: d3d8types.h:812
#define IDirect3DBaseTexture9_GetType(p)
Definition: d3d9.h:844
#define D3DERR_INVALIDCALL
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
Definition: resource.c:382
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define WINEDDERR_NOTLOCKED
Definition: wined3d.h:50

◆ impl_from_IDirect3DSurface9()

◆ surface_init()

void surface_init ( struct d3d9_surface surface,
struct wined3d_texture wined3d_texture,
unsigned int  sub_resource_idx,
const struct wined3d_parent_ops **  parent_ops 
)

Definition at line 355 of file surface.c.

357{
358 IDirect3DBaseTexture9 *texture;
359
361 d3d9_resource_init(&surface->resource);
362 surface->resource.refcount = 0;
363 list_init(&surface->rtv_entry);
366 surface->sub_resource_idx = sub_resource_idx;
367
368 if (surface->container && SUCCEEDED(IUnknown_QueryInterface(surface->container,
369 &IID_IDirect3DBaseTexture9, (void **)&texture)))
370 {
373 }
374
375 *parent_ops = &d3d9_surface_wined3d_parent_ops;
376}
static void list_init(struct list_entry *head)
Definition: list.h:51
void d3d9_resource_init(struct d3d9_resource *resource)
Definition: d3d9_main.c:216
static const struct IDirect3DSurface9Vtbl d3d9_surface_vtbl
Definition: surface.c:319
static const struct wined3d_parent_ops d3d9_surface_wined3d_parent_ops
Definition: surface.c:350
void *CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
Definition: texture.c:1121
GLenum GLuint texture
Definition: glext.h:6295
struct d3d9_texture * unsafe_impl_from_IDirect3DBaseTexture9(IDirect3DBaseTexture9 *iface) DECLSPEC_HIDDEN
Definition: texture.c:1269

◆ surface_wined3d_object_destroyed()

static void STDMETHODCALLTYPE surface_wined3d_object_destroyed ( void parent)
static

Definition at line 343 of file surface.c.

344{
345 struct d3d9_surface *surface = parent;
347 heap_free(surface);
348}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
void d3d9_resource_cleanup(struct d3d9_resource *resource)
Definition: d3d9_main.c:155
r parent
Definition: btrfs.c:3010

◆ unsafe_impl_from_IDirect3DSurface9()

struct d3d9_surface * unsafe_impl_from_IDirect3DSurface9 ( IDirect3DSurface9 *  iface)

◆ view_wined3d_object_destroyed()

static void STDMETHODCALLTYPE view_wined3d_object_destroyed ( void parent)
static

Definition at line 378 of file surface.c.

379{
380 struct d3d9_surface *surface = parent;
381
382 /* If the surface reference count drops to zero, we release our reference
383 * to the view, but don't clear the pointer yet, in case e.g. a
384 * GetRenderTarget() call brings the surface back before the view is
385 * actually destroyed. When the view is destroyed, we need to clear the
386 * pointer, or a subsequent surface AddRef() would reference it again.
387 *
388 * This is safe because as long as the view still has a reference to the
389 * texture, the surface is also still alive, and we're called before the
390 * view releases that reference. */
391 surface->wined3d_rtv = NULL;
392 list_remove(&surface->rtv_entry);
393}
static void list_remove(struct list_entry *entry)
Definition: list.h:90

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( d3d9  )

Variable Documentation

◆ d3d9_surface_vtbl

const struct IDirect3DSurface9Vtbl d3d9_surface_vtbl
static
Initial value:
=
{
}
static D3DRESOURCETYPE WINAPI d3d9_surface_GetType(IDirect3DSurface9 *iface)
Definition: surface.c:189
static HRESULT WINAPI d3d9_surface_GetPrivateData(IDirect3DSurface9 *iface, REFGUID guid, void *data, DWORD *data_size)
Definition: surface.c:148
static HRESULT WINAPI d3d9_surface_GetDesc(IDirect3DSurface9 *iface, D3DSURFACE_DESC *desc)
Definition: surface.c:213
static HRESULT WINAPI d3d9_surface_GetDC(IDirect3DSurface9 *iface, HDC *dc)
Definition: surface.c:289
static HRESULT WINAPI d3d9_surface_QueryInterface(IDirect3DSurface9 *iface, REFIID riid, void **out)
Definition: surface.c:32
static HRESULT WINAPI d3d9_surface_GetDevice(IDirect3DSurface9 *iface, IDirect3DDevice9 **device)
Definition: surface.c:121
static HRESULT WINAPI d3d9_surface_LockRect(IDirect3DSurface9 *iface, D3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
Definition: surface.c:236
static HRESULT WINAPI d3d9_surface_SetPrivateData(IDirect3DSurface9 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
Definition: surface.c:138
static DWORD WINAPI d3d9_surface_SetPriority(IDirect3DSurface9 *iface, DWORD priority)
Definition: surface.c:166
static void WINAPI d3d9_surface_PreLoad(IDirect3DSurface9 *iface)
Definition: surface.c:178
static HRESULT WINAPI d3d9_surface_FreePrivateData(IDirect3DSurface9 *iface, REFGUID guid)
Definition: surface.c:158
static HRESULT WINAPI d3d9_surface_UnlockRect(IDirect3DSurface9 *iface)
Definition: surface.c:264
static HRESULT WINAPI d3d9_surface_GetContainer(IDirect3DSurface9 *iface, REFIID riid, void **container)
Definition: surface.c:196
static HRESULT WINAPI d3d9_surface_ReleaseDC(IDirect3DSurface9 *iface, HDC dc)
Definition: surface.c:303
static DWORD WINAPI d3d9_surface_GetPriority(IDirect3DSurface9 *iface)
Definition: surface.c:172

Definition at line 319 of file surface.c.

Referenced by surface_init(), and unsafe_impl_from_IDirect3DSurface9().

◆ d3d9_surface_wined3d_parent_ops

const struct wined3d_parent_ops d3d9_surface_wined3d_parent_ops
static
Initial value:
=
{
}
static void STDMETHODCALLTYPE surface_wined3d_object_destroyed(void *parent)
Definition: surface.c:305

Definition at line 350 of file surface.c.

Referenced by surface_init().

◆ d3d9_view_wined3d_parent_ops

const struct wined3d_parent_ops d3d9_view_wined3d_parent_ops
static
Initial value:
=
{
}
static void STDMETHODCALLTYPE view_wined3d_object_destroyed(void *parent)
Definition: surface.c:340

Definition at line 395 of file surface.c.

Referenced by d3d9_surface_acquire_rendertarget_view().