mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1063486 - Track current point in _cairo_path_bounder_curve_to r=jmuizelaar
This commit is contained in:
parent
1e9c1097ad
commit
d98692ef21
@ -49,5 +49,48 @@ TEST(Cairo, Bug825721) {
|
||||
TryCircle(0.0, 1.0, 5761126469220696064.0);
|
||||
}
|
||||
|
||||
TEST(Cairo, Bug1063486) {
|
||||
|
||||
double x1, y1, x2, y2;
|
||||
const double epsilon = .01;
|
||||
|
||||
cairo_surface_t *surf = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 1, 1);
|
||||
ASSERT_TRUE(surf != nullptr);
|
||||
|
||||
cairo_t *cairo = cairo_create(surf);
|
||||
ASSERT_TRUE(cairo != nullptr);
|
||||
|
||||
printf("Path 1\n");
|
||||
cairo_move_to(cairo, -20, -10);
|
||||
cairo_line_to(cairo, 20, -10);
|
||||
cairo_line_to(cairo, 20, 10);
|
||||
cairo_curve_to(cairo, 10,10, -10,10, -20,10);
|
||||
cairo_curve_to(cairo, -30,10, -30,-10, -20,-10);
|
||||
|
||||
cairo_path_extents(cairo, &x1, &y1, &x2, &y2);
|
||||
|
||||
ASSERT_LT(std::abs(-27.5 - x1), epsilon); // the failing coordinate
|
||||
ASSERT_LT(std::abs(-10 - y1), epsilon);
|
||||
ASSERT_LT(std::abs(20 - x2), epsilon);
|
||||
ASSERT_LT(std::abs(10 - y2), epsilon);
|
||||
|
||||
printf("Path 2\n");
|
||||
cairo_new_path(cairo);
|
||||
cairo_move_to(cairo, 10, 30);
|
||||
cairo_line_to(cairo, 90, 30);
|
||||
cairo_curve_to(cairo, 30,30, 30,30, 10,30);
|
||||
cairo_curve_to(cairo, 0,30, 0,0, 30,5);
|
||||
|
||||
cairo_path_extents(cairo, &x1, &y1, &x2, &y2);
|
||||
|
||||
ASSERT_LT(std::abs(4.019531 - x1), epsilon); // the failing coordinate
|
||||
ASSERT_LT(std::abs(4.437500 - y1), epsilon);
|
||||
ASSERT_LT(std::abs(90. - x2), epsilon);
|
||||
ASSERT_LT(std::abs(30. - y2), epsilon);
|
||||
|
||||
cairo_surface_destroy(surf);
|
||||
cairo_destroy(cairo);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -131,6 +131,7 @@ _cairo_path_bounder_curve_to (void *closure,
|
||||
else
|
||||
{
|
||||
/* All control points are within the current extents. */
|
||||
bounder->current_point = *d;
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'windows':
|
||||
UNIFIED_SOURCES += [ '/gfx/2d/unittest/%s' % p for p in [
|
||||
'TestBase.cpp',
|
||||
'TestBugs.cpp',
|
||||
'TestCairo.cpp',
|
||||
'TestPoint.cpp',
|
||||
'TestScaling.cpp',
|
||||
]]
|
||||
|
Loading…
Reference in New Issue
Block a user