d2d1: Reuse VS constant buffer object.
[wine.git] / dlls / d2d1 / d2d1_private.h
blob81a46c8a7ce85495666c82568dda8244e840cda2
1 /*
2 * Copyright 2014 Henri Verbeet for CodeWeavers
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.
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.
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
19 #ifndef __WINE_D2D1_PRIVATE_H
20 #define __WINE_D2D1_PRIVATE_H
22 #include "wine/debug.h"
23 #include "wine/heap.h"
25 #include <assert.h>
26 #include <limits.h>
27 #include <math.h>
28 #define COBJMACROS
29 #include "d2d1_2.h"
30 #include "d3d11.h"
31 #ifdef D2D1_INIT_GUID
32 #include "initguid.h"
33 #endif
34 #include "dwrite_2.h"
36 enum d2d_brush_type
38 D2D_BRUSH_TYPE_SOLID,
39 D2D_BRUSH_TYPE_LINEAR,
40 D2D_BRUSH_TYPE_RADIAL,
41 D2D_BRUSH_TYPE_BITMAP,
42 D2D_BRUSH_TYPE_COUNT,
45 enum d2d_shape_type
47 D2D_SHAPE_TYPE_OUTLINE,
48 D2D_SHAPE_TYPE_BEZIER_OUTLINE,
49 D2D_SHAPE_TYPE_ARC_OUTLINE,
50 D2D_SHAPE_TYPE_TRIANGLE,
51 D2D_SHAPE_TYPE_CURVE,
52 D2D_SHAPE_TYPE_COUNT,
55 struct d2d_settings
57 unsigned int max_version_factory;
59 extern struct d2d_settings d2d_settings DECLSPEC_HIDDEN;
61 struct d2d_clip_stack
63 D2D1_RECT_F *stack;
64 size_t size;
65 size_t count;
68 struct d2d_error_state
70 HRESULT code;
71 D2D1_TAG tag1, tag2;
74 struct d2d_shape_resources
76 ID3D10InputLayout *il;
77 ID3D10VertexShader *vs;
80 struct d2d_brush_cb
82 enum d2d_brush_type type;
83 float opacity;
84 unsigned int pad[2];
85 union
87 struct
89 D2D1_COLOR_F colour;
90 } solid;
91 struct
93 D2D1_POINT_2F start;
94 D2D1_POINT_2F end;
95 unsigned int stop_count;
96 } linear;
97 struct
99 D2D1_POINT_2F centre;
100 D2D1_POINT_2F offset;
101 D2D1_POINT_2F ra;
102 D2D1_POINT_2F rb;
103 unsigned int stop_count;
104 float pad[3];
105 } radial;
106 struct
108 float _11, _21, _31, pad;
109 float _12, _22, _32;
110 BOOL ignore_alpha;
111 } bitmap;
112 } u;
115 struct d2d_ps_cb
117 BOOL outline;
118 BOOL is_arc;
119 BOOL pad[2];
120 struct d2d_brush_cb colour_brush;
121 struct d2d_brush_cb opacity_brush;
124 struct d2d_vec4
126 float x, y, z, w;
129 struct d2d_vs_cb
131 struct
133 float _11, _21, _31, pad0;
134 float _12, _22, _32, stroke_width;
135 } transform_geometry;
136 struct d2d_vec4 transform_rtx;
137 struct d2d_vec4 transform_rty;
140 struct d2d_device_context_ops
142 HRESULT (*device_context_present)(IUnknown *outer_unknown);
145 enum d2d_device_context_sampler_limits
147 D2D_SAMPLER_INTERPOLATION_MODE_COUNT = 2,
148 D2D_SAMPLER_EXTEND_MODE_COUNT = 3,
151 struct d2d_device_context
153 ID2D1DeviceContext ID2D1DeviceContext_iface;
154 ID2D1GdiInteropRenderTarget ID2D1GdiInteropRenderTarget_iface;
155 IDWriteTextRenderer IDWriteTextRenderer_iface;
156 IUnknown IUnknown_iface;
157 LONG refcount;
159 IUnknown *outer_unknown;
160 const struct d2d_device_context_ops *ops;
162 ID2D1Factory *factory;
163 ID2D1Device *device;
164 ID3D10Device *d3d_device;
165 struct d2d_bitmap *target;
166 ID3D10StateBlock *stateblock;
167 struct d2d_shape_resources shape_resources[D2D_SHAPE_TYPE_COUNT];
168 ID3D10Buffer *vs_cb;
169 ID3D10PixelShader *ps;
170 ID3D10Buffer *ps_cb;
171 ID3D10Buffer *ib;
172 unsigned int vb_stride;
173 ID3D10Buffer *vb;
174 ID3D10RasterizerState *rs;
175 ID3D10BlendState *bs;
176 ID3D10SamplerState *sampler_states
177 [D2D_SAMPLER_INTERPOLATION_MODE_COUNT]
178 [D2D_SAMPLER_EXTEND_MODE_COUNT]
179 [D2D_SAMPLER_EXTEND_MODE_COUNT];
181 struct d2d_error_state error;
182 D2D1_DRAWING_STATE_DESCRIPTION1 drawing_state;
183 IDWriteRenderingParams *text_rendering_params;
184 IDWriteRenderingParams *default_text_rendering_params;
186 D2D1_RENDER_TARGET_PROPERTIES desc;
187 D2D1_SIZE_U pixel_size;
188 struct d2d_clip_stack clip_stack;
191 HRESULT d2d_d3d_create_render_target(ID2D1Device *device, IDXGISurface *surface, IUnknown *outer_unknown,
192 const struct d2d_device_context_ops *ops, const D2D1_RENDER_TARGET_PROPERTIES *desc,
193 void **render_target) DECLSPEC_HIDDEN;
195 static inline BOOL d2d_device_context_is_dxgi_target(const struct d2d_device_context *context)
197 return !context->ops;
200 struct d2d_wic_render_target
202 IUnknown IUnknown_iface;
203 LONG refcount;
205 IDXGISurface *dxgi_surface;
206 ID2D1RenderTarget *dxgi_target;
207 IUnknown *dxgi_inner;
208 ID3D10Texture2D *readback_texture;
209 IWICBitmap *bitmap;
211 unsigned int width;
212 unsigned int height;
213 unsigned int bpp;
216 HRESULT d2d_wic_render_target_init(struct d2d_wic_render_target *render_target, ID2D1Factory1 *factory,
217 ID3D10Device1 *d3d_device, IWICBitmap *bitmap, const D2D1_RENDER_TARGET_PROPERTIES *desc) DECLSPEC_HIDDEN;
219 struct d2d_dc_render_target
221 ID2D1DCRenderTarget ID2D1DCRenderTarget_iface;
222 LONG refcount;
224 IDXGISurface1 *dxgi_surface;
225 D2D1_PIXEL_FORMAT pixel_format;
226 ID3D10Device1 *d3d_device;
227 ID2D1RenderTarget *dxgi_target;
228 IUnknown *dxgi_inner;
230 RECT dst_rect;
231 HDC hdc;
234 HRESULT d2d_dc_render_target_init(struct d2d_dc_render_target *render_target, ID2D1Factory1 *factory,
235 ID3D10Device1 *d3d_device, const D2D1_RENDER_TARGET_PROPERTIES *desc) DECLSPEC_HIDDEN;
237 struct d2d_hwnd_render_target
239 ID2D1HwndRenderTarget ID2D1HwndRenderTarget_iface;
240 LONG refcount;
242 ID2D1RenderTarget *dxgi_target;
243 IUnknown *dxgi_inner;
244 IDXGISwapChain *swapchain;
245 UINT sync_interval;
246 HWND hwnd;
249 HRESULT d2d_hwnd_render_target_init(struct d2d_hwnd_render_target *render_target, ID2D1Factory1 *factory,
250 ID3D10Device1 *d3d_device, const D2D1_RENDER_TARGET_PROPERTIES *desc,
251 const D2D1_HWND_RENDER_TARGET_PROPERTIES *hwnd_desc) DECLSPEC_HIDDEN;
253 struct d2d_bitmap_render_target
255 ID2D1BitmapRenderTarget ID2D1BitmapRenderTarget_iface;
256 LONG refcount;
258 ID2D1RenderTarget *dxgi_target;
259 IUnknown *dxgi_inner;
260 ID2D1Bitmap *bitmap;
263 HRESULT d2d_bitmap_render_target_init(struct d2d_bitmap_render_target *render_target,
264 const struct d2d_device_context *parent_target, const D2D1_SIZE_F *size,
265 const D2D1_SIZE_U *pixel_size, const D2D1_PIXEL_FORMAT *format,
266 D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options) DECLSPEC_HIDDEN;
268 struct d2d_gradient
270 ID2D1GradientStopCollection ID2D1GradientStopCollection_iface;
271 LONG refcount;
273 ID2D1Factory *factory;
274 ID3D10ShaderResourceView *view;
275 D2D1_GRADIENT_STOP *stops;
276 UINT32 stop_count;
279 HRESULT d2d_gradient_create(ID2D1Factory *factory, ID3D10Device *device, const D2D1_GRADIENT_STOP *stops,
280 UINT32 stop_count, D2D1_GAMMA gamma, D2D1_EXTEND_MODE extend_mode,
281 struct d2d_gradient **gradient) DECLSPEC_HIDDEN;
283 struct d2d_brush
285 ID2D1Brush ID2D1Brush_iface;
286 LONG refcount;
288 ID2D1Factory *factory;
289 float opacity;
290 D2D1_MATRIX_3X2_F transform;
292 enum d2d_brush_type type;
293 union
295 struct
297 D2D1_COLOR_F color;
298 } solid;
299 struct
301 struct d2d_gradient *gradient;
302 D2D1_POINT_2F start;
303 D2D1_POINT_2F end;
304 } linear;
305 struct
307 struct d2d_gradient *gradient;
308 D2D1_POINT_2F centre;
309 D2D1_POINT_2F offset;
310 D2D1_POINT_2F radius;
311 } radial;
312 struct
314 struct d2d_bitmap *bitmap;
315 D2D1_EXTEND_MODE extend_mode_x;
316 D2D1_EXTEND_MODE extend_mode_y;
317 D2D1_INTERPOLATION_MODE interpolation_mode;
318 } bitmap;
319 } u;
322 HRESULT d2d_solid_color_brush_create(ID2D1Factory *factory, const D2D1_COLOR_F *color,
323 const D2D1_BRUSH_PROPERTIES *desc, struct d2d_brush **brush) DECLSPEC_HIDDEN;
324 HRESULT d2d_linear_gradient_brush_create(ID2D1Factory *factory,
325 const D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *gradient_desc, const D2D1_BRUSH_PROPERTIES *brush_desc,
326 ID2D1GradientStopCollection *gradient, struct d2d_brush **brush) DECLSPEC_HIDDEN;
327 HRESULT d2d_radial_gradient_brush_create(ID2D1Factory *factory,
328 const D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES *gradient_desc, const D2D1_BRUSH_PROPERTIES *brush_desc,
329 ID2D1GradientStopCollection *gradient, struct d2d_brush **brush) DECLSPEC_HIDDEN;
330 HRESULT d2d_bitmap_brush_create(ID2D1Factory *factory, ID2D1Bitmap *bitmap,
331 const D2D1_BITMAP_BRUSH_PROPERTIES1 *bitmap_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc,
332 struct d2d_brush **brush) DECLSPEC_HIDDEN;
333 void d2d_brush_bind_resources(struct d2d_brush *brush, struct d2d_device_context *context,
334 unsigned int brush_idx) DECLSPEC_HIDDEN;
335 BOOL d2d_brush_fill_cb(const struct d2d_brush *brush, struct d2d_brush_cb *cb) DECLSPEC_HIDDEN;
336 struct d2d_brush *unsafe_impl_from_ID2D1Brush(ID2D1Brush *iface) DECLSPEC_HIDDEN;
338 struct d2d_stroke_style
340 ID2D1StrokeStyle ID2D1StrokeStyle_iface;
341 LONG refcount;
343 ID2D1Factory *factory;
344 D2D1_STROKE_STYLE_PROPERTIES desc;
345 float *dashes;
346 UINT32 dash_count;
349 HRESULT d2d_stroke_style_init(struct d2d_stroke_style *style, ID2D1Factory *factory,
350 const D2D1_STROKE_STYLE_PROPERTIES *desc, const float *dashes, UINT32 dash_count) DECLSPEC_HIDDEN;
352 struct d2d_layer
354 ID2D1Layer ID2D1Layer_iface;
355 LONG refcount;
357 ID2D1Factory *factory;
358 D2D1_SIZE_F size;
361 HRESULT d2d_layer_create(ID2D1Factory *factory, const D2D1_SIZE_F *size, struct d2d_layer **layer) DECLSPEC_HIDDEN;
363 struct d2d_mesh
365 ID2D1Mesh ID2D1Mesh_iface;
366 LONG refcount;
368 ID2D1Factory *factory;
371 HRESULT d2d_mesh_create(ID2D1Factory *factory, struct d2d_mesh **mesh) DECLSPEC_HIDDEN;
373 struct d2d_bitmap
375 ID2D1Bitmap1 ID2D1Bitmap1_iface;
376 LONG refcount;
378 ID2D1Factory *factory;
379 ID3D10ShaderResourceView *srv;
380 ID3D10RenderTargetView *rtv;
381 IDXGISurface *surface;
382 ID3D10Resource *resource;
383 D2D1_SIZE_U pixel_size;
384 D2D1_PIXEL_FORMAT format;
385 float dpi_x;
386 float dpi_y;
387 D2D1_BITMAP_OPTIONS options;
390 HRESULT d2d_bitmap_create(struct d2d_device_context *context, D2D1_SIZE_U size, const void *src_data,
391 UINT32 pitch, const D2D1_BITMAP_PROPERTIES1 *desc, struct d2d_bitmap **bitmap) DECLSPEC_HIDDEN;
392 HRESULT d2d_bitmap_create_shared(struct d2d_device_context *context, REFIID iid, void *data,
393 const D2D1_BITMAP_PROPERTIES1 *desc, struct d2d_bitmap **bitmap) DECLSPEC_HIDDEN;
394 HRESULT d2d_bitmap_create_from_wic_bitmap(struct d2d_device_context *context, IWICBitmapSource *bitmap_source,
395 const D2D1_BITMAP_PROPERTIES1 *desc, struct d2d_bitmap **bitmap) DECLSPEC_HIDDEN;
396 struct d2d_bitmap *unsafe_impl_from_ID2D1Bitmap(ID2D1Bitmap *iface) DECLSPEC_HIDDEN;
398 struct d2d_state_block
400 ID2D1DrawingStateBlock1 ID2D1DrawingStateBlock1_iface;
401 LONG refcount;
403 ID2D1Factory *factory;
404 D2D1_DRAWING_STATE_DESCRIPTION1 drawing_state;
405 IDWriteRenderingParams *text_rendering_params;
408 void d2d_state_block_init(struct d2d_state_block *state_block, ID2D1Factory *factory,
409 const D2D1_DRAWING_STATE_DESCRIPTION1 *desc, IDWriteRenderingParams *text_rendering_params) DECLSPEC_HIDDEN;
410 struct d2d_state_block *unsafe_impl_from_ID2D1DrawingStateBlock(ID2D1DrawingStateBlock *iface) DECLSPEC_HIDDEN;
412 enum d2d_geometry_state
414 D2D_GEOMETRY_STATE_INITIAL = 0,
415 D2D_GEOMETRY_STATE_ERROR,
416 D2D_GEOMETRY_STATE_OPEN,
417 D2D_GEOMETRY_STATE_CLOSED,
418 D2D_GEOMETRY_STATE_FIGURE,
421 struct d2d_curve_vertex
423 D2D1_POINT_2F position;
424 struct
426 float u, v, sign;
427 } texcoord;
430 struct d2d_face
432 UINT16 v[3];
435 struct d2d_outline_vertex
437 D2D1_POINT_2F position;
438 D2D1_POINT_2F prev;
439 D2D1_POINT_2F next;
442 struct d2d_curve_outline_vertex
444 D2D1_POINT_2F position;
445 D2D1_POINT_2F p0, p1, p2;
446 D2D1_POINT_2F prev, next;
449 struct d2d_geometry
451 ID2D1Geometry ID2D1Geometry_iface;
452 LONG refcount;
454 ID2D1Factory *factory;
456 D2D_MATRIX_3X2_F transform;
458 struct
460 D2D1_POINT_2F *vertices;
461 size_t vertex_count;
463 struct d2d_face *faces;
464 size_t faces_size;
465 size_t face_count;
467 struct d2d_curve_vertex *bezier_vertices;
468 size_t bezier_vertices_size;
469 size_t bezier_vertex_count;
471 struct d2d_curve_vertex *arc_vertices;
472 size_t arc_vertices_size;
473 size_t arc_vertex_count;
474 } fill;
476 struct
478 struct d2d_outline_vertex *vertices;
479 size_t vertices_size;
480 size_t vertex_count;
482 struct d2d_face *faces;
483 size_t faces_size;
484 size_t face_count;
486 struct d2d_curve_outline_vertex *beziers;
487 size_t beziers_size;
488 size_t bezier_count;
490 struct d2d_face *bezier_faces;
491 size_t bezier_faces_size;
492 size_t bezier_face_count;
494 struct d2d_curve_outline_vertex *arcs;
495 size_t arcs_size;
496 size_t arc_count;
498 struct d2d_face *arc_faces;
499 size_t arc_faces_size;
500 size_t arc_face_count;
501 } outline;
503 union
505 struct
507 D2D1_ELLIPSE ellipse;
508 } ellipse;
509 struct
511 ID2D1GeometrySink ID2D1GeometrySink_iface;
513 struct d2d_figure *figures;
514 size_t figures_size;
515 size_t figure_count;
517 enum d2d_geometry_state state;
518 D2D1_FILL_MODE fill_mode;
519 UINT32 segment_count;
521 D2D1_RECT_F bounds;
522 } path;
523 struct
525 D2D1_RECT_F rect;
526 } rectangle;
527 struct
529 D2D1_ROUNDED_RECT rounded_rect;
530 } rounded_rectangle;
531 struct
533 ID2D1Geometry *src_geometry;
534 D2D_MATRIX_3X2_F transform;
535 } transformed;
536 struct
538 ID2D1Geometry **src_geometries;
539 UINT32 geometry_count;
540 D2D1_FILL_MODE fill_mode;
541 } group;
542 } u;
545 HRESULT d2d_ellipse_geometry_init(struct d2d_geometry *geometry,
546 ID2D1Factory *factory, const D2D1_ELLIPSE *ellipse) DECLSPEC_HIDDEN;
547 void d2d_path_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *factory) DECLSPEC_HIDDEN;
548 HRESULT d2d_rectangle_geometry_init(struct d2d_geometry *geometry,
549 ID2D1Factory *factory, const D2D1_RECT_F *rect) DECLSPEC_HIDDEN;
550 HRESULT d2d_rounded_rectangle_geometry_init(struct d2d_geometry *geometry,
551 ID2D1Factory *factory, const D2D1_ROUNDED_RECT *rounded_rect) DECLSPEC_HIDDEN;
552 void d2d_transformed_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *factory,
553 ID2D1Geometry *src_geometry, const D2D_MATRIX_3X2_F *transform) DECLSPEC_HIDDEN;
554 HRESULT d2d_geometry_group_init(struct d2d_geometry *geometry, ID2D1Factory *factory,
555 D2D1_FILL_MODE fill_mode, ID2D1Geometry **src_geometries, unsigned int geometry_count) DECLSPEC_HIDDEN;
556 struct d2d_geometry *unsafe_impl_from_ID2D1Geometry(ID2D1Geometry *iface) DECLSPEC_HIDDEN;
558 struct d2d_device
560 ID2D1Device ID2D1Device_iface;
561 LONG refcount;
562 ID2D1Factory1 *factory;
563 IDXGIDevice *dxgi_device;
566 void d2d_device_init(struct d2d_device *device, ID2D1Factory1 *factory, IDXGIDevice *dxgi_device) DECLSPEC_HIDDEN;
568 struct d2d_effect
570 ID2D1Effect ID2D1Effect_iface;
571 LONG refcount;
574 void d2d_effect_init(struct d2d_effect *effect) DECLSPEC_HIDDEN;
576 static inline BOOL d2d_array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
578 size_t new_capacity, max_capacity;
579 void *new_elements;
581 if (count <= *capacity)
582 return TRUE;
584 max_capacity = ~(SIZE_T)0 / size;
585 if (count > max_capacity)
586 return FALSE;
588 new_capacity = max(4, *capacity);
589 while (new_capacity < count && new_capacity <= max_capacity / 2)
590 new_capacity *= 2;
591 if (new_capacity < count)
592 new_capacity = max_capacity;
594 if (!(new_elements = heap_realloc(*elements, new_capacity * size)))
595 return FALSE;
597 *elements = new_elements;
598 *capacity = new_capacity;
599 return TRUE;
602 static inline void d2d_matrix_multiply(D2D_MATRIX_3X2_F *a, const D2D_MATRIX_3X2_F *b)
604 D2D_MATRIX_3X2_F tmp = *a;
606 a->_11 = tmp._11 * b->_11 + tmp._12 * b->_21;
607 a->_12 = tmp._11 * b->_12 + tmp._12 * b->_22;
608 a->_21 = tmp._21 * b->_11 + tmp._22 * b->_21;
609 a->_22 = tmp._21 * b->_12 + tmp._22 * b->_22;
610 a->_31 = tmp._31 * b->_11 + tmp._32 * b->_21 + b->_31;
611 a->_32 = tmp._31 * b->_12 + tmp._32 * b->_22 + b->_32;
614 /* Dst must be different from src. */
615 static inline BOOL d2d_matrix_invert(D2D_MATRIX_3X2_F *dst, const D2D_MATRIX_3X2_F *src)
617 float d = src->_11 * src->_22 - src->_21 * src->_12;
619 if (d == 0.0f)
620 return FALSE;
621 dst->_11 = src->_22 / d;
622 dst->_21 = -src->_21 / d;
623 dst->_31 = (src->_21 * src->_32 - src->_31 * src->_22) / d;
624 dst->_12 = -src->_12 / d;
625 dst->_22 = src->_11 / d;
626 dst->_32 = -(src->_11 * src->_32 - src->_31 * src->_12) / d;
628 return TRUE;
631 static inline void d2d_point_set(D2D1_POINT_2F *dst, float x, float y)
633 dst->x = x;
634 dst->y = y;
637 static inline float d2d_point_dot(const D2D1_POINT_2F *p0, const D2D1_POINT_2F *p1)
639 return p0->x * p1->x + p0->y * p1->y;
642 static inline void d2d_point_transform(D2D1_POINT_2F *dst, const D2D1_MATRIX_3X2_F *matrix, float x, float y)
644 dst->x = x * matrix->_11 + y * matrix->_21 + matrix->_31;
645 dst->y = x * matrix->_12 + y * matrix->_22 + matrix->_32;
648 static inline void d2d_rect_expand(D2D1_RECT_F *dst, const D2D1_POINT_2F *point)
650 if (point->x < dst->left)
651 dst->left = point->x;
652 if (point->x > dst->right)
653 dst->right = point->x;
654 if (point->y < dst->top)
655 dst->top = point->y;
656 if (point->y > dst->bottom)
657 dst->bottom = point->y;
660 static inline D2D1_INTERPOLATION_MODE d2d1_1_interp_mode_from_d2d1(D2D1_BITMAP_INTERPOLATION_MODE mode)
662 return (D2D1_INTERPOLATION_MODE)mode;
665 static inline const char *debug_d2d_color_f(const D2D1_COLOR_F *colour)
667 if (!colour)
668 return "(null)";
669 return wine_dbg_sprintf("{%.8e, %.8e, %.8e, %.8e}", colour->r, colour->g, colour->b, colour->a);
672 static inline const char *debug_d2d_point_2f(const D2D1_POINT_2F *point)
674 if (!point)
675 return "(null)";
676 return wine_dbg_sprintf("{%.8e, %.8e}", point->x, point->y);
679 static inline const char *debug_d2d_rect_f(const D2D1_RECT_F *rect)
681 if (!rect)
682 return "(null)";
683 return wine_dbg_sprintf("(%.8e, %.8e)-(%.8e, %.8e)", rect->left, rect->top, rect->right, rect->bottom);
686 static inline const char *debug_d2d_rounded_rect(const D2D1_ROUNDED_RECT *rounded_rect)
688 if (!rounded_rect)
689 return "(null)";
690 return wine_dbg_sprintf("(%.8e, %.8e)-(%.8e, %.8e)[%.8e, %.8e]", rounded_rect->rect.left, rounded_rect->rect.top,
691 rounded_rect->rect.right, rounded_rect->rect.bottom, rounded_rect->radiusX, rounded_rect->radiusY);
694 static inline const char *debug_d2d_ellipse(const D2D1_ELLIPSE *ellipse)
696 if (!ellipse)
697 return "(null)";
698 return wine_dbg_sprintf("(%.8e, %.8e)[%.8e, %.8e]",
699 ellipse->point.x, ellipse->point.y, ellipse->radiusX, ellipse->radiusY);
702 #endif /* __WINE_D2D1_PRIVATE_H */