From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d2d1/d2d1_private.h | 3 +++ dlls/d2d1/effect.c | 17 +++++++++++++++-- dlls/d2d1/tests/d2d1.c | 7 +++++++ 3 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h index bd6ca55ea96..c3c5c6404ab 100644 --- a/dlls/d2d1/d2d1_private.h +++ b/dlls/d2d1/d2d1_private.h @@ -771,6 +771,9 @@ struct d2d_transform_graph
struct d2d_transform_node *output;
+ bool passthrough; + unsigned int passthrough_input; + struct list nodes; };
diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c index 25a75a31ecb..f32eba886bf 100644 --- a/dlls/d2d1/effect.c +++ b/dlls/d2d1/effect.c @@ -659,6 +659,7 @@ static void d2d_transform_graph_clear(struct d2d_transform_graph *graph) { d2d_transform_graph_delete_node(graph, node); } + graph->passthrough = false; }
static inline struct d2d_transform_graph *impl_from_ID2D1TransformGraph(ID2D1TransformGraph *iface) @@ -788,6 +789,7 @@ static HRESULT STDMETHODCALLTYPE d2d_transform_graph_SetOutputNode(ID2D1Transfor return HRESULT_FROM_WIN32(ERROR_NOT_FOUND);
graph->output = node; + graph->passthrough = false;
return S_OK; } @@ -821,6 +823,7 @@ static HRESULT STDMETHODCALLTYPE d2d_transform_graph_ConnectToEffectInput(ID2D1T
graph->inputs[input_index].node = node; graph->inputs[input_index].index = node_index; + graph->passthrough = false;
return S_OK; } @@ -836,9 +839,19 @@ static void STDMETHODCALLTYPE d2d_transform_graph_Clear(ID2D1TransformGraph *ifa
static HRESULT STDMETHODCALLTYPE d2d_transform_graph_SetPassthroughGraph(ID2D1TransformGraph *iface, UINT32 index) { - FIXME("iface %p, index %u stub!\n", iface, index); + struct d2d_transform_graph *graph = impl_from_ID2D1TransformGraph(iface);
- return E_NOTIMPL; + TRACE("iface %p, index %u.\n", iface, index); + + if (index >= graph->input_count) + return E_INVALIDARG; + + d2d_transform_graph_clear(graph); + + graph->passthrough = true; + graph->passthrough_input = index; + + return S_OK; }
static const ID2D1TransformGraphVtbl d2d_transform_graph_vtbl = diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 2ec11c342ad..cfe44936864 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -12914,6 +12914,13 @@ static void test_transform_graph(BOOL d3d11) todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
+ /* Passthrough graph. */ + hr = ID2D1TransformGraph_SetPassthroughGraph(graph, 100); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); + + hr = ID2D1TransformGraph_SetPassthroughGraph(graph, 0); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ID2D1BlendTransform_Release(blend_transform); ID2D1OffsetTransform_Release(offset_transform); ID2D1Effect_Release(effect);