Bug 896047 - Clear builder when fill rule for path changes. r=Bas

This commit is contained in:
Yury Delendik 2013-11-08 21:24:24 -06:00
Родитель 9e604f7bc6
Коммит 136f3344de
4 изменённых файлов: 39 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<body>
<canvas id="c" width="200" height="100">
</canvas>
<script>
var ctx = document.getElementById("c").getContext("2d");
ctx.save();
ctx.save();
ctx.rect(0,0, 1,1);
ctx.restore();
ctx.fill('evenodd');
ctx.restore();
ctx.lineTo(10, 0);
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<body>
<canvas id="c" width="200" height="100">
</canvas>
<script>
var ctx = document.getElementById("c").getContext("2d");
ctx.save();
ctx.mozFillRule = 'nonzero';
ctx.save();
ctx.mozFillRule = 'evenodd';
ctx.rect(0,0, 1,1);
ctx.restore();
ctx.isPointInPath(0,0);
ctx.restore();
ctx.lineTo(10, 0);
</script>
</body>
</html>

Просмотреть файл

@ -17,4 +17,6 @@ skip-if(Android||B2G) load 780392-1.html # bug 833371 for B2G
skip-if(Android||B2G) load 789933-1.html # bug 833371
load 794463-1.html
load 802926-1.html
load 896047-1.html
load 896047-2.html
load 916128-1.html

Просмотреть файл

@ -2003,6 +2003,7 @@ CanvasRenderingContext2D::EnsureUserSpacePath(const CanvasWindingRule& winding)
if (mPath && mPath->GetFillRule() != fillRule) {
mPathBuilder = mPath->CopyToBuilder(fillRule);
mPath = mPathBuilder->Finish();
mPathBuilder = nullptr;
}
NS_ASSERTION(mPath, "mPath should exist");