Commit 391fda75 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d2d1: Implement d2d_factory_CreateRectangleGeometry().

parent 35ec7abe
......@@ -198,16 +198,39 @@ enum d2d_geometry_state
D2D_GEOMETRY_STATE_FIGURE,
};
struct d2d_face
{
UINT16 v[3];
};
struct d2d_geometry
{
ID2D1Geometry ID2D1Geometry_iface;
ID2D1GeometrySink ID2D1GeometrySink_iface;
LONG refcount;
D2D1_POINT_2F *vertices;
size_t vertex_count;
struct d2d_face *faces;
size_t face_count;
union
{
struct
{
ID2D1GeometrySink ID2D1GeometrySink_iface;
enum d2d_geometry_state state;
UINT32 figure_count, segment_count;
} path;
struct
{
D2D1_RECT_F rect;
} rectangle;
} u;
};
void d2d_path_geometry_init(struct d2d_geometry *geometry) DECLSPEC_HIDDEN;
HRESULT d2d_rectangle_geometry_init(struct d2d_geometry *geometry, const D2D1_RECT_F *rect) DECLSPEC_HIDDEN;
#endif /* __WINE_D2D1_PRIVATE_H */
......@@ -94,9 +94,25 @@ static void STDMETHODCALLTYPE d2d_factory_GetDesktopDpi(ID2D1Factory *iface, flo
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateRectangleGeometry(ID2D1Factory *iface,
const D2D1_RECT_F *rect, ID2D1RectangleGeometry **geometry)
{
FIXME("iface %p, rect %p, geometry %p stub!\n", iface, rect, geometry);
struct d2d_geometry *object;
HRESULT hr;
return E_NOTIMPL;
TRACE("iface %p, rect %p, geometry %p.\n", iface, rect, geometry);
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
return E_OUTOFMEMORY;
if (FAILED(hr = d2d_rectangle_geometry_init(object, rect)))
{
WARN("Failed to initialize rectangle geometry, hr %#x.\n", hr);
HeapFree(GetProcessHeap(), 0, object);
return hr;
}
TRACE("Created rectangle geometry %p.\n", object);
*geometry = (ID2D1RectangleGeometry *)&object->ID2D1Geometry_iface;
return S_OK;
}
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateRoundedRectangleGeometry(ID2D1Factory *iface,
......
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