<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Henri,<br>
<br>
On 06/16/14 13:13, Henri Verbeet wrote:<br>
</div>
<blockquote
cite="mid:1402917204-12394-1-git-send-email-hverbeet@codeweavers.com"
type="cite">
<div class="moz-text-plain" wrap="true" graphical-quote="true"
style="font-family: -moz-fixed; font-size: 12px;"
lang="x-western">
<pre wrap="">
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h
index 5609db6..9e91728 100644
--- a/dlls/d2d1/d2d1_private.h
+++ b/dlls/d2d1/d2d1_private.h
@@ -33,4 +33,13 @@ struct d2d_d3d_render_target
void d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_target, ID2D1Factory *factory,
IDXGISurface *surface, const D2D1_RENDER_TARGET_PROPERTIES *desc) DECLSPEC_HIDDEN;
+struct d2d_brush
+{
+ ID2D1Brush ID2D1Brush_iface;</pre>
</div>
</blockquote>
<br>
Given how you use this object, this should be ID2D1SolidColorBrush.
I guess you want to somehow reuse this struct for other brush types,
but there should be better ways for this. Then:<br>
<br>
<pre wrap="">+void d2d_solid_color_brush_init(struct d2d_brush *brush, ID2D1RenderTarget *render_target,
+ const D2D1_COLOR_F *color, const D2D1_BRUSH_PROPERTIES *desc)
+{
+ FIXME("Ignoring brush properties.\n");
+
+ brush->ID2D1Brush_iface.lpVtbl = (ID2D1BrushVtbl *)&d2d_solid_color_brush_vtbl;
+ brush->refcount = 1;
+}
This cast should not be needed.
</pre>
<br>
<blockquote
cite="mid:1402917204-12394-1-git-send-email-hverbeet@codeweavers.com"
type="cite">
<div class="moz-text-plain" wrap="true" graphical-quote="true"
style="font-family: -moz-fixed; font-size: 12px;"
lang="x-western">
<pre wrap="">
+ LONG refcount;
+};
+
+void d2d_solid_color_brush_init(struct d2d_brush *brush, ID2D1RenderTarget *render_target,
+ const D2D1_COLOR_F *color, const D2D1_BRUSH_PROPERTIES *desc) DECLSPEC_HIDDEN;
+
#endif /* __WINE_D2D1_PRIVATE_H */
diff --git a/dlls/d2d1/render_target.c b/dlls/d2d1/render_target.c
index be9c1b6..e8c56a0 100644
--- a/dlls/d2d1/render_target.c
+++ b/dlls/d2d1/render_target.c
@@ -117,9 +117,19 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmapBrush(ID2D1Re
static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateSolidColorBrush(ID2D1RenderTarget *iface,
const D2D1_COLOR_F *color, const D2D1_BRUSH_PROPERTIES *desc, ID2D1SolidColorBrush **brush)
{
- FIXME("iface %p, color %p, desc %p, brush %p stub!\n", iface, color, desc, brush);
+ struct d2d_brush *object;
- return E_NOTIMPL;
+ TRACE("iface %p, color %p, desc %p, brush %p.\n", iface, color, desc, brush);
+
+ if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
+ return E_OUTOFMEMORY;
+
+ d2d_solid_color_brush_init(object, iface, color, desc);
+
+ TRACE("Created brush %p.\n", object);
+ *brush = (ID2D1SolidColorBrush *)&object->ID2D1Brush_iface;
</pre>
</div>
</blockquote>
<br>
Same here, the cast should not be needed. Also allocating memory in
brush.c seems more logical to me (although that's a matter of
taste).<br>
<br>
Cheers,<br>
Jacek<br>
</body>
</html>