diff options
author | Fujii Hironori <Hironori.Fujii@sony.com> | 2023-01-10 13:55:59 +0900 |
---|---|---|
committer | Fujii Hironori <Hironori.Fujii@sony.com> | 2023-01-11 05:39:13 +0900 |
commit | a599720c889dd57d2c10b92c6403f99da057c556 (patch) | |
tree | fbe2bd27f312680944ecd0176c30e338ce4bd8be /src/win32 | |
parent | c76a699f6cfd386b134f63515dc6a3c791fdd226 (diff) | |
download | cairo-a599720c889dd57d2c10b92c6403f99da057c556.tar.gz |
DWrite: Don't call _controlfp_s with MCW_PC
GeometryRecorder class was calling _controlfp_s with MCW_PC to reset
the floating point precision to default. However, MCW_PC isn't
supported for ARM or x64 platforms. It reports an assertion failure
for them. And, Cairo isn't changing the MCW_PC setting. Removed the
calls. Also, removed `GetFixedX` and `GetFixedY` methods because they
called only `_cairo_fixed_from_double`.
Fixes cairo/cairo#566
Diffstat (limited to 'src/win32')
-rw-r--r-- | src/win32/cairo-dwrite-font.cpp | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/src/win32/cairo-dwrite-font.cpp b/src/win32/cairo-dwrite-font.cpp index ea87fe7e1..03f1668d3 100644 --- a/src/win32/cairo-dwrite-font.cpp +++ b/src/win32/cairo-dwrite-font.cpp @@ -738,28 +738,14 @@ public: return; } - cairo_fixed_t GetFixedX(const D2D1_POINT_2F &point) - { - unsigned int control_word; - _controlfp_s(&control_word, _CW_DEFAULT, MCW_PC); - return _cairo_fixed_from_double(point.x); - } - - cairo_fixed_t GetFixedY(const D2D1_POINT_2F &point) - { - unsigned int control_word; - _controlfp_s(&control_word, _CW_DEFAULT, MCW_PC); - return _cairo_fixed_from_double(point.y); - } - IFACEMETHODIMP_(void) BeginFigure( D2D1_POINT_2F startPoint, D2D1_FIGURE_BEGIN figureBegin) { mStartPoint = startPoint; cairo_status_t status = _cairo_path_fixed_move_to(mCairoPath, - GetFixedX(startPoint), - GetFixedY(startPoint)); + _cairo_fixed_from_double(startPoint.x), + _cairo_fixed_from_double(startPoint.y)); (void)status; /* squelch warning */ } @@ -768,8 +754,8 @@ public: { if (figureEnd == D2D1_FIGURE_END_CLOSED) { cairo_status_t status = _cairo_path_fixed_line_to(mCairoPath, - GetFixedX(mStartPoint), - GetFixedY(mStartPoint)); + _cairo_fixed_from_double(mStartPoint.x), + _cairo_fixed_from_double(mStartPoint.y)); (void)status; /* squelch warning */ } } @@ -780,12 +766,12 @@ public: { for (unsigned int i = 0; i < beziersCount; i++) { cairo_status_t status = _cairo_path_fixed_curve_to(mCairoPath, - GetFixedX(beziers[i].point1), - GetFixedY(beziers[i].point1), - GetFixedX(beziers[i].point2), - GetFixedY(beziers[i].point2), - GetFixedX(beziers[i].point3), - GetFixedY(beziers[i].point3)); + _cairo_fixed_from_double(beziers[i].point1.x), + _cairo_fixed_from_double(beziers[i].point1.y), + _cairo_fixed_from_double(beziers[i].point2.x), + _cairo_fixed_from_double(beziers[i].point2.y), + _cairo_fixed_from_double(beziers[i].point3.x), + _cairo_fixed_from_double(beziers[i].point3.y)); (void)status; /* squelch warning */ } } @@ -796,8 +782,8 @@ public: { for (unsigned int i = 0; i < pointsCount; i++) { cairo_status_t status = _cairo_path_fixed_line_to(mCairoPath, - GetFixedX(points[i]), - GetFixedY(points[i])); + _cairo_fixed_from_double(points[i].x), + _cairo_fixed_from_double(points[i].y)); (void)status; /* squelch warning */ } } |