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
parent 442b84a9be
commit 86f4a50ea7
4 changed files with 39 additions and 0 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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

View File

@ -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");