Bug 802658 - Part 1: Whitespace fixes
authorAnthony Jones <ajones@mozilla.com>
Sun, 28 Oct 2012 21:51:43 +0100
changeset 111772 1d7fc5c44ee2c6536dadd9ef904f6a8989e1d387
parent 111766 aa367b01df3f8f4640c73a64dc2b2c1349b4aff0
child 111773 278e17fa10e7d2df13659ee9fa2c2ddbda14c603
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
bugs802658
milestone19.0a1
Bug 802658 - Part 1: Whitespace fixes
content/canvas/src/CanvasRenderingContext2D.cpp
--- a/content/canvas/src/CanvasRenderingContext2D.cpp
+++ b/content/canvas/src/CanvasRenderingContext2D.cpp
@@ -296,17 +296,17 @@ public:
 
     const ContextState &state = mCtx->CurrentState();
 
     mSigma = state.shadowBlur / 2.0f;
 
     if (mSigma > SIGMA_MAX) {
       mSigma = SIGMA_MAX;
     }
-      
+
     Matrix transform = mCtx->mTarget->GetTransform();
 
     mTempRect = mgfx::Rect(0, 0, ctx->mWidth, ctx->mHeight);
 
     static const gfxFloat GAUSSIAN_SCALE_FACTOR = (3 * sqrt(2 * M_PI) / 4) * 1.5;
     int32_t blurRadius = (int32_t) floor(mSigma * GAUSSIAN_SCALE_FACTOR + 0.5);
 
     // We need to enlarge and possibly offset our temporary surface
@@ -324,17 +324,17 @@ public:
                               blurRadius, blurRadius));
       mTempRect = mTempRect.Intersect(*aBounds);
     }
 
     mTempRect.ScaleRoundOut(1.0f);
 
     transform._31 -= mTempRect.x;
     transform._32 -= mTempRect.y;
-      
+
     mTarget =
       mCtx->mTarget->CreateShadowDrawTarget(IntSize(int32_t(mTempRect.width), int32_t(mTempRect.height)),
                                             FORMAT_B8G8R8A8, mSigma);
 
     if (!mTarget) {
       // XXX - Deal with the situation where our temp size is too big to
       // fit in a texture.
       mTarget = ctx->mTarget;
@@ -346,17 +346,17 @@ public:
 
   ~AdjustedTarget()
   {
     if (!mCtx) {
       return;
     }
 
     RefPtr<SourceSurface> snapshot = mTarget->Snapshot();
-    
+
     mCtx->mTarget->DrawSurfaceWithShadow(snapshot, mTempRect.TopLeft(),
                                          Color::FromABGR(mCtx->CurrentState().shadowColor),
                                          mCtx->CurrentState().shadowOffset, mSigma,
                                          mCtx->CurrentState().op);
   }
 
   DrawTarget* operator->()
   {
@@ -957,17 +957,17 @@ CanvasRenderingContext2D::Render(gfxCont
   nsresult rv = NS_OK;
 
   EnsureTarget();
   if (!IsTargetValid()) {
     return NS_ERROR_FAILURE;
   }
 
   nsRefPtr<gfxASurface> surface;
-  
+
   if (NS_FAILED(GetThebesSurface(getter_AddRefs(surface)))) {
     return NS_ERROR_FAILURE;
   }
 
   nsRefPtr<gfxPattern> pat = new gfxPattern(surface);
 
   pat->SetFilter(aFilter);
   pat->SetExtend(gfxPattern::EXTEND_PAD);
@@ -1948,17 +1948,17 @@ CanvasRenderingContext2D::GetMozShadowCo
 
 void
 CanvasRenderingContext2D::ClearRect(double x, double y, double w,
                                     double h)
 {
   if (!FloatValidate(x,y,w,h) || !mTarget) {
     return;
   }
- 
+
   mTarget->ClearRect(mgfx::Rect(x, y, w, h));
 
   RedrawUser(gfxRect(x, y, w, h));
 }
 
 NS_IMETHODIMP
 CanvasRenderingContext2D::ClearRect(float x, float y, float w, float h)
 {
@@ -2018,17 +2018,17 @@ CanvasRenderingContext2D::FillRect(doubl
         if (h < 0) {
           h = 0;
         }
       }
     }
   }
 
   mgfx::Rect bounds;
-  
+
   EnsureTarget();
   if (NeedToDrawShadow()) {
     bounds = mgfx::Rect(x, y, w, h);
     bounds = mTarget->GetTransform().TransformBounds(bounds);
   }
 
   AdjustedTarget(this, bounds.IsEmpty() ? nullptr : &bounds)->
     FillRect(mgfx::Rect(x, y, w, h),
@@ -2246,17 +2246,17 @@ CanvasRenderingContext2D::MoveTo(float x
 }
 
 NS_IMETHODIMP
 CanvasRenderingContext2D::LineTo(float x, float y)
 {
   LineTo((double)x, (double)y);
   return NS_OK;
 }
-  
+
 NS_IMETHODIMP
 CanvasRenderingContext2D::QuadraticCurveTo(float cpx, float cpy, float x,
                                            float y)
 {
   QuadraticCurveTo((double)cpx, (double)cpy, (double)x, (double)y);
   return NS_OK;
 }
 
@@ -3201,17 +3201,17 @@ CanvasRenderingContext2D::DrawOrMeasureT
     processor.mThebes->SetMatrix(gfxMatrix(matrix._11, matrix._12, matrix._21, matrix._22, matrix._31, matrix._32));
   }
   processor.mCtx = this;
   processor.mOp = aOp;
   processor.mBoundingBox = gfxRect(0, 0, 0, 0);
   processor.mDoMeasureBoundingBox = doDrawShadow || !mIsEntireFrameInvalid;
   processor.mState = &CurrentState();
   processor.mFontgrp = currentFontStyle;
-    
+
   nscoord totalWidthCoord;
 
   // calls bidi algo twice since it needs the full text width and the
   // bounding boxes before rendering anything
   nsBidi bidiEngine;
   rv = nsBidiPresUtils::ProcessText(textToDraw.get(),
                                     textToDraw.Length(),
                                     isRTL ? NSBIDI_RTL : NSBIDI_LTR,
@@ -3366,17 +3366,17 @@ gfxFontGroup *CanvasRenderingContext2D::
                                                     nullptr);
       if (CurrentState().fontGroup) {
         CurrentState().font = kDefaultFontStyle;
         rv = NS_OK;
       } else {
         rv = NS_ERROR_OUT_OF_MEMORY;
       }
     }
-            
+
     NS_ASSERTION(NS_SUCCEEDED(rv), "Default canvas font is invalid");
   }
 
   return CurrentState().fontGroup;
 }
 
 //
 // line caps/joins
@@ -3549,30 +3549,30 @@ CanvasRenderingContext2D::GetMozDash(JSC
 
 NS_IMETHODIMP
 CanvasRenderingContext2D::GetMozDash(JSContext* cx, jsval* dashArray)
 {
   ErrorResult rv;
   *dashArray = GetMozDash(cx, rv);
   return rv.ErrorCode();
 }
- 
+
 NS_IMETHODIMP
 CanvasRenderingContext2D::SetMozDashOffset(float offset)
 {
   if (!FloatValidate(offset)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   ContextState& state = CurrentState();
   if (!state.dash.IsEmpty()) {
     state.dashOffset = offset;
   }
   return NS_OK;
 }
- 
+
 NS_IMETHODIMP
 CanvasRenderingContext2D::GetMozDashOffset(float* offset)
 {
   *offset = MozDashOffset();
   return NS_OK;
 }
 
 bool
@@ -3614,17 +3614,17 @@ CanvasRenderingContext2D::IsPointInPath(
 // dx, dy, dw and dh are passed in then optional_argc should be 2. The only
 // other valid value for optional_argc is 6 if sx, sy, sw, sh, dx, dy, dw and dh
 // are all passed in.
 
 void
 CanvasRenderingContext2D::DrawImage(const HTMLImageOrCanvasOrVideoElement& image,
                                     double sx, double sy, double sw,
                                     double sh, double dx, double dy,
-                                    double dw, double dh, 
+                                    double dw, double dh,
                                     uint8_t optional_argc,
                                     ErrorResult& error)
 {
   MOZ_ASSERT(optional_argc == 0 || optional_argc == 2 || optional_argc == 6);
 
   RefPtr<SourceSurface> srcSurf;
   gfxIntSize imgSize;
 
@@ -3741,17 +3741,17 @@ CanvasRenderingContext2D::DrawImage(cons
   Filter filter;
 
   if (CurrentState().imageSmoothingEnabled)
     filter = mgfx::FILTER_LINEAR;
   else
     filter = mgfx::FILTER_POINT;
 
   mgfx::Rect bounds;
-  
+
   if (NeedToDrawShadow()) {
     bounds = mgfx::Rect(dx, dy, dw, dh);
     bounds = mTarget->GetTransform().TransformBounds(bounds);
   }
 
   AdjustedTarget(this, bounds.IsEmpty() ? nullptr : &bounds)->
     DrawSurface(srcSurf,
                 mgfx::Rect(dx, dy, dw, dh),
@@ -4238,17 +4238,17 @@ CanvasRenderingContext2D::GetImageDataAr
   IntRect destRect(aX, aY, aWidth, aHeight);
 
   IntRect srcReadRect = srcRect.Intersect(destRect);
   IntRect dstWriteRect = srcReadRect;
   dstWriteRect.MoveBy(-aX, -aY);
 
   uint8_t* src = data;
   uint32_t srcStride = aWidth * 4;
-  
+
   RefPtr<DataSourceSurface> readback;
   if (!srcReadRect.IsEmpty()) {
     RefPtr<SourceSurface> snapshot = mTarget->Snapshot();
     if (snapshot) {
       readback = snapshot->GetDataSurface();
 
       srcStride = readback->Stride();
       src = readback->GetData() + srcReadRect.y * srcStride + srcReadRect.x * 4;
@@ -4502,17 +4502,17 @@ CanvasRenderingContext2D::PutImageData_e
 }
 
 NS_IMETHODIMP
 CanvasRenderingContext2D::GetThebesSurface(gfxASurface **surface)
 {
   EnsureTarget();
   if (!mThebesSurface) {
     mThebesSurface =
-      gfxPlatform::GetPlatform()->GetThebesSurfaceForDrawTarget(mTarget);    
+      gfxPlatform::GetPlatform()->GetThebesSurfaceForDrawTarget(mTarget);
 
     if (!mThebesSurface) {
       return NS_ERROR_FAILURE;
     }
   } else {
     // Normally GetThebesSurfaceForDrawTarget will handle the flush, when
     // we're returning a cached ThebesSurface we need to flush here.
     mTarget->Flush();