d2d1: Introduce a debug helper for D2D1_POINT_2F.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2018-09-25 01:55:17 +03:30 committed by Alexandre Julliard
parent 52fecef1a2
commit ced1590255
8 changed files with 60 additions and 54 deletions

View File

@ -218,8 +218,8 @@ static void STDMETHODCALLTYPE d2d_bitmap_render_target_DrawLine(ID2D1BitmapRende
{
struct d2d_bitmap_render_target *render_target = impl_from_ID2D1BitmapRenderTarget(iface);
TRACE("iface %p, p0 {%.8e, %.8e}, p1 {%.8e, %.8e}, brush %p, stroke_width %.8e, stroke_style %p.\n",
iface, p0.x, p0.y, p1.x, p1.y, brush, stroke_width, stroke_style);
TRACE("iface %p, p0 %s, p1 %s, brush %p, stroke_width %.8e, stroke_style %p.\n",
iface, debug_d2d_point_2f(&p0), debug_d2d_point_2f(&p1), brush, stroke_width, stroke_style);
ID2D1RenderTarget_DrawLine(render_target->dxgi_target, p0, p1, brush, stroke_width, stroke_style);
}
@ -364,8 +364,8 @@ static void STDMETHODCALLTYPE d2d_bitmap_render_target_DrawTextLayout(ID2D1Bitma
{
struct d2d_bitmap_render_target *render_target = impl_from_ID2D1BitmapRenderTarget(iface);
TRACE("iface %p, origin {%.8e, %.8e}, layout %p, brush %p, options %#x.\n",
iface, origin.x, origin.y, layout, brush, options);
TRACE("iface %p, origin %s, layout %p, brush %p, options %#x.\n",
iface, debug_d2d_point_2f(&origin), layout, brush, options);
ID2D1RenderTarget_DrawTextLayout(render_target->dxgi_target, origin, layout, brush, options);
}
@ -376,8 +376,8 @@ static void STDMETHODCALLTYPE d2d_bitmap_render_target_DrawGlyphRun(ID2D1BitmapR
{
struct d2d_bitmap_render_target *render_target = impl_from_ID2D1BitmapRenderTarget(iface);
TRACE("iface %p, baseline_origin {%.8e, %.8e}, glyph_run %p, brush %p, measuring_mode %#x.\n",
iface, baseline_origin.x, baseline_origin.y, glyph_run, brush, measuring_mode);
TRACE("iface %p, baseline_origin %s, glyph_run %p, brush %p, measuring_mode %#x.\n",
iface, debug_d2d_point_2f(&baseline_origin), glyph_run, brush, measuring_mode);
ID2D1RenderTarget_DrawGlyphRun(render_target->dxgi_target,
baseline_origin, glyph_run, brush, measuring_mode);

View File

@ -502,7 +502,7 @@ static void STDMETHODCALLTYPE d2d_linear_gradient_brush_SetStartPoint(ID2D1Linea
{
struct d2d_brush *brush = impl_from_ID2D1LinearGradientBrush(iface);
TRACE("iface %p, start_point {%.8e, %.8e}.\n", iface, start_point.x, start_point.y);
TRACE("iface %p, start_point %s.\n", iface, debug_d2d_point_2f(&start_point));
brush->u.linear.start = start_point;
}
@ -512,7 +512,7 @@ static void STDMETHODCALLTYPE d2d_linear_gradient_brush_SetEndPoint(ID2D1LinearG
{
struct d2d_brush *brush = impl_from_ID2D1LinearGradientBrush(iface);
TRACE("iface %p, end_point {%.8e, %.8e}.\n", iface, end_point.x, end_point.y);
TRACE("iface %p, end_point %s.\n", iface, debug_d2d_point_2f(&end_point));
brush->u.linear.end = end_point;
}
@ -689,7 +689,7 @@ static void STDMETHODCALLTYPE d2d_radial_gradient_brush_SetCenter(ID2D1RadialGra
{
struct d2d_brush *brush = impl_from_ID2D1RadialGradientBrush(iface);
TRACE("iface %p, centre {%.8e, %.8e}.\n", iface, centre.x, centre.y);
TRACE("iface %p, centre %s.\n", iface, debug_d2d_point_2f(&centre));
brush->u.radial.centre = centre;
}
@ -699,7 +699,7 @@ static void STDMETHODCALLTYPE d2d_radial_gradient_brush_SetGradientOriginOffset(
{
struct d2d_brush *brush = impl_from_ID2D1RadialGradientBrush(iface);
TRACE("iface %p, offset {%.8e, %.8e}.\n", iface, offset.x, offset.y);
TRACE("iface %p, offset %s.\n", iface, debug_d2d_point_2f(&offset));
brush->u.radial.offset = offset;
}

View File

@ -587,6 +587,13 @@ static inline void d2d_rect_expand(D2D1_RECT_F *dst, const D2D1_POINT_2F *point)
dst->bottom = point->y;
}
static inline const char *debug_d2d_point_2f(const D2D1_POINT_2F *point)
{
if (!point)
return "(null)";
return wine_dbg_sprintf("{%.8e, %.8e}", point->x, point->y);
}
static inline const char *debug_d2d_rect_f(const D2D1_RECT_F *rect)
{
if (!rect) return "(null)";

View File

@ -247,8 +247,8 @@ static void STDMETHODCALLTYPE d2d_dc_render_target_DrawLine(ID2D1DCRenderTarget
{
struct d2d_dc_render_target *render_target = impl_from_ID2D1DCRenderTarget(iface);
TRACE("iface %p, p0 {%.8e, %.8e}, p1 {%.8e, %.8e}, brush %p, stroke_width %.8e, stroke_style %p.\n",
iface, p0.x, p0.y, p1.x, p1.y, brush, stroke_width, stroke_style);
TRACE("iface %p, p0 %s, p1 %s, brush %p, stroke_width %.8e, stroke_style %p.\n",
iface, debug_d2d_point_2f(&p0), debug_d2d_point_2f(&p1), brush, stroke_width, stroke_style);
ID2D1RenderTarget_DrawLine(render_target->dxgi_target, p0, p1, brush, stroke_width, stroke_style);
}
@ -393,8 +393,8 @@ static void STDMETHODCALLTYPE d2d_dc_render_target_DrawTextLayout(ID2D1DCRenderT
{
struct d2d_dc_render_target *render_target = impl_from_ID2D1DCRenderTarget(iface);
TRACE("iface %p, origin {%.8e, %.8e}, layout %p, brush %p, options %#x.\n",
iface, origin.x, origin.y, layout, brush, options);
TRACE("iface %p, origin %s, layout %p, brush %p, options %#x.\n",
iface, debug_d2d_point_2f(&origin), layout, brush, options);
ID2D1RenderTarget_DrawTextLayout(render_target->dxgi_target, origin, layout, brush, options);
}
@ -405,8 +405,8 @@ static void STDMETHODCALLTYPE d2d_dc_render_target_DrawGlyphRun(ID2D1DCRenderTar
{
struct d2d_dc_render_target *render_target = impl_from_ID2D1DCRenderTarget(iface);
TRACE("iface %p, baseline_origin {%.8e, %.8e}, glyph_run %p, brush %p, measuring_mode %#x.\n",
iface, baseline_origin.x, baseline_origin.y, glyph_run, brush, measuring_mode);
TRACE("iface %p, baseline_origin %s, glyph_run %p, brush %p, measuring_mode %#x.\n",
iface, debug_d2d_point_2f(&baseline_origin), glyph_run, brush, measuring_mode);
ID2D1RenderTarget_DrawGlyphRun(render_target->dxgi_target,
baseline_origin, glyph_run, brush, measuring_mode);

View File

@ -550,8 +550,8 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawLine(ID2D1DeviceContext *if
ID2D1GeometrySink *sink;
HRESULT hr;
TRACE("iface %p, p0 {%.8e, %.8e}, p1 {%.8e, %.8e}, brush %p, stroke_width %.8e, stroke_style %p.\n",
iface, p0.x, p0.y, p1.x, p1.y, brush, stroke_width, stroke_style);
TRACE("iface %p, p0 %s, p1 %s, brush %p, stroke_width %.8e, stroke_style %p.\n",
iface, debug_d2d_point_2f(&p0), debug_d2d_point_2f(&p1), brush, stroke_width, stroke_style);
if (FAILED(hr = ID2D1Factory_CreatePathGeometry(render_target->factory, &geometry)))
{
@ -1108,8 +1108,8 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawTextLayout(ID2D1DeviceConte
struct d2d_draw_text_layout_ctx ctx;
HRESULT hr;
TRACE("iface %p, origin {%.8e, %.8e}, layout %p, brush %p, options %#x.\n",
iface, origin.x, origin.y, layout, brush, options);
TRACE("iface %p, origin %s, layout %p, brush %p, options %#x.\n",
iface, debug_d2d_point_2f(&origin), layout, brush, options);
ctx.brush = brush;
ctx.options = options;
@ -1324,8 +1324,8 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawGlyphRun(ID2D1DeviceContext
DWRITE_RENDERING_MODE rendering_mode;
HRESULT hr;
TRACE("iface %p, baseline_origin {%.8e, %.8e}, glyph_run %p, brush %p, measuring_mode %#x.\n",
iface, baseline_origin.x, baseline_origin.y, glyph_run, brush, measuring_mode);
TRACE("iface %p, baseline_origin %s, glyph_run %p, brush %p, measuring_mode %#x.\n",
iface, debug_d2d_point_2f(&baseline_origin), glyph_run, brush, measuring_mode);
rendering_params = render_target->text_rendering_params ? render_target->text_rendering_params
: render_target->default_text_rendering_params;
@ -1945,8 +1945,8 @@ static HRESULT STDMETHODCALLTYPE d2d_device_context_GetGlyphRunWorldBounds(ID2D1
D2D1_POINT_2F baseline_origin, const DWRITE_GLYPH_RUN *glyph_run,
DWRITE_MEASURING_MODE measuring_mode, D2D1_RECT_F *bounds)
{
FIXME("iface %p, baseline_origin {%.8e, %.8e}, glyph_run %p, measuring_mode %#x, bounds %p stub!\n", iface,
baseline_origin.x, baseline_origin.y, glyph_run, measuring_mode, bounds);
FIXME("iface %p, baseline_origin %s, glyph_run %p, measuring_mode %#x, bounds %p stub!\n",
iface, debug_d2d_point_2f(&baseline_origin), glyph_run, measuring_mode, bounds);
return E_NOTIMPL;
}
@ -2012,23 +2012,24 @@ static void STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_DrawGlyphRun
D2D1_POINT_2F baseline_origin, const DWRITE_GLYPH_RUN *glyph_run,
const DWRITE_GLYPH_RUN_DESCRIPTION *glyph_run_desc, ID2D1Brush *brush, DWRITE_MEASURING_MODE measuring_mode)
{
FIXME("iface %p, baseline_origin {%.8e, %.8e}, glyph_run %p, "
"glyph_run_desc %p, brush %p, measuring_mode %#x stub!\n",
iface, baseline_origin.x, baseline_origin.y, glyph_run, glyph_run_desc, brush, measuring_mode);
FIXME("iface %p, baseline_origin %s, glyph_run %p, glyph_run_desc %p, brush %p, measuring_mode %#x stub!\n",
iface, debug_d2d_point_2f(&baseline_origin), glyph_run, glyph_run_desc, brush, measuring_mode);
}
static void STDMETHODCALLTYPE d2d_device_context_DrawImage(ID2D1DeviceContext *iface, ID2D1Image *image,
const D2D1_POINT_2F *target_offset, const D2D1_RECT_F *image_rect, D2D1_INTERPOLATION_MODE interpolation_mode,
D2D1_COMPOSITE_MODE composite_mode)
{
FIXME("iface %p, image %p, target_offset %p, image_rect %s, interpolation_mode %#x, composite_mode %#x stub!\n",
iface, image, target_offset, debug_d2d_rect_f(image_rect), interpolation_mode, composite_mode);
FIXME("iface %p, image %p, target_offset %s, image_rect %s, interpolation_mode %#x, composite_mode %#x stub!\n",
iface, image, debug_d2d_point_2f(target_offset), debug_d2d_rect_f(image_rect),
interpolation_mode, composite_mode);
}
static void STDMETHODCALLTYPE d2d_device_context_DrawGdiMetafile(ID2D1DeviceContext *iface,
ID2D1GdiMetafile *metafile, const D2D1_POINT_2F *target_offset)
{
FIXME("iface %p, metafile %p, target_offset %p stub!\n", iface, metafile, target_offset);
FIXME("iface %p, metafile %p, target_offset %s stub!\n",
iface, metafile, debug_d2d_point_2f(target_offset));
}
static void STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_DrawBitmap(ID2D1DeviceContext *iface,

View File

@ -577,7 +577,7 @@ void WINAPI D2D1MakeRotateMatrix(float angle, D2D1_POINT_2F center, D2D1_MATRIX_
{
float theta, sin_theta, cos_theta;
TRACE("angle %.8e, center {%.8e, %.8e}, matrix %p.\n", angle, center.x, center.y, matrix);
TRACE("angle %.8e, center %s, matrix %p.\n", angle, debug_d2d_point_2f(&center), matrix);
theta = angle * (M_PI / 180.0f);
sin_theta = sinf(theta);

View File

@ -2419,8 +2419,8 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_BeginFigure(ID2D1GeometrySink *i
struct d2d_geometry *geometry = impl_from_ID2D1GeometrySink(iface);
struct d2d_figure *figure;
TRACE("iface %p, start_point {%.8e, %.8e}, figure_begin %#x.\n",
iface, start_point.x, start_point.y, figure_begin);
TRACE("iface %p, start_point %s, figure_begin %#x.\n",
iface, debug_d2d_point_2f(&start_point), figure_begin);
if (geometry->u.path.state != D2D_GEOMETRY_STATE_OPEN)
{
@ -2882,7 +2882,7 @@ done:
static void STDMETHODCALLTYPE d2d_geometry_sink_AddLine(ID2D1GeometrySink *iface, D2D1_POINT_2F point)
{
TRACE("iface %p, point {%.8e, %.8e}.\n", iface, point.x, point.y);
TRACE("iface %p, point %s.\n", iface, debug_d2d_point_2f(&point));
d2d_geometry_sink_AddLines(iface, &point, 1);
}
@ -3164,9 +3164,9 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_StrokeContainsPoint(ID2D1Path
D2D1_POINT_2F point, float stroke_width, ID2D1StrokeStyle *stroke_style, const D2D1_MATRIX_3X2_F *transform,
float tolerance, BOOL *contains)
{
FIXME("iface %p, point {%.8e, %.8e}, stroke_width %.8e, stroke_style %p, "
FIXME("iface %p, point %s, stroke_width %.8e, stroke_style %p, "
"transform %p, tolerance %.8e, contains %p stub!\n",
iface, point.x, point.y, stroke_width, stroke_style, transform, tolerance, contains);
iface, debug_d2d_point_2f(&point), stroke_width, stroke_style, transform, tolerance, contains);
return E_NOTIMPL;
}
@ -3177,8 +3177,8 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_FillContainsPoint(ID2D1PathGe
struct d2d_geometry *geometry = impl_from_ID2D1PathGeometry(iface);
D2D1_MATRIX_3X2_F g_i;
TRACE("iface %p, point {%.8e, %.8e}, transform %p, tolerance %.8e, contains %p.\n",
iface, point.x, point.y, transform, tolerance, contains);
TRACE("iface %p, point %s, transform %p, tolerance %.8e, contains %p.\n",
iface, debug_d2d_point_2f(&point), transform, tolerance, contains);
if (transform)
{
@ -3609,9 +3609,8 @@ static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_StrokeContainsPoint(ID2D
D2D1_POINT_2F point, float stroke_width, ID2D1StrokeStyle *stroke_style, const D2D1_MATRIX_3X2_F *transform,
float tolerance, BOOL *contains)
{
FIXME("iface %p, point {%.8e, %.8e}, stroke_width %.8e, stroke_style %p, "
"transform %p, tolerance %.8e, contains %p stub!\n",
iface, point.x, point.y, stroke_width, stroke_style, transform, tolerance, contains);
FIXME("iface %p, point %s, stroke_width %.8e, stroke_style %p, transform %p, tolerance %.8e, contains %p stub!\n",
iface, debug_d2d_point_2f(&point), stroke_width, stroke_style, transform, tolerance, contains);
return E_NOTIMPL;
}
@ -3623,8 +3622,8 @@ static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_FillContainsPoint(ID2D1R
D2D1_RECT_F *rect = &geometry->u.rectangle.rect;
float dx, dy;
TRACE("iface %p, point {%.8e, %.8e}, transform %p, tolerance %.8e, contains %p.\n",
iface, point.x, point.y, transform, tolerance, contains);
TRACE("iface %p, point %s, transform %p, tolerance %.8e, contains %p.\n",
iface, debug_d2d_point_2f(&point), transform, tolerance, contains);
if (transform)
{
@ -3939,9 +3938,8 @@ static HRESULT STDMETHODCALLTYPE d2d_transformed_geometry_StrokeContainsPoint(ID
struct d2d_geometry *geometry = impl_from_ID2D1TransformedGeometry(iface);
D2D1_MATRIX_3X2_F g;
TRACE("iface %p, point {%.8e, %.8e}, stroke_width %.8e, stroke_style %p, "
"transform %p, tolerance %.8e, contains %p.\n",
iface, point.x, point.y, stroke_width, stroke_style, transform, tolerance, contains);
TRACE("iface %p, point %s, stroke_width %.8e, stroke_style %p, transform %p, tolerance %.8e, contains %p.\n",
iface, debug_d2d_point_2f(&point), stroke_width, stroke_style, transform, tolerance, contains);
g = geometry->transform;
if (transform)
@ -3957,8 +3955,8 @@ static HRESULT STDMETHODCALLTYPE d2d_transformed_geometry_FillContainsPoint(ID2D
struct d2d_geometry *geometry = impl_from_ID2D1TransformedGeometry(iface);
D2D1_MATRIX_3X2_F g;
TRACE("iface %p, point {%.8e, %.8e}, transform %p, tolerance %.8e, contains %p.\n",
iface, point.x, point.y, transform, tolerance, contains);
TRACE("iface %p, point %s, transform %p, tolerance %.8e, contains %p.\n",
iface, debug_d2d_point_2f(&point), transform, tolerance, contains);
g = geometry->transform;
if (transform)

View File

@ -233,8 +233,8 @@ static void STDMETHODCALLTYPE d2d_hwnd_render_target_DrawLine(ID2D1HwndRenderTar
{
struct d2d_hwnd_render_target *render_target = impl_from_ID2D1HwndRenderTarget(iface);
TRACE("iface %p, p0 {%.8e, %.8e}, p1 {%.8e, %.8e}, brush %p, stroke_width %.8e, stroke_style %p.\n",
iface, p0.x, p0.y, p1.x, p1.y, brush, stroke_width, stroke_style);
TRACE("iface %p, p0 %s, p1 %s, brush %p, stroke_width %.8e, stroke_style %p.\n",
iface, debug_d2d_point_2f(&p0), debug_d2d_point_2f(&p1), brush, stroke_width, stroke_style);
ID2D1RenderTarget_DrawLine(render_target->dxgi_target, p0, p1, brush, stroke_width, stroke_style);
}
@ -379,8 +379,8 @@ static void STDMETHODCALLTYPE d2d_hwnd_render_target_DrawTextLayout(ID2D1HwndRen
{
struct d2d_hwnd_render_target *render_target = impl_from_ID2D1HwndRenderTarget(iface);
TRACE("iface %p, origin {%.8e, %.8e}, layout %p, brush %p, options %#x.\n",
iface, origin.x, origin.y, layout, brush, options);
TRACE("iface %p, origin %s, layout %p, brush %p, options %#x.\n",
iface, debug_d2d_point_2f(&origin), layout, brush, options);
ID2D1RenderTarget_DrawTextLayout(render_target->dxgi_target, origin, layout, brush, options);
}
@ -391,8 +391,8 @@ static void STDMETHODCALLTYPE d2d_hwnd_render_target_DrawGlyphRun(ID2D1HwndRende
{
struct d2d_hwnd_render_target *render_target = impl_from_ID2D1HwndRenderTarget(iface);
TRACE("iface %p, baseline_origin {%.8e, %.8e}, glyph_run %p, brush %p, measuring_mode %#x.\n",
iface, baseline_origin.x, baseline_origin.y, glyph_run, brush, measuring_mode);
TRACE("iface %p, baseline_origin %s, glyph_run %p, brush %p, measuring_mode %#x.\n",
iface, debug_d2d_point_2f(&baseline_origin), glyph_run, brush, measuring_mode);
ID2D1RenderTarget_DrawGlyphRun(render_target->dxgi_target,
baseline_origin, glyph_run, brush, measuring_mode);