ReactOS 0.4.17-dev-923-g4c9a150
effect.c
Go to the documentation of this file.
1/*
2 * Copyright 2018 Nikolay Sivov for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#include "d2d1_private.h"
20
22
24{
26}
27
29{
31}
32
34{
36}
37
40{
42}
43
45{
47}
48
50 REFIID iid, void **out)
51{
52 TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
53
54 if (IsEqualGUID(iid, &IID_ID2D1VertexBuffer)
55 || IsEqualGUID(iid, &IID_IUnknown))
56 {
57 *out = iface;
58 ID2D1VertexBuffer_AddRef(iface);
59 return S_OK;
60 }
61
62 WARN("Unsupported interface %s.\n", debugstr_guid(iid));
63 *out = NULL;
64 return E_NOINTERFACE;
65}
66
68{
71
72 TRACE("%p increasing refcount to %lu.\n", iface, refcount);
73
74 return refcount;
75}
76
78{
81
82 TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
83
84 if (!refcount)
85 free(buffer);
86
87 return refcount;
88}
89
91{
92 FIXME("iface %p, data %p, size %u.\n", iface, data, size);
93
94 return E_NOTIMPL;
95}
96
98{
99 FIXME("iface %p.\n", iface);
100
101 return E_NOTIMPL;
102}
103
104static const ID2D1VertexBufferVtbl d2d_vertex_buffer_vtbl =
105{
111};
112
114{
116
117 if (!(object = calloc(1, sizeof(*object))))
118 return E_OUTOFMEMORY;
119
120 object->ID2D1VertexBuffer_iface.lpVtbl = &d2d_vertex_buffer_vtbl;
121 object->refcount = 1;
122
123 *buffer = &object->ID2D1VertexBuffer_iface;
124
125 return S_OK;
126}
127
129 REFIID iid, void **out)
130{
131 TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
132
133 if (IsEqualGUID(iid, &IID_ID2D1OffsetTransform)
134 || IsEqualGUID(iid, &IID_ID2D1TransformNode)
135 || IsEqualGUID(iid, &IID_IUnknown))
136 {
137 *out = iface;
138 ID2D1OffsetTransform_AddRef(iface);
139 return S_OK;
140 }
141
142 WARN("Unsupported interface %s.\n", debugstr_guid(iid));
143 *out = NULL;
144 return E_NOINTERFACE;
145}
146
148{
151
152 TRACE("%p increasing refcount to %lu.\n", iface, refcount);
153
154 return refcount;
155}
156
158{
161
162 TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
163
164 if (!refcount)
166
167 return refcount;
168}
169
171{
172 TRACE("iface %p.\n", iface);
173
174 return 1;
175}
176
179{
181
182 TRACE("iface %p, offset %s.\n", iface, debug_d2d_point_2l(&offset));
183
184 transform->offset = offset;
185}
186
189{
191
192 TRACE("iface %p.\n", iface);
193
194 *offset = transform->offset;
195 return offset;
196}
197
198static const ID2D1OffsetTransformVtbl d2d_offset_transform_vtbl =
199{
206};
207
209{
210 struct d2d_transform *object;
211
212 if (!(object = calloc(1, sizeof(*object))))
213 return E_OUTOFMEMORY;
214
215 object->ID2D1TransformNode_iface.lpVtbl = (ID2D1TransformNodeVtbl *)&d2d_offset_transform_vtbl;
216 object->refcount = 1;
217 object->offset = offset;
218
219 *transform = (ID2D1OffsetTransform *)&object->ID2D1TransformNode_iface;
220
221 return S_OK;
222}
223
225 REFIID iid, void **out)
226{
227 TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
228
229 if (IsEqualGUID(iid, &IID_ID2D1BlendTransform)
230 || IsEqualGUID(iid, &IID_ID2D1ConcreteTransform)
231 || IsEqualGUID(iid, &IID_ID2D1TransformNode)
232 || IsEqualGUID(iid, &IID_IUnknown))
233 {
234 *out = iface;
235 ID2D1BlendTransform_AddRef(iface);
236 return S_OK;
237 }
238
239 WARN("Unsupported interface %s.\n", debugstr_guid(iid));
240 *out = NULL;
241 return E_NOINTERFACE;
242}
243
245{
248
249 TRACE("%p increasing refcount to %lu.\n", iface, refcount);
250
251 return refcount;
252}
253
255{
258
259 TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
260
261 if (!refcount)
263
264 return refcount;
265}
266
268{
270
271 TRACE("iface %p.\n", iface);
272
273 return transform->input_count;
274}
275
278{
279 FIXME("iface %p, precision %u, depth %u stub.\n", iface, precision, depth);
280
281 return E_NOTIMPL;
282}
283
285 BOOL is_cached)
286{
287 FIXME("iface %p, is_cached %d stub.\n", iface, is_cached);
288}
289
292{
294
295 TRACE("iface %p, description %p.\n", iface, description);
296
297 transform->blend_desc = *description;
298}
299
302{
304
305 TRACE("iface %p, description %p.\n", iface, description);
306
307 *description = transform->blend_desc;
308}
309
310static const ID2D1BlendTransformVtbl d2d_blend_transform_vtbl =
311{
320};
321
324{
325 struct d2d_transform *object;
326
327 *transform = NULL;
328
329 if (!input_count)
330 return E_INVALIDARG;
331
332 if (!(object = calloc(1, sizeof(*object))))
333 return E_OUTOFMEMORY;
334
335 object->ID2D1TransformNode_iface.lpVtbl = (ID2D1TransformNodeVtbl *)&d2d_blend_transform_vtbl;
336 object->refcount = 1;
337 object->input_count = input_count;
338 object->blend_desc = *blend_desc;
339
340 *transform = (ID2D1BlendTransform *)&object->ID2D1TransformNode_iface;
341
342 return S_OK;
343}
344
346 REFIID iid, void **out)
347{
348 TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
349
350 if (IsEqualGUID(iid, &IID_ID2D1BorderTransform)
351 || IsEqualGUID(iid, &IID_ID2D1ConcreteTransform)
352 || IsEqualGUID(iid, &IID_ID2D1TransformNode)
353 || IsEqualGUID(iid, &IID_IUnknown))
354 {
355 *out = iface;
356 ID2D1BorderTransform_AddRef(iface);
357 return S_OK;
358 }
359
360 WARN("Unsupported interface %s.\n", debugstr_guid(iid));
361 *out = NULL;
362 return E_NOINTERFACE;
363}
364
366{
369
370 TRACE("%p increasing refcount to %lu.\n", iface, refcount);
371
372 return refcount;
373}
374
376{
379
380 TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
381
382 if (!refcount)
384
385 return refcount;
386}
387
389{
390 TRACE("iface %p.\n", iface);
391
392 return 1;
393}
394
397{
398 FIXME("iface %p, precision %u, depth %u stub.\n", iface, precision, depth);
399
400 return E_NOTIMPL;
401}
402
404 ID2D1BorderTransform *iface, BOOL is_cached)
405{
406 FIXME("iface %p, is_cached %d stub.\n", iface, is_cached);
407}
408
411{
413
414 TRACE("iface %p.\n", iface);
415
416 switch (mode)
417 {
421 transform->border.mode_x = mode;
422 break;
423 default:
424 ;
425 }
426}
427
430{
432
433 TRACE("iface %p.\n", iface);
434
435 switch (mode)
436 {
440 transform->border.mode_y = mode;
441 break;
442 default:
443 ;
444 }
445}
446
449{
451
452 TRACE("iface %p.\n", iface);
453
454 return transform->border.mode_x;
455}
456
459{
461
462 TRACE("iface %p.\n", iface);
463
464 return transform->border.mode_y;
465}
466
467static const ID2D1BorderTransformVtbl d2d_border_transform_vtbl =
468{
479};
480
483{
484 struct d2d_transform *object;
485
486 *transform = NULL;
487
488 if (!(object = calloc(1, sizeof(*object))))
489 return E_OUTOFMEMORY;
490
491 object->ID2D1TransformNode_iface.lpVtbl = (ID2D1TransformNodeVtbl *)&d2d_border_transform_vtbl;
492 object->refcount = 1;
493 object->border.mode_x = mode_x;
494 object->border.mode_y = mode_y;
495
496 *transform = (ID2D1BorderTransform *)&object->ID2D1TransformNode_iface;
497
498 return S_OK;
499}
500
502 ID2D1BoundsAdjustmentTransform *iface, REFIID iid, void **out)
503{
504 TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
505
506 if (IsEqualGUID(iid, &IID_ID2D1BoundsAdjustmentTransform)
507 || IsEqualGUID(iid, &IID_ID2D1TransformNode)
508 || IsEqualGUID(iid, &IID_IUnknown))
509 {
510 *out = iface;
511 ID2D1BoundsAdjustmentTransform_AddRef(iface);
512 return S_OK;
513 }
514
515 WARN("Unsupported interface %s.\n", debugstr_guid(iid));
516 *out = NULL;
517 return E_NOINTERFACE;
518}
519
522{
525
526 TRACE("%p increasing refcount to %lu.\n", iface, refcount);
527
528 return refcount;
529}
530
533{
536
537 TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
538
539 if (!refcount)
541
542 return refcount;
543}
544
547{
548 TRACE("iface %p.\n", iface);
549
550 return 1;
551}
552
555{
557
558 TRACE("iface %p.\n", iface);
559
560 transform->bounds = *bounds;
561}
562
565{
567
568 TRACE("iface %p.\n", iface);
569
570 *bounds = transform->bounds;
571}
572
573static const ID2D1BoundsAdjustmentTransformVtbl d2d_bounds_adjustment_transform_vtbl =
574{
581};
582
585{
586 struct d2d_transform *object;
587
588 *transform = NULL;
589
590 if (!(object = calloc(1, sizeof(*object))))
591 return E_OUTOFMEMORY;
592
593 object->ID2D1TransformNode_iface.lpVtbl = (ID2D1TransformNodeVtbl *)&d2d_bounds_adjustment_transform_vtbl;
594 object->refcount = 1;
595 object->bounds = *rect;
596
597 *transform = (ID2D1BoundsAdjustmentTransform *)&object->ID2D1TransformNode_iface;
598
599 return S_OK;
600}
601
603 ID2D1TransformNode *object)
604{
605 struct d2d_transform_node *node;
606
608 {
609 if (node->object == object)
610 return node;
611 }
612
613 return NULL;
614}
615
617 ID2D1TransformNode *object)
618{
619 struct d2d_transform_node *node;
620
621 if (!(node = calloc(1, sizeof(*node))))
622 return E_OUTOFMEMORY;
623 node->input_count = ID2D1TransformNode_GetInputCount(object);
624 if (!(node->inputs = calloc(node->input_count, sizeof(*node->inputs))))
625 {
626 free(node);
627 return E_OUTOFMEMORY;
628 }
629
630 node->object = object;
631 ID2D1TransformNode_AddRef(node->object);
632 list_add_tail(&graph->nodes, &node->entry);
633
634 return S_OK;
635}
636
638{
639 struct d2d_transform_node *output = node->output;
640 unsigned int i;
641
642 if (!output)
643 return;
644
645 for (i = 0; i < output->input_count; ++i)
646 {
647 if (output->inputs[i] == node)
648 {
649 output->inputs[i] = NULL;
650 break;
651 }
652 }
653}
654
656 struct d2d_transform_node *node)
657{
658 unsigned int i;
659
660 list_remove(&node->entry);
661 ID2D1TransformNode_Release(node->object);
662
663 for (i = 0; i < graph->input_count; ++i)
664 {
665 if (graph->inputs[i].node == node)
666 memset(&graph->inputs[i].node, 0, sizeof(graph->inputs[i].node));
667 }
668
669 if (graph->output == node)
670 graph->output = NULL;
671
672 if (node->render_info)
673 ID2D1DrawInfo_Release(&node->render_info->ID2D1DrawInfo_iface);
674
676
677 free(node->inputs);
678 free(node);
679}
680
682{
683 struct d2d_transform_node *node, *node_next;
684
685 LIST_FOR_EACH_ENTRY_SAFE(node, node_next, &graph->nodes, struct d2d_transform_node, entry)
686 {
688 }
689 graph->passthrough = false;
690}
691
693{
695}
696
698{
699 TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
700
701 if (IsEqualGUID(iid, &IID_ID2D1TransformGraph)
702 || IsEqualGUID(iid, &IID_IUnknown))
703 {
704 ID2D1TransformGraph_AddRef(iface);
705 *out = iface;
706 return S_OK;
707 }
708
709 *out = NULL;
710 return E_NOINTERFACE;
711}
712
714{
717
718 TRACE("%p increasing refcount to %lu.\n", iface, refcount);
719
720 return refcount;
721}
722
724{
727
728 TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
729
730 if (!refcount)
731 {
733 free(graph->inputs);
734 free(graph);
735 }
736
737 return refcount;
738}
739
741{
743
744 TRACE("iface %p.\n", iface);
745
746 return graph->input_count;
747}
748
750 ID2D1TransformNode *object)
751{
753 struct d2d_transform_node *node;
754 unsigned int i, input_count;
755 HRESULT hr;
756
757 TRACE("iface %p, object %p.\n", iface, object);
758
761 return hr;
762
764 graph->output = node;
765
766 input_count = ID2D1TransformNode_GetInputCount(object);
767 if (graph->input_count != input_count)
768 return E_INVALIDARG;
769
770 for (i = 0; i < graph->input_count; ++i)
771 {
772 graph->inputs[i].node = node;
773 graph->inputs[i].index = i;
774 }
775
776 return S_OK;
777}
778
780 ID2D1TransformNode *object)
781{
783
784 TRACE("iface %p, object %p.\n", iface, object);
785
787 return E_INVALIDARG;
788
789 return d2d_transform_graph_add_node(graph, object);
790}
791
793 ID2D1TransformNode *object)
794{
796 struct d2d_transform_node *node;
797
798 TRACE("iface %p, object %p.\n", iface, object);
799
800 if (!(node = d2d_transform_graph_get_node(graph, object)))
802
804 return S_OK;
805}
806
808 ID2D1TransformNode *object)
809{
811 struct d2d_transform_node *node;
812
813 TRACE("iface %p, object %p.\n", iface, object);
814
815 if (!(node = d2d_transform_graph_get_node(graph, object)))
817
818 graph->output = node;
819 graph->passthrough = false;
820
821 return S_OK;
822}
823
826{
828 struct d2d_transform_node *from, *to;
829
830 TRACE("iface %p, from_node %p, to_node %p, index %u.\n", iface, from_node, to_node, index);
831
832 if (!(from = d2d_transform_graph_get_node(graph, from_node)))
834
835 if (!(to = d2d_transform_graph_get_node(graph, to_node)))
837
838 if (index >= to->input_count)
839 return E_INVALIDARG;
840
842 to->inputs[index] = from;
843 from->output = to;
844
845 return S_OK;
846}
847
849 UINT32 input_index, ID2D1TransformNode *object, UINT32 node_index)
850{
852 struct d2d_transform_node *node;
853 unsigned int count;
854
855 TRACE("iface %p, input_index %u, object %p, node_index %u.\n", iface, input_index, object, node_index);
856
857 if (!(node = d2d_transform_graph_get_node(graph, object)))
859
860 if (input_index >= graph->input_count)
861 return E_INVALIDARG;
862
863 count = ID2D1TransformNode_GetInputCount(object);
864 if (node_index >= count)
865 return E_INVALIDARG;
866
867 graph->inputs[input_index].node = node;
868 graph->inputs[input_index].index = node_index;
869 graph->passthrough = false;
870
871 return S_OK;
872}
873
875{
877
878 TRACE("iface %p.\n", iface);
879
881}
882
884{
886
887 TRACE("iface %p, index %u.\n", iface, index);
888
889 if (index >= graph->input_count)
890 return E_INVALIDARG;
891
893
894 graph->passthrough = true;
895 graph->passthrough_input = index;
896
897 return S_OK;
898}
899
900static const ID2D1TransformGraphVtbl d2d_transform_graph_vtbl =
901{
914};
915
917{
919
920 if (!(object = calloc(1, sizeof(*object))))
921 return E_OUTOFMEMORY;
922
923 object->ID2D1TransformGraph_iface.lpVtbl = &d2d_transform_graph_vtbl;
924 object->refcount = 1;
925 list_init(&object->nodes);
926
927 if (!(object->inputs = calloc(input_count, sizeof(*object->inputs))))
928 {
929 free(object);
930 return E_OUTOFMEMORY;
931 }
932 object->input_count = input_count;
933
934 *graph = object;
935
936 return S_OK;
937}
938
940{
941 TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
942
943 if (IsEqualGUID(iid, &IID_ID2D1EffectImpl)
944 || IsEqualGUID(iid, &IID_IUnknown))
945 {
946 ID2D1EffectImpl_AddRef(iface);
947 *out = iface;
948 return S_OK;
949 }
950
951 *out = NULL;
952 return E_NOINTERFACE;
953}
954
956{
957 return 2;
958}
959
961{
962 return 1;
963}
964
967{
968 return S_OK;
969}
970
972{
973 return S_OK;
974}
975
977{
978 return S_OK;
979}
980
981static const ID2D1EffectImplVtbl d2d_effect_impl_vtbl =
982{
989};
990
992{
993 static ID2D1EffectImpl builtin_stub = { &d2d_effect_impl_vtbl };
994
995 *effect_impl = (IUnknown *)&builtin_stub;
996
997 return S_OK;
998}
999
1001L"<?xml version='1.0'?> \
1002 <Effect> \
1003 <Property name='DisplayName' type='string' value='2D Affine Transform'/> \
1004 <Property name='Author' type='string' value='The Wine Project'/> \
1005 <Property name='Category' type='string' value='Stub'/> \
1006 <Property name='Description' type='string' value='2D Affine Transform'/> \
1007 <Inputs> \
1008 <Input name='Source'/> \
1009 </Inputs> \
1010 </Effect>";
1011
1013L"<?xml version='1.0'?> \
1014 <Effect> \
1015 <Property name='DisplayName' type='string' value='3D Perspective Transform'/> \
1016 <Property name='Author' type='string' value='The Wine Project'/> \
1017 <Property name='Category' type='string' value='Stub'/> \
1018 <Property name='Description' type='string' value='3D Perspective Transform'/> \
1019 <Inputs> \
1020 <Input name='Source'/> \
1021 </Inputs> \
1022 </Effect>";
1023
1025L"<?xml version='1.0'?> \
1026 <Effect> \
1027 <Property name='DisplayName' type='string' value='Composite'/> \
1028 <Property name='Author' type='string' value='The Wine Project'/> \
1029 <Property name='Category' type='string' value='Stub'/> \
1030 <Property name='Description' type='string' value='Composite'/> \
1031 <Inputs minimum='1' maximum='0xffffffff' > \
1032 <Input name='Source1'/> \
1033 <Input name='Source2'/> \
1034 </Inputs> \
1035 </Effect>";
1036
1037static const WCHAR crop_description[] =
1038L"<?xml version='1.0'?> \
1039 <Effect> \
1040 <Property name='DisplayName' type='string' value='Crop'/> \
1041 <Property name='Author' type='string' value='The Wine Project'/> \
1042 <Property name='Category' type='string' value='Stub'/> \
1043 <Property name='Description' type='string' value='Crop'/> \
1044 <Inputs > \
1045 <Input name='Source'/> \
1046 </Inputs> \
1047 <Property name='Rect' type='vector4' /> \
1048 </Effect>";
1049
1051L"<?xml version='1.0'?> \
1052 <Effect> \
1053 <Property name='DisplayName' type='string' value='Shadow'/> \
1054 <Property name='Author' type='string' value='The Wine Project'/> \
1055 <Property name='Category' type='string' value='Stub'/> \
1056 <Property name='Description' type='string' value='Shadow'/> \
1057 <Inputs > \
1058 <Input name='Source'/> \
1059 </Inputs> \
1060 </Effect>";
1061
1063L"<?xml version='1.0'?> \
1064 <Effect> \
1065 <Property name='DisplayName' type='string' value='Grayscale'/> \
1066 <Property name='Author' type='string' value='The Wine Project'/> \
1067 <Property name='Category' type='string' value='Stub'/> \
1068 <Property name='Description' type='string' value='Grayscale'/> \
1069 <Inputs > \
1070 <Input name='Source'/> \
1071 </Inputs> \
1072 </Effect>";
1073
1075{
1076 static const struct builtin_description
1077 {
1078 const CLSID *clsid;
1079 const WCHAR *description;
1080 }
1081 builtin_effects[] =
1082 {
1083 { &CLSID_D2D12DAffineTransform, _2d_affine_transform_description },
1084 { &CLSID_D2D13DPerspectiveTransform, _3d_perspective_transform_description},
1085 { &CLSID_D2D1Composite, composite_description },
1086 { &CLSID_D2D1Crop, crop_description },
1087 { &CLSID_D2D1Shadow, shadow_description },
1088 { &CLSID_D2D1Grayscale, grayscale_description },
1089 };
1090 unsigned int i;
1091 HRESULT hr;
1092
1093 for (i = 0; i < ARRAY_SIZE(builtin_effects); ++i)
1094 {
1095 if (FAILED(hr = d2d_factory_register_builtin_effect(factory, builtin_effects[i].clsid, builtin_effects[i].description,
1097 {
1098 WARN("Failed to register the effect %s, hr %#lx.\n", wine_dbgstr_guid(builtin_effects[i].clsid), hr);
1099 }
1100 }
1101}
1102
1103/* Same syntax is used for value and default values. */
1105 float *vec)
1106{
1107 unsigned int i, num_components;
1108 WCHAR *end_ptr;
1109
1110 /* Type values are sequential. */
1111 switch (type)
1112 {
1116 num_components = (type - D2D1_PROPERTY_TYPE_VECTOR2) + 2;
1117 break;
1119 num_components = 6;
1120 break;
1124 num_components = (type - D2D1_PROPERTY_TYPE_MATRIX_4X3) * 4 + 12;
1125 break;
1126 default:
1127 return E_UNEXPECTED;
1128 }
1129
1130 if (*(value++) != '(') return E_INVALIDARG;
1131
1132 for (i = 0; i < num_components; ++i)
1133 {
1134 vec[i] = wcstof(value, &end_ptr);
1135 if (value == end_ptr) return E_INVALIDARG;
1136 value = end_ptr;
1137
1138 /* Trailing characters after last component are ignored. */
1139 if (i == num_components - 1) continue;
1140 if (*(value++) != ',') return E_INVALIDARG;
1141 }
1142
1143 return S_OK;
1144}
1145
1147 const WCHAR *name, UINT32 index, BOOL subprop, D2D1_PROPERTY_TYPE type, const WCHAR *value)
1148{
1149 static const UINT32 sizes[] =
1150 {
1153 [D2D1_PROPERTY_TYPE_BOOL] = sizeof(BOOL),
1155 [D2D1_PROPERTY_TYPE_INT32] = sizeof(INT32),
1156 [D2D1_PROPERTY_TYPE_FLOAT] = sizeof(float),
1162 [D2D1_PROPERTY_TYPE_ENUM] = sizeof(UINT32),
1163 [D2D1_PROPERTY_TYPE_ARRAY] = sizeof(UINT32),
1164 [D2D1_PROPERTY_TYPE_CLSID] = sizeof(CLSID),
1170 };
1171 struct d2d_effect_property *p;
1172 HRESULT hr;
1173
1175
1176 if (!d2d_array_reserve((void **)&props->properties, &props->size, props->count + 1,
1177 sizeof(*props->properties)))
1178 {
1179 return E_OUTOFMEMORY;
1180 }
1181
1182 /* TODO: we could save some space for properties that have both getter and setter. */
1183 if (!d2d_array_reserve((void **)&props->data.ptr, &props->data.size,
1184 props->data.count + sizes[type], sizeof(*props->data.ptr)))
1185 {
1186 return E_OUTOFMEMORY;
1187 }
1188 props->data.count += sizes[type];
1189
1190 p = &props->properties[props->count++];
1191 memset(p, 0, sizeof(*p));
1192 p->index = index;
1193 if (p->index < 0x80000000)
1194 {
1195 props->custom_count++;
1196 /* FIXME: this should probably be controlled by subproperty */
1197 p->readonly = FALSE;
1198 }
1199 else if (subprop)
1200 p->readonly = TRUE;
1201 else
1203 p->name = wcsdup(name);
1204 p->type = type;
1205 if (p->type == D2D1_PROPERTY_TYPE_STRING)
1206 {
1207 p->data.ptr = wcsdup(value);
1208 p->size = value ? (wcslen(value) + 1) * sizeof(WCHAR) : sizeof(WCHAR);
1209 }
1210 else if (p->type == D2D1_PROPERTY_TYPE_BLOB)
1211 {
1212 p->data.ptr = NULL;
1213 p->size = 0;
1214 }
1215 else
1216 {
1217 void *src = NULL;
1218 UINT32 _uint32;
1219 float _vec[20];
1220 CLSID _clsid;
1221 BOOL _bool;
1222
1223 p->data.offset = props->offset;
1224 p->size = sizes[type];
1225 props->offset += p->size;
1226
1227 if (value)
1228 {
1229 switch (p->type)
1230 {
1233 _uint32 = wcstoul(value, NULL, 0);
1234 src = &_uint32;
1235 break;
1237 _uint32 = wcstoul(value, NULL, 10);
1238 src = &_uint32;
1239 break;
1241 if (!wcscmp(value, L"true")) _bool = TRUE;
1242 else if (!wcscmp(value, L"false")) _bool = FALSE;
1243 else return E_INVALIDARG;
1244 src = &_bool;
1245 break;
1247 CLSIDFromString(value, &_clsid);
1248 src = &_clsid;
1249 break;
1257 if (FAILED(hr = d2d_effect_parse_float_array(p->type, value, _vec)))
1258 {
1259 WARN("Failed to parse float array %s for type %u.\n",
1260 wine_dbgstr_w(value), p->type);
1261 return hr;
1262 }
1263 src = _vec;
1264 break;
1267 break;
1268 default:
1269 FIXME("Initial value for property type %u is not handled.\n", p->type);
1270 }
1271
1272 if (src && p->size) memcpy(props->data.ptr + p->data.offset, src, p->size);
1273 }
1274 else if (p->size)
1275 memset(props->data.ptr + p->data.offset, 0, p->size);
1276 }
1277
1278 return S_OK;
1279}
1280
1283{
1285}
1286
1289{
1291}
1292
1294 struct d2d_effect_properties *dst, const struct d2d_effect_properties *src)
1295{
1296 HRESULT hr;
1297 size_t i;
1298
1299 *dst = *src;
1300 dst->effect = effect;
1301
1302 if (!(dst->data.ptr = malloc(dst->data.size)))
1303 return E_OUTOFMEMORY;
1304 memcpy(dst->data.ptr, src->data.ptr, dst->data.size);
1305
1306 if (!(dst->properties = calloc(dst->size, sizeof(*dst->properties))))
1307 return E_OUTOFMEMORY;
1308
1309 for (i = 0; i < dst->count; ++i)
1310 {
1311 struct d2d_effect_property *d = &dst->properties[i];
1312 const struct d2d_effect_property *s = &src->properties[i];
1313
1314 *d = *s;
1315 d->name = wcsdup(s->name);
1316 if (d->type == D2D1_PROPERTY_TYPE_STRING)
1317 d->data.ptr = wcsdup((WCHAR *)s->data.ptr);
1318
1319 if (s->subproperties)
1320 {
1321 if (!(d->subproperties = calloc(1, sizeof(*d->subproperties))))
1322 return E_OUTOFMEMORY;
1323 if (FAILED(hr = d2d_effect_duplicate_properties(effect, d->subproperties, s->subproperties)))
1324 return hr;
1325 }
1326 }
1327
1328 return S_OK;
1329}
1330
1332 const struct d2d_effect_properties *properties, UINT32 index)
1333{
1334 unsigned int i;
1335
1336 for (i = 0; i < properties->count; ++i)
1337 {
1338 if (properties->properties[i].index == index)
1339 return &properties->properties[i];
1340 }
1341
1342 return NULL;
1343}
1344
1346 const struct d2d_effect_properties *properties, const WCHAR *name)
1347{
1348 unsigned int i;
1349
1350 for (i = 0; i < properties->count; ++i)
1351 {
1352 if (!wcscmp(properties->properties[i].name, name))
1353 return &properties->properties[i];
1354 }
1355
1356 return NULL;
1357}
1358
1360 UINT32 index)
1361{
1362 struct d2d_effect *effect = properties->effect;
1363 struct d2d_effect_property *prop;
1364 UINT32 size;
1365
1366 if (!(prop = d2d_effect_properties_get_property_by_index(properties, index)))
1367 return 0;
1368
1369 if (prop->get_function)
1370 {
1371 if (FAILED(prop->get_function((IUnknown *)effect->impl, NULL, 0, &size))) return 0;
1372 return size;
1373 }
1374
1375 return prop->size;
1376}
1377
1379{
1380 UINT32 size = str ? wcslen(str) : 0;
1382 if (str) memcpy(buffer, str, (size + 1) * sizeof(*buffer));
1383 else *buffer = 0;
1384 return S_OK;
1385}
1386
1389{
1390 struct d2d_effect *effect = properties->effect;
1391 UINT32 actual_size;
1392
1393 memset(value, 0, size);
1394
1395 if (type != D2D1_PROPERTY_TYPE_UNKNOWN && prop->type != type) return E_INVALIDARG;
1396 /* Do not check sizes for variable-length properties. */
1397 if (prop->type != D2D1_PROPERTY_TYPE_STRING
1398 && prop->type != D2D1_PROPERTY_TYPE_BLOB
1399 && prop->size != size)
1400 {
1401 return E_INVALIDARG;
1402 }
1403
1404 if (prop->get_function)
1405 return prop->get_function((IUnknown *)effect->impl, value, size, &actual_size);
1406
1407 switch (prop->type)
1408 {
1410 memset(value, 0, size);
1411 break;
1413 return d2d_effect_return_string(prop->data.ptr, (WCHAR *)value, size / sizeof(WCHAR));
1414 default:
1415 memcpy(value, properties->data.ptr + prop->data.offset, size);
1416 break;
1417 }
1418
1419 return S_OK;
1420}
1421
1423 const struct d2d_effect_property *prop, UINT32 *value)
1424{
1426 (BYTE *)value, sizeof(*value));
1427}
1428
1431{
1432 struct d2d_effect *effect = properties->effect;
1433 if (prop->readonly || !effect) return E_INVALIDARG;
1434 if (type != D2D1_PROPERTY_TYPE_UNKNOWN && prop->type != type) return E_INVALIDARG;
1435 if (prop->get_function && !prop->set_function) return E_INVALIDARG;
1436 if (prop->index < 0x80000000 && !prop->set_function) return E_INVALIDARG;
1437
1438 if (prop->set_function)
1439 return prop->set_function((IUnknown *)effect->impl, value, size);
1440
1441 if (prop->size != size) return E_INVALIDARG;
1442
1443 switch (prop->type)
1444 {
1448 memcpy(properties->data.ptr + prop->data.offset, value, size);
1449 break;
1450 default:
1451 FIXME("Unhandled type %u.\n", prop->type);
1452 }
1453
1454 return S_OK;
1455}
1456
1458{
1459 struct d2d_effect_property *p;
1460 size_t i;
1461
1462 for (i = 0; i < props->count; ++i)
1463 {
1464 p = &props->properties[i];
1465 free(p->name);
1466 if (p->type == D2D1_PROPERTY_TYPE_STRING)
1467 free(p->data.ptr);
1468 if (p->subproperties)
1469 {
1470 d2d_effect_properties_cleanup(p->subproperties);
1471 free(p->subproperties);
1472 }
1473 }
1474 free(props->properties);
1475 free(props->data.ptr);
1476}
1477
1479{
1481}
1482
1484{
1485 TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
1486
1487 if (IsEqualGUID(iid, &IID_ID2D1EffectContext)
1488 || IsEqualGUID(iid, &IID_IUnknown))
1489 {
1490 ID2D1EffectContext_AddRef(iface);
1491 *out = iface;
1492 return S_OK;
1493 }
1494
1495 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
1496
1497 *out = NULL;
1498 return E_NOINTERFACE;
1499}
1500
1502{
1503 struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
1504 ULONG refcount = InterlockedIncrement(&effect_context->refcount);
1505
1506 TRACE("%p increasing refcount to %lu.\n", iface, refcount);
1507
1508 return refcount;
1509}
1510
1512{
1513 struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
1514 ULONG refcount = InterlockedDecrement(&effect_context->refcount);
1515
1516 TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
1517
1518 if (!refcount)
1519 {
1520 ID2D1DeviceContext6_Release(&effect_context->device_context->ID2D1DeviceContext6_iface);
1521 free(effect_context);
1522 }
1523
1524 return refcount;
1525}
1526
1527static void STDMETHODCALLTYPE d2d_effect_context_GetDpi(ID2D1EffectContext *iface, float *dpi_x, float *dpi_y)
1528{
1529 struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
1530
1531 TRACE("iface %p, dpi_x %p, dpi_y %p.\n", iface, dpi_x, dpi_y);
1532
1533 ID2D1DeviceContext6_GetDpi(&effect_context->device_context->ID2D1DeviceContext6_iface, dpi_x, dpi_y);
1534}
1535
1537 REFCLSID clsid, ID2D1Effect **effect)
1538{
1539 struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
1540
1541 TRACE("iface %p, clsid %s, effect %p.\n", iface, debugstr_guid(clsid), effect);
1542
1543 return ID2D1DeviceContext6_CreateEffect(&effect_context->device_context->ID2D1DeviceContext6_iface,
1544 clsid, effect);
1545}
1546
1548 const D3D_FEATURE_LEVEL *levels, UINT32 level_count, D3D_FEATURE_LEVEL *max_level)
1549{
1550 FIXME("iface %p, levels %p, level_count %u, max_level %p stub!\n", iface, levels, level_count, max_level);
1551
1552 return E_NOTIMPL;
1553}
1554
1557{
1558 FIXME("iface %p, effect %p, node %p stub!\n", iface, effect, node);
1559
1560 return E_NOTIMPL;
1561}
1562
1565{
1566 TRACE("iface %p, num_inputs %u, description %p, transform %p,\n", iface, num_inputs, description, transform);
1567
1569}
1570
1573{
1574 TRACE("iface %p, mode_x %#x, mode_y %#x, transform %p.\n", iface, mode_x, mode_y, transform);
1575
1576 return d2d_border_transform_create(mode_x, mode_y, transform);
1577}
1578
1581{
1582 TRACE("iface %p, offset %s, transform %p.\n", iface, debug_d2d_point_2l(&offset), transform);
1583
1585}
1586
1589{
1590 TRACE("iface %p, output_rect %s, transform %p.\n", iface, debug_d2d_rect_l(output_rect), transform);
1591
1593}
1594
1596 REFGUID shader_id, const BYTE *buffer, UINT32 buffer_size)
1597{
1598 struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
1599 struct d2d_device *device = effect_context->device_context->device;
1600 ID3D11PixelShader *shader;
1601 HRESULT hr;
1602
1603 TRACE("iface %p, shader_id %s, buffer %p, buffer_size %u.\n",
1604 iface, debugstr_guid(shader_id), buffer, buffer_size);
1605
1606 if (d2d_device_get_indexed_object(&device->shaders, shader_id, NULL))
1607 return S_OK;
1608
1609 if (FAILED(hr = ID3D11Device1_CreatePixelShader(effect_context->device_context->d3d_device,
1611 {
1612 WARN("Failed to create a pixel shader, hr %#lx.\n", hr);
1613 return hr;
1614 }
1615
1616 hr = d2d_device_add_indexed_object(&device->shaders, shader_id, (IUnknown *)shader);
1617 ID3D11PixelShader_Release(shader);
1618
1619 return hr;
1620}
1621
1623 REFGUID shader_id, const BYTE *buffer, UINT32 buffer_size)
1624{
1625 struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
1626 struct d2d_device *device = effect_context->device_context->device;
1627 ID3D11VertexShader *shader;
1628 HRESULT hr;
1629
1630 TRACE("iface %p, shader_id %s, buffer %p, buffer_size %u.\n",
1631 iface, debugstr_guid(shader_id), buffer, buffer_size);
1632
1633 if (d2d_device_get_indexed_object(&device->shaders, shader_id, NULL))
1634 return S_OK;
1635
1636 if (FAILED(hr = ID3D11Device1_CreateVertexShader(effect_context->device_context->d3d_device,
1638 {
1639 WARN("Failed to create vertex shader, hr %#lx.\n", hr);
1640 return hr;
1641 }
1642
1643 hr = d2d_device_add_indexed_object(&device->shaders, shader_id, (IUnknown *)shader);
1644 ID3D11VertexShader_Release(shader);
1645
1646 return hr;
1647}
1648
1650 REFGUID shader_id, const BYTE *buffer, UINT32 buffer_size)
1651{
1652 struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
1653 struct d2d_device *device = effect_context->device_context->device;
1654 ID3D11ComputeShader *shader;
1655 HRESULT hr;
1656
1657 TRACE("iface %p, shader_id %s, buffer %p, buffer_size %u.\n",
1658 iface, debugstr_guid(shader_id), buffer, buffer_size);
1659
1660 if (d2d_device_get_indexed_object(&device->shaders, shader_id, NULL))
1661 return S_OK;
1662
1663 if (FAILED(hr = ID3D11Device1_CreateComputeShader(effect_context->device_context->d3d_device,
1665 {
1666 WARN("Failed to create a compute shader, hr %#lx.\n", hr);
1667 return hr;
1668 }
1669
1670 hr = d2d_device_add_indexed_object(&device->shaders, shader_id, (IUnknown *)shader);
1671 ID3D11ComputeShader_Release(shader);
1672
1673 return hr;
1674}
1675
1677{
1678 struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
1679 struct d2d_device *device = effect_context->device_context->device;
1680
1681 TRACE("iface %p, shader_id %s.\n", iface, debugstr_guid(shader_id));
1682
1683 return d2d_device_get_indexed_object(&device->shaders, shader_id, NULL);
1684}
1685
1687 const GUID *id, const D2D1_RESOURCE_TEXTURE_PROPERTIES *texture_properties,
1688 const BYTE *data, const UINT32 *strides, UINT32 data_size, ID2D1ResourceTexture **texture)
1689{
1690 FIXME("iface %p, id %s, texture_properties %p, data %p, strides %p, data_size %u, texture %p stub!\n",
1691 iface, debugstr_guid(id), texture_properties, data, strides, data_size, texture);
1692
1693 return E_NOTIMPL;
1694}
1695
1697 const GUID *id, ID2D1ResourceTexture **texture)
1698{
1699 FIXME("iface %p, id %s, texture %p stub!\n", iface, debugstr_guid(id), texture);
1700
1701 return E_NOTIMPL;
1702}
1703
1705 const D2D1_VERTEX_BUFFER_PROPERTIES *buffer_properties, const GUID *id,
1706 const D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES *custom_buffer_properties,
1708{
1709 struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
1710 struct d2d_device_context *context = effect_context->device_context;
1711 HRESULT hr;
1712
1713 FIXME("iface %p, buffer_properties %p, id %s, custom_buffer_properties %p, buffer %p stub!\n",
1714 iface, buffer_properties, debugstr_guid(id), custom_buffer_properties, buffer);
1715
1716 if (id && d2d_device_get_indexed_object(&context->vertex_buffers, id, (IUnknown **)buffer))
1717 return S_OK;
1718
1720 {
1721 if (id)
1722 hr = d2d_device_add_indexed_object(&context->vertex_buffers, id, (IUnknown *)*buffer);
1723 }
1724
1725 if (FAILED(hr))
1726 *buffer = NULL;
1727
1728 return hr;
1729}
1730
1732 const GUID *id, ID2D1VertexBuffer **buffer)
1733{
1734 struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
1735 struct d2d_device_context *context = effect_context->device_context;
1736
1737 TRACE("iface %p, id %s, buffer %p.\n", iface, debugstr_guid(id), buffer);
1738
1739 if (!d2d_device_get_indexed_object(&context->vertex_buffers, id, (IUnknown **)buffer))
1741
1742 return S_OK;
1743}
1744
1746 D2D1_COLOR_SPACE space, const BYTE *profile, UINT32 profile_size, ID2D1ColorContext **color_context)
1747{
1748 struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
1749
1750 TRACE("iface %p, space %#x, profile %p, profile_size %u, color_context %p.\n",
1751 iface, space, profile, profile_size, color_context);
1752
1753 return ID2D1DeviceContext6_CreateColorContext(&effect_context->device_context->ID2D1DeviceContext6_iface,
1754 space, profile, profile_size, color_context);
1755}
1756
1758 const WCHAR *filename, ID2D1ColorContext **color_context)
1759{
1760 struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
1761
1762 TRACE("iface %p, filename %s, color_context %p.\n", iface, debugstr_w(filename), color_context);
1763
1764 return ID2D1DeviceContext6_CreateColorContextFromFilename(&effect_context->device_context->ID2D1DeviceContext6_iface,
1765 filename, color_context);
1766}
1767
1769 IWICColorContext *wic_color_context, ID2D1ColorContext **color_context)
1770{
1771 struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
1772
1773 TRACE("iface %p, wic_color_context %p, color_context %p.\n", iface, wic_color_context, color_context);
1774
1775 return ID2D1DeviceContext6_CreateColorContextFromWicColorContext(&effect_context->device_context->ID2D1DeviceContext6_iface,
1776 wic_color_context, color_context);
1777}
1778
1780 D2D1_FEATURE feature, void *data, UINT32 data_size)
1781{
1782 struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
1783 D3D11_FEATURE d3d11_feature;
1784
1785 TRACE("iface %p, feature %#x, data %p, data_size %u.\n", iface, feature, data, data_size);
1786
1787 /* Data structures are compatible. */
1788 switch (feature)
1789 {
1790 case D2D1_FEATURE_DOUBLES: d3d11_feature = D3D11_FEATURE_DOUBLES; break;
1792 default:
1793 WARN("Unexpected feature index %d.\n", feature);
1794 return E_INVALIDARG;
1795 }
1796
1797 return ID3D11Device1_CheckFeatureSupport(effect_context->device_context->d3d_device,
1798 d3d11_feature, data, data_size);
1799}
1800
1803{
1804 struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
1805
1806 TRACE("iface %p, precision %u.\n", iface, precision);
1807
1808 return ID2D1DeviceContext6_IsBufferPrecisionSupported(&effect_context->device_context->ID2D1DeviceContext6_iface,
1809 precision);
1810}
1811
1812static const ID2D1EffectContextVtbl d2d_effect_context_vtbl =
1813{
1838};
1839
1841{
1842 effect_context->ID2D1EffectContext_iface.lpVtbl = &d2d_effect_context_vtbl;
1843 effect_context->refcount = 1;
1844 effect_context->device_context = device_context;
1845 ID2D1DeviceContext6_AddRef(&device_context->ID2D1DeviceContext6_iface);
1846}
1847
1848static inline struct d2d_effect *impl_from_ID2D1Effect(ID2D1Effect *iface)
1849{
1850 return CONTAINING_RECORD(iface, struct d2d_effect, ID2D1Effect_iface);
1851}
1852
1853static void d2d_effect_cleanup(struct d2d_effect *effect)
1854{
1855 unsigned int i;
1856
1857 for (i = 0; i < effect->input_count; ++i)
1858 {
1859 if (effect->inputs[i])
1860 ID2D1Image_Release(effect->inputs[i]);
1861 }
1862 free(effect->inputs);
1863 ID2D1EffectContext_Release(&effect->effect_context->ID2D1EffectContext_iface);
1864 if (effect->graph)
1865 ID2D1TransformGraph_Release(&effect->graph->ID2D1TransformGraph_iface);
1867 if (effect->impl)
1868 ID2D1EffectImpl_Release(effect->impl);
1869}
1870
1872{
1873 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
1874 TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
1875
1876 if (IsEqualGUID(iid, &IID_ID2D1Effect)
1877 || IsEqualGUID(iid, &IID_ID2D1Properties)
1878 || IsEqualGUID(iid, &IID_IUnknown))
1879 {
1880 ID2D1Effect_AddRef(iface);
1881 *out = iface;
1882 return S_OK;
1883 }
1884
1885 if (IsEqualGUID(iid, &IID_ID2D1Image)
1886 || IsEqualGUID(iid, &IID_ID2D1Resource))
1887 {
1888 ID2D1Image_AddRef(&effect->ID2D1Image_iface);
1889 *out = &effect->ID2D1Image_iface;
1890 return S_OK;
1891 }
1892
1893 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
1894
1895 *out = NULL;
1896 return E_NOINTERFACE;
1897}
1898
1900{
1901 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
1903
1904 TRACE("%p increasing refcount to %lu.\n", iface, refcount);
1905
1906 return refcount;
1907}
1908
1910{
1911 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
1913
1914 TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
1915
1916 if (!refcount)
1917 {
1918 d2d_effect_cleanup(effect);
1919 free(effect);
1920 }
1921
1922 return refcount;
1923}
1924
1926{
1927 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
1928
1929 TRACE("iface %p.\n", iface);
1930
1931 return ID2D1Properties_GetPropertyCount(&effect->properties.ID2D1Properties_iface);
1932}
1933
1935 WCHAR *name, UINT32 name_count)
1936{
1937 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
1938
1939 TRACE("iface %p, index %u, name %p, name_count %u.\n", iface, index, name, name_count);
1940
1941 return ID2D1Properties_GetPropertyName(&effect->properties.ID2D1Properties_iface,
1942 index, name, name_count);
1943}
1944
1946{
1947 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
1948
1949 TRACE("iface %p, index %u.\n", iface, index);
1950
1951 return ID2D1Properties_GetPropertyNameLength(&effect->properties.ID2D1Properties_iface, index);
1952}
1953
1955{
1956 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
1957
1958 TRACE("iface %p, index %#x.\n", iface, index);
1959
1960 return ID2D1Properties_GetType(&effect->properties.ID2D1Properties_iface, index);
1961}
1962
1964{
1965 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
1966
1967 TRACE("iface %p, name %s.\n", iface, debugstr_w(name));
1968
1969 return ID2D1Properties_GetPropertyIndex(&effect->properties.ID2D1Properties_iface, name);
1970}
1971
1973 D2D1_PROPERTY_TYPE type, const BYTE *value, UINT32 value_size)
1974{
1975 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
1976
1977 TRACE("iface %p, name %s, type %u, value %p, value_size %u.\n", iface, debugstr_w(name),
1978 type, value, value_size);
1979
1980 return ID2D1Properties_SetValueByName(&effect->properties.ID2D1Properties_iface, name,
1981 type, value, value_size);
1982}
1983
1985 const BYTE *value, UINT32 value_size)
1986{
1987 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
1988
1989 TRACE("iface %p, index %#x, type %u, value %p, value_size %u.\n", iface, index, type, value, value_size);
1990
1991 return ID2D1Properties_SetValue(&effect->properties.ID2D1Properties_iface, index, type,
1992 value, value_size);
1993}
1994
1996 D2D1_PROPERTY_TYPE type, BYTE *value, UINT32 value_size)
1997{
1998 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
1999
2000 TRACE("iface %p, name %s, type %#x, value %p, value_size %u.\n", iface, debugstr_w(name), type,
2001 value, value_size);
2002
2003 return ID2D1Properties_GetValueByName(&effect->properties.ID2D1Properties_iface, name, type,
2004 value, value_size);
2005}
2006
2008 BYTE *value, UINT32 value_size)
2009{
2010 return ID2D1Properties_GetValue(&effect->properties.ID2D1Properties_iface, index, type, value, value_size);
2011}
2012
2014 BYTE *value, UINT32 value_size)
2015{
2016 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
2017
2018 TRACE("iface %p, index %#x, type %u, value %p, value_size %u.\n", iface, index, type, value, value_size);
2019
2020 return d2d_effect_get_value(effect, index, type, value, value_size);
2021}
2022
2024{
2025 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
2026
2027 TRACE("iface %p, index %#x.\n", iface, index);
2028
2029 return ID2D1Properties_GetValueSize(&effect->properties.ID2D1Properties_iface, index);
2030}
2031
2034{
2035 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
2036
2037 TRACE("iface %p, index %u, props %p.\n", iface, index, props);
2038
2039 return ID2D1Properties_GetSubProperties(&effect->properties.ID2D1Properties_iface, index, props);
2040}
2041
2043{
2044 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
2045
2046 TRACE("iface %p, index %u, input %p, invalidate %#x.\n", iface, index, input, invalidate);
2047
2048 if (index >= effect->input_count)
2049 return;
2050
2051 ID2D1Image_AddRef(input);
2052 if (effect->inputs[index])
2053 ID2D1Image_Release(effect->inputs[index]);
2054 effect->inputs[index] = input;
2055}
2056
2058{
2059 bool initialized = effect->inputs != NULL;
2060 HRESULT hr = S_OK;
2061 unsigned int i;
2062
2063 if (count == effect->input_count)
2064 return S_OK;
2065
2066 if (count < effect->input_count)
2067 {
2068 for (i = count; i < effect->input_count; ++i)
2069 {
2070 if (effect->inputs[i])
2071 ID2D1Image_Release(effect->inputs[i]);
2072 }
2073 }
2074 else
2075 {
2076 if (!d2d_array_reserve((void **)&effect->inputs, &effect->inputs_size,
2077 count, sizeof(*effect->inputs)))
2078 {
2079 ERR("Failed to resize inputs array.\n");
2080 return E_OUTOFMEMORY;
2081 }
2082
2083 memset(&effect->inputs[effect->input_count], 0, sizeof(*effect->inputs) * (count - effect->input_count));
2084 }
2085 effect->input_count = count;
2086
2087 if (initialized)
2088 {
2089 ID2D1TransformGraph_Release(&effect->graph->ID2D1TransformGraph_iface);
2090 effect->graph = NULL;
2091
2093 {
2094 if (FAILED(hr = ID2D1EffectImpl_SetGraph(effect->impl, &effect->graph->ID2D1TransformGraph_iface)))
2095 WARN("Failed to set a new transform graph, hr %#lx.\n", hr);
2096 }
2097 }
2098
2099 return hr;
2100}
2101
2103{
2104 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
2105 unsigned int min_inputs, max_inputs;
2106
2107 TRACE("iface %p, count %u.\n", iface, count);
2108
2110 (BYTE *)&min_inputs, sizeof(min_inputs));
2112 (BYTE *)&max_inputs, sizeof(max_inputs));
2113
2114 if (count < min_inputs || count > max_inputs)
2115 return E_INVALIDARG;
2116
2117 return d2d_effect_set_input_count(effect, count);
2118}
2119
2121{
2122 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
2123
2124 TRACE("iface %p, index %u, input %p.\n", iface, index, input);
2125
2126 if (index < effect->input_count && effect->inputs[index])
2127 ID2D1Image_AddRef(*input = effect->inputs[index]);
2128 else
2129 *input = NULL;
2130}
2131
2133{
2134 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
2135
2136 TRACE("iface %p.\n", iface);
2137
2138 return effect->input_count;
2139}
2140
2142{
2143 struct d2d_effect *effect = impl_from_ID2D1Effect(iface);
2144
2145 TRACE("iface %p, output %p.\n", iface, output);
2146
2147 ID2D1Image_AddRef(*output = &effect->ID2D1Image_iface);
2148}
2149
2150static const ID2D1EffectVtbl d2d_effect_vtbl =
2151{
2171};
2172
2173static inline struct d2d_effect *impl_from_ID2D1Image(ID2D1Image *iface)
2174{
2175 return CONTAINING_RECORD(iface, struct d2d_effect, ID2D1Image_iface);
2176}
2177
2179{
2180 struct d2d_effect *effect = impl_from_ID2D1Image(iface);
2181
2182 TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
2183
2184 return d2d_effect_QueryInterface(&effect->ID2D1Effect_iface, iid, out);
2185}
2186
2188{
2189 struct d2d_effect *effect = impl_from_ID2D1Image(iface);
2190
2191 TRACE("iface %p.\n", iface);
2192
2193 return d2d_effect_AddRef(&effect->ID2D1Effect_iface);
2194}
2195
2197{
2198 struct d2d_effect *effect = impl_from_ID2D1Image(iface);
2199
2200 TRACE("iface %p.\n", iface);
2201
2202 return d2d_effect_Release(&effect->ID2D1Effect_iface);
2203}
2204
2206{
2207 struct d2d_effect *effect = impl_from_ID2D1Image(iface);
2208
2209 TRACE("iface %p, factory %p.\n", iface, factory);
2210
2211 ID2D1Factory_AddRef(*factory = effect->effect_context->device_context->factory);
2212}
2213
2214static const ID2D1ImageVtbl d2d_effect_image_vtbl =
2215{
2220};
2221
2223{
2225}
2226
2228 REFIID riid, void **obj)
2229{
2230 if (IsEqualGUID(riid, &IID_ID2D1Properties) ||
2232 {
2233 *obj = iface;
2234 ID2D1Properties_AddRef(iface);
2235 return S_OK;
2236 }
2237
2238 *obj = NULL;
2239 return E_NOINTERFACE;
2240}
2241
2243{
2245
2246 if (properties->effect)
2247 return ID2D1Effect_AddRef(&properties->effect->ID2D1Effect_iface);
2248
2249 return InterlockedIncrement(&properties->refcount);
2250}
2251
2253{
2256
2257 if (properties->effect)
2258 return ID2D1Effect_Release(&properties->effect->ID2D1Effect_iface);
2259
2261
2262 if (!refcount)
2263 {
2266 }
2267
2268 return refcount;
2269}
2270
2272{
2274
2275 TRACE("iface %p.\n", iface);
2276
2277 return properties->custom_count;
2278}
2279
2281 UINT32 index, WCHAR *name, UINT32 name_count)
2282{
2284 struct d2d_effect_property *prop;
2285
2286 TRACE("iface %p, index %u, name %p, name_count %u.\n", iface, index, name, name_count);
2287
2288 if (!(prop = d2d_effect_properties_get_property_by_index(properties, index)))
2290
2291 return d2d_effect_return_string(prop->name, name, name_count);
2292}
2293
2295 UINT32 index)
2296{
2298 struct d2d_effect_property *prop;
2299
2300 TRACE("iface %p, index %u.\n", iface, index);
2301
2302 if (!(prop = d2d_effect_properties_get_property_by_index(properties, index)))
2304
2305 return wcslen(prop->name);
2306}
2307
2309 UINT32 index)
2310{
2312 struct d2d_effect_property *prop;
2313
2314 TRACE("iface %p, index %#x.\n", iface, index);
2315
2316 if (!(prop = d2d_effect_properties_get_property_by_index(properties, index)))
2318
2319 return prop->type;
2320}
2321
2323 const WCHAR *name)
2324{
2326 struct d2d_effect_property *prop;
2327
2328 TRACE("iface %p, name %s.\n", iface, debugstr_w(name));
2329
2330 if (!(prop = d2d_effect_properties_get_property_by_name(properties, name)))
2331 return D2D1_INVALID_PROPERTY_INDEX;
2332
2333 return prop->index;
2334}
2335
2337 const WCHAR *name, D2D1_PROPERTY_TYPE type, const BYTE *value, UINT32 value_size)
2338{
2340 struct d2d_effect_property *prop;
2341
2342 TRACE("iface %p, name %s, type %u, value %p, value_size %u.\n", iface, debugstr_w(name),
2343 type, value, value_size);
2344
2345 if (!(prop = d2d_effect_properties_get_property_by_name(properties, name)))
2347
2348 return d2d_effect_property_set_value(properties, prop, type, value, value_size);
2349}
2350
2352 UINT32 index, D2D1_PROPERTY_TYPE type, const BYTE *value, UINT32 value_size)
2353{
2355 struct d2d_effect_property *prop;
2356
2357 TRACE("iface %p, index %#x, type %u, value %p, value_size %u.\n", iface, index, type, value, value_size);
2358
2359 if (!(prop = d2d_effect_properties_get_property_by_index(properties, index)))
2361
2362 return d2d_effect_property_set_value(properties, prop, type, value, value_size);
2363}
2364
2366 const WCHAR *name, D2D1_PROPERTY_TYPE type, BYTE *value, UINT32 value_size)
2367{
2369 struct d2d_effect_property *prop;
2370
2371 TRACE("iface %p, name %s, type %#x, value %p, value_size %u.\n", iface, debugstr_w(name), type,
2372 value, value_size);
2373
2374 if (!(prop = d2d_effect_properties_get_property_by_name(properties, name)))
2376
2377 return d2d_effect_property_get_value(properties, prop, type, value, value_size);
2378}
2379
2382{
2384 struct d2d_effect_property *prop;
2385
2386 TRACE("iface %p, index %#x, type %u, value %p, value_size %u.\n", iface, index, type, value, value_size);
2387
2388 if (!(prop = d2d_effect_properties_get_property_by_index(properties, index)))
2390
2391 return d2d_effect_property_get_value(properties, prop, type, value, value_size);
2392}
2393
2395 UINT32 index)
2396{
2398
2399 TRACE("iface %p, index %#x.\n", iface, index);
2400
2402}
2403
2406{
2408 struct d2d_effect_property *prop;
2409
2410 TRACE("iface %p, index %u, props %p.\n", iface, index, props);
2411
2412 if (!(prop = d2d_effect_properties_get_property_by_index(properties, index)))
2414
2415 if (!prop->subproperties) return D2DERR_NO_SUBPROPERTIES;
2416
2417 *props = &prop->subproperties->ID2D1Properties_iface;
2418 ID2D1Properties_AddRef(*props);
2419 return S_OK;
2420}
2421
2422static const ID2D1PropertiesVtbl d2d_effect_properties_vtbl =
2423{
2438};
2439
2441 struct d2d_effect_properties *properties)
2442{
2444 properties->effect = effect;
2445 properties->refcount = 1;
2446}
2447
2449{
2451}
2452
2454 void **obj)
2455{
2456 TRACE("iface %p, iid %s, obj %p.\n", iface, debugstr_guid(iid), obj);
2457
2458 if (IsEqualGUID(iid, &IID_ID2D1DrawInfo)
2459 || IsEqualGUID(iid, &IID_ID2D1RenderInfo)
2460 || IsEqualGUID(iid, &IID_IUnknown))
2461 {
2462 *obj = iface;
2463 ID2D1DrawInfo_AddRef(iface);
2464 return S_OK;
2465 }
2466
2467 WARN("Unsupported interface %s.\n", debugstr_guid(iid));
2468
2469 *obj = NULL;
2470
2471 return E_NOINTERFACE;
2472}
2473
2475{
2476 struct d2d_render_info *render_info = impl_from_ID2D1DrawInfo(iface);
2478
2479 TRACE("iface %p refcount %lu.\n", iface, refcount);
2480
2481 return refcount;
2482}
2483
2485{
2486 struct d2d_render_info *render_info = impl_from_ID2D1DrawInfo(iface);
2488
2489 TRACE("iface %p refcount %lu.\n", iface, refcount);
2490
2491 if (!refcount)
2492 free(render_info);
2493
2494 return refcount;
2495}
2496
2499{
2500 FIXME("iface %p, index %u stub.\n", iface, index);
2501
2502 return E_NOTIMPL;
2503}
2504
2507{
2508 FIXME("iface %p, precision %u, depth %u stub.\n", iface, precision, depth);
2509
2510 return E_NOTIMPL;
2511}
2512
2514{
2515 FIXME("iface %p, is_cached %d stub.\n", iface, is_cached);
2516}
2517
2519 UINT32 count)
2520{
2521 FIXME("iface %p, count %u stub.\n", iface, count);
2522}
2523
2525 const BYTE *buffer, UINT32 size)
2526{
2527 FIXME("iface %p, buffer %p, size %u stub.\n", iface, buffer, size);
2528
2529 return E_NOTIMPL;
2530}
2531
2534{
2535 FIXME("iface %p, index %u, texture %p stub.\n", iface, index, texture);
2536
2537 return E_NOTIMPL;
2538}
2539
2541 const BYTE *buffer, UINT32 size)
2542{
2543 FIXME("iface %p, buffer %p, size %u stub.\n", iface, buffer, size);
2544
2545 return E_NOTIMPL;
2546}
2547
2550{
2551 struct d2d_render_info *render_info = impl_from_ID2D1DrawInfo(iface);
2552
2553 TRACE("iface %p, id %s, options %u.\n", iface, debugstr_guid(id), options);
2554
2555 render_info->mask |= D2D_RENDER_INFO_PIXEL_SHADER;
2556 render_info->pixel_shader = *id;
2557 return S_OK;
2558}
2559
2563 const GUID *shader)
2564{
2565 FIXME("iface %p, buffer %p, options %#x, description %p, range %p, shader %s stub.\n",
2567
2568 return E_NOTIMPL;
2569}
2570
2571static const ID2D1DrawInfoVtbl d2d_draw_info_vtbl =
2572{
2585};
2586
2588{
2589 struct d2d_render_info *object;
2590
2591 if (!(object = calloc(1, sizeof(*object))))
2592 return E_OUTOFMEMORY;
2593
2594 object->ID2D1DrawInfo_iface.lpVtbl = &d2d_draw_info_vtbl;
2595 object->refcount = 1;
2596
2597 *obj = object;
2598
2599 return S_OK;
2600}
2601
2603{
2604 static const GUID *iids[] =
2605 {
2606 &IID_ID2D1SourceTransform,
2607 &IID_ID2D1ComputeTransform,
2608 &IID_ID2D1DrawTransform,
2609 };
2610 unsigned int i;
2611 IUnknown *obj;
2612
2613 for (i = 0; i < ARRAY_SIZE(iids); ++i)
2614 {
2615 if (SUCCEEDED(ID2D1TransformNode_QueryInterface(node->object, iids[i], (void **)&obj)))
2616 {
2617 IUnknown_Release(obj);
2618 return true;
2619 }
2620 }
2621
2622 return false;
2623}
2624
2626{
2627 ID2D1DrawTransform *draw_transform;
2628 struct d2d_transform_node *node;
2629 HRESULT hr;
2630
2632 {
2634 {
2635 if (FAILED(hr = d2d_effect_render_info_create(&node->render_info)))
2636 return hr;
2637 }
2638
2639 if (SUCCEEDED(ID2D1TransformNode_QueryInterface(node->object, &IID_ID2D1DrawTransform,
2640 (void **)&draw_transform)))
2641 {
2642 hr = ID2D1DrawTransform_SetDrawInfo(draw_transform, &node->render_info->ID2D1DrawInfo_iface);
2643 ID2D1DrawTransform_Release(draw_transform);
2644 if (FAILED(hr))
2645 {
2646 WARN("Failed to set draw info, hr %#lx.\n", hr);
2647 return hr;
2648 }
2649 }
2650 else
2651 {
2652 FIXME("Unsupported node %p.\n", node);
2653 return E_NOTIMPL;
2654 }
2655 }
2656
2657 return S_OK;
2658}
2659
2661 ID2D1Effect **effect)
2662{
2663 struct d2d_effect_context *effect_context;
2664 const struct d2d_effect_registration *reg;
2665 struct d2d_effect *object;
2667 WCHAR clsidW[39];
2668 HRESULT hr;
2669
2671 {
2672 WARN("Effect id %s not found.\n", wine_dbgstr_guid(effect_id));
2674 }
2675
2676 if (!(effect_context = calloc(1, sizeof(*effect_context))))
2677 return E_OUTOFMEMORY;
2679
2680 if (!(object = calloc(1, sizeof(*object))))
2681 {
2682 ID2D1EffectContext_Release(&effect_context->ID2D1EffectContext_iface);
2683 return E_OUTOFMEMORY;
2684 }
2685
2686 object->ID2D1Effect_iface.lpVtbl = &d2d_effect_vtbl;
2687 object->ID2D1Image_iface.lpVtbl = &d2d_effect_image_vtbl;
2688 object->refcount = 1;
2689 object->effect_context = effect_context;
2690
2691 /* Create properties */
2692 d2d_effect_duplicate_properties(object, &object->properties, reg->properties);
2693
2694 StringFromGUID2(effect_id, clsidW, ARRAY_SIZE(clsidW));
2698
2699 /* Sync instance input count with default input count from the description. */
2702
2704 {
2705 ID2D1EffectContext_Release(&effect_context->ID2D1EffectContext_iface);
2706 return hr;
2707 }
2708
2709 if (FAILED(hr = reg->factory((IUnknown **)&object->impl)))
2710 {
2711 WARN("Failed to create implementation object, hr %#lx.\n", hr);
2712 ID2D1Effect_Release(&object->ID2D1Effect_iface);
2713 return hr;
2714 }
2715
2716 if (FAILED(hr = ID2D1EffectImpl_Initialize(object->impl, &effect_context->ID2D1EffectContext_iface,
2717 &object->graph->ID2D1TransformGraph_iface)))
2718 {
2719 WARN("Failed to initialize effect, hr %#lx.\n", hr);
2720 ID2D1Effect_Release(&object->ID2D1Effect_iface);
2721 return hr;
2722 }
2723
2725 {
2726 WARN("Failed to initialize graph nodes, hr %#lx.\n", hr);
2727 ID2D1Effect_Release(&object->ID2D1Effect_iface);
2728 return hr;
2729 }
2730
2731 *effect = &object->ID2D1Effect_iface;
2732
2733 TRACE("Created effect %p.\n", *effect);
2734
2735 return S_OK;
2736}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define index(s, c)
Definition: various.h:29
#define ARRAY_SIZE(A)
Definition: main.h:20
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_init(struct list_entry *head)
Definition: list.h:51
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
RECT rect
Definition: combotst.c:67
D2D1_EXTEND_MODE
Definition: d2d1.idl:198
@ D2D1_EXTEND_MODE_WRAP
Definition: d2d1.idl:200
@ D2D1_EXTEND_MODE_MIRROR
Definition: d2d1.idl:201
@ D2D1_EXTEND_MODE_CLAMP
Definition: d2d1.idl:199
@ D2D1_PROPERTY_CLSID
Definition: d2d1_1.idl:189
@ D2D1_PROPERTY_CACHED
Definition: d2d1_1.idl:195
@ D2D1_PROPERTY_MAX_INPUTS
Definition: d2d1_1.idl:198
@ D2D1_PROPERTY_PRECISION
Definition: d2d1_1.idl:196
@ D2D1_PROPERTY_MIN_INPUTS
Definition: d2d1_1.idl:197
@ D2D1_PROPERTY_INPUTS
Definition: d2d1_1.idl:194
D2D1_PROPERTY_TYPE
Definition: d2d1_1.idl:164
@ D2D1_PROPERTY_TYPE_BLOB
Definition: d2d1_1.idl:174
@ D2D1_PROPERTY_TYPE_CLSID
Definition: d2d1_1.idl:178
@ D2D1_PROPERTY_TYPE_MATRIX_5X4
Definition: d2d1_1.idl:182
@ D2D1_PROPERTY_TYPE_ENUM
Definition: d2d1_1.idl:176
@ D2D1_PROPERTY_TYPE_BOOL
Definition: d2d1_1.idl:167
@ D2D1_PROPERTY_TYPE_MATRIX_3X2
Definition: d2d1_1.idl:179
@ D2D1_PROPERTY_TYPE_MATRIX_4X4
Definition: d2d1_1.idl:181
@ D2D1_PROPERTY_TYPE_UINT32
Definition: d2d1_1.idl:168
@ D2D1_PROPERTY_TYPE_UNKNOWN
Definition: d2d1_1.idl:165
@ D2D1_PROPERTY_TYPE_MATRIX_4X3
Definition: d2d1_1.idl:180
@ D2D1_PROPERTY_TYPE_STRING
Definition: d2d1_1.idl:166
@ D2D1_PROPERTY_TYPE_VECTOR2
Definition: d2d1_1.idl:171
@ D2D1_PROPERTY_TYPE_FLOAT
Definition: d2d1_1.idl:170
@ D2D1_PROPERTY_TYPE_VECTOR3
Definition: d2d1_1.idl:172
@ D2D1_PROPERTY_TYPE_IUNKNOWN
Definition: d2d1_1.idl:175
@ D2D1_PROPERTY_TYPE_ARRAY
Definition: d2d1_1.idl:177
@ D2D1_PROPERTY_TYPE_INT32
Definition: d2d1_1.idl:169
@ D2D1_PROPERTY_TYPE_VECTOR4
Definition: d2d1_1.idl:173
@ D2D1_PROPERTY_TYPE_COLOR_CONTEXT
Definition: d2d1_1.idl:183
D2D1_COLOR_SPACE
Definition: d2d1_1.idl:79
D2D1_BUFFER_PRECISION
Definition: d2d1_1.idl:106
@ D2D_RENDER_INFO_PIXEL_SHADER
Definition: d2d1_private.h:743
HRESULT d2d_factory_register_builtin_effect(struct d2d_factory *factory, REFCLSID effect_id, const WCHAR *property_xml, const D2D1_PROPERTY_BINDING *bindings, UINT32 binding_count, PD2D1_EFFECT_FACTORY effect_factory)
Definition: factory.c:1081
HRESULT d2d_device_add_indexed_object(struct d2d_indexed_objects *objects, const GUID *id, IUnknown *object)
Definition: device.c:4542
static const char * debug_d2d_point_2l(const D2D1_POINT_2L *point)
static const char * debug_d2d_rect_l(const D2D1_RECT_L *rect)
static BOOL d2d_array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
Definition: d2d1_private.h:897
struct d2d_effect_registration * d2d_factory_get_registered_effect(ID2D1Factory *factory, const GUID *effect_id)
Definition: factory.c:66
BOOL d2d_device_get_indexed_object(struct d2d_indexed_objects *objects, const GUID *id, IUnknown **object)
Definition: device.c:4560
D2D1_FEATURE
@ D2D1_FEATURE_DOUBLES
@ D2D1_FEATURE_D3D10_X_HARDWARE_OPTIONS
D2D1_PIXEL_OPTIONS
D2D1_VERTEX_OPTIONS
D2D1_CHANGE_TYPE
D2D1_CHANNEL_DEPTH
#define D2DERR_INSUFFICIENT_BUFFER
Definition: d2derr.h:23
D3D11_FEATURE
Definition: d3d11.idl:660
@ D3D11_FEATURE_DOUBLES
Definition: d3d11.idl:662
@ D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS
Definition: d3d11.idl:665
void * description
D3D_FEATURE_LEVEL
Definition: d3dcommon.idl:102
range
Definition: d3dx9_private.h:58
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static HRESULT STDMETHODCALLTYPE d2d_effect_image_QueryInterface(ID2D1Image *iface, REFIID iid, void **out)
Definition: effect.c:2178
static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateResourceTexture(ID2D1EffectContext *iface, const GUID *id, const D2D1_RESOURCE_TEXTURE_PROPERTIES *texture_properties, const BYTE *data, const UINT32 *strides, UINT32 data_size, ID2D1ResourceTexture **texture)
Definition: effect.c:1686
static void STDMETHODCALLTYPE d2d_blend_transform_GetDescription(ID2D1BlendTransform *iface, D2D1_BLEND_DESCRIPTION *description)
Definition: effect.c:300
static HRESULT STDMETHODCALLTYPE d2d_effect_context_CheckFeatureSupport(ID2D1EffectContext *iface, D2D1_FEATURE feature, void *data, UINT32 data_size)
Definition: effect.c:1779
static HRESULT STDMETHODCALLTYPE d2d_draw_info_SetResourceTexture(ID2D1DrawInfo *iface, UINT32 index, ID2D1ResourceTexture *texture)
Definition: effect.c:2532
static HRESULT STDMETHODCALLTYPE d2d_transform_graph_RemoveNode(ID2D1TransformGraph *iface, ID2D1TransformNode *object)
Definition: effect.c:792
static HRESULT d2d_offset_transform_create(D2D1_POINT_2L offset, ID2D1OffsetTransform **transform)
Definition: effect.c:208
static struct d2d_effect * impl_from_ID2D1Image(ID2D1Image *iface)
Definition: effect.c:2173
static HRESULT d2d_effect_return_string(const WCHAR *str, WCHAR *buffer, UINT32 buffer_size)
Definition: effect.c:1378
static HRESULT STDMETHODCALLTYPE d2d_draw_info_SetVertexShaderConstantBuffer(ID2D1DrawInfo *iface, const BYTE *buffer, UINT32 size)
Definition: effect.c:2540
static UINT32 STDMETHODCALLTYPE d2d_effect_GetPropertyIndex(ID2D1Effect *iface, const WCHAR *name)
Definition: effect.c:1963
static HRESULT d2d_effect_property_get_value(const struct d2d_effect_properties *properties, const struct d2d_effect_property *prop, D2D1_PROPERTY_TYPE type, BYTE *value, UINT32 size)
Definition: effect.c:1387
static HRESULT STDMETHODCALLTYPE d2d_effect_properties_GetValueByName(ID2D1Properties *iface, const WCHAR *name, D2D1_PROPERTY_TYPE type, BYTE *value, UINT32 value_size)
Definition: effect.c:2365
static HRESULT STDMETHODCALLTYPE d2d_effect_GetValue(ID2D1Effect *iface, UINT32 index, D2D1_PROPERTY_TYPE type, BYTE *value, UINT32 value_size)
Definition: effect.c:2013
static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateVertexBuffer(ID2D1EffectContext *iface, const D2D1_VERTEX_BUFFER_PROPERTIES *buffer_properties, const GUID *id, const D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES *custom_buffer_properties, ID2D1VertexBuffer **buffer)
Definition: effect.c:1704
static UINT32 STDMETHODCALLTYPE d2d_transform_graph_GetInputCount(ID2D1TransformGraph *iface)
Definition: effect.c:740
static void STDMETHODCALLTYPE d2d_blend_transform_SetCached(ID2D1BlendTransform *iface, BOOL is_cached)
Definition: effect.c:284
static HRESULT d2d_effect_get_value(struct d2d_effect *effect, UINT32 index, D2D1_PROPERTY_TYPE type, BYTE *value, UINT32 value_size)
Definition: effect.c:2007
static struct d2d_effect_context * impl_from_ID2D1EffectContext(ID2D1EffectContext *iface)
Definition: effect.c:1478
static HRESULT STDMETHODCALLTYPE d2d_effect_context_FindVertexBuffer(ID2D1EffectContext *iface, const GUID *id, ID2D1VertexBuffer **buffer)
Definition: effect.c:1731
static const WCHAR _2d_affine_transform_description[]
Definition: effect.c:1000
static const ID2D1VertexBufferVtbl d2d_vertex_buffer_vtbl
Definition: effect.c:104
static UINT32 STDMETHODCALLTYPE d2d_effect_properties_GetPropertyCount(ID2D1Properties *iface)
Definition: effect.c:2271
static UINT32 STDMETHODCALLTYPE d2d_effect_properties_GetValueSize(ID2D1Properties *iface, UINT32 index)
Definition: effect.c:2394
static ULONG STDMETHODCALLTYPE d2d_effect_AddRef(ID2D1Effect *iface)
Definition: effect.c:1899
static ULONG STDMETHODCALLTYPE d2d_effect_Release(ID2D1Effect *iface)
Definition: effect.c:1909
void d2d_effect_context_init(struct d2d_effect_context *effect_context, struct d2d_device_context *device_context)
Definition: effect.c:1840
static ULONG STDMETHODCALLTYPE d2d_transform_graph_Release(ID2D1TransformGraph *iface)
Definition: effect.c:723
static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadVertexShader(ID2D1EffectContext *iface, REFGUID shader_id, const BYTE *buffer, UINT32 buffer_size)
Definition: effect.c:1622
static ULONG STDMETHODCALLTYPE d2d_border_transform_Release(ID2D1BorderTransform *iface)
Definition: effect.c:375
static HRESULT STDMETHODCALLTYPE d2d_effect_SetInputCount(ID2D1Effect *iface, UINT32 count)
Definition: effect.c:2102
static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateBlendTransform(ID2D1EffectContext *iface, UINT32 num_inputs, const D2D1_BLEND_DESCRIPTION *description, ID2D1BlendTransform **transform)
Definition: effect.c:1563
static HRESULT STDMETHODCALLTYPE d2d_vertex_buffer_QueryInterface(ID2D1VertexBuffer *iface, REFIID iid, void **out)
Definition: effect.c:49
static HRESULT STDMETHODCALLTYPE d2d_effect_GetPropertyName(ID2D1Effect *iface, UINT32 index, WCHAR *name, UINT32 name_count)
Definition: effect.c:1934
static UINT32 STDMETHODCALLTYPE d2d_offset_transform_GetInputCount(ID2D1OffsetTransform *iface)
Definition: effect.c:170
static UINT32 STDMETHODCALLTYPE d2d_effect_GetValueSize(ID2D1Effect *iface, UINT32 index)
Definition: effect.c:2023
static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadComputeShader(ID2D1EffectContext *iface, REFGUID shader_id, const BYTE *buffer, UINT32 buffer_size)
Definition: effect.c:1649
static const ID2D1BorderTransformVtbl d2d_border_transform_vtbl
Definition: effect.c:467
HRESULT d2d_effect_create(struct d2d_device_context *context, const CLSID *effect_id, ID2D1Effect **effect)
Definition: effect.c:2660
static ULONG STDMETHODCALLTYPE d2d_offset_transform_AddRef(ID2D1OffsetTransform *iface)
Definition: effect.c:147
static HRESULT STDMETHODCALLTYPE d2d_draw_info_SetOutputBuffer(ID2D1DrawInfo *iface, D2D1_BUFFER_PRECISION precision, D2D1_CHANNEL_DEPTH depth)
Definition: effect.c:2505
static struct d2d_effect * impl_from_ID2D1Effect(ID2D1Effect *iface)
Definition: effect.c:1848
static void STDMETHODCALLTYPE d2d_border_transform_SetExtendModeX(ID2D1BorderTransform *iface, D2D1_EXTEND_MODE mode)
Definition: effect.c:409
static const ID2D1OffsetTransformVtbl d2d_offset_transform_vtbl
Definition: effect.c:198
static HRESULT d2d_effect_property_set_value(struct d2d_effect_properties *properties, struct d2d_effect_property *prop, D2D1_PROPERTY_TYPE type, const BYTE *value, UINT32 size)
Definition: effect.c:1429
static HRESULT STDMETHODCALLTYPE d2d_effect_GetSubProperties(ID2D1Effect *iface, UINT32 index, ID2D1Properties **props)
Definition: effect.c:2032
static HRESULT STDMETHODCALLTYPE d2d_vertex_buffer_Map(ID2D1VertexBuffer *iface, BYTE **data, UINT32 size)
Definition: effect.c:90
void d2d_effect_init_properties(struct d2d_effect *effect, struct d2d_effect_properties *properties)
Definition: effect.c:2440
static UINT32 STDMETHODCALLTYPE d2d_effect_GetPropertyNameLength(ID2D1Effect *iface, UINT32 index)
Definition: effect.c:1945
static D2D1_POINT_2L *STDMETHODCALLTYPE d2d_offset_transform_GetOffset(ID2D1OffsetTransform *iface, D2D1_POINT_2L *offset)
Definition: effect.c:187
static const WCHAR _3d_perspective_transform_description[]
Definition: effect.c:1012
static const WCHAR grayscale_description[]
Definition: effect.c:1062
static struct d2d_transform * impl_from_ID2D1BoundsAdjustmentTransform(ID2D1BoundsAdjustmentTransform *iface)
Definition: effect.c:38
static HRESULT STDMETHODCALLTYPE d2d_offset_transform_QueryInterface(ID2D1OffsetTransform *iface, REFIID iid, void **out)
Definition: effect.c:128
static void STDMETHODCALLTYPE d2d_effect_GetInput(ID2D1Effect *iface, UINT32 index, ID2D1Image **input)
Definition: effect.c:2120
static HRESULT d2d_effect_set_input_count(struct d2d_effect *effect, UINT32 count)
Definition: effect.c:2057
static ULONG STDMETHODCALLTYPE d2d_effect_context_Release(ID2D1EffectContext *iface)
Definition: effect.c:1511
static HRESULT d2d_effect_parse_float_array(D2D1_PROPERTY_TYPE type, const WCHAR *value, float *vec)
Definition: effect.c:1104
static void STDMETHODCALLTYPE d2d_offset_transform_SetOffset(ID2D1OffsetTransform *iface, D2D1_POINT_2L offset)
Definition: effect.c:177
static HRESULT STDMETHODCALLTYPE d2d_effect_impl_QueryInterface(ID2D1EffectImpl *iface, REFIID iid, void **out)
Definition: effect.c:939
static ULONG STDMETHODCALLTYPE d2d_vertex_buffer_AddRef(ID2D1VertexBuffer *iface)
Definition: effect.c:67
static HRESULT d2d_effect_duplicate_properties(struct d2d_effect *effect, struct d2d_effect_properties *dst, const struct d2d_effect_properties *src)
Definition: effect.c:1293
static struct d2d_vertex_buffer * impl_from_ID2D1VertexBuffer(ID2D1VertexBuffer *iface)
Definition: effect.c:44
static bool d2d_transform_node_needs_render_info(const struct d2d_transform_node *node)
Definition: effect.c:2602
static void STDMETHODCALLTYPE d2d_effect_image_GetFactory(ID2D1Image *iface, ID2D1Factory **factory)
Definition: effect.c:2205
static HRESULT STDMETHODCALLTYPE d2d_effect_impl_SetGraph(ID2D1EffectImpl *iface, ID2D1TransformGraph *graph)
Definition: effect.c:976
static ULONG STDMETHODCALLTYPE d2d_effect_properties_Release(ID2D1Properties *iface)
Definition: effect.c:2252
static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateOffsetTransform(ID2D1EffectContext *iface, D2D1_POINT_2L offset, ID2D1OffsetTransform **transform)
Definition: effect.c:1579
static struct d2d_effect_properties * impl_from_ID2D1Properties(ID2D1Properties *iface)
Definition: effect.c:2222
static HRESULT STDMETHODCALLTYPE d2d_effect_properties_GetValue(ID2D1Properties *iface, UINT32 index, D2D1_PROPERTY_TYPE type, BYTE *value, UINT32 value_size)
Definition: effect.c:2380
static HRESULT STDMETHODCALLTYPE d2d_effect_QueryInterface(ID2D1Effect *iface, REFIID iid, void **out)
Definition: effect.c:1871
static HRESULT STDMETHODCALLTYPE d2d_transform_graph_SetSingleTransformNode(ID2D1TransformGraph *iface, ID2D1TransformNode *object)
Definition: effect.c:749
static HRESULT STDMETHODCALLTYPE d2d_effect_context_QueryInterface(ID2D1EffectContext *iface, REFIID iid, void **out)
Definition: effect.c:1483
static ULONG STDMETHODCALLTYPE d2d_vertex_buffer_Release(ID2D1VertexBuffer *iface)
Definition: effect.c:77
static void STDMETHODCALLTYPE d2d_bounds_adjustment_transform_GetOutputBounds(ID2D1BoundsAdjustmentTransform *iface, D2D1_RECT_L *bounds)
Definition: effect.c:563
static void STDMETHODCALLTYPE d2d_draw_info_SetInstructionCountHint(ID2D1DrawInfo *iface, UINT32 count)
Definition: effect.c:2518
static UINT32 STDMETHODCALLTYPE d2d_blend_transform_GetInputCount(ID2D1BlendTransform *iface)
Definition: effect.c:267
static struct d2d_transform * impl_from_ID2D1BlendTransform(ID2D1BlendTransform *iface)
Definition: effect.c:28
static ULONG STDMETHODCALLTYPE d2d_effect_context_AddRef(ID2D1EffectContext *iface)
Definition: effect.c:1501
static HRESULT STDMETHODCALLTYPE d2d_effect_impl_PrepareForRender(ID2D1EffectImpl *iface, D2D1_CHANGE_TYPE type)
Definition: effect.c:971
static HRESULT d2d_bounds_adjustment_transform_create(const D2D1_RECT_L *rect, ID2D1BoundsAdjustmentTransform **transform)
Definition: effect.c:583
static struct d2d_transform_node * d2d_transform_graph_get_node(const struct d2d_transform_graph *graph, ID2D1TransformNode *object)
Definition: effect.c:602
static D2D1_PROPERTY_TYPE STDMETHODCALLTYPE d2d_effect_GetType(ID2D1Effect *iface, UINT32 index)
Definition: effect.c:1954
static HRESULT STDMETHODCALLTYPE d2d_border_transform_SetOutputBuffer(ID2D1BorderTransform *iface, D2D1_BUFFER_PRECISION precision, D2D1_CHANNEL_DEPTH depth)
Definition: effect.c:395
static HRESULT STDMETHODCALLTYPE d2d_draw_info_SetInputDescription(ID2D1DrawInfo *iface, UINT32 index, D2D1_INPUT_DESCRIPTION description)
Definition: effect.c:2497
static ULONG STDMETHODCALLTYPE d2d_effect_properties_AddRef(ID2D1Properties *iface)
Definition: effect.c:2242
static HRESULT d2d_transform_graph_add_node(struct d2d_transform_graph *graph, ID2D1TransformNode *object)
Definition: effect.c:616
static BOOL STDMETHODCALLTYPE d2d_effect_context_IsBufferPrecisionSupported(ID2D1EffectContext *iface, D2D1_BUFFER_PRECISION precision)
Definition: effect.c:1801
static void STDMETHODCALLTYPE d2d_border_transform_SetExtendModeY(ID2D1BorderTransform *iface, D2D1_EXTEND_MODE mode)
Definition: effect.c:428
static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateBoundsAdjustmentTransform(ID2D1EffectContext *iface, const D2D1_RECT_L *output_rect, ID2D1BoundsAdjustmentTransform **transform)
Definition: effect.c:1587
static HRESULT d2d_vertex_buffer_create(ID2D1VertexBuffer **buffer)
Definition: effect.c:113
static HRESULT STDMETHODCALLTYPE d2d_draw_info_SetPixelShaderConstantBuffer(ID2D1DrawInfo *iface, const BYTE *buffer, UINT32 size)
Definition: effect.c:2524
static ULONG STDMETHODCALLTYPE d2d_effect_image_AddRef(ID2D1Image *iface)
Definition: effect.c:2187
HRESULT d2d_effect_subproperties_add(struct d2d_effect_properties *props, const WCHAR *name, UINT32 index, D2D1_PROPERTY_TYPE type, const WCHAR *value)
Definition: effect.c:1287
static HRESULT STDMETHODCALLTYPE d2d_draw_info_SetVertexProcessing(ID2D1DrawInfo *iface, ID2D1VertexBuffer *buffer, D2D1_VERTEX_OPTIONS options, const D2D1_BLEND_DESCRIPTION *description, const D2D1_VERTEX_RANGE *range, const GUID *shader)
Definition: effect.c:2560
static void STDMETHODCALLTYPE d2d_effect_GetOutput(ID2D1Effect *iface, ID2D1Image **output)
Definition: effect.c:2141
static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateColorContext(ID2D1EffectContext *iface, D2D1_COLOR_SPACE space, const BYTE *profile, UINT32 profile_size, ID2D1ColorContext **color_context)
Definition: effect.c:1745
static const ID2D1EffectImplVtbl d2d_effect_impl_vtbl
Definition: effect.c:981
static void d2d_effect_cleanup(struct d2d_effect *effect)
Definition: effect.c:1853
static ULONG STDMETHODCALLTYPE d2d_effect_image_Release(ID2D1Image *iface)
Definition: effect.c:2196
struct d2d_effect_property * d2d_effect_properties_get_property_by_name(const struct d2d_effect_properties *properties, const WCHAR *name)
Definition: effect.c:1345
static void d2d_transform_graph_clear(struct d2d_transform_graph *graph)
Definition: effect.c:681
static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateEffect(ID2D1EffectContext *iface, REFCLSID clsid, ID2D1Effect **effect)
Definition: effect.c:1536
static HRESULT STDMETHODCALLTYPE d2d_effect_properties_GetSubProperties(ID2D1Properties *iface, UINT32 index, ID2D1Properties **props)
Definition: effect.c:2404
static HRESULT STDMETHODCALLTYPE d2d_effect_properties_SetValueByName(ID2D1Properties *iface, const WCHAR *name, D2D1_PROPERTY_TYPE type, const BYTE *value, UINT32 value_size)
Definition: effect.c:2336
static struct d2d_transform_graph * impl_from_ID2D1TransformGraph(ID2D1TransformGraph *iface)
Definition: effect.c:692
static UINT32 STDMETHODCALLTYPE d2d_effect_properties_GetPropertyNameLength(ID2D1Properties *iface, UINT32 index)
Definition: effect.c:2294
static const ID2D1BlendTransformVtbl d2d_blend_transform_vtbl
Definition: effect.c:310
static D2D1_PROPERTY_TYPE STDMETHODCALLTYPE d2d_effect_properties_GetType(ID2D1Properties *iface, UINT32 index)
Definition: effect.c:2308
static HRESULT STDMETHODCALLTYPE d2d_blend_transform_SetOutputBuffer(ID2D1BlendTransform *iface, D2D1_BUFFER_PRECISION precision, D2D1_CHANNEL_DEPTH depth)
Definition: effect.c:276
static const WCHAR shadow_description[]
Definition: effect.c:1050
static UINT32 d2d_effect_properties_get_value_size(const struct d2d_effect_properties *properties, UINT32 index)
Definition: effect.c:1359
static struct d2d_render_info * impl_from_ID2D1DrawInfo(ID2D1DrawInfo *iface)
Definition: effect.c:2448
static HRESULT d2d_effect_properties_internal_add(struct d2d_effect_properties *props, const WCHAR *name, UINT32 index, BOOL subprop, D2D1_PROPERTY_TYPE type, const WCHAR *value)
Definition: effect.c:1146
static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateBorderTransform(ID2D1EffectContext *iface, D2D1_EXTEND_MODE mode_x, D2D1_EXTEND_MODE mode_y, ID2D1BorderTransform **transform)
Definition: effect.c:1571
void d2d_effects_init_builtins(struct d2d_factory *factory)
Definition: effect.c:1074
static ULONG STDMETHODCALLTYPE d2d_transform_graph_AddRef(ID2D1TransformGraph *iface)
Definition: effect.c:713
static D2D1_EXTEND_MODE STDMETHODCALLTYPE d2d_border_transform_GetExtendModeX(ID2D1BorderTransform *iface)
Definition: effect.c:447
static HRESULT STDMETHODCALLTYPE d2d_effect_context_FindResourceTexture(ID2D1EffectContext *iface, const GUID *id, ID2D1ResourceTexture **texture)
Definition: effect.c:1696
void d2d_effect_properties_cleanup(struct d2d_effect_properties *props)
Definition: effect.c:1457
static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateTransformNodeFromEffect(ID2D1EffectContext *iface, ID2D1Effect *effect, ID2D1TransformNode **node)
Definition: effect.c:1555
static UINT32 STDMETHODCALLTYPE d2d_effect_properties_GetPropertyIndex(ID2D1Properties *iface, const WCHAR *name)
Definition: effect.c:2322
static HRESULT STDMETHODCALLTYPE d2d_transform_graph_SetOutputNode(ID2D1TransformGraph *iface, ID2D1TransformNode *object)
Definition: effect.c:807
static UINT32 STDMETHODCALLTYPE d2d_border_transform_GetInputCount(ID2D1BorderTransform *iface)
Definition: effect.c:388
static HRESULT STDMETHODCALLTYPE d2d_bounds_adjustment_transform_QueryInterface(ID2D1BoundsAdjustmentTransform *iface, REFIID iid, void **out)
Definition: effect.c:501
static const ID2D1PropertiesVtbl d2d_effect_properties_vtbl
Definition: effect.c:2422
static ULONG STDMETHODCALLTYPE d2d_bounds_adjustment_transform_AddRef(ID2D1BoundsAdjustmentTransform *iface)
Definition: effect.c:520
static HRESULT STDMETHODCALLTYPE d2d_border_transform_QueryInterface(ID2D1BorderTransform *iface, REFIID iid, void **out)
Definition: effect.c:345
static struct d2d_transform * impl_from_ID2D1BorderTransform(ID2D1BorderTransform *iface)
Definition: effect.c:33
static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateColorContextFromWicColorContext(ID2D1EffectContext *iface, IWICColorContext *wic_color_context, ID2D1ColorContext **color_context)
Definition: effect.c:1768
static UINT32 STDMETHODCALLTYPE d2d_effect_GetInputCount(ID2D1Effect *iface)
Definition: effect.c:2132
static HRESULT STDMETHODCALLTYPE d2d_transform_graph_QueryInterface(ID2D1TransformGraph *iface, REFIID iid, void **out)
Definition: effect.c:697
static HRESULT STDMETHODCALLTYPE builtin_factory_stub(IUnknown **effect_impl)
Definition: effect.c:991
static const ID2D1TransformGraphVtbl d2d_transform_graph_vtbl
Definition: effect.c:900
static HRESULT STDMETHODCALLTYPE d2d_effect_impl_Initialize(ID2D1EffectImpl *iface, ID2D1EffectContext *context, ID2D1TransformGraph *graph)
Definition: effect.c:965
static HRESULT STDMETHODCALLTYPE d2d_transform_graph_SetPassthroughGraph(ID2D1TransformGraph *iface, UINT32 index)
Definition: effect.c:883
static HRESULT STDMETHODCALLTYPE d2d_draw_info_QueryInterface(ID2D1DrawInfo *iface, REFIID iid, void **obj)
Definition: effect.c:2453
static D2D1_EXTEND_MODE STDMETHODCALLTYPE d2d_border_transform_GetExtendModeY(ID2D1BorderTransform *iface)
Definition: effect.c:457
static ULONG STDMETHODCALLTYPE d2d_effect_impl_Release(ID2D1EffectImpl *iface)
Definition: effect.c:960
static HRESULT STDMETHODCALLTYPE d2d_effect_properties_GetPropertyName(ID2D1Properties *iface, UINT32 index, WCHAR *name, UINT32 name_count)
Definition: effect.c:2280
static void STDMETHODCALLTYPE d2d_effect_SetInput(ID2D1Effect *iface, UINT32 index, ID2D1Image *input, BOOL invalidate)
Definition: effect.c:2042
static void d2d_transform_graph_delete_node(struct d2d_transform_graph *graph, struct d2d_transform_node *node)
Definition: effect.c:655
static HRESULT STDMETHODCALLTYPE d2d_effect_properties_QueryInterface(ID2D1Properties *iface, REFIID riid, void **obj)
Definition: effect.c:2227
static struct d2d_transform * impl_from_ID2D1OffsetTransform(ID2D1OffsetTransform *iface)
Definition: effect.c:23
static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadPixelShader(ID2D1EffectContext *iface, REFGUID shader_id, const BYTE *buffer, UINT32 buffer_size)
Definition: effect.c:1595
static ULONG STDMETHODCALLTYPE d2d_blend_transform_AddRef(ID2D1BlendTransform *iface)
Definition: effect.c:244
static ULONG STDMETHODCALLTYPE d2d_draw_info_AddRef(ID2D1DrawInfo *iface)
Definition: effect.c:2474
static struct d2d_effect_property * d2d_effect_properties_get_property_by_index(const struct d2d_effect_properties *properties, UINT32 index)
Definition: effect.c:1331
static HRESULT STDMETHODCALLTYPE d2d_transform_graph_AddNode(ID2D1TransformGraph *iface, ID2D1TransformNode *object)
Definition: effect.c:779
static HRESULT d2d_effect_transform_graph_initialize_nodes(struct d2d_transform_graph *graph)
Definition: effect.c:2625
static const ID2D1EffectContextVtbl d2d_effect_context_vtbl
Definition: effect.c:1812
HRESULT d2d_effect_properties_add(struct d2d_effect_properties *props, const WCHAR *name, UINT32 index, D2D1_PROPERTY_TYPE type, const WCHAR *value)
Definition: effect.c:1281
static HRESULT STDMETHODCALLTYPE d2d_effect_GetValueByName(ID2D1Effect *iface, const WCHAR *name, D2D1_PROPERTY_TYPE type, BYTE *value, UINT32 value_size)
Definition: effect.c:1995
static HRESULT STDMETHODCALLTYPE d2d_transform_graph_ConnectNode(ID2D1TransformGraph *iface, ID2D1TransformNode *from_node, ID2D1TransformNode *to_node, UINT32 index)
Definition: effect.c:824
static void STDMETHODCALLTYPE d2d_border_transform_SetCached(ID2D1BorderTransform *iface, BOOL is_cached)
Definition: effect.c:403
static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateColorContextFromFilename(ID2D1EffectContext *iface, const WCHAR *filename, ID2D1ColorContext **color_context)
Definition: effect.c:1757
HRESULT d2d_effect_property_get_uint32_value(const struct d2d_effect_properties *properties, const struct d2d_effect_property *prop, UINT32 *value)
Definition: effect.c:1422
static const ID2D1ImageVtbl d2d_effect_image_vtbl
Definition: effect.c:2214
static UINT32 STDMETHODCALLTYPE d2d_effect_GetPropertyCount(ID2D1Effect *iface)
Definition: effect.c:1925
static const ID2D1EffectVtbl d2d_effect_vtbl
Definition: effect.c:2150
static HRESULT STDMETHODCALLTYPE d2d_effect_SetValue(ID2D1Effect *iface, UINT32 index, D2D1_PROPERTY_TYPE type, const BYTE *value, UINT32 value_size)
Definition: effect.c:1984
static HRESULT STDMETHODCALLTYPE d2d_vertex_buffer_Unmap(ID2D1VertexBuffer *iface)
Definition: effect.c:97
static const ID2D1BoundsAdjustmentTransformVtbl d2d_bounds_adjustment_transform_vtbl
Definition: effect.c:573
static ULONG STDMETHODCALLTYPE d2d_bounds_adjustment_transform_Release(ID2D1BoundsAdjustmentTransform *iface)
Definition: effect.c:531
static HRESULT STDMETHODCALLTYPE d2d_effect_context_GetMaximumSupportedFeatureLevel(ID2D1EffectContext *iface, const D3D_FEATURE_LEVEL *levels, UINT32 level_count, D3D_FEATURE_LEVEL *max_level)
Definition: effect.c:1547
static HRESULT STDMETHODCALLTYPE d2d_effect_properties_SetValue(ID2D1Properties *iface, UINT32 index, D2D1_PROPERTY_TYPE type, const BYTE *value, UINT32 value_size)
Definition: effect.c:2351
static BOOL STDMETHODCALLTYPE d2d_effect_context_IsShaderLoaded(ID2D1EffectContext *iface, REFGUID shader_id)
Definition: effect.c:1676
static HRESULT d2d_blend_transform_create(UINT32 input_count, const D2D1_BLEND_DESCRIPTION *blend_desc, ID2D1BlendTransform **transform)
Definition: effect.c:322
static HRESULT STDMETHODCALLTYPE d2d_blend_transform_QueryInterface(ID2D1BlendTransform *iface, REFIID iid, void **out)
Definition: effect.c:224
static HRESULT STDMETHODCALLTYPE d2d_draw_info_SetPixelShader(ID2D1DrawInfo *iface, REFGUID id, D2D1_PIXEL_OPTIONS options)
Definition: effect.c:2548
static void STDMETHODCALLTYPE d2d_blend_transform_SetDescription(ID2D1BlendTransform *iface, const D2D1_BLEND_DESCRIPTION *description)
Definition: effect.c:290
static void STDMETHODCALLTYPE d2d_effect_context_GetDpi(ID2D1EffectContext *iface, float *dpi_x, float *dpi_y)
Definition: effect.c:1527
static UINT32 STDMETHODCALLTYPE d2d_bounds_adjustment_transform_GetInputCount(ID2D1BoundsAdjustmentTransform *iface)
Definition: effect.c:545
static ULONG STDMETHODCALLTYPE d2d_effect_impl_AddRef(ID2D1EffectImpl *iface)
Definition: effect.c:955
static const WCHAR composite_description[]
Definition: effect.c:1024
static HRESULT STDMETHODCALLTYPE d2d_transform_graph_ConnectToEffectInput(ID2D1TransformGraph *iface, UINT32 input_index, ID2D1TransformNode *object, UINT32 node_index)
Definition: effect.c:848
static void STDMETHODCALLTYPE d2d_transform_graph_Clear(ID2D1TransformGraph *iface)
Definition: effect.c:874
static HRESULT d2d_effect_render_info_create(struct d2d_render_info **obj)
Definition: effect.c:2587
static const WCHAR crop_description[]
Definition: effect.c:1037
static ULONG STDMETHODCALLTYPE d2d_border_transform_AddRef(ID2D1BorderTransform *iface)
Definition: effect.c:365
static void STDMETHODCALLTYPE d2d_draw_info_SetCached(ID2D1DrawInfo *iface, BOOL is_cached)
Definition: effect.c:2513
static HRESULT STDMETHODCALLTYPE d2d_effect_SetValueByName(ID2D1Effect *iface, const WCHAR *name, D2D1_PROPERTY_TYPE type, const BYTE *value, UINT32 value_size)
Definition: effect.c:1972
static ULONG STDMETHODCALLTYPE d2d_offset_transform_Release(ID2D1OffsetTransform *iface)
Definition: effect.c:157
static ULONG STDMETHODCALLTYPE d2d_draw_info_Release(ID2D1DrawInfo *iface)
Definition: effect.c:2484
static HRESULT d2d_transform_graph_create(UINT32 input_count, struct d2d_transform_graph **graph)
Definition: effect.c:916
static void STDMETHODCALLTYPE d2d_bounds_adjustment_transform_SetOutputBounds(ID2D1BoundsAdjustmentTransform *iface, const D2D1_RECT_L *bounds)
Definition: effect.c:553
static const ID2D1DrawInfoVtbl d2d_draw_info_vtbl
Definition: effect.c:2571
static HRESULT d2d_border_transform_create(D2D1_EXTEND_MODE mode_x, D2D1_EXTEND_MODE mode_y, ID2D1BorderTransform **transform)
Definition: effect.c:481
static ULONG STDMETHODCALLTYPE d2d_blend_transform_Release(ID2D1BlendTransform *iface)
Definition: effect.c:254
static void d2d_transform_node_disconnect(struct d2d_transform_node *node)
Definition: effect.c:637
INT WINAPI StringFromGUID2(REFGUID guid, LPOLESTR str, INT cmax)
Definition: combase.c:1525
HRESULT WINAPI CLSIDFromString(LPCOLESTR str, LPCLSID clsid)
Definition: combase.c:1470
#define assert(_expr)
Definition: assert.h:32
_ACRTIMP float __cdecl wcstof(const wchar_t *, wchar_t **)
Definition: strtod.cpp:114
_ACRTIMP __msvcrt_ulong __cdecl wcstoul(const wchar_t *, wchar_t **, int)
Definition: wcs.c:2917
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
FT_Vector * vec
Definition: ftbbox.c:469
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint GLenum GLenum transform
Definition: glext.h:9407
GLenum GLuint texture
Definition: glext.h:6295
GLenum src
Definition: glext.h:6340
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
GLuint shader
Definition: glext.h:6030
GLuint index
Definition: glext.h:6031
GLenum mode
Definition: glext.h:6217
GLenum GLenum dst
Definition: glext.h:6340
GLsizei levels
Definition: glext.h:7884
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLint GLint * precision
Definition: glext.h:7539
GLenum GLenum GLenum input
Definition: glext.h:9031
GLuint id
Definition: glext.h:5910
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static int reg
Definition: i386-dis.c:1290
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
const char * filename
Definition: ioapi.h:137
uint32_t entry
Definition: isohybrid.c:63
#define d
Definition: ke_i.h:81
#define debugstr_guid
Definition: kernel32.h:35
#define profile
Definition: kernel32.h:12
#define debugstr_w
Definition: kernel32.h:32
#define wine_dbgstr_w
Definition: kernel32.h:34
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
INTERNETFEATURELIST feature
Definition: misc.c:1807
static const struct @662 sizes[]
const CLSID * clsid
Definition: msctf.cpp:50
IID CLSID
Definition: mstsclib_i.c:62
#define BOOL
Definition: nt_native.h:43
short WCHAR
Definition: pedump.c:58
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
#define calloc
Definition: rosglue.h:14
const WCHAR * str
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:181
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:236
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:242
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
CardRegion * from
Definition: spigame.cpp:19
wchar_t const *const size_t const buffer_size
Definition: stat.cpp:95
Definition: dcommon.idl:28
Definition: scsiwmi.h:51
Definition: http.c:7252
ID2D1EffectContext ID2D1EffectContext_iface
Definition: d2d1_private.h:630
struct d2d_device_context * device_context
Definition: d2d1_private.h:633
struct d2d_effect_property * properties
Definition: d2d1_private.h:662
ID2D1Properties ID2D1Properties_iface
Definition: d2d1_private.h:658
struct d2d_effect * effect
Definition: d2d1_private.h:660
PD2D1_PROPERTY_SET_FUNCTION set_function
Definition: d2d1_private.h:651
D2D1_PROPERTY_TYPE type
Definition: d2d1_private.h:642
PD2D1_PROPERTY_GET_FUNCTION get_function
Definition: d2d1_private.h:652
union d2d_effect_property::@250 data
struct d2d_effect_properties * subproperties
Definition: d2d1_private.h:653
ID2D1Image ID2D1Image_iface
Definition: d2d1_private.h:790
ID2D1EffectImpl * impl
Definition: d2d1_private.h:793
size_t inputs_size
Definition: d2d1_private.h:798
ID2D1Effect ID2D1Effect_iface
Definition: d2d1_private.h:789
struct d2d_effect_properties properties
Definition: d2d1_private.h:794
struct d2d_effect_context * effect_context
Definition: d2d1_private.h:795
struct d2d_transform_graph * graph
Definition: d2d1_private.h:796
ID2D1Image ** inputs
Definition: d2d1_private.h:797
size_t input_count
Definition: d2d1_private.h:799
unsigned int mask
Definition: d2d1_private.h:751
ID2D1DrawInfo ID2D1DrawInfo_iface
Definition: d2d1_private.h:748
ID2D1TransformGraph ID2D1TransformGraph_iface
Definition: d2d1_private.h:773
unsigned int input_count
Definition: d2d1_private.h:777
ID2D1TransformNode * object
Definition: d2d1_private.h:758
struct d2d_transform_node * output
Definition: d2d1_private.h:762
struct d2d_transform_node ** inputs
Definition: d2d1_private.h:760
unsigned int input_count
Definition: d2d1_private.h:761
D2D1_BLEND_DESCRIPTION blend_desc
Definition: d2d1_private.h:729
ID2D1TransformNode ID2D1TransformNode_iface
Definition: d2d1_private.h:723
D2D1_EXTEND_MODE mode_y
Definition: d2d1_private.h:733
D2D1_EXTEND_MODE mode_x
Definition: d2d1_private.h:732
D2D1_RECT_L bounds
Definition: d2d1_private.h:735
UINT32 input_count
Definition: d2d1_private.h:738
ID2D1VertexBuffer ID2D1VertexBuffer_iface
Definition: d2d1_private.h:818
char * name
Definition: wpp.c:52
Definition: devices.h:37
Definition: main.c:439
Definition: graph.c:32
LONG refcount
Definition: amstream.c:2173
Definition: name.c:39
static void invalidate()
static BOOL initialized
Definition: syslog.c:39
int32_t INT32
Definition: typedefs.h:58
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t UINT32
Definition: typedefs.h:59
uint32_t ULONG
Definition: typedefs.h:59
Definition: dlist.c:348
Definition: pdh_main.c:64
static const WCHAR props[]
Definition: wbemdisp.c:288
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
#define D2DERR_EFFECT_IS_NOT_REGISTERED
Definition: winerror.h:7391
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define E_NOINTERFACE
Definition: winerror.h:3479
#define D2DERR_INVALID_PROPERTY
Definition: winerror.h:7392
#define E_UNEXPECTED
Definition: winerror.h:3528
#define D2DERR_NO_SUBPROPERTIES
Definition: winerror.h:7393
#define ERROR_NOT_FOUND
Definition: winerror.h:1014
unsigned char BYTE
Definition: xxhash.c:193