Bug 853889 - Check orientation of single trapezoid in _cairo_bentley_ottmann_tessellate_rectangular_traps. r=jmuizelaar

This commit is contained in:
Tom Klein 2015-06-15 16:57:00 +02:00
parent 1cd7ac366a
commit e0dbed1ec3
4 changed files with 44 additions and 3 deletions

View File

@ -674,11 +674,20 @@ _cairo_bentley_ottmann_tessellate_rectangular_traps (cairo_traps_t *traps,
cairo_status_t status;
int i;
if (unlikely (traps->num_traps <= 1))
return CAIRO_STATUS_SUCCESS;
assert (traps->is_rectangular);
if (unlikely (traps->num_traps <= 1)) {
if (traps->num_traps == 1) {
cairo_trapezoid_t *trap = traps->traps;
if (trap->left.p1.x > trap->right.p1.x) {
cairo_line_t tmp = trap->left;
trap->left = trap->right;
trap->right = tmp;
}
}
return CAIRO_STATUS_SUCCESS;
}
dump_traps (traps, "bo-rects-traps-in.txt");
rectangles = stack_rectangles;

View File

@ -0,0 +1,12 @@
<!doctype html>
<html>
<head><title>Testcase for bug 853889</title></head>
<body>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="400px" height="400px">
<path d="M 0 0 L 0 50 L 400 50 L 400 0 Z"
fill="rgb(12,200,12)"></path>
</svg>
</body>
</html>

View File

@ -0,0 +1,19 @@
<!doctype html>
<html>
<head><title>Testcase for bug 853889</title></head>
<body>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="400px" height="400px">
<path d="M 0 400 L 0 450 L 600 450 L 600 400 Z"
fill="rgb(200,12,12)"></path>
<path d="M 0 0 L 0 50 L 600 50 L 600 0 Z"
fill="rgb(200,12,12)"></path>
<path d="M 0 0 L 0 50 L 600 50 L 600 0 Z
M 0 400 L 0 450 L 600 450 L 600 400 Z"
fill="rgb(12,200,12)"></path>
</svg>
</body>
</html>

View File

@ -3,3 +3,4 @@
fuzzy-if(winWidget,175,443) == 611498-1.html 611498-ref.html
skip-if(B2G) fuzzy-if(Android&&AndroidVersion>=15,8,1000) == 709477-1.html 709477-1-ref.html # bug 773482
skip-if(!asyncPanZoom) == 1086723.html 1086723-ref.html
== 853889-1.html 853889-1-ref.html