dwrite/tests: Test character spacing applied to cluster metrics.
[wine/multimedia.git] / dlls / d2d1 / mesh.c
blobb56638291f86144d4f71ac0a597e81ea96c123c1
1 /*
2 * Copyright 2014 Henri Verbeet for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "config.h"
20 #include "wine/port.h"
22 #include "d2d1_private.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(d2d);
26 static inline struct d2d_mesh *impl_from_ID2D1Mesh(ID2D1Mesh *iface)
28 return CONTAINING_RECORD(iface, struct d2d_mesh, ID2D1Mesh_iface);
31 static HRESULT STDMETHODCALLTYPE d2d_mesh_QueryInterface(ID2D1Mesh *iface, REFIID iid, void **out)
33 TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
35 if (IsEqualGUID(iid, &IID_ID2D1Mesh)
36 || IsEqualGUID(iid, &IID_ID2D1Resource)
37 || IsEqualGUID(iid, &IID_IUnknown))
39 ID2D1Mesh_AddRef(iface);
40 *out = iface;
41 return S_OK;
44 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
46 *out = NULL;
47 return E_NOINTERFACE;
50 static ULONG STDMETHODCALLTYPE d2d_mesh_AddRef(ID2D1Mesh *iface)
52 struct d2d_mesh *mesh = impl_from_ID2D1Mesh(iface);
53 ULONG refcount = InterlockedIncrement(&mesh->refcount);
55 TRACE("%p increasing refcount to %u.\n", iface, refcount);
57 return refcount;
60 static ULONG STDMETHODCALLTYPE d2d_mesh_Release(ID2D1Mesh *iface)
62 struct d2d_mesh *mesh = impl_from_ID2D1Mesh(iface);
63 ULONG refcount = InterlockedDecrement(&mesh->refcount);
65 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
67 if (!refcount)
68 HeapFree(GetProcessHeap(), 0, mesh);
70 return refcount;
73 static void STDMETHODCALLTYPE d2d_mesh_GetFactory(ID2D1Mesh *iface, ID2D1Factory **factory)
75 FIXME("iface %p, factory %p stub!\n", iface, factory);
77 *factory = NULL;
80 static HRESULT STDMETHODCALLTYPE d2d_mesh_Open(ID2D1Mesh *iface, ID2D1TessellationSink **sink)
82 FIXME("iface %p, sink %p stub!\n", iface, sink);
84 return E_NOTIMPL;
87 static const struct ID2D1MeshVtbl d2d_mesh_vtbl =
89 d2d_mesh_QueryInterface,
90 d2d_mesh_AddRef,
91 d2d_mesh_Release,
92 d2d_mesh_GetFactory,
93 d2d_mesh_Open,
96 void d2d_mesh_init(struct d2d_mesh *mesh)
98 mesh->ID2D1Mesh_iface.lpVtbl = &d2d_mesh_vtbl;
99 mesh->refcount = 1;