From 136f3344de0afd92dea45ca18fa2474da3bdd492 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Fri, 8 Nov 2013 21:24:24 -0600 Subject: [PATCH] Bug 896047 - Clear builder when fill rule for path changes. r=Bas --- content/canvas/crashtests/896047-1.html | 17 +++++++++++++++++ content/canvas/crashtests/896047-2.html | 19 +++++++++++++++++++ content/canvas/crashtests/crashtests.list | 2 ++ .../canvas/src/CanvasRenderingContext2D.cpp | 1 + 4 files changed, 39 insertions(+) create mode 100644 content/canvas/crashtests/896047-1.html create mode 100644 content/canvas/crashtests/896047-2.html diff --git a/content/canvas/crashtests/896047-1.html b/content/canvas/crashtests/896047-1.html new file mode 100644 index 000000000000..2b121b22794c --- /dev/null +++ b/content/canvas/crashtests/896047-1.html @@ -0,0 +1,17 @@ + + + + + + + + diff --git a/content/canvas/crashtests/896047-2.html b/content/canvas/crashtests/896047-2.html new file mode 100644 index 000000000000..4cd12dfb481c --- /dev/null +++ b/content/canvas/crashtests/896047-2.html @@ -0,0 +1,19 @@ + + + + + + + + diff --git a/content/canvas/crashtests/crashtests.list b/content/canvas/crashtests/crashtests.list index f8e817b96f7a..1cfc35f1e942 100644 --- a/content/canvas/crashtests/crashtests.list +++ b/content/canvas/crashtests/crashtests.list @@ -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 diff --git a/content/canvas/src/CanvasRenderingContext2D.cpp b/content/canvas/src/CanvasRenderingContext2D.cpp index 240755b5d7ab..0b19690ee5e9 100644 --- a/content/canvas/src/CanvasRenderingContext2D.cpp +++ b/content/canvas/src/CanvasRenderingContext2D.cpp @@ -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");