Commit 3d64da16 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d2d1/effect: Implement SetOutputNode().

parent 054c9d85
......@@ -742,6 +742,8 @@ struct d2d_transform_graph
struct d2d_transform_node_connection *inputs;
unsigned int input_count;
struct d2d_transform_node *output;
struct list nodes;
};
......
......@@ -290,6 +290,9 @@ static void d2d_transform_graph_delete_node(struct d2d_transform_graph *graph,
memset(&graph->inputs[i].node, 0, sizeof(graph->inputs[i].node));
}
if (graph->output == node)
graph->output = NULL;
free(node);
}
......@@ -396,11 +399,20 @@ static HRESULT STDMETHODCALLTYPE d2d_transform_graph_RemoveNode(ID2D1TransformGr
return S_OK;
}
static HRESULT STDMETHODCALLTYPE d2d_transform_graph_SetOutputNode(ID2D1TransformGraph *iface, ID2D1TransformNode *node)
static HRESULT STDMETHODCALLTYPE d2d_transform_graph_SetOutputNode(ID2D1TransformGraph *iface,
ID2D1TransformNode *object)
{
FIXME("iface %p, node %p stub!\n", iface, node);
struct d2d_transform_graph *graph = impl_from_ID2D1TransformGraph(iface);
struct d2d_transform_node *node;
return E_NOTIMPL;
TRACE("iface %p, object %p.\n", iface, object);
if (!(node = d2d_transform_graph_get_node(graph, object)))
return HRESULT_FROM_WIN32(ERROR_NOT_FOUND);
graph->output = node;
return S_OK;
}
static HRESULT STDMETHODCALLTYPE d2d_transform_graph_ConnectNode(ID2D1TransformGraph *iface,
......
......@@ -12729,6 +12729,8 @@ static void test_transform_graph(BOOL d3d11)
/* Add nodes */
hr = ID2D1TransformGraph_ConnectToEffectInput(graph, 1, (ID2D1TransformNode *)offset_transform, 0);
ok(hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND), "Got unexpected hr %#lx.\n", hr);
hr = ID2D1TransformGraph_SetOutputNode(graph, (ID2D1TransformNode *)offset_transform);
ok(hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND), "Got unexpected hr %#lx.\n", hr);
hr = ID2D1TransformGraph_AddNode(graph, (ID2D1TransformNode *)offset_transform);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID2D1TransformGraph_AddNode(graph, (ID2D1TransformNode *)offset_transform);
......@@ -12744,6 +12746,8 @@ static void test_transform_graph(BOOL d3d11)
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
hr = ID2D1TransformGraph_ConnectToEffectInput(graph, 0, (ID2D1TransformNode *)offset_transform, 0);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID2D1TransformGraph_SetOutputNode(graph, (ID2D1TransformNode *)offset_transform);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
/* Remove nodes */
hr = ID2D1TransformGraph_RemoveNode(graph, (ID2D1TransformNode *)offset_transform);
......
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