Bug 1305259 - Use PushGroupAndCopyBackground for the masked group so that we can have subpixel AA inside the mask / clip-path. r?cjku, r?Bas
MozReview-Commit-ID: 3J9ncPn9sij
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -874,19 +874,25 @@ nsSVGIntegrationUtils::PaintMaskAndClipP
if (!shouldGenerateClipMaskLayer && !shouldGenerateMaskLayer) {
MOZ_ASSERT(opacity != 1.0f);
matSR.SetContext(&context);
SetupContextMatrix(firstFrame, aParams, offsetToBoundingBox,
offsetToUserSpace, true);
}
- context.PushGroupForBlendBack(gfxContentType::COLOR_ALPHA,
- opacityApplied ? 1.0 : opacity,
- maskSurface, maskTransform);
+ if (aParams.layerManager->GetRoot()->GetContentFlags() & Layer::CONTENT_COMPONENT_ALPHA) {
+ context.PushGroupAndCopyBackground(gfxContentType::COLOR_ALPHA,
+ opacityApplied ? 1.0 : opacity,
+ maskSurface, maskTransform);
+ } else {
+ context.PushGroupForBlendBack(gfxContentType::COLOR_ALPHA,
+ opacityApplied ? 1.0 : opacity,
+ maskSurface, maskTransform);
+ }
}
/* If this frame has only a trivial clipPath, set up cairo's clipping now so
* we can just do normal painting and get it clipped appropriately.
*/
if (shouldApplyClipPath || shouldApplyBasicShape) {
context.Save();
SetupContextMatrix(firstFrame, aParams, offsetToBoundingBox,