d2d1: Move mesh creation to mesh.c.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
27d5d4caf2
commit
3d222560b2
|
@ -188,7 +188,7 @@ struct d2d_mesh
|
||||||
ID2D1Factory *factory;
|
ID2D1Factory *factory;
|
||||||
};
|
};
|
||||||
|
|
||||||
void d2d_mesh_init(struct d2d_mesh *mesh, ID2D1Factory *factory) DECLSPEC_HIDDEN;
|
HRESULT d2d_mesh_create(ID2D1Factory *factory, struct d2d_mesh **mesh) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
struct d2d_bitmap
|
struct d2d_bitmap
|
||||||
{
|
{
|
||||||
|
|
|
@ -98,9 +98,15 @@ static const struct ID2D1MeshVtbl d2d_mesh_vtbl =
|
||||||
d2d_mesh_Open,
|
d2d_mesh_Open,
|
||||||
};
|
};
|
||||||
|
|
||||||
void d2d_mesh_init(struct d2d_mesh *mesh, ID2D1Factory *factory)
|
HRESULT d2d_mesh_create(ID2D1Factory *factory, struct d2d_mesh **mesh)
|
||||||
{
|
{
|
||||||
mesh->ID2D1Mesh_iface.lpVtbl = &d2d_mesh_vtbl;
|
if (!(*mesh = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(**mesh))))
|
||||||
mesh->refcount = 1;
|
return E_OUTOFMEMORY;
|
||||||
ID2D1Factory_AddRef(mesh->factory = factory);
|
|
||||||
|
(*mesh)->ID2D1Mesh_iface.lpVtbl = &d2d_mesh_vtbl;
|
||||||
|
(*mesh)->refcount = 1;
|
||||||
|
ID2D1Factory_AddRef((*mesh)->factory = factory);
|
||||||
|
|
||||||
|
TRACE("Created mesh %p.\n", *mesh);
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -446,18 +446,14 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateMesh(ID2D1RenderTar
|
||||||
{
|
{
|
||||||
struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
|
struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
|
||||||
struct d2d_mesh *object;
|
struct d2d_mesh *object;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE("iface %p, mesh %p.\n", iface, mesh);
|
TRACE("iface %p, mesh %p.\n", iface, mesh);
|
||||||
|
|
||||||
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
|
if (SUCCEEDED(hr = d2d_mesh_create(render_target->factory, &object)))
|
||||||
return E_OUTOFMEMORY;
|
*mesh = &object->ID2D1Mesh_iface;
|
||||||
|
|
||||||
d2d_mesh_init(object, render_target->factory);
|
return hr;
|
||||||
|
|
||||||
TRACE("Created mesh %p.\n", object);
|
|
||||||
*mesh = &object->ID2D1Mesh_iface;
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawLine(ID2D1RenderTarget *iface,
|
static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawLine(ID2D1RenderTarget *iface,
|
||||||
|
|
Loading…
Reference in New Issue