wined3d: Remove COM from the rendertarget view implementation.
This commit is contained in:
parent
519a3a9162
commit
2ab5b833d7
|
@ -134,7 +134,7 @@ struct d3d10_rendertarget_view
|
||||||
const struct ID3D10RenderTargetViewVtbl *vtbl;
|
const struct ID3D10RenderTargetViewVtbl *vtbl;
|
||||||
LONG refcount;
|
LONG refcount;
|
||||||
|
|
||||||
IWineD3DRendertargetView *wined3d_view;
|
struct wined3d_rendertarget_view *wined3d_view;
|
||||||
D3D10_RENDER_TARGET_VIEW_DESC desc;
|
D3D10_RENDER_TARGET_VIEW_DESC desc;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -372,12 +372,13 @@ static void STDMETHODCALLTYPE d3d10_device_ClearRenderTargetView(ID3D10Device *i
|
||||||
ID3D10RenderTargetView *render_target_view, const FLOAT color_rgba[4])
|
ID3D10RenderTargetView *render_target_view, const FLOAT color_rgba[4])
|
||||||
{
|
{
|
||||||
struct d3d10_device *This = (struct d3d10_device *)iface;
|
struct d3d10_device *This = (struct d3d10_device *)iface;
|
||||||
IWineD3DRendertargetView *wined3d_view = ((struct d3d10_rendertarget_view *)render_target_view)->wined3d_view;
|
struct wined3d_rendertarget_view *wined3d_view;
|
||||||
const WINED3DCOLORVALUE color = {color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]};
|
const WINED3DCOLORVALUE color = {color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]};
|
||||||
|
|
||||||
TRACE("iface %p, render_target_view %p, color_rgba [%f %f %f %f]\n",
|
TRACE("iface %p, render_target_view %p, color_rgba [%f %f %f %f]\n",
|
||||||
iface, render_target_view, color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]);
|
iface, render_target_view, color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]);
|
||||||
|
|
||||||
|
wined3d_view = ((struct d3d10_rendertarget_view *)render_target_view)->wined3d_view;
|
||||||
IWineD3DDevice_ClearRendertargetView(This->wined3d_device, wined3d_view, &color);
|
IWineD3DDevice_ClearRendertargetView(This->wined3d_device, wined3d_view, &color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -328,7 +328,7 @@ static ULONG STDMETHODCALLTYPE d3d10_rendertarget_view_Release(ID3D10RenderTarge
|
||||||
|
|
||||||
if (!refcount)
|
if (!refcount)
|
||||||
{
|
{
|
||||||
IWineD3DRendertargetView_Release(This->wined3d_view);
|
wined3d_rendertarget_view_decref(This->wined3d_view);
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -380,10 +380,10 @@ static void STDMETHODCALLTYPE d3d10_rendertarget_view_GetResource(ID3D10RenderTa
|
||||||
|
|
||||||
TRACE("iface %p, resource %p\n", iface, resource);
|
TRACE("iface %p, resource %p\n", iface, resource);
|
||||||
|
|
||||||
hr = IWineD3DRendertargetView_GetResource(This->wined3d_view, &wined3d_resource);
|
wined3d_resource = wined3d_rendertarget_view_get_resource(This->wined3d_view);
|
||||||
if (FAILED(hr))
|
if (!wined3d_resource)
|
||||||
{
|
{
|
||||||
ERR("Failed to get wined3d resource, hr %#x\n", hr);
|
ERR("Failed to get wined3d resource.\n");
|
||||||
*resource = NULL;
|
*resource = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1089,7 +1089,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UI
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateRendertargetView(IWineD3DDevice *iface,
|
static HRESULT WINAPI IWineD3DDeviceImpl_CreateRendertargetView(IWineD3DDevice *iface,
|
||||||
struct wined3d_resource *resource, void *parent, IWineD3DRendertargetView **rendertarget_view)
|
struct wined3d_resource *resource, void *parent, struct wined3d_rendertarget_view **rendertarget_view)
|
||||||
{
|
{
|
||||||
struct wined3d_rendertarget_view *object;
|
struct wined3d_rendertarget_view *object;
|
||||||
|
|
||||||
|
@ -1106,7 +1106,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateRendertargetView(IWineD3DDevice *
|
||||||
wined3d_rendertarget_view_init(object, resource, parent);
|
wined3d_rendertarget_view_init(object, resource, parent);
|
||||||
|
|
||||||
TRACE("Created render target view %p.\n", object);
|
TRACE("Created render target view %p.\n", object);
|
||||||
*rendertarget_view = (IWineD3DRendertargetView *)object;
|
*rendertarget_view = object;
|
||||||
|
|
||||||
return WINED3D_OK;
|
return WINED3D_OK;
|
||||||
}
|
}
|
||||||
|
@ -5776,18 +5776,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface,
|
||||||
|
|
||||||
/* Do not call while under the GL lock. */
|
/* Do not call while under the GL lock. */
|
||||||
static void WINAPI IWineD3DDeviceImpl_ClearRendertargetView(IWineD3DDevice *iface,
|
static void WINAPI IWineD3DDeviceImpl_ClearRendertargetView(IWineD3DDevice *iface,
|
||||||
IWineD3DRendertargetView *rendertarget_view, const WINED3DCOLORVALUE *color)
|
struct wined3d_rendertarget_view *rendertarget_view, const WINED3DCOLORVALUE *color)
|
||||||
{
|
{
|
||||||
struct wined3d_resource *resource;
|
struct wined3d_resource *resource;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
hr = IWineD3DRendertargetView_GetResource(rendertarget_view, &resource);
|
resource = rendertarget_view->resource;
|
||||||
if (FAILED(hr))
|
|
||||||
{
|
|
||||||
ERR("Failed to get resource, hr %#x\n", hr);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (resource->resourceType != WINED3DRTYPE_SURFACE)
|
if (resource->resourceType != WINED3DRTYPE_SURFACE)
|
||||||
{
|
{
|
||||||
FIXME("Only supported on surface resources\n");
|
FIXME("Only supported on surface resources\n");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
* Copyright 2009, 2011 Henri Verbeet for CodeWeavers
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -24,90 +24,44 @@
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||||
|
|
||||||
/* IUnknown methods */
|
ULONG CDECL wined3d_rendertarget_view_incref(struct wined3d_rendertarget_view *view)
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE rendertarget_view_QueryInterface(IWineD3DRendertargetView *iface,
|
|
||||||
REFIID riid, void **object)
|
|
||||||
{
|
{
|
||||||
TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
|
ULONG refcount = InterlockedIncrement(&view->refcount);
|
||||||
|
|
||||||
if (IsEqualGUID(riid, &IID_IWineD3DRendertargetView)
|
TRACE("%p increasing refcount to %u.\n", view, refcount);
|
||||||
|| IsEqualGUID(riid, &IID_IWineD3DBase)
|
|
||||||
|| IsEqualGUID(riid, &IID_IUnknown))
|
|
||||||
{
|
|
||||||
IUnknown_AddRef(iface);
|
|
||||||
*object = iface;
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
|
|
||||||
|
|
||||||
*object = NULL;
|
|
||||||
return E_NOINTERFACE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ULONG STDMETHODCALLTYPE rendertarget_view_AddRef(IWineD3DRendertargetView *iface)
|
|
||||||
{
|
|
||||||
struct wined3d_rendertarget_view *This = (struct wined3d_rendertarget_view *)iface;
|
|
||||||
ULONG refcount = InterlockedIncrement(&This->refcount);
|
|
||||||
|
|
||||||
TRACE("%p increasing refcount to %u\n", This, refcount);
|
|
||||||
|
|
||||||
return refcount;
|
return refcount;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG STDMETHODCALLTYPE rendertarget_view_Release(IWineD3DRendertargetView *iface)
|
ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *view)
|
||||||
{
|
{
|
||||||
struct wined3d_rendertarget_view *This = (struct wined3d_rendertarget_view *)iface;
|
ULONG refcount = InterlockedDecrement(&view->refcount);
|
||||||
ULONG refcount = InterlockedDecrement(&This->refcount);
|
|
||||||
|
|
||||||
TRACE("%p decreasing refcount to %u\n", This, refcount);
|
TRACE("%p decreasing refcount to %u.\n", view, refcount);
|
||||||
|
|
||||||
if (!refcount)
|
if (!refcount)
|
||||||
{
|
HeapFree(GetProcessHeap(), 0, view);
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
|
||||||
}
|
|
||||||
|
|
||||||
return refcount;
|
return refcount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* IWineD3DBase methods */
|
void * CDECL wined3d_rendertarget_view_get_parent(const struct wined3d_rendertarget_view *view)
|
||||||
|
|
||||||
static void * STDMETHODCALLTYPE rendertarget_view_GetParent(IWineD3DRendertargetView *iface)
|
|
||||||
{
|
{
|
||||||
TRACE("iface %p.\n", iface);
|
TRACE("view %p.\n", view);
|
||||||
|
|
||||||
return ((struct wined3d_rendertarget_view *)iface)->parent;
|
return view->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* IWineD3DRendertargetView methods */
|
struct wined3d_resource * CDECL wined3d_rendertarget_view_get_resource(const struct wined3d_rendertarget_view *view)
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE rendertarget_view_GetResource(IWineD3DRendertargetView *iface,
|
|
||||||
struct wined3d_resource **resource)
|
|
||||||
{
|
{
|
||||||
struct wined3d_rendertarget_view *This = (struct wined3d_rendertarget_view *)iface;
|
TRACE("view %p.\n", view);
|
||||||
|
|
||||||
*resource = This->resource;
|
return view->resource;
|
||||||
|
|
||||||
return WINED3D_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct IWineD3DRendertargetViewVtbl wined3d_rendertarget_view_vtbl =
|
|
||||||
{
|
|
||||||
/* IUnknown methods */
|
|
||||||
rendertarget_view_QueryInterface,
|
|
||||||
rendertarget_view_AddRef,
|
|
||||||
rendertarget_view_Release,
|
|
||||||
/* IWineD3DBase methods */
|
|
||||||
rendertarget_view_GetParent,
|
|
||||||
/* IWineD3DRendertargetView methods */
|
|
||||||
rendertarget_view_GetResource,
|
|
||||||
};
|
|
||||||
|
|
||||||
void wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *view,
|
void wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *view,
|
||||||
struct wined3d_resource *resource, void *parent)
|
struct wined3d_resource *resource, void *parent)
|
||||||
{
|
{
|
||||||
view->vtbl = &wined3d_rendertarget_view_vtbl;
|
|
||||||
view->refcount = 1;
|
view->refcount = 1;
|
||||||
view->resource = resource;
|
view->resource = resource;
|
||||||
view->parent = parent;
|
view->parent = parent;
|
||||||
|
|
|
@ -61,6 +61,11 @@
|
||||||
@ cdecl wined3d_resource_get_desc(ptr ptr)
|
@ cdecl wined3d_resource_get_desc(ptr ptr)
|
||||||
@ cdecl wined3d_resource_get_parent(ptr)
|
@ cdecl wined3d_resource_get_parent(ptr)
|
||||||
|
|
||||||
|
@ cdecl wined3d_rendertarget_view_decref(ptr)
|
||||||
|
@ cdecl wined3d_rendertarget_view_get_parent(ptr)
|
||||||
|
@ cdecl wined3d_rendertarget_view_get_resource(ptr)
|
||||||
|
@ cdecl wined3d_rendertarget_view_incref(ptr)
|
||||||
|
|
||||||
@ cdecl wined3d_shader_decref(ptr)
|
@ cdecl wined3d_shader_decref(ptr)
|
||||||
@ cdecl wined3d_shader_get_byte_code(ptr ptr ptr)
|
@ cdecl wined3d_shader_get_byte_code(ptr ptr ptr)
|
||||||
@ cdecl wined3d_shader_get_parent(ptr)
|
@ cdecl wined3d_shader_get_parent(ptr)
|
||||||
|
|
|
@ -2507,10 +2507,8 @@ HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device,
|
||||||
UINT size, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, GLenum bind_hint,
|
UINT size, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, GLenum bind_hint,
|
||||||
const char *data, void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
|
const char *data, void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
/* IWineD3DRendertargetView */
|
|
||||||
struct wined3d_rendertarget_view
|
struct wined3d_rendertarget_view
|
||||||
{
|
{
|
||||||
const struct IWineD3DRendertargetViewVtbl *vtbl;
|
|
||||||
LONG refcount;
|
LONG refcount;
|
||||||
|
|
||||||
struct wined3d_resource *resource;
|
struct wined3d_resource *resource;
|
||||||
|
|
|
@ -2096,6 +2096,7 @@ struct wined3d_clipper;
|
||||||
struct wined3d_palette;
|
struct wined3d_palette;
|
||||||
struct wined3d_query;
|
struct wined3d_query;
|
||||||
struct wined3d_resource;
|
struct wined3d_resource;
|
||||||
|
struct wined3d_rendertarget_view;
|
||||||
struct wined3d_shader;
|
struct wined3d_shader;
|
||||||
struct wined3d_stateblock;
|
struct wined3d_stateblock;
|
||||||
struct wined3d_texture;
|
struct wined3d_texture;
|
||||||
|
@ -2207,18 +2208,6 @@ interface IWineD3DResource : IWineD3DBase
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
[
|
|
||||||
object,
|
|
||||||
local,
|
|
||||||
uuid(f7d8abf4-fb93-43e4-9c96-4618cf9b3cbc)
|
|
||||||
]
|
|
||||||
interface IWineD3DRendertargetView : IWineD3DBase
|
|
||||||
{
|
|
||||||
HRESULT GetResource(
|
|
||||||
[out] struct wined3d_resource **resource
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
[
|
[
|
||||||
object,
|
object,
|
||||||
local,
|
local,
|
||||||
|
@ -2438,7 +2427,7 @@ interface IWineD3DDevice : IUnknown
|
||||||
HRESULT CreateRendertargetView(
|
HRESULT CreateRendertargetView(
|
||||||
[in] struct wined3d_resource *resource,
|
[in] struct wined3d_resource *resource,
|
||||||
[in] void *parent,
|
[in] void *parent,
|
||||||
[out] IWineD3DRendertargetView **rendertarget_view
|
[out] struct wined3d_rendertarget_view **rendertarget_view
|
||||||
);
|
);
|
||||||
HRESULT CreateTexture(
|
HRESULT CreateTexture(
|
||||||
[in] UINT width,
|
[in] UINT width,
|
||||||
|
@ -2893,7 +2882,7 @@ interface IWineD3DDevice : IUnknown
|
||||||
[in] DWORD stencil
|
[in] DWORD stencil
|
||||||
);
|
);
|
||||||
void ClearRendertargetView(
|
void ClearRendertargetView(
|
||||||
[in] IWineD3DRendertargetView *rendertarget_view,
|
[in] struct wined3d_rendertarget_view *rendertarget_view,
|
||||||
[in] const WINED3DCOLORVALUE *color
|
[in] const WINED3DCOLORVALUE *color
|
||||||
);
|
);
|
||||||
void SetPrimitiveType(
|
void SetPrimitiveType(
|
||||||
|
@ -3075,6 +3064,11 @@ void __cdecl wined3d_resource_get_desc(const struct wined3d_resource *resource,
|
||||||
struct wined3d_resource_desc *desc);
|
struct wined3d_resource_desc *desc);
|
||||||
void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resource);
|
void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resource);
|
||||||
|
|
||||||
|
ULONG __cdecl wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *view);
|
||||||
|
void * __cdecl wined3d_rendertarget_view_get_parent(const struct wined3d_rendertarget_view *view);
|
||||||
|
struct wined3d_resource * __cdecl wined3d_rendertarget_view_get_resource(const struct wined3d_rendertarget_view *view);
|
||||||
|
ULONG __cdecl wined3d_rendertarget_view_incref(struct wined3d_rendertarget_view *view);
|
||||||
|
|
||||||
ULONG __cdecl wined3d_shader_decref(struct wined3d_shader *shader);
|
ULONG __cdecl wined3d_shader_decref(struct wined3d_shader *shader);
|
||||||
HRESULT __cdecl wined3d_shader_get_byte_code(const struct wined3d_shader *shader,
|
HRESULT __cdecl wined3d_shader_get_byte_code(const struct wined3d_shader *shader,
|
||||||
void *byte_code, UINT *byte_code_size);
|
void *byte_code, UINT *byte_code_size);
|
||||||
|
|
Loading…
Reference in New Issue