1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 use ctypes::c_void;
7 use shared::basetsd::UINT32;
8 use shared::dxgiformat::DXGI_FORMAT;
9 use shared::guiddef::{GUID, REFCLSID, REFGUID};
10 use shared::minwindef::{BOOL, BYTE, FLOAT};
11 use shared::ntdef::{HRESULT, PCSTR, PCWSTR};
12 use um::d2d1::D2D1_EXTEND_MODE;
13 use um::d2d1_1::{
14     D2D1_BUFFER_PRECISION, D2D1_COLOR_SPACE, ID2D1Bitmap1, ID2D1ColorContext, ID2D1Effect,
15 };
16 use um::d2dbasetypes::{D2D_POINT_2L, D2D_POINT_2U, D2D_RECT_L};
17 use um::d3dcommon::D3D_FEATURE_LEVEL;
18 use um::unknwnbase::{IUnknown, IUnknownVtbl};
19 use um::wincodec::IWICColorContext;
20 FN!{stdcall PD2D1_PROPERTY_SET_FUNCTION(
21     effect: *const IUnknown,
22     data: *const BYTE,
23     dataSize: UINT32,
24 ) -> HRESULT}
25 FN!{stdcall PD2D1_PROPERTY_GET_FUNCTION(
26     effect: *const IUnknown,
27     data: *mut BYTE,
28     dataSize: UINT32,
29     actualSize: *mut UINT32,
30 ) -> HRESULT}
31 ENUM!{enum D2D1_CHANGE_TYPE {
32     D2D1_CHANGE_TYPE_NONE = 0,
33     D2D1_CHANGE_TYPE_PROPERTIES = 1,
34     D2D1_CHANGE_TYPE_CONTEXT = 2,
35     D2D1_CHANGE_TYPE_GRAPH = 3,
36 }}
37 ENUM!{enum D2D1_PIXEL_OPTIONS {
38     D2D1_PIXEL_OPTIONS_NONE = 0,
39     D2D1_PIXEL_OPTIONS_TRIVIAL_SAMPLING = 1,
40 }}
41 ENUM!{enum D2D1_VERTEX_OPTIONS {
42     D2D1_VERTEX_OPTIONS_NONE = 0,
43     D2D1_VERTEX_OPTIONS_DO_NOT_CLEAR = 1,
44     D2D1_VERTEX_OPTIONS_USE_DEPTH_BUFFER = 2,
45     D2D1_VERTEX_OPTIONS_ASSUME_NO_OVERLAP = 4,
46 }}
47 ENUM!{enum D2D1_VERTEX_USAGE {
48     D2D1_VERTEX_USAGE_STATIC = 0,
49     D2D1_VERTEX_USAGE_DYNAMIC = 1,
50 }}
51 ENUM!{enum D2D1_BLEND_OPERATION {
52     D2D1_BLEND_OPERATION_ADD = 1,
53     D2D1_BLEND_OPERATION_SUBTRACT = 2,
54     D2D1_BLEND_OPERATION_REV_SUBTRACT = 3,
55     D2D1_BLEND_OPERATION_MIN = 4,
56     D2D1_BLEND_OPERATION_MAX = 5,
57 }}
58 ENUM!{enum D2D1_BLEND {
59     D2D1_BLEND_ZERO = 1,
60     D2D1_BLEND_ONE = 2,
61     D2D1_BLEND_SRC_COLOR = 3,
62     D2D1_BLEND_INV_SRC_COLOR = 4,
63     D2D1_BLEND_SRC_ALPHA = 5,
64     D2D1_BLEND_INV_SRC_ALPHA = 6,
65     D2D1_BLEND_DEST_ALPHA = 7,
66     D2D1_BLEND_INV_DEST_ALPHA = 8,
67     D2D1_BLEND_DEST_COLOR = 9,
68     D2D1_BLEND_INV_DEST_COLOR = 10,
69     D2D1_BLEND_SRC_ALPHA_SAT = 11,
70     D2D1_BLEND_BLEND_FACTOR = 14,
71     D2D1_BLEND_INV_BLEND_FACTOR = 15,
72 }}
73 ENUM!{enum D2D1_CHANNEL_DEPTH {
74     D2D1_CHANNEL_DEPTH_DEFAULT = 0,
75     D2D1_CHANNEL_DEPTH_1 = 1,
76     D2D1_CHANNEL_DEPTH_4 = 4,
77 }}
78 ENUM!{enum D2D1_FILTER {
79     D2D1_FILTER_MIN_MAG_MIP_POINT = 0x00,
80     D2D1_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x01,
81     D2D1_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x04,
82     D2D1_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x05,
83     D2D1_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10,
84     D2D1_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11,
85     D2D1_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14,
86     D2D1_FILTER_MIN_MAG_MIP_LINEAR = 0x15,
87     D2D1_FILTER_ANISOTROPIC = 0x55,
88 }}
89 ENUM!{enum D2D1_FEATURE {
90     D2D1_FEATURE_DOUBLES = 0,
91     D2D1_FEATURE_D3D10_X_HARDWARE_OPTIONS = 1,
92 }}
93 STRUCT!{struct D2D1_PROPERTY_BINDING {
94     propertyName: PCWSTR,
95     setFunction: PD2D1_PROPERTY_SET_FUNCTION,
96     getFunction: PD2D1_PROPERTY_GET_FUNCTION,
97 }}
98 STRUCT!{struct D2D1_RESOURCE_TEXTURE_PROPERTIES {
99     extents: *const UINT32,
100     dimensions: UINT32,
101     bufferPrecision: D2D1_BUFFER_PRECISION,
102     channelDepth: D2D1_CHANNEL_DEPTH,
103     filter: D2D1_FILTER,
104     extendModes: *const D2D1_EXTEND_MODE,
105 }}
106 STRUCT!{struct D2D1_INPUT_ELEMENT_DESC {
107     semanticName: PCSTR,
108     semanticIndex: UINT32,
109     format: DXGI_FORMAT,
110     inputSlot: UINT32,
111     alignedByteOffset: UINT32,
112 }}
113 pub const D2D1_APPEND_ALIGNED_ELEMENT: UINT32 = 0xffffffff;
114 STRUCT!{struct D2D1_VERTEX_BUFFER_PROPERTIES {
115     inputCount: UINT32,
116     usage: D2D1_VERTEX_USAGE,
117     data: *const BYTE,
118     byteWidth: UINT32,
119 }}
120 STRUCT!{struct D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES {
121     shaderBufferWithInputSignature: *const BYTE,
122     shaderBufferSize: UINT32,
123     inputElements: *const D2D1_INPUT_ELEMENT_DESC,
124     elementCount: UINT32,
125     stride: UINT32,
126 }}
127 STRUCT!{struct D2D1_VERTEX_RANGE {
128     startVertex: UINT32,
129     vertexCount: UINT32,
130 }}
131 STRUCT!{struct D2D1_BLEND_DESCRIPTION {
132     sourceBlend: D2D1_BLEND,
133     destinationBlend: D2D1_BLEND,
134     blendOperation: D2D1_BLEND_OPERATION,
135     sourceBlendAlpha: D2D1_BLEND,
136     destinationBlendAlpha: D2D1_BLEND,
137     blendOperationAlpha: D2D1_BLEND_OPERATION,
138     blendFactor: [FLOAT; 4],
139 }}
140 STRUCT!{struct D2D1_INPUT_DESCRIPTION {
141     filter: D2D1_FILTER,
142     leveOfDetailCount: UINT32,
143 }}
144 STRUCT!{struct D2D1_FEATURE_DATA_DOUBLES {
145     doublePrecisionFloatShaderOps: BOOL,
146 }}
147 STRUCT!{struct D2D1_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS {
148     computeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x: BOOL,
149 }}
150 DEFINE_GUID!{IID_ID2D1VertexBuffer,
151     0x9b8b1336, 0x00a5, 0x4668, 0x92, 0xb7, 0xce, 0xd5, 0xd8, 0xbf, 0x9b, 0x7b}
152 DEFINE_GUID!{IID_ID2D1ResourceTexture,
153     0x688d15c3, 0x02b0, 0x438d, 0xb1, 0x3a, 0xd1, 0xb4, 0x4c, 0x32, 0xc3, 0x9a}
154 DEFINE_GUID!{IID_ID2D1RenderInfo,
155     0x519ae1bd, 0xd19a, 0x420d, 0xb8, 0x49, 0x36, 0x4f, 0x59, 0x47, 0x76, 0xb7}
156 DEFINE_GUID!{IID_ID2D1DrawInfo,
157     0x693ce632, 0x7f2f, 0x45de, 0x93, 0xfe, 0x18, 0xd8, 0x8b, 0x37, 0xaa, 0x21}
158 DEFINE_GUID!{IID_ID2D1ComputeInfo,
159     0x5598b14b, 0x9fd7, 0x48b7, 0x9b, 0xdb, 0x8f, 0x09, 0x64, 0xeb, 0x38, 0xbc}
160 DEFINE_GUID!{IID_ID2D1TransformNode,
161     0xb2efe1e7, 0x729f, 0x4102, 0x94, 0x9f, 0x50, 0x5f, 0xa2, 0x1b, 0xf6, 0x66}
162 DEFINE_GUID!{IID_ID2D1TransformGraph,
163     0x13d29038, 0xc3e6, 0x4034, 0x90, 0x81, 0x13, 0xb5, 0x3a, 0x41, 0x79, 0x92}
164 DEFINE_GUID!{IID_ID2D1Transform,
165     0xef1a287d, 0x342a, 0x4f76, 0x8f, 0xdb, 0xda, 0x0d, 0x6e, 0xa9, 0xf9, 0x2b}
166 DEFINE_GUID!{IID_ID2D1DrawTransform,
167     0x36bfdcb6, 0x9739, 0x435d, 0xa3, 0x0d, 0xa6, 0x53, 0xbe, 0xff, 0x6a, 0x6f}
168 DEFINE_GUID!{IID_ID2D1ComputeTransform,
169     0x0d85573c, 0x01e3, 0x4f7d, 0xbf, 0xd9, 0x0d, 0x60, 0x60, 0x8b, 0xf3, 0xc3}
170 DEFINE_GUID!{IID_ID2D1AnalysisTransform,
171     0x0359dc30, 0x95e6, 0x4568, 0x90, 0x55, 0x27, 0x72, 0x0d, 0x13, 0x0e, 0x93}
172 DEFINE_GUID!{IID_ID2D1SourceTransform,
173     0xdb1800dd, 0x0c34, 0x4cf9, 0xbe, 0x90, 0x31, 0xcc, 0x0a, 0x56, 0x53, 0xe1}
174 DEFINE_GUID!{IID_ID2D1ConcreteTransform,
175     0x1a799d8a, 0x69f7, 0x4e4c, 0x9f, 0xed, 0x43, 0x7c, 0xcc, 0x66, 0x84, 0xcc}
176 DEFINE_GUID!{IID_ID2D1BlendTransform,
177     0x63ac0b32, 0xba44, 0x450f, 0x88, 0x06, 0x7f, 0x4c, 0xa1, 0xff, 0x2f, 0x1b}
178 DEFINE_GUID!{IID_ID2D1BorderTransform,
179     0x4998735c, 0x3a19, 0x473c, 0x97, 0x81, 0x65, 0x68, 0x47, 0xe3, 0xa3, 0x47}
180 DEFINE_GUID!{IID_ID2D1OffsetTransform,
181     0x3fe6adea, 0x7643, 0x4f53, 0xbd, 0x14, 0xa0, 0xce, 0x63, 0xf2, 0x40, 0x42}
182 DEFINE_GUID!{IID_ID2D1BoundsAdjustmentTransform,
183     0x90f732e2, 0x5092, 0x4606, 0xa8, 0x19, 0x86, 0x51, 0x97, 0x0b, 0xac, 0xcd}
184 DEFINE_GUID!{IID_ID2D1EffectImpl,
185     0xa248fd3f, 0x3e6c, 0x4e63, 0x9f, 0x03, 0x7f, 0x68, 0xec, 0xc9, 0x1d, 0xb9}
186 DEFINE_GUID!{IID_ID2D1EffectContext,
187     0x3d9f916b, 0x27dc, 0x4ad7, 0xb4, 0xf1, 0x64, 0x94, 0x53, 0x40, 0xf5, 0x63}
188 RIDL!{#[uuid(0x9b8b1336, 0x00a5, 0x4668, 0x92, 0xb7, 0xce, 0xd5, 0xd8, 0xbf, 0x9b, 0x7b)]
189 interface ID2D1VertexBuffer(ID2D1VertexBufferVtbl): IUnknown(IUnknownVtbl) {
190     fn Map(
191         data: *mut *mut BYTE,
192     ) -> HRESULT,
193     fn Unmap() -> HRESULT,
194 }}
195 RIDL!{#[uuid(0x688d15c3, 0x02b0, 0x438d, 0xb1, 0x3a, 0xd1, 0xb4, 0x4c, 0x32, 0xc3, 0x9a)]
196 interface ID2D1ResourceTexture(ID2D1ResourceTextureVtbl): IUnknown(IUnknownVtbl) {
197     fn Update(
198         minimumExtents: *const UINT32,
199         maximumExtents: *const UINT32,
200         strides: *const UINT32,
201         dimensions: UINT32,
202         data: *const BYTE,
203         dataCount: UINT32,
204     ) -> HRESULT,
205 }}
206 RIDL!{#[uuid(0x519ae1bd, 0xd19a, 0x420d, 0xb8, 0x49, 0x36, 0x4f, 0x59, 0x47, 0x76, 0xb7)]
207 interface ID2D1RenderInfo(ID2D1RenderInfoVtbl): IUnknown(IUnknownVtbl) {
208     fn SetInputDescription(
209         inputIndex: UINT32,
210         inputDescription: D2D1_INPUT_DESCRIPTION,
211     ) -> HRESULT,
212     fn SetOutputBuffer(
213         bufferPrecision: D2D1_BUFFER_PRECISION,
214         channelDepth: D2D1_CHANNEL_DEPTH,
215     ) -> HRESULT,
216     fn SetCached(
217         isCached: BOOL,
218     ) -> (),
219     fn SetInstructionCountHint(
220         instructionCount: UINT32,
221     ) -> (),
222 }}
223 RIDL!{#[uuid(0x693ce632, 0x7f2f, 0x45de, 0x93, 0xfe, 0x18, 0xd8, 0x8b, 0x37, 0xaa, 0x21)]
224 interface ID2D1DrawInfo(ID2D1DrawInfoVtbl): ID2D1RenderInfo(ID2D1RenderInfoVtbl) {
225     fn SetPixelShaderConstantBuffer(
226         buffer: *const BYTE,
227         bufferCount: UINT32,
228     ) -> HRESULT,
229     fn SetResourceTexture(
230         textureIndex: UINT32,
231         resourceTexture: *mut ID2D1ResourceTexture,
232     ) -> HRESULT,
233     fn SetVertexShaderConstantBuffer(
234         buffer: *const BYTE,
235         bufferCount: UINT32,
236     ) -> HRESULT,
237     fn SetPixelShader(
238         shaderId: REFGUID,
239         pixelOptions: D2D1_PIXEL_OPTIONS,
240     ) -> HRESULT,
241     fn SetVertexProcessing(
242         vertexBuffer: *mut ID2D1VertexBuffer,
243         vertexOptions: D2D1_VERTEX_OPTIONS,
244         blendDescription: *const D2D1_BLEND_DESCRIPTION,
245         vertexRange: *const D2D1_VERTEX_RANGE,
246         vertexShader: *const GUID,
247     ) -> HRESULT,
248 }}
249 RIDL!{#[uuid(0x5598b14b, 0x9fd7, 0x48b7, 0x9b, 0xdb, 0x8f, 0x09, 0x64, 0xeb, 0x38, 0xbc)]
250 interface ID2D1ComputeInfo(ID2D1ComputeInfoVtbl): ID2D1RenderInfo(ID2D1RenderInfoVtbl) {
251     fn SetComputeShaderConstantBuffer(
252         buffer: *const BYTE,
253         bufferCount: UINT32,
254     ) -> HRESULT,
255     fn SetComputeShader(
256         shaderId: REFGUID,
257     ) -> HRESULT,
258     fn SetResourceTexture(
259         textureIndex: UINT32,
260         resourceTexture: *mut ID2D1ResourceTexture,
261     ) -> HRESULT,
262 }}
263 RIDL!{#[uuid(0xb2efe1e7, 0x729f, 0x4102, 0x94, 0x9f, 0x50, 0x5f, 0xa2, 0x1b, 0xf6, 0x66)]
264 interface ID2D1TransformNode(ID2D1TransformNodeVtbl): IUnknown(IUnknownVtbl) {
265     fn GetInputCount() -> UINT32,
266 }}
267 RIDL!{#[uuid(0x13d29038, 0xc3e6, 0x4034, 0x90, 0x81, 0x13, 0xb5, 0x3a, 0x41, 0x79, 0x92)]
268 interface ID2D1TransformGraph(ID2D1TransformGraphVtbl): IUnknown(IUnknownVtbl) {
269     fn GetInputCount() -> UINT32,
270     fn SetSingleTransformNode(
271         node: *mut ID2D1TransformNode,
272     ) -> HRESULT,
273     fn AddNode(
274         node: *mut ID2D1TransformNode,
275     ) -> HRESULT,
276     fn RemoveNode(
277         node: *mut ID2D1TransformNode,
278     ) -> HRESULT,
279     fn SetOutputNode(
280         node: *mut ID2D1TransformNode,
281     ) -> HRESULT,
282     fn ConnectNode(
283         fromNode: *mut ID2D1TransformNode,
284         toNode: *mut ID2D1TransformNode,
285         toNodeInputIndex: UINT32,
286     ) -> HRESULT,
287     fn ConnectToEffectInput(
288         toEffectInputIndex: UINT32,
289         node: *mut ID2D1TransformNode,
290         toNodeInputIndex: UINT32,
291     ) -> HRESULT,
292     fn Clear() -> (),
293     fn SetPassthroughGraph(
294         effectInputIndex: UINT32,
295     ) -> HRESULT,
296 }}
297 RIDL!{#[uuid(0xef1a287d, 0x342a, 0x4f76, 0x8f, 0xdb, 0xda, 0x0d, 0x6e, 0xa9, 0xf9, 0x2b)]
298 interface ID2D1Transform(ID2D1TransformVtbl): ID2D1TransformNode(ID2D1TransformNodeVtbl) {
299     fn MapOutputRectToInputRects(
300         outputRect: *const D2D_RECT_L,
301         inputRects: *mut D2D_RECT_L,
302         inputRectsCount: UINT32,
303     ) -> HRESULT,
304     fn MapInputRectsToOutputRect(
305         inputRects: *const D2D_RECT_L,
306         inputOpaqueSubRects: *const D2D_RECT_L,
307         inputRectCount: UINT32,
308         outputRect: *mut D2D_RECT_L,
309         outputOpaqueSubRect: *mut D2D_RECT_L,
310     ) -> HRESULT,
311     fn MapInvalidRect(
312         inputIndex: UINT32,
313         invalidInputRect: D2D_RECT_L,
314         invalidOutputRect: *mut D2D_RECT_L,
315     ) -> HRESULT,
316 }}
317 RIDL!{#[uuid(0x36bfdcb6, 0x9739, 0x435d, 0xa3, 0x0d, 0xa6, 0x53, 0xbe, 0xff, 0x6a, 0x6f)]
318 interface ID2D1DrawTransform(ID2D1DrawTransformVtbl): ID2D1Transform(ID2D1TransformVtbl) {
319     fn SetDrawInfo(
320         drawInfo: *mut ID2D1DrawInfo,
321     ) -> HRESULT,
322 }}
323 RIDL!{#[uuid(0x0d85573c, 0x01e3, 0x4f7d, 0xbf, 0xd9, 0x0d, 0x60, 0x60, 0x8b, 0xf3, 0xc3)]
324 interface ID2D1ComputeTransform(ID2D1ComputeTransformVtbl): ID2D1Transform(ID2D1TransformVtbl) {
325     fn SetComputeInfo(
326         computeInfo: *mut ID2D1ComputeInfo,
327     ) -> HRESULT,
328     fn CalculateThreadgroups(
329         outputRect: *const D2D_RECT_L,
330         dimensionX: *mut UINT32,
331         dimensionY: *mut UINT32,
332         dimensionZ: *mut UINT32,
333     ) -> HRESULT,
334 }}
335 RIDL!{#[uuid(0x0359dc30, 0x95e6, 0x4568, 0x90, 0x55, 0x27, 0x72, 0x0d, 0x13, 0x0e, 0x93)]
336 interface ID2D1AnalysisTransform(ID2D1AnalysisTransformVtbl): IUnknown(IUnknownVtbl) {
337     fn ProcessAnalysisResults(
338         analysisData: *const BYTE,
339         analysisDataCount: UINT32,
340     ) -> HRESULT,
341 }}
342 RIDL!{#[uuid(0xdb1800dd, 0x0c34, 0x4cf9, 0xbe, 0x90, 0x31, 0xcc, 0x0a, 0x56, 0x53, 0xe1)]
343 interface ID2D1SourceTransform(ID2D1SourceTransformVtbl): ID2D1Transform(ID2D1TransformVtbl) {
344     fn SetRenderInfo(
345         renderInfo: *mut ID2D1RenderInfo,
346     ) -> HRESULT,
347     fn Draw(
348         target: *mut ID2D1Bitmap1,
349         drawRect: *mut D2D_RECT_L,
350         targetOrigin: D2D_POINT_2U,
351     ) -> HRESULT,
352 }}
353 RIDL!{#[uuid(0x1a799d8a, 0x69f7, 0x4e4c, 0x9f, 0xed, 0x43, 0x7c, 0xcc, 0x66, 0x84, 0xcc)]
354 interface ID2D1ConcreteTransform(ID2D1ConcreteTransformVtbl):
355     ID2D1TransformNode(ID2D1TransformNodeVtbl) {
356     fn SetOutputBuffer(
357         bufferPrecision: D2D1_BUFFER_PRECISION,
358         channelDepth: D2D1_CHANNEL_DEPTH,
359     ) -> HRESULT,
360     fn SetCached(
361         isCached: BOOL,
362     ) -> (),
363 }}
364 RIDL!{#[uuid(0x63ac0b32, 0xba44, 0x450f, 0x88, 0x06, 0x7f, 0x4c, 0xa1, 0xff, 0x2f, 0x1b)]
365 interface ID2D1BlendTransform(ID2D1BlendTransformVtbl):
366     ID2D1ConcreteTransform(ID2D1ConcreteTransformVtbl) {
367     fn SetDescription(
368         description: *const D2D1_BLEND_DESCRIPTION,
369     ) -> (),
370     fn GetDescription(
371         description: *mut D2D1_BLEND_DESCRIPTION,
372     ) -> (),
373 }}
374 RIDL!{#[uuid(0x4998735c, 0x3a19, 0x473c, 0x97, 0x81, 0x65, 0x68, 0x47, 0xe3, 0xa3, 0x47)]
375 interface ID2D1BorderTransform(ID2D1BorderTransformVtbl):
376     ID2D1ConcreteTransform(ID2D1ConcreteTransformVtbl) {
377     fn SetExtendModeX(
378         extendMode: D2D1_EXTEND_MODE,
379     ) -> (),
380     fn SetExtendModeY(
381         extendMode: D2D1_EXTEND_MODE,
382     ) -> (),
383     fn GetExtendModeX() -> D2D1_EXTEND_MODE,
384     fn GetExtendModeY() -> D2D1_EXTEND_MODE,
385 }}
386 RIDL!{#[uuid(0x3fe6adea, 0x7643, 0x4f53, 0xbd, 0x14, 0xa0, 0xce, 0x63, 0xf2, 0x40, 0x42)]
387 interface ID2D1OffsetTransform(ID2D1OffsetTransformVtbl):
388     ID2D1TransformNode(ID2D1TransformNodeVtbl) {
389     fn SetOffset(
390         offset: D2D_POINT_2L,
391     ) -> (),
392     fn GetOffset() -> D2D_POINT_2L,
393 }}
394 RIDL!{#[uuid(0x90f732e2, 0x5092, 0x4606, 0xa8, 0x19, 0x86, 0x51, 0x97, 0x0b, 0xac, 0xcd)]
395 interface ID2D1BoundsAdjustmentTransform(ID2D1BoundsAdjustmentTransformVtbl):
396     ID2D1TransformNode(ID2D1TransformNodeVtbl) {
397     fn SetOutputBounds(
398         outputBounds: *const D2D_RECT_L,
399     ) -> (),
400     fn GetOutputBounds(
401         outputBounds: *mut D2D_RECT_L,
402     ) -> (),
403 }}
404 RIDL!{#[uuid(0xa248fd3f, 0x3e6c, 0x4e63, 0x9f, 0x03, 0x7f, 0x68, 0xec, 0xc9, 0x1d, 0xb9)]
405 interface ID2D1EffectImpl(ID2D1EffectImplVtbl): IUnknown(IUnknownVtbl) {
406     fn Initialize(
407         effectContext: *mut ID2D1EffectContext,
408         transformGraph: *mut ID2D1TransformGraph,
409     ) -> HRESULT,
410     fn PrepareForRender(
411         changeType: D2D1_CHANGE_TYPE,
412     ) -> HRESULT,
413     fn SetGraph(
414         transformGraph: *mut ID2D1TransformGraph,
415     ) -> HRESULT,
416 }}
417 RIDL!{#[uuid(0x3d9f916b, 0x27dc, 0x4ad7, 0xb4, 0xf1, 0x64, 0x94, 0x53, 0x40, 0xf5, 0x63)]
418 interface ID2D1EffectContext(ID2D1EffectContextVtbl): IUnknown(IUnknownVtbl) {
419     fn GetDpi(
420         dpiX: *mut FLOAT,
421         dpiY: *mut FLOAT,
422     ) -> (),
423     fn CreateEffect(
424         effectId: REFCLSID,
425         effect: *mut *mut ID2D1Effect,
426     ) -> HRESULT,
427     fn GetMaximumSupportedFeatureLevel(
428         featureLevels: *const D3D_FEATURE_LEVEL,
429         featureLevelsCount: UINT32,
430         maximumSupportedFeatureLevel: *mut D3D_FEATURE_LEVEL,
431     ) -> HRESULT,
432     fn CreateTransformNodeFromEffect(
433         effect: *mut ID2D1Effect,
434         transformNode: *mut *mut ID2D1TransformNode,
435     ) -> HRESULT,
436     fn CreateBlendTransform(
437         numInputs: UINT32,
438         blendDescription: D2D1_BLEND_DESCRIPTION,
439         transform: *mut *mut ID2D1BlendTransform,
440     ) -> HRESULT,
441     fn CreateBorderTransform(
442         extendModeX: D2D1_EXTEND_MODE,
443         extendModeY: D2D1_EXTEND_MODE,
444         transform: *mut *mut ID2D1BorderTransform,
445     ) -> HRESULT,
446     fn CreateOffsetTransform(
447         offset: D2D_POINT_2L,
448         transform: *mut *mut ID2D1OffsetTransform,
449     ) -> HRESULT,
450     fn CreateBoundsAdjustmentTransform(
451         outputRectangle: *mut D2D_RECT_L,
452         transform: ID2D1BoundsAdjustmentTransform,
453     ) -> HRESULT,
454     fn LoadPixelShader(
455         shaderId: REFGUID,
456         shaderBuffer: *const BYTE,
457         shaderBufferCount: UINT32,
458     ) -> HRESULT,
459     fn LoadVertexShader(
460         resourceId: REFGUID,
461         shaderBuffer: *const BYTE,
462         shaderBufferCount: UINT32,
463     ) -> HRESULT,
464     fn LoadComputeShader(
465         resourceId: REFGUID,
466         shaderBuffer: *const BYTE,
467         shaderBufferCount: UINT32,
468     ) -> HRESULT,
469     fn IsShaderLoaded(
470         shaderId: REFGUID,
471     ) -> BOOL,
472     fn CreateResourceTexture(
473         resourceId: *const GUID,
474         resourceTextureProperties: *const D2D1_RESOURCE_TEXTURE_PROPERTIES,
475         data: *const BYTE,
476         strides: *const UINT32,
477         dataSize: UINT32,
478         resourceTexture: *mut *mut ID2D1ResourceTexture,
479     ) -> HRESULT,
480     fn FindResourceTexture(
481         resourceId: *const GUID,
482         resourceTexture: *mut *mut ID2D1ResourceTexture,
483     ) -> HRESULT,
484     fn CreateVertexBuffer(
485         vertexBufferProperties: *const D2D1_VERTEX_BUFFER_PROPERTIES,
486         resourceId: *const GUID,
487         customVertexBufferProperties: *const D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES,
488         buffer: *mut *mut ID2D1VertexBuffer,
489     ) -> HRESULT,
490     fn FindVertexBuffer(
491         resourceId: *const GUID,
492         buffer: *mut *mut ID2D1VertexBuffer,
493     ) -> HRESULT,
494     fn CreateColorContext(
495         space: D2D1_COLOR_SPACE,
496         profile: *const BYTE,
497         profileSize: UINT32,
498         colorContext: *mut *mut ID2D1ColorContext,
499     ) -> HRESULT,
500     fn CreateColorContextFromFilename(
501         filename: PCWSTR,
502         colorContext: *mut *mut ID2D1ColorContext,
503     ) -> HRESULT,
504     fn CreateColorContextFromWicColorContext(
505         wicColorContext: *mut IWICColorContext,
506         colorContext: *mut *mut ID2D1ColorContext,
507     ) -> HRESULT,
508     fn CheckFeatureSupport(
509         feature: D2D1_FEATURE,
510         featureSupportData: *mut c_void,
511         featureSupportDataSize: UINT32,
512     ) -> HRESULT,
513     fn IsBufferPrecisionSupported(
514         bufferPrecision: D2D1_BUFFER_PRECISION,
515     ) -> BOOL,
516 }}
517