static ULONG STDMETHODCALLTYPE dxgi_swapchain_AddRef(IDXGISwapChain *iface) { struct dxgi_swapchain *This = impl_from_IDXGISwapChain(iface); ULONG refcount = InterlockedIncrement(&This->refcount); TRACE("%p increasing refcount to %u\n", This, refcount); if (refcount == 1) wined3d_swapchain_incref(This->wined3d_swapchain); return refcount; }
ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture) { ULONG refcount; TRACE("texture %p, swapchain %p.\n", texture, texture->swapchain); if (texture->swapchain) return wined3d_swapchain_incref(texture->swapchain); refcount = InterlockedIncrement(&texture->resource.ref); TRACE("%p increasing refcount to %u.\n", texture, refcount); return refcount; }
static ULONG WINAPI d3d8_swapchain_AddRef(IDirect3DSwapChain8 *iface) { struct d3d8_swapchain *swapchain = impl_from_IDirect3DSwapChain8(iface); ULONG ref = InterlockedIncrement(&swapchain->refcount); TRACE("%p increasing refcount to %u.\n", iface, ref); if (ref == 1) { if (swapchain->parent_device) IDirect3DDevice8_AddRef(swapchain->parent_device); wined3d_mutex_lock(); wined3d_swapchain_incref(swapchain->wined3d_swapchain); wined3d_mutex_unlock(); } return ref; }
static ULONG WINAPI IDirect3DSwapChain9Impl_AddRef(LPDIRECT3DSWAPCHAIN9 iface) { IDirect3DSwapChain9Impl *This = (IDirect3DSwapChain9Impl *)iface; ULONG ref = InterlockedIncrement(&This->ref); TRACE("%p increasing refcount to %u.\n", iface, ref); if (ref == 1) { if (This->parentDevice) IDirect3DDevice9Ex_AddRef(This->parentDevice); wined3d_mutex_lock(); wined3d_swapchain_incref(This->wined3d_swapchain); wined3d_mutex_unlock(); } return ref; }
static ULONG WINAPI IDirect3DSwapChain8Impl_AddRef(IDirect3DSwapChain8 *iface) { IDirect3DSwapChain8Impl *This = impl_from_IDirect3DSwapChain8(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("%p increasing refcount to %u.\n", iface, ref); if (ref == 1) { if (This->parentDevice) IDirect3DDevice8_AddRef(This->parentDevice); wined3d_mutex_lock(); wined3d_swapchain_incref(This->wined3d_swapchain); wined3d_mutex_unlock(); } return ref; }