Bug 1348430 - Part 2. Rename a local variable in nsSVGPatternFrame::PaintPattern. draft
authorcku <cku@mozilla.com>
Sun, 19 Mar 2017 01:55:34 +0800
changeset 501298 f9499f354f9a3ab738d3af613921baae0c5ca33c
parent 501297 14a22be99ebf53a4414ffc291e4008adf6a3ca8a
child 501299 d34c14814a885577835857a9743e41775ca2225f
push id49921
push userbmo:cku@mozilla.com
push dateSun, 19 Mar 2017 17:32:20 +0000
bugs1348430
milestone55.0a1
Bug 1348430 - Part 2. Rename a local variable in nsSVGPatternFrame::PaintPattern. MozReview-Commit-ID: FIWQOHsC5o5
layout/svg/nsSVGPatternFrame.cpp
--- a/layout/svg/nsSVGPatternFrame.cpp
+++ b/layout/svg/nsSVGPatternFrame.cpp
@@ -375,22 +375,22 @@ nsSVGPatternFrame::PaintPattern(const Dr
 
   RefPtr<DrawTarget> dt =
     aDrawTarget->CreateSimilarDrawTarget(surfaceSize, SurfaceFormat::B8G8R8A8);
   if (!dt || !dt->IsValid()) {
     return MakePair(DrawResult::TEMPORARY_ERROR, RefPtr<SourceSurface>());
   }
   dt->ClearRect(Rect(0, 0, surfaceSize.width, surfaceSize.height));
 
-  RefPtr<gfxContext> gfx = gfxContext::CreateOrNull(dt);
-  MOZ_ASSERT(gfx); // already checked the draw target above
+  RefPtr<gfxContext> ctx = gfxContext::CreateOrNull(dt);
+  MOZ_ASSERT(ctx); // already checked the draw target above
 
   if (aGraphicOpacity != 1.0f) {
-    gfx->Save();
-    gfx->PushGroupForBlendBack(gfxContentType::COLOR_ALPHA, aGraphicOpacity);
+    ctx->Save();
+    ctx->PushGroupForBlendBack(gfxContentType::COLOR_ALPHA, aGraphicOpacity);
   }
 
   // OK, now render -- note that we use "firstKid", which
   // we got at the beginning because it takes care of the
   // referenced pattern situation for us
 
   if (aSource->IsFrameOfType(nsIFrame::eSVGGeometry)) {
     // Set the geometrical parent of the pattern we are rendering
@@ -410,27 +410,27 @@ nsSVGPatternFrame::PaintPattern(const Dr
         SVGFrame->NotifySVGChanged(nsISVGChildFrame::TRANSFORM_CHANGED);
       }
       gfxMatrix tm = *(patternWithChildren->mCTM);
       if (kid->GetContent()->IsSVGElement()) {
         tm = static_cast<nsSVGElement*>(kid->GetContent())->
                PrependLocalTransformsTo(tm, eUserSpaceToParent);
       }
 
-      result &= nsSVGUtils::PaintFrameWithEffects(kid, *gfx, tm);
+      result &= nsSVGUtils::PaintFrameWithEffects(kid, *ctx, tm);
     }
 
     patternWithChildren->RemoveStateBits(NS_FRAME_DRAWING_AS_PAINTSERVER);
   }
 
   patternWithChildren->mSource = nullptr;
 
   if (aGraphicOpacity != 1.0f) {
-    gfx->PopGroupAndBlend();
-    gfx->Restore();
+    ctx->PopGroupAndBlend();
+    ctx->Restore();
   }
 
   // caller now owns the surface
   RefPtr<SourceSurface> surf = dt->Snapshot();
   return MakePair(result, Move(surf));
 }
 
 /* Will probably need something like this... */