Signed-off-by: James McDonnell <topgamer7(a)gmail.com>
---
dlls/d2d1/device.c | 22 ++++++------
dlls/d2d1/factory.c | 4 +--
dlls/d2d1/geometry.c | 80 +++++++++++++++++++++++++-------------------
include/d2d1_1.idl | 17 +++++++++-
4 files changed, 75 insertions(+), 48 deletions(-)
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c
index 13c99458cfa..f6a664c2e33 100644
--- a/dlls/d2d1/device.c
+++ b/dlls/d2d1/device.c
@@ -563,23 +563,23 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawLine(ID2D1DeviceContext *if
D2D1_POINT_2F p0, D2D1_POINT_2F p1, ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style)
{
struct d2d_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
- ID2D1PathGeometry *geometry;
+ ID2D1PathGeometry1 *geometry;
ID2D1GeometrySink *sink;
HRESULT hr;
TRACE("iface %p, p0 %s, p1 %s, brush %p, stroke_width %.8e, stroke_style %p.\n",
iface, debug_d2d_point_2f(&p0), debug_d2d_point_2f(&p1), brush, stroke_width, stroke_style);
- if (FAILED(hr = ID2D1Factory_CreatePathGeometry(render_target->factory, &geometry)))
+ if (FAILED(hr = ID2D1Factory1_CreatePathGeometry(render_target->factory, &geometry)))
{
WARN("Failed to create path geometry, hr %#lx.\n", hr);
return;
}
- if (FAILED(hr = ID2D1PathGeometry_Open(geometry, &sink)))
+ if (FAILED(hr = ID2D1PathGeometry1_Open(geometry, &sink)))
{
WARN("Failed to open geometry sink, hr %#lx.\n", hr);
- ID2D1PathGeometry_Release(geometry);
+ ID2D1PathGeometry1_Release(geometry);
return;
}
@@ -591,7 +591,7 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawLine(ID2D1DeviceContext *if
ID2D1GeometrySink_Release(sink);
ID2D1DeviceContext_DrawGeometry(iface, (ID2D1Geometry *)geometry, brush, stroke_width, stroke_style);
- ID2D1PathGeometry_Release(geometry);
+ ID2D1PathGeometry1_Release(geometry);
}
static void STDMETHODCALLTYPE d2d_device_context_DrawRectangle(ID2D1DeviceContext *iface,
@@ -1226,20 +1226,20 @@ static void d2d_device_context_draw_glyph_run_outline(struct d2d_device_context
{
D2D1_MATRIX_3X2_F *transform, prev_transform;
D2D1_ANTIALIAS_MODE prev_antialias_mode;
- ID2D1PathGeometry *geometry;
+ ID2D1PathGeometry1 *geometry;
ID2D1GeometrySink *sink;
HRESULT hr;
- if (FAILED(hr = ID2D1Factory_CreatePathGeometry(render_target->factory, &geometry)))
+ if (FAILED(hr = ID2D1Factory1_CreatePathGeometry(render_target->factory, &geometry)))
{
ERR("Failed to create geometry, hr %#lx.\n", hr);
return;
}
- if (FAILED(hr = ID2D1PathGeometry_Open(geometry, &sink)))
+ if (FAILED(hr = ID2D1PathGeometry1_Open(geometry, &sink)))
{
ERR("Failed to open geometry sink, hr %#lx.\n", hr);
- ID2D1PathGeometry_Release(geometry);
+ ID2D1PathGeometry1_Release(geometry);
return;
}
@@ -1249,7 +1249,7 @@ static void d2d_device_context_draw_glyph_run_outline(struct d2d_device_context
{
ERR("Failed to get glyph run outline, hr %#lx.\n", hr);
ID2D1GeometrySink_Release(sink);
- ID2D1PathGeometry_Release(geometry);
+ ID2D1PathGeometry1_Release(geometry);
return;
}
@@ -1267,7 +1267,7 @@ static void d2d_device_context_draw_glyph_run_outline(struct d2d_device_context
render_target->drawing_state.antialiasMode = prev_antialias_mode;
*transform = prev_transform;
- ID2D1PathGeometry_Release(geometry);
+ ID2D1PathGeometry1_Release(geometry);
}
static void d2d_device_context_draw_glyph_run_bitmap(struct d2d_device_context *render_target,
diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c
index f0f61674889..754975544e5 100644
--- a/dlls/d2d1/factory.c
+++ b/dlls/d2d1/factory.c
@@ -521,9 +521,9 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateStrokeStyle1(ID2D1Factory3 *i
static HRESULT STDMETHODCALLTYPE d2d_factory_CreatePathGeometry1(ID2D1Factory3 *iface, ID2D1PathGeometry1 **geometry)
{
- FIXME("iface %p, geometry %p stub!\n", iface, geometry);
+ TRACE("iface %p, geometry %p.\n", iface, geometry);
- return E_NOTIMPL;
+ return d2d_factory_CreatePathGeometry(iface, (ID2D1PathGeometry **)geometry);
}
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDrawingStateBlock1(ID2D1Factory3 *iface,
diff --git a/dlls/d2d1/geometry.c b/dlls/d2d1/geometry.c
index eb1bb353b4c..bc032399fad 100644
--- a/dlls/d2d1/geometry.c
+++ b/dlls/d2d1/geometry.c
@@ -3354,21 +3354,22 @@ static const struct ID2D1GeometrySinkVtbl d2d_geometry_sink_vtbl =
d2d_geometry_sink_AddArc,
};
-static inline struct d2d_geometry *impl_from_ID2D1PathGeometry(ID2D1PathGeometry *iface)
+static inline struct d2d_geometry *impl_from_ID2D1PathGeometry1(ID2D1PathGeometry1 *iface)
{
return CONTAINING_RECORD(iface, struct d2d_geometry, ID2D1Geometry_iface);
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_QueryInterface(ID2D1PathGeometry *iface, REFIID iid, void **out)
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_QueryInterface(ID2D1PathGeometry1 *iface, REFIID iid, void **out)
{
TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
if (IsEqualGUID(iid, &IID_ID2D1PathGeometry)
+ || IsEqualGUID(iid, &IID_ID2D1PathGeometry1)
|| IsEqualGUID(iid, &IID_ID2D1Geometry)
|| IsEqualGUID(iid, &IID_ID2D1Resource)
|| IsEqualGUID(iid, &IID_IUnknown))
{
- ID2D1PathGeometry_AddRef(iface);
+ ID2D1PathGeometry1_AddRef(iface);
*out = iface;
return S_OK;
}
@@ -3379,9 +3380,9 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_QueryInterface(ID2D1PathGeome
return E_NOINTERFACE;
}
-static ULONG STDMETHODCALLTYPE d2d_path_geometry_AddRef(ID2D1PathGeometry *iface)
+static ULONG STDMETHODCALLTYPE d2d_path_geometry_AddRef(ID2D1PathGeometry1 *iface)
{
- struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry(iface);
+ struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry1(iface);
ULONG refcount = InterlockedIncrement(&geometry->refcount);
TRACE("%p increasing refcount to %lu.\n", iface, refcount);
@@ -3389,9 +3390,9 @@ static ULONG STDMETHODCALLTYPE d2d_path_geometry_AddRef(ID2D1PathGeometry *iface
return refcount;
}
-static ULONG STDMETHODCALLTYPE d2d_path_geometry_Release(ID2D1PathGeometry *iface)
+static ULONG STDMETHODCALLTYPE d2d_path_geometry_Release(ID2D1PathGeometry1 *iface)
{
- struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry(iface);
+ struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry1(iface);
ULONG refcount = InterlockedDecrement(&geometry->refcount);
TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
@@ -3406,19 +3407,19 @@ static ULONG STDMETHODCALLTYPE d2d_path_geometry_Release(ID2D1PathGeometry *ifac
return refcount;
}
-static void STDMETHODCALLTYPE d2d_path_geometry_GetFactory(ID2D1PathGeometry *iface, ID2D1Factory **factory)
+static void STDMETHODCALLTYPE d2d_path_geometry_GetFactory(ID2D1PathGeometry1 *iface, ID2D1Factory **factory)
{
- struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry(iface);
+ struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry1(iface);
TRACE("iface %p, factory %p.\n", iface, factory);
ID2D1Factory_AddRef(*factory = geometry->factory);
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_GetBounds(ID2D1PathGeometry *iface,
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_GetBounds(ID2D1PathGeometry1 *iface,
const D2D1_MATRIX_3X2_F *transform, D2D1_RECT_F *bounds)
{
- struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry(iface);
+ struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry1(iface);
size_t i;
TRACE("iface %p, transform %p, bounds %p.\n", iface, transform, bounds);
@@ -3536,7 +3537,7 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_GetBounds(ID2D1PathGeometry *
return S_OK;
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_GetWidenedBounds(ID2D1PathGeometry *iface, float stroke_width,
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_GetWidenedBounds(ID2D1PathGeometry1 *iface, float stroke_width,
ID2D1StrokeStyle *stroke_style, const D2D1_MATRIX_3X2_F *transform, float tolerance, D2D1_RECT_F *bounds)
{
FIXME("iface %p, stroke_width %.8e, stroke_style %p, transform %p, tolerance %.8e, bounds %p stub!\n",
@@ -3545,11 +3546,11 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_GetWidenedBounds(ID2D1PathGeo
return E_NOTIMPL;
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_StrokeContainsPoint(ID2D1PathGeometry *iface,
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_StrokeContainsPoint(ID2D1PathGeometry1 *iface,
D2D1_POINT_2F point, float stroke_width, ID2D1StrokeStyle *stroke_style, const D2D1_MATRIX_3X2_F *transform,
float tolerance, BOOL *contains)
{
- struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry(iface);
+ struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry1(iface);
enum d2d_vertex_type type = D2D_VERTEX_TYPE_NONE;
unsigned int i, j, bezier_idx;
D2D1_BEZIER_SEGMENT b;
@@ -3630,10 +3631,10 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_StrokeContainsPoint(ID2D1Path
return S_OK;
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_FillContainsPoint(ID2D1PathGeometry *iface,
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_FillContainsPoint(ID2D1PathGeometry1 *iface,
D2D1_POINT_2F point, const D2D1_MATRIX_3X2_F *transform, float tolerance, BOOL *contains)
{
- struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry(iface);
+ struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry1(iface);
D2D1_MATRIX_3X2_F g_i;
TRACE("iface %p, point %s, transform %p, tolerance %.8e, contains %p.\n",
@@ -3653,7 +3654,7 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_FillContainsPoint(ID2D1PathGe
return S_OK;
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_CompareWithGeometry(ID2D1PathGeometry *iface,
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_CompareWithGeometry(ID2D1PathGeometry1 *iface,
ID2D1Geometry *geometry, const D2D1_MATRIX_3X2_F *transform, float tolerance, D2D1_GEOMETRY_RELATION *relation)
{
FIXME("iface %p, geometry %p, transform %p, tolerance %.8e, relation %p stub!\n",
@@ -3707,11 +3708,11 @@ static void d2d_geometry_flatten_cubic(ID2D1SimplifiedGeometrySink *sink, const
ID2D1SimplifiedGeometrySink_SetSegmentFlags(sink, D2D1_PATH_SEGMENT_NONE);
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Simplify(ID2D1PathGeometry *iface,
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Simplify(ID2D1PathGeometry1 *iface,
D2D1_GEOMETRY_SIMPLIFICATION_OPTION option, const D2D1_MATRIX_3X2_F *transform, float tolerance,
ID2D1SimplifiedGeometrySink *sink)
{
- struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry(iface);
+ struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry1(iface);
enum d2d_vertex_type type = D2D_VERTEX_TYPE_NONE;
unsigned int i, j, bezier_idx;
D2D1_FIGURE_BEGIN begin;
@@ -3795,7 +3796,7 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Simplify(ID2D1PathGeometry *i
return S_OK;
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Tessellate(ID2D1PathGeometry *iface,
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Tessellate(ID2D1PathGeometry1 *iface,
const D2D1_MATRIX_3X2_F *transform, float tolerance, ID2D1TessellationSink *sink)
{
FIXME("iface %p, transform %p, tolerance %.8e, sink %p stub!\n", iface, transform, tolerance, sink);
@@ -3803,7 +3804,7 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Tessellate(ID2D1PathGeometry
return E_NOTIMPL;
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_CombineWithGeometry(ID2D1PathGeometry *iface,
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_CombineWithGeometry(ID2D1PathGeometry1 *iface,
ID2D1Geometry *geometry, D2D1_COMBINE_MODE combine_mode, const D2D1_MATRIX_3X2_F *transform,
float tolerance, ID2D1SimplifiedGeometrySink *sink)
{
@@ -3813,7 +3814,7 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_CombineWithGeometry(ID2D1Path
return E_NOTIMPL;
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Outline(ID2D1PathGeometry *iface,
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Outline(ID2D1PathGeometry1 *iface,
const D2D1_MATRIX_3X2_F *transform, float tolerance, ID2D1SimplifiedGeometrySink *sink)
{
FIXME("iface %p, transform %p, tolerance %.8e, sink %p stub!\n", iface, transform, tolerance, sink);
@@ -3821,7 +3822,7 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Outline(ID2D1PathGeometry *if
return E_NOTIMPL;
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_ComputeArea(ID2D1PathGeometry *iface,
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_ComputeArea(ID2D1PathGeometry1 *iface,
const D2D1_MATRIX_3X2_F *transform, float tolerance, float *area)
{
FIXME("iface %p, transform %p, tolerance %.8e, area %p stub!\n", iface, transform, tolerance, area);
@@ -3829,7 +3830,7 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_ComputeArea(ID2D1PathGeometry
return E_NOTIMPL;
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_ComputeLength(ID2D1PathGeometry *iface,
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_ComputeLength(ID2D1PathGeometry1 *iface,
const D2D1_MATRIX_3X2_F *transform, float tolerance, float *length)
{
FIXME("iface %p, transform %p, tolerance %.8e, length %p stub!\n", iface, transform, tolerance, length);
@@ -3837,7 +3838,7 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_ComputeLength(ID2D1PathGeomet
return E_NOTIMPL;
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_ComputePointAtLength(ID2D1PathGeometry *iface, float length,
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_ComputePointAtLength(ID2D1PathGeometry1 *iface, float length,
const D2D1_MATRIX_3X2_F *transform, float tolerance, D2D1_POINT_2F *point, D2D1_POINT_2F *tangent)
{
FIXME("iface %p, length %.8e, transform %p, tolerance %.8e, point %p, tangent %p stub!\n",
@@ -3846,7 +3847,7 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_ComputePointAtLength(ID2D1Pat
return E_NOTIMPL;
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Widen(ID2D1PathGeometry *iface, float stroke_width,
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Widen(ID2D1PathGeometry1 *iface, float stroke_width,
ID2D1StrokeStyle *stroke_style, const D2D1_MATRIX_3X2_F *transform, float tolerance,
ID2D1SimplifiedGeometrySink *sink)
{
@@ -3856,9 +3857,9 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Widen(ID2D1PathGeometry *ifac
return E_NOTIMPL;
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Open(ID2D1PathGeometry *iface, ID2D1GeometrySink **sink)
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Open(ID2D1PathGeometry1 *iface, ID2D1GeometrySink **sink)
{
- struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry(iface);
+ struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry1(iface);
TRACE("iface %p, sink %p.\n", iface, sink);
@@ -3873,16 +3874,16 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Open(ID2D1PathGeometry *iface
return S_OK;
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Stream(ID2D1PathGeometry *iface, ID2D1GeometrySink *sink)
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Stream(ID2D1PathGeometry1 *iface, ID2D1GeometrySink *sink)
{
FIXME("iface %p, sink %p stub!\n", iface, sink);
return E_NOTIMPL;
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_GetSegmentCount(ID2D1PathGeometry *iface, UINT32 *count)
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_GetSegmentCount(ID2D1PathGeometry1 *iface, UINT32 *count)
{
- struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry(iface);
+ struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry1(iface);
TRACE("iface %p, count %p.\n", iface, count);
@@ -3894,9 +3895,9 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_GetSegmentCount(ID2D1PathGeom
return S_OK;
}
-static HRESULT STDMETHODCALLTYPE d2d_path_geometry_GetFigureCount(ID2D1PathGeometry *iface, UINT32 *count)
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry_GetFigureCount(ID2D1PathGeometry1 *iface, UINT32 *count)
{
- struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry(iface);
+ struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry1(iface);
TRACE("iface %p, count %p.\n", iface, count);
@@ -3908,7 +3909,17 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_GetFigureCount(ID2D1PathGeome
return S_OK;
}
-static const struct ID2D1PathGeometryVtbl d2d_path_geometry_vtbl =
+static HRESULT STDMETHODCALLTYPE d2d_path_geometry1_ComputePointAndSegmentAtLength(ID2D1PathGeometry1 *iface,
+ float length, UINT32 startSegment, const D2D1_MATRIX_3X2_F *transform, float tolerance,
+ D2D1_POINT_DESCRIPTION *pointDescription)
+{
+ FIXME("iface %p, length %.8e, startSegment %u, transform %p, tolerance %.8e, pointDescription %p",
+ iface, length, startSegment, transform, tolerance, pointDescription);
+
+ return E_NOTIMPL;
+}
+
+static const struct ID2D1PathGeometry1Vtbl d2d_path_geometry_vtbl =
{
d2d_path_geometry_QueryInterface,
d2d_path_geometry_AddRef,
@@ -3931,6 +3942,7 @@ static const struct ID2D1PathGeometryVtbl d2d_path_geometry_vtbl =
d2d_path_geometry_Stream,
d2d_path_geometry_GetSegmentCount,
d2d_path_geometry_GetFigureCount,
+ d2d_path_geometry1_ComputePointAndSegmentAtLength,
};
void d2d_path_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *factory)
diff --git a/include/d2d1_1.idl b/include/d2d1_1.idl
index fdec8ae5f9c..f86ac8748a4 100644
--- a/include/d2d1_1.idl
+++ b/include/d2d1_1.idl
@@ -20,7 +20,6 @@ import "d2d1.idl";
import "d2d1effects.idl";
interface ID2D1DeviceContext;
-interface ID2D1PathGeometry1;
interface ID2D1Properties;
interface IPrintDocumentPackageTarget;
interface ID2D1PrintControl;
@@ -349,6 +348,22 @@ interface ID2D1GdiMetafile : ID2D1Resource
);
}
+[
+ object,
+ uuid(62baa2d2-ab54-41b7-b872-787e0106a421),
+ local,
+]
+interface ID2D1PathGeometry1 : ID2D1PathGeometry
+{
+ HRESULT ComputePointAndSegmentAtLength(
+ [in] float length,
+ [in] UINT32 startSegment,
+ [in, optional] const D2D1_MATRIX_3X2_F *worldTransform,
+ [in] float flatteningTolerance,
+ [out] D2D1_POINT_DESCRIPTION *pointDescription
+ );
+};
+
[
object,
uuid(483473d7-cd46-4f9d-9d3a-3112aa80159d),
--
2.35.1