Bug 1114398 - Part 2: Test whether the path backend matches the DrawTarget backend for the SVG path cache. r=jwatt

This commit is contained in:
Bas Schouten 2015-01-08 00:10:49 +00:00
parent 5396c56489
commit 8ac764e40a

View File

@ -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<PathBuilder> builder = aDrawTarget.CreatePathBuilder(aFillRule);
RefPtr<Path> path = BuildPath(builder);