Numerous whitespace fixes in D3D9 layers code.
authorBas Schouten <bschouten@mozilla.com>
Sat, 29 May 2010 05:27:03 +0200
changeset 42922 c458465578e05553463703065a793280ccf36855
parent 42921 d8a36dd3fc3c17196c577596464735412794343f
child 42923 76f945869514d0f272077d9e3c25089edae07fa6
push idunknown
push userunknown
push dateunknown
milestone1.9.3a5pre
Numerous whitespace fixes in D3D9 layers code.
gfx/layers/d3d9/CanvasLayerD3D9.cpp
gfx/layers/d3d9/CanvasLayerD3D9.h
gfx/layers/d3d9/ColorLayerD3D9.cpp
gfx/layers/d3d9/ColorLayerD3D9.h
gfx/layers/d3d9/ContainerLayerD3D9.cpp
gfx/layers/d3d9/ContainerLayerD3D9.h
gfx/layers/d3d9/ImageLayerD3D9.cpp
gfx/layers/d3d9/ImageLayerD3D9.h
gfx/layers/d3d9/LayerManagerD3D9.cpp
gfx/layers/d3d9/LayerManagerD3D9.h
gfx/layers/d3d9/LayerManagerD3D9Shaders.hlsl
gfx/layers/d3d9/ThebesLayerD3D9.cpp
gfx/layers/d3d9/ThebesLayerD3D9.h
--- a/gfx/layers/d3d9/CanvasLayerD3D9.cpp
+++ b/gfx/layers/d3d9/CanvasLayerD3D9.cpp
@@ -157,17 +157,17 @@ CanvasLayerD3D9::Updated(const nsIntRect
     }
 
     for (int y = 0; y < aRect.height; y++) {
       memcpy((PRUint8*)lockedRect.pBits + lockedRect.Pitch * y,
              startBits + sourceStride * y,
              aRect.width * 4);
     }
 
-    mTexture->UnlockRect(0);    
+    mTexture->UnlockRect(0);
   }
 }
 
 LayerD3D9::LayerType
 CanvasLayerD3D9::GetType()
 {
   return TYPE_CANVAS;
 }
@@ -182,17 +182,17 @@ void
 CanvasLayerD3D9::RenderLayer()
 {
   float quadTransform[4][4];
   /*
    * Matrix to transform the <0.0,0.0>, <1.0,1.0> quad to the correct position
    * and size. To get pixel perfect mapping we offset the quad half a pixel
    * to the top-left. We also flip the Y axis here, note we can only do this
    * because we are in CULL_NONE mode!
-   * 
+   *
    * See: http://msdn.microsoft.com/en-us/library/bb219690%28VS.85%29.aspx
    */
   memset(&quadTransform, 0, sizeof(quadTransform));
   quadTransform[0][0] = (float)mBounds.width;
   if (mNeedsYFlip) {
     quadTransform[1][1] = (float)-mBounds.height;
     quadTransform[3][1] = (float)mBounds.height - 0.5f;
   } else {
--- a/gfx/layers/d3d9/CanvasLayerD3D9.h
+++ b/gfx/layers/d3d9/CanvasLayerD3D9.h
@@ -52,17 +52,17 @@ class THEBES_API CanvasLayerD3D9 :
 {
 public:
   CanvasLayerD3D9(LayerManagerD3D9 *aManager)
     : CanvasLayer(aManager, NULL),
       LayerD3D9(aManager),
       mTexture(0),
       mGLBufferIsPremultiplied(PR_FALSE),
       mNeedsYFlip(PR_FALSE)
-  { 
+  {
       mImplData = static_cast<LayerD3D9*>(this);
   }
 
   ~CanvasLayerD3D9();
 
   // CanvasLayer implementation
   virtual void Initialize(const Data& aData);
   virtual void Updated(const nsIntRect& aRect);
--- a/gfx/layers/d3d9/ColorLayerD3D9.cpp
+++ b/gfx/layers/d3d9/ColorLayerD3D9.cpp
@@ -51,17 +51,17 @@ Layer*
 ColorLayerD3D9::GetLayer()
 {
   return this;
 }
 
 void
 ColorLayerD3D9::RenderLayer()
 {
-  // XXX we might be able to improve performance by using 
+  // XXX we might be able to improve performance by using
   // IDirect3DDevice9::Clear
 
   float quadTransform[4][4];
   nsIntRect visibleRect = mVisibleRegion.GetBounds();
   // Transform the quad to the size of the visible area.
   memset(&quadTransform, 0, sizeof(quadTransform));
   quadTransform[0][0] = (float)visibleRect.width;
   quadTransform[1][1] = (float)visibleRect.height;
--- a/gfx/layers/d3d9/ColorLayerD3D9.h
+++ b/gfx/layers/d3d9/ColorLayerD3D9.h
@@ -46,17 +46,17 @@ namespace layers {
 
 class THEBES_API ColorLayerD3D9 : public ColorLayer,
                                  public LayerD3D9
 {
 public:
   ColorLayerD3D9(LayerManagerD3D9 *aManager)
     : ColorLayer(aManager, NULL)
     , LayerD3D9(aManager)
-  { 
+  {
     mImplData = static_cast<LayerD3D9*>(this);
   }
 
   virtual void SetVisibleRegion(const nsIntRegion& aRegion) { mVisibleRegion = aRegion; }
 
   // LayerD3D9 Implementation
   virtual LayerType GetType();
 
--- a/gfx/layers/d3d9/ContainerLayerD3D9.cpp
+++ b/gfx/layers/d3d9/ContainerLayerD3D9.cpp
@@ -81,17 +81,17 @@ ContainerLayerD3D9::InsertAfter(Layer* a
     aChild->SetNextSibling(oldFirstChild);
     aChild->SetPrevSibling(nsnull);
     if (oldFirstChild) {
       oldFirstChild->SetPrevSibling(aChild);
     }
     NS_ADDREF(aChild);
     return;
   }
-  for (Layer *child = GetFirstChild(); 
+  for (Layer *child = GetFirstChild();
        child; child = child->GetNextSibling()) {
     if (aAfter == child) {
       Layer *oldNextSibling = child->GetNextSibling();
       child->SetNextSibling(aChild);
       aChild->SetNextSibling(oldNextSibling);
       if (oldNextSibling) {
         oldNextSibling->SetPrevSibling(aChild);
       }
@@ -111,17 +111,17 @@ ContainerLayerD3D9::RemoveChild(Layer *a
       GetFirstChild()->GetNextSibling() : nsnull;
     if (mFirstChild) {
       mFirstChild->SetPrevSibling(nsnull);
     }
     NS_RELEASE(aChild);
     return;
   }
   Layer *lastChild = nsnull;
-  for (Layer *child = GetFirstChild(); child; 
+  for (Layer *child = GetFirstChild(); child;
        child = child->GetNextSibling()) {
     if (child == aChild) {
       // We're sure this is not our first child. So lastChild != NULL.
       lastChild->SetNextSibling(child->GetNextSibling());
       if (child->GetNextSibling()) {
         child->GetNextSibling()->SetPrevSibling(lastChild);
       }
       child->SetNextSibling(nsnull);
@@ -165,40 +165,40 @@ ContainerLayerD3D9::RenderLayer()
   float renderTargetOffset[] = { 0, 0, 0, 0 };
   float oldViewMatrix[4][4];
 
   PRBool useIntermediate = (opacity != 1.0 || !mTransform.IsIdentity());
 
   if (useIntermediate) {
     device()->GetRenderTarget(0, getter_AddRefs(previousRenderTarget));
     device()->CreateTexture(mVisibleRect.width, mVisibleRect.height, 1,
-			    D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8,
-			    D3DPOOL_DEFAULT, getter_AddRefs(renderTexture),
+                            D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8,
+                            D3DPOOL_DEFAULT, getter_AddRefs(renderTexture),
                             NULL);
     nsRefPtr<IDirect3DSurface9> renderSurface;
     renderTexture->GetSurfaceLevel(0, getter_AddRefs(renderSurface));
     device()->SetRenderTarget(0, renderSurface);
     device()->GetVertexShaderConstantF(12, previousRenderTargetOffset, 1);
     renderTargetOffset[0] = (float)GetVisibleRect().x;
     renderTargetOffset[1] = (float)GetVisibleRect().y;
     device()->SetVertexShaderConstantF(12, renderTargetOffset, 1);
 
     float viewMatrix[4][4];
     /*
-     * Matrix to transform to viewport space ( <-1.0, 1.0> topleft, 
+     * Matrix to transform to viewport space ( <-1.0, 1.0> topleft,
      * <1.0, -1.0> bottomright)
      */
     memset(&viewMatrix, 0, sizeof(viewMatrix));
     viewMatrix[0][0] = 2.0f / mVisibleRect.width;
     viewMatrix[1][1] = -2.0f / mVisibleRect.height;
     viewMatrix[2][2] = 1.0f;
     viewMatrix[3][0] = -1.0f;
     viewMatrix[3][1] = 1.0f;
     viewMatrix[3][3] = 1.0f;
-    
+
     device()->GetVertexShaderConstantF(8, &oldViewMatrix[0][0], 4);
     device()->SetVertexShaderConstantF(8, &viewMatrix[0][0], 4);
   }
 
   /*
    * Render this container's contents.
    */
   LayerD3D9 *layerToRender = GetFirstChildD3D9();
@@ -247,17 +247,17 @@ ContainerLayerD3D9::RenderLayer()
     device()->SetVertexShaderConstantF(12, previousRenderTargetOffset, 1);
     device()->SetVertexShaderConstantF(8, &oldViewMatrix[0][0], 4);
 
     float quadTransform[4][4];
     /*
      * Matrix to transform the <0.0,0.0>, <1.0,1.0> quad to the correct position
      * and size. To get pixel perfect mapping we offset the quad half a pixel
      * to the top-left.
-     * 
+     *
      * See: http://msdn.microsoft.com/en-us/library/bb219690%28VS.85%29.aspx
      */
     memset(&quadTransform, 0, sizeof(quadTransform));
     quadTransform[0][0] = (float)GetVisibleRect().width;
     quadTransform[1][1] = (float)GetVisibleRect().height;
     quadTransform[2][2] = 1.0f;
     quadTransform[3][0] = (float)GetVisibleRect().x - 0.5f;
     quadTransform[3][1] = (float)GetVisibleRect().y - 0.5f;
--- a/gfx/layers/d3d9/ContainerLayerD3D9.h
+++ b/gfx/layers/d3d9/ContainerLayerD3D9.h
@@ -39,17 +39,17 @@
 #define GFX_CONTAINERLAYERD3D9_H
 
 #include "Layers.h"
 #include "LayerManagerD3D9.h"
 
 namespace mozilla {
 namespace layers {
 
-class ContainerLayerD3D9 : public ContainerLayer, 
+class ContainerLayerD3D9 : public ContainerLayer,
                            public LayerD3D9
 {
 public:
   ContainerLayerD3D9(LayerManagerD3D9 *aManager);
   ~ContainerLayerD3D9();
 
   const nsIntRect &GetVisibleRect();
 
--- a/gfx/layers/d3d9/ImageLayerD3D9.cpp
+++ b/gfx/layers/d3d9/ImageLayerD3D9.cpp
@@ -265,17 +265,17 @@ PlanarYCbCrImageD3D9::SetData(const Plan
     NS_ERROR("YCbCr format not supported");
   }
 
   mData = aData;
   mData.mCbCrStride = mData.mCbCrSize.width = aData.mPicSize.width >> width_shift;
   mData.mCbCrSize.height = aData.mPicSize.height >> height_shift;
   mData.mYSize = aData.mPicSize;
   mData.mYStride = mData.mYSize.width;
-  
+
   mBuffer = new PRUint8[mData.mCbCrStride * mData.mCbCrSize.height * 2 +
                         mData.mYStride * mData.mYSize.height];
   mData.mYChannel = mBuffer;
   mData.mCbChannel = mData.mYChannel + mData.mYStride * mData.mYSize.height;
   mData.mCrChannel = mData.mCbChannel + mData.mCbCrStride * mData.mCbCrSize.height;
 
   int cbcr_x = aData.mPicX >> width_shift;
   int cbcr_y = aData.mPicY >> height_shift;
@@ -385,30 +385,30 @@ PlanarYCbCrImageD3D9::FreeTextures()
 {
 }
 
 already_AddRefed<gfxASurface>
 PlanarYCbCrImageD3D9::GetAsSurface()
 {
   nsRefPtr<gfxImageSurface> imageSurface =
     new gfxImageSurface(mSize, gfxASurface::ImageFormatRGB24);
- 
+
   // Convert from YCbCr to RGB now
   gfx::ConvertYCbCrToRGB32(mData.mYChannel,
                            mData.mCbChannel,
                            mData.mCrChannel,
                            imageSurface->Data(),
                            0,
                            0,
                            mSize.width,
                            mSize.height,
                            mData.mYStride,
                            mData.mCbCrStride,
                            imageSurface->Stride(),
-                           gfx::YV12); 
+                           gfx::YV12);
 
   return imageSurface.forget().get();
 }
 
 CairoImageD3D9::~CairoImageD3D9()
 {
 }
 
--- a/gfx/layers/d3d9/ImageLayerD3D9.h
+++ b/gfx/layers/d3d9/ImageLayerD3D9.h
@@ -72,17 +72,17 @@ private:
 
 class THEBES_API ImageLayerD3D9 : public ImageLayer,
                                   public LayerD3D9
 {
 public:
   ImageLayerD3D9(LayerManagerD3D9 *aManager)
     : ImageLayer(aManager, NULL)
     , LayerD3D9(aManager)
-  { 
+  {
     mImplData = static_cast<LayerD3D9*>(this);
   }
 
   // LayerD3D9 Implementation
   virtual LayerType GetType();
 
   virtual Layer* GetLayer();
 
@@ -115,17 +115,17 @@ public:
    * drawing this frame. We cannot free this from the constructor since it may
    * be destroyed off the main-thread and might not be able to properly clean
    * up its textures
    */
   void FreeTextures();
   PRBool HasData() { return mHasData; }
 
   virtual already_AddRefed<gfxASurface> GetAsSurface();
-  
+
   nsAutoArrayPtr<PRUint8> mBuffer;
   LayerManagerD3D9 *mManager;
   Data mData;
   gfxIntSize mSize;
   nsRefPtr<IDirect3DTexture9> mYTexture;
   nsRefPtr<IDirect3DTexture9> mCrTexture;
   nsRefPtr<IDirect3DTexture9> mCbTexture;
   PRPackedBool mHasData;
--- a/gfx/layers/d3d9/LayerManagerD3D9.cpp
+++ b/gfx/layers/d3d9/LayerManagerD3D9.cpp
@@ -158,17 +158,17 @@ LayerManagerD3D9::Initialize()
     return PR_FALSE;
   }
 
   vertex *vertices;
   hr = mVB->Lock(0, 0, (void**)&vertices, 0);
   if (FAILED(hr)) {
     return PR_FALSE;
   }
-  
+
   vertices[0].x = vertices[0].y = 0;
   vertices[1].x = 1; vertices[1].y = 0;
   vertices[2].x = 0; vertices[2].y = 1;
   vertices[3].x = 1; vertices[3].y = 1;
 
   mVB->Unlock();
 
   hr = mDevice->SetStreamSource(0, mVB, 0, sizeof(vertex));
@@ -176,22 +176,22 @@ LayerManagerD3D9::Initialize()
     return PR_FALSE;
   }
 
   D3DVERTEXELEMENT9 elements[] = {
     { 0, 0, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT,
       D3DDECLUSAGE_POSITION, 0 },
     D3DDECL_END()
   };
-  
+
   mDevice->CreateVertexDeclaration(elements, getter_AddRefs(mVD));
 
   SetupRenderState();
 
-  nsCOMPtr<nsIConsoleService> 
+  nsCOMPtr<nsIConsoleService>
     console(do_GetService(NS_CONSOLESERVICE_CONTRACTID));
 
   D3DADAPTER_IDENTIFIER9 identifier;
   mD3D9->GetAdapterIdentifier(D3DADAPTER_DEFAULT, 0, &identifier);
 
   if (console) {
     nsString msg;
     msg +=
@@ -323,17 +323,17 @@ LayerManagerD3D9::Render()
   }
   SetupPipeline();
   nsIntRect rect;
   mWidget->GetBounds(rect);
 
   mDevice->Clear(0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0, 0);
 
   mDevice->BeginScene();
-  
+
   if (mRootLayer) {
     const nsIntRect *clipRect = mRootLayer->GetLayer()->GetClipRect();
     RECT r;
     if (clipRect) {
       r.left = (LONG)clipRect->x;
       r.top = (LONG)clipRect->y;
       r.right = (LONG)(clipRect->x + clipRect->width);
       r.bottom = (LONG)(clipRect->y + clipRect->height);
@@ -369,40 +369,40 @@ LayerManagerD3D9::Render()
 void
 LayerManagerD3D9::SetupPipeline()
 {
   nsIntRect rect;
   mWidget->GetBounds(rect);
 
   float viewMatrix[4][4];
   /*
-   * Matrix to transform to viewport space ( <-1.0, 1.0> topleft, 
+   * Matrix to transform to viewport space ( <-1.0, 1.0> topleft,
    * <1.0, -1.0> bottomright)
    */
   memset(&viewMatrix, 0, sizeof(viewMatrix));
   viewMatrix[0][0] = 2.0f / rect.width;
   viewMatrix[1][1] = -2.0f / rect.height;
   viewMatrix[2][2] = 1.0f;
   viewMatrix[3][0] = -1.0f;
   viewMatrix[3][1] = 1.0f;
   viewMatrix[3][3] = 1.0f;
-  
+
   HRESULT hr = mDevice->SetVertexShaderConstantF(8, &viewMatrix[0][0], 4);
 
   if (FAILED(hr)) {
     NS_WARNING("Failed to set projection shader constant!");
   }
 }
 
 PRBool
 LayerManagerD3D9::SetupBackBuffer()
 {
   nsRefPtr<IDirect3DSurface9> backBuffer;
   mDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO,
-			 getter_AddRefs(backBuffer));
+                         getter_AddRefs(backBuffer));
 
   D3DSURFACE_DESC desc;
   nsIntRect rect;
   mWidget->GetBounds(rect);
   backBuffer->GetDesc(&desc);
 
   HRESULT hr = mDevice->TestCooperativeLevel();
 
--- a/gfx/layers/d3d9/LayerManagerD3D9.h
+++ b/gfx/layers/d3d9/LayerManagerD3D9.h
@@ -67,17 +67,17 @@ public:
    * to draw to the window. If this method fails the device cannot be used.
    * This function is not threadsafe.
    *
    * \return True is initialization was succesful, false when it was not.
    */
   PRBool Initialize();
 
   /*
-   * Sets the clipping region for this layer manager. This is important on 
+   * Sets the clipping region for this layer manager. This is important on
    * windows because using OGL we no longer have GDI's native clipping. Therefor
    * widget must tell us what part of the screen is being invalidated,
    * and we should clip to this.
    *
    * \param aClippingRegion Region to clip to. Setting an empty region
    * will disable clipping.
    */
   void SetClippingRegion(const nsIntRegion& aClippingRegion);
@@ -97,17 +97,17 @@ public:
   };
 
   void EndTransaction(DrawThebesLayerCallback aCallback,
                       void* aCallbackData);
 
   const CallbackInfo &GetCallbackInfo() { return mCurrentCallbackInfo; }
 
   void SetRoot(Layer* aLayer);
-  
+
   virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
 
   virtual already_AddRefed<ContainerLayer> CreateContainerLayer();
 
   virtual already_AddRefed<ImageLayer> CreateImageLayer();
 
   virtual already_AddRefed<ColorLayer> CreateColorLayer();
 
@@ -135,17 +135,17 @@ public:
   nsTArray<ThebesLayerD3D9*> mThebesLayers;
 
 private:
   /* Direct3D9 instance */
   static IDirect3D9 *mD3D9;
 
   /* Widget associated with this layer manager */
   nsIWidget *mWidget;
-  /* 
+  /*
    * Context target, NULL when drawing directly to our swap chain.
    */
   nsRefPtr<gfxContext> mTarget;
 
   nsRefPtr<IDirect3DDevice9> mDevice;
 
   /* Vertex shader used for layer quads */
   nsRefPtr<IDirect3DVertexShader9> mLayerVS;
@@ -165,17 +165,17 @@ private:
   /* Our vertex declaration */
   nsRefPtr<IDirect3DVertexDeclaration9> mVD;
 
   /* Current root layer. */
   LayerD3D9 *mRootLayer;
 
   /* Callback info for current transaction */
   CallbackInfo mCurrentCallbackInfo;
-  
+
   /*
    * Region we're clipping our current drawing to.
    */
   nsIntRegion mClippingRegion;
   /*
    * Render the current layer tree to the active target.
    */
   void Render();
@@ -209,17 +209,17 @@ private:
  */
 class LayerD3D9
 {
 public:
   LayerD3D9(LayerManagerD3D9 *aManager);
 
   enum LayerType { TYPE_THEBES, TYPE_CONTAINER, TYPE_IMAGE, TYPE_COLOR,
                    TYPE_CANVAS };
-  
+
   virtual LayerType GetType() = 0;
 
   virtual LayerD3D9 *GetFirstChildD3D9() { return nsnull; }
 
   void SetFirstChild(LayerD3D9 *aParent);
 
   virtual Layer* GetLayer() = 0;
 
--- a/gfx/layers/d3d9/LayerManagerD3D9Shaders.hlsl
+++ b/gfx/layers/d3d9/LayerManagerD3D9Shaders.hlsl
@@ -46,16 +46,16 @@ float4 YCbCrShader(const VS_OUTPUT aVert
   yuv.r = tex2D(s2DCr, aVertex.vTexCoords).r - 0.5;
   yuv.g = tex2D(s2DY, aVertex.vTexCoords).r - 0.0625;
   yuv.b = tex2D(s2DCb, aVertex.vTexCoords).r - 0.5;
 
   color.r = yuv.g * 1.164 + yuv.r * 1.596;
   color.g = yuv.g * 1.164 - 0.813 * yuv.r - 0.391 * yuv.b;
   color.b = yuv.g * 1.164 + yuv.b * 2.018;
   color.a = 1.0f;
-  
+ 
   return color * fLayerOpacity;
 }
 
 float4 SolidColorShader(const VS_OUTPUT aVertex) : COLOR
 {
   return fLayerColor;
 }
--- a/gfx/layers/d3d9/ThebesLayerD3D9.cpp
+++ b/gfx/layers/d3d9/ThebesLayerD3D9.cpp
@@ -59,18 +59,18 @@ void
 ThebesLayerD3D9::SetVisibleRegion(const nsIntRegion &aRegion)
 {
   if (aRegion.GetBounds() == mVisibleRect) {
     return;
   }
   mVisibleRect = aRegion.GetBounds();
 
   device()->CreateTexture(mVisibleRect.width, mVisibleRect.height, 1,
-			  D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8,
-			  D3DPOOL_DEFAULT, getter_AddRefs(mTexture), NULL);
+                          D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8,
+                          D3DPOOL_DEFAULT, getter_AddRefs(mTexture), NULL);
 
   mInvalidatedRect = mVisibleRect;
 }
 
 
 void
 ThebesLayerD3D9::InvalidateRegion(const nsIntRegion &aRegion)
 {
@@ -92,18 +92,18 @@ ThebesLayerD3D9::GetVisibleRect()
   return mVisibleRect;
 }
 
 void
 ThebesLayerD3D9::RenderLayer()
 {
   if (!mTexture) {
     device()->CreateTexture(mVisibleRect.width, mVisibleRect.height, 1,
-			      D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8,
-			      D3DPOOL_DEFAULT, getter_AddRefs(mTexture), NULL);
+                            D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8,
+                            D3DPOOL_DEFAULT, getter_AddRefs(mTexture), NULL);
     mInvalidatedRect = mVisibleRect;
   }
   if (!mInvalidatedRect.IsEmpty()) {
     nsIntRegion region = mInvalidatedRect;
 
     gfxASurface::gfxImageFormat imageFormat = gfxASurface::ImageFormatARGB32;;
     nsRefPtr<gfxASurface> destinationSurface;
     nsRefPtr<gfxContext> context;
@@ -113,21 +113,21 @@ ThebesLayerD3D9::RenderLayer()
         CreateOffscreenSurface(gfxIntSize(mInvalidatedRect.width,
                                           mInvalidatedRect.height),
                                imageFormat);
 
     context = new gfxContext(destinationSurface);
     context->Translate(gfxPoint(-mInvalidatedRect.x, -mInvalidatedRect.y));
     LayerManagerD3D9::CallbackInfo cbInfo = mD3DManager->GetCallbackInfo();
     cbInfo.Callback(this, context, region, cbInfo.CallbackData);
-    
+
     nsRefPtr<IDirect3DTexture9> tmpTexture;
     device()->CreateTexture(mInvalidatedRect.width, mInvalidatedRect.height, 1,
-			    0, D3DFMT_A8R8G8B8,
-			    D3DPOOL_SYSTEMMEM, getter_AddRefs(tmpTexture), NULL);
+                            0, D3DFMT_A8R8G8B8,
+                            D3DPOOL_SYSTEMMEM, getter_AddRefs(tmpTexture), NULL);
 
     D3DLOCKED_RECT r;
     tmpTexture->LockRect(0, &r, NULL, 0);
 
     nsRefPtr<gfxImageSurface> imgSurface =
       new gfxImageSurface((unsigned char *)r.pBits,
                           gfxIntSize(mInvalidatedRect.width,
                                      mInvalidatedRect.height),
@@ -140,32 +140,32 @@ ThebesLayerD3D9::RenderLayer()
     context->Paint();
 
     imgSurface = NULL;
 
     tmpTexture->UnlockRect(0);
 
     nsRefPtr<IDirect3DSurface9> srcSurface;
     nsRefPtr<IDirect3DSurface9> dstSurface;
-    
+
     mTexture->GetSurfaceLevel(0, getter_AddRefs(dstSurface));
     tmpTexture->GetSurfaceLevel(0, getter_AddRefs(srcSurface));
-    
+
     POINT point;
     point.x = mInvalidatedRect.x - mVisibleRect.x;
     point.y = mInvalidatedRect.y - mVisibleRect.y;
     device()->UpdateSurface(srcSurface, NULL, dstSurface, &point);
   }
-  
+
   float quadTransform[4][4];
   /*
    * Matrix to transform the <0.0,0.0>, <1.0,1.0> quad to the correct position
    * and size. To get pixel perfect mapping we offset the quad half a pixel
    * to the top-left.
-   * 
+   *
    * See: http://msdn.microsoft.com/en-us/library/bb219690%28VS.85%29.aspx
    */
   memset(&quadTransform, 0, sizeof(quadTransform));
   quadTransform[0][0] = (float)GetVisibleRect().width;
   quadTransform[1][1] = (float)GetVisibleRect().height;
   quadTransform[2][2] = 1.0f;
   quadTransform[3][0] = (float)GetVisibleRect().x - 0.5f;
   quadTransform[3][1] = (float)GetVisibleRect().y - 0.5f;
--- a/gfx/layers/d3d9/ThebesLayerD3D9.h
+++ b/gfx/layers/d3d9/ThebesLayerD3D9.h
@@ -41,17 +41,17 @@
 #include "Layers.h"
 #include "LayerManagerD3D9.h"
 #include "gfxImageSurface.h"
 
 
 namespace mozilla {
 namespace layers {
 
-class ThebesLayerD3D9 : public ThebesLayer, 
+class ThebesLayerD3D9 : public ThebesLayer,
                         public LayerD3D9
 {
 public:
   ThebesLayerD3D9(LayerManagerD3D9 *aManager);
   virtual ~ThebesLayerD3D9();
 
   /* Layer implementation */
   void SetVisibleRegion(const nsIntRegion& aRegion);
@@ -66,17 +66,17 @@ public:
   virtual void RenderLayer();
   virtual void CleanResources();
 
   /* ThebesLayerD3D9 */
   const nsIntRect &GetVisibleRect();
   const nsIntRect &GetInvalidatedRect();
 
 private:
-  /* 
+  /*
    * Visible rectangle, this is used to know the size and position of the quad
    * when doing the rendering of this layer.
    */
   nsIntRect mVisibleRect;
   /*
    * Currently invalidated rectangular area.
    */
   nsIntRect mInvalidatedRect;