diff --git a/dom/svg/nsSVGPathGeometryElement.cpp b/dom/svg/nsSVGPathGeometryElement.cpp index 37c8c648874..33a5f8fa80a 100644 --- a/dom/svg/nsSVGPathGeometryElement.cpp +++ b/dom/svg/nsSVGPathGeometryElement.cpp @@ -87,7 +87,9 @@ nsSVGPathGeometryElement::GetOrBuildPath(const DrawTarget& aDrawTarget, // chrome). The benefit is that we avoid causing a CPU memory cache miss by // looking at the global variable that the pref's stored in. if (cacheable && mCachedPath) { - return mCachedPath; + if (aDrawTarget.GetBackendType() == mCachedPath->GetBackendType()) { + return mCachedPath; + } } RefPtr builder = aDrawTarget.CreatePathBuilder(aFillRule); RefPtr path = BuildPath(builder);