Bug 1304991 - Part 1. Remove aOpacity parameter of GenerateMaskSurface. draft
authorcku <cku@mozilla.com>
Mon, 26 Sep 2016 18:35:18 +0800
changeset 417821 72629ee209f675e482544d7257324cc8b46e40af
parent 417649 c55bcb7c777ea09431b4d16903ed079ae5632648
child 417822 ff4a8dc6a754623424111b7e0ee1494647de4aac
push id30517
push userbmo:cku@mozilla.com
push dateTue, 27 Sep 2016 07:11:58 +0000
bugs1304991
milestone52.0a1
Bug 1304991 - Part 1. Remove aOpacity parameter of GenerateMaskSurface. MozReview-Commit-ID: D4vTSGobSMg
layout/svg/nsSVGIntegrationUtils.cpp
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -487,17 +487,17 @@ ComputeMaskGeometry(const PaintFramesPar
   IntRect result = ComputeClipExtsInDeviceSpace(ctx);
   ctx.Restore();
 
   return result;
 }
 
 static DrawResult
 GenerateMaskSurface(const PaintFramesParams& aParams,
-                    float aOpacity, nsStyleContext* aSC,
+                    nsStyleContext* aSC,
                     const nsTArray<nsSVGMaskFrame *>& aMaskFrames,
                     const nsPoint& aOffsetToUserSpace,
                     Matrix& aOutMaskTransform,
                     RefPtr<SourceSurface>& aOutMaskSurface)
 {
   const nsStyleSVGReset *svgReset = aSC->StyleSVGReset();
   MOZ_ASSERT(aMaskFrames.Length() > 0);
 
@@ -505,17 +505,17 @@ GenerateMaskSurface(const PaintFramesPar
     nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(aParams.frame);
 
   gfxContext& ctx = aParams.ctx;
 
   // There is only one SVG mask.
   if (((aMaskFrames.Length() == 1) && aMaskFrames[0])) {
     aOutMaskSurface =
       aMaskFrames[0]->GetMaskForMaskedFrame(&ctx, aParams.frame,
-                                            cssPxToDevPxMatrix, aOpacity,
+                                            cssPxToDevPxMatrix, 1.0,
                                             &aOutMaskTransform,
                                             svgReset->mMask.mLayers[0].mMaskMode);
     return DrawResult::SUCCESS;
   }
 
   IntRect maskSurfaceRect = ComputeMaskGeometry(aParams, svgReset,
                                                 aOffsetToUserSpace,
                                                 aMaskFrames);
@@ -560,17 +560,17 @@ GenerateMaskSurface(const PaintFramesPar
       : nsCSSRendering::GetGFXCompositeMode(svgReset->mMask.mLayers[i].mComposite);
 
     // maskFrame != nullptr means we get a SVG mask.
     // maskFrame == nullptr means we get an image mask.
     if (maskFrame) {
       Matrix svgMaskMatrix;
       RefPtr<SourceSurface> svgMask =
         maskFrame->GetMaskForMaskedFrame(maskContext, aParams.frame,
-                                         cssPxToDevPxMatrix, aOpacity,
+                                         cssPxToDevPxMatrix, 1.0,
                                          &svgMaskMatrix,
                                          svgReset->mMask.mLayers[i].mMaskMode);
       if (svgMask) {
         gfxContextMatrixAutoSaveRestore matRestore(maskContext);
 
         maskContext->Multiply(ThebesMatrix(svgMaskMatrix));
         Rect drawRect = IntRectToRect(IntRect(IntPoint(0, 0), svgMask->GetSize()));
         maskDT->MaskSurface(ColorPattern(Color(0.0, 0.0, 0.0, 1.0)), svgMask, drawRect.TopLeft(),
@@ -874,17 +874,17 @@ nsSVGIntegrationUtils::PaintMaskAndClipP
     if (shouldGenerateMaskLayer) {
       matSR.SetContext(&context);
 
       // For css-mask, we want to generate a mask for each continuation frame,
       // so we setup context matrix by the position of the current frame,
       // instead of the first continuation frame.
       SetupContextMatrix(frame, aParams, offsetToBoundingBox,
                          offsetToUserSpace, true);
-      result = GenerateMaskSurface(aParams, opacity,
+      result = GenerateMaskSurface(aParams,
                                   firstFrame->StyleContext(),
                                   maskFrames, offsetToUserSpace,
                                   maskTransform, maskSurface);
       context.PopClip();
       if (!maskSurface) {
         // Entire surface is clipped out.
         return result;
       }