Commit 54ac05a8 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

d3d10core: COM cleanup for the ID3D10RasterizerState iface.

parent 815470e6
...@@ -227,7 +227,7 @@ HRESULT d3d10_depthstencil_state_init(struct d3d10_depthstencil_state *state) DE ...@@ -227,7 +227,7 @@ HRESULT d3d10_depthstencil_state_init(struct d3d10_depthstencil_state *state) DE
/* ID3D10RasterizerState */ /* ID3D10RasterizerState */
struct d3d10_rasterizer_state struct d3d10_rasterizer_state
{ {
const struct ID3D10RasterizerStateVtbl *vtbl; ID3D10RasterizerState ID3D10RasterizerState_iface;
LONG refcount; LONG refcount;
}; };
......
...@@ -1026,7 +1026,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRasterizerState(ID3D10Device ...@@ -1026,7 +1026,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRasterizerState(ID3D10Device
} }
TRACE("Created rasterizer state %p.\n", object); TRACE("Created rasterizer state %p.\n", object);
*rasterizer_state = (ID3D10RasterizerState *)object; *rasterizer_state = &object->ID3D10RasterizerState_iface;
return S_OK; return S_OK;
} }
......
...@@ -256,6 +256,11 @@ HRESULT d3d10_depthstencil_state_init(struct d3d10_depthstencil_state *state) ...@@ -256,6 +256,11 @@ HRESULT d3d10_depthstencil_state_init(struct d3d10_depthstencil_state *state)
return S_OK; return S_OK;
} }
static inline struct d3d10_rasterizer_state *impl_from_ID3D10RasterizerState(ID3D10RasterizerState *iface)
{
return CONTAINING_RECORD(iface, struct d3d10_rasterizer_state, ID3D10RasterizerState_iface);
}
/* IUnknown methods */ /* IUnknown methods */
static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_QueryInterface(ID3D10RasterizerState *iface, static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_QueryInterface(ID3D10RasterizerState *iface,
...@@ -280,7 +285,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_QueryInterface(ID3D10Ras ...@@ -280,7 +285,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_QueryInterface(ID3D10Ras
static ULONG STDMETHODCALLTYPE d3d10_rasterizer_state_AddRef(ID3D10RasterizerState *iface) static ULONG STDMETHODCALLTYPE d3d10_rasterizer_state_AddRef(ID3D10RasterizerState *iface)
{ {
struct d3d10_rasterizer_state *This = (struct d3d10_rasterizer_state *)iface; struct d3d10_rasterizer_state *This = impl_from_ID3D10RasterizerState(iface);
ULONG refcount = InterlockedIncrement(&This->refcount); ULONG refcount = InterlockedIncrement(&This->refcount);
TRACE("%p increasing refcount to %u.\n", This, refcount); TRACE("%p increasing refcount to %u.\n", This, refcount);
...@@ -290,7 +295,7 @@ static ULONG STDMETHODCALLTYPE d3d10_rasterizer_state_AddRef(ID3D10RasterizerSta ...@@ -290,7 +295,7 @@ static ULONG STDMETHODCALLTYPE d3d10_rasterizer_state_AddRef(ID3D10RasterizerSta
static ULONG STDMETHODCALLTYPE d3d10_rasterizer_state_Release(ID3D10RasterizerState *iface) static ULONG STDMETHODCALLTYPE d3d10_rasterizer_state_Release(ID3D10RasterizerState *iface)
{ {
struct d3d10_rasterizer_state *This = (struct d3d10_rasterizer_state *)iface; struct d3d10_rasterizer_state *This = impl_from_ID3D10RasterizerState(iface);
ULONG refcount = InterlockedDecrement(&This->refcount); ULONG refcount = InterlockedDecrement(&This->refcount);
TRACE("%p decreasing refcount to %u.\n", This, refcount); TRACE("%p decreasing refcount to %u.\n", This, refcount);
...@@ -361,7 +366,7 @@ static const struct ID3D10RasterizerStateVtbl d3d10_rasterizer_state_vtbl = ...@@ -361,7 +366,7 @@ static const struct ID3D10RasterizerStateVtbl d3d10_rasterizer_state_vtbl =
HRESULT d3d10_rasterizer_state_init(struct d3d10_rasterizer_state *state) HRESULT d3d10_rasterizer_state_init(struct d3d10_rasterizer_state *state)
{ {
state->vtbl = &d3d10_rasterizer_state_vtbl; state->ID3D10RasterizerState_iface.lpVtbl = &d3d10_rasterizer_state_vtbl;
state->refcount = 1; state->refcount = 1;
return S_OK; return S_OK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment