Backed out changeset 6150269410b2 (bug 921212) for bustage on a CLOSED TREE.
authorRyan VanderMeulen <ryanvm@gmail.com>
Fri, 18 Oct 2013 10:21:38 -0400
changeset 165164 9ae8ea90aff4e142f777beb659f8488d35a0a983
parent 165163 2c07714a7a821531dfbd8b4dccadaff45ef3830c
child 165165 fb616f657c4cb091f50c434c800f7e08ff256867
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs921212
milestone27.0a1
backs out6150269410b2ddad02f99457a33d922e2e3784ad
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 6150269410b2 (bug 921212) for bustage on a CLOSED TREE.
gfx/2d/2D.h
gfx/2d/DrawTargetCairo.cpp
gfx/2d/DrawTargetCairo.h
gfx/layers/BufferUnrotate.cpp
gfx/layers/BufferUnrotate.h
gfx/layers/ThebesLayerBuffer.cpp
gfx/layers/ThebesLayerBuffer.h
gfx/layers/client/ContentClient.cpp
gfx/layers/moz.build
gfx/tests/gtest/TestBufferRotation.cpp
gfx/tests/gtest/moz.build
--- a/gfx/2d/2D.h
+++ b/gfx/2d/2D.h
@@ -573,25 +573,16 @@ public:
   /**
    * Returns a SourceSurface which is a snapshot of the current contents of the DrawTarget.
    * Multiple calls to Snapshot() without any drawing operations in between will
    * normally return the same SourceSurface object.
    */
   virtual TemporaryRef<SourceSurface> Snapshot() = 0;
   virtual IntSize GetSize() = 0;
 
-  /**
-   * If possible returns the bits to this DrawTarget for direct manipulation. While
-   * the bits is locked any modifications to this DrawTarget is forbidden.
-   * Release takes the original data pointer for safety.
-   */
-  virtual bool LockBits(uint8_t** aData, IntSize* aSize,
-                        int32_t* aStride, SurfaceFormat* aFormat) { return false; }
-  virtual void ReleaseBits(uint8_t* aData) {}
-
   /* Ensure that the DrawTarget backend has flushed all drawing operations to
    * this draw target. This must be called before using the backing surface of
    * this draw target outside of GFX 2D code.
    */
   virtual void Flush() = 0;
 
   /*
    * Draw a surface to the draw target. Possibly doing partial drawing or
--- a/gfx/2d/DrawTargetCairo.cpp
+++ b/gfx/2d/DrawTargetCairo.cpp
@@ -394,27 +394,25 @@ NeedIntermediateSurface(const Pattern& a
   if (aOptions.mAlpha == 1.0)
     return false;
 
   return true;
 }
 
 DrawTargetCairo::DrawTargetCairo()
   : mContext(nullptr)
-  , mLockedBits(nullptr)
 {
 }
 
 DrawTargetCairo::~DrawTargetCairo()
 {
   cairo_destroy(mContext);
   if (mSurface) {
     cairo_surface_destroy(mSurface);
   }
-  MOZ_ASSERT(!mLockedBits);
 }
 
 IntSize
 DrawTargetCairo::GetSize()
 {
   return mSize;
 }
 
@@ -430,41 +428,16 @@ DrawTargetCairo::Snapshot()
   cairo_content_t content = cairo_surface_get_content(mSurface);
   mSnapshot = new SourceSurfaceCairo(mSurface,
                                      size,
                                      CairoContentToGfxFormat(content),
                                      this);
   return mSnapshot;
 }
 
-bool
-DrawTargetCairo::LockBits(uint8_t** aData, IntSize* aSize,
-                          int32_t* aStride, SurfaceFormat* aFormat)
-{
-  if (cairo_surface_get_type(mSurface) == CAIRO_SURFACE_TYPE_IMAGE) {
-    WillChange();
-
-    mLockedBits = cairo_image_surface_get_data(mSurface);
-    *aData = mLockedBits;
-    *aSize = GetSize();
-    *aStride = cairo_image_surface_get_stride(mSurface);
-    *aFormat = GetFormat();
-    return true;
-  }
-
-  return false;
-}
-
-void
-DrawTargetCairo::ReleaseBits(uint8_t* aData)
-{
-  MOZ_ASSERT(mLockedBits = aData);
-  mLockedBits = nullptr;
-}
-
 void
 DrawTargetCairo::Flush()
 {
   cairo_surface_t* surf = cairo_get_target(mContext);
   cairo_surface_flush(surf);
 }
 
 void
@@ -1161,17 +1134,16 @@ DrawTargetCairo::MarkSnapshotIndependent
     mSnapshot = nullptr;
   }
 }
 
 void
 DrawTargetCairo::WillChange(const Path* aPath /* = nullptr */)
 {
   MarkSnapshotIndependent();
-  MOZ_ASSERT(!mLiveSurface);
 }
 
 void
 DrawTargetCairo::SetTransform(const Matrix& aTransform)
 {
   mTransform = aTransform;
 
   cairo_matrix_t mat;
--- a/gfx/2d/DrawTargetCairo.h
+++ b/gfx/2d/DrawTargetCairo.h
@@ -55,20 +55,16 @@ public:
 
   DrawTargetCairo();
   virtual ~DrawTargetCairo();
 
   virtual BackendType GetType() const { return BACKEND_CAIRO; }
   virtual TemporaryRef<SourceSurface> Snapshot();
   virtual IntSize GetSize();
 
-  virtual bool LockBits(uint8_t** aData, IntSize* aSize,
-                        int32_t* aStride, SurfaceFormat* aFormat);
-  virtual void ReleaseBits(uint8_t* aData);
-
   virtual void Flush();
   virtual void DrawSurface(SourceSurface *aSurface,
                            const Rect &aDest,
                            const Rect &aSource,
                            const DrawSurfaceOptions &aSurfOptions = DrawSurfaceOptions(),
                            const DrawOptions &aOptions = DrawOptions());
   virtual void DrawSurfaceWithShadow(SourceSurface *aSurface,
                                      const Point &aDest,
@@ -183,18 +179,16 @@ private: // methods
   // If the current operator is "source" then clear the destination before we
   // draw into it, to simulate the effect of an unbounded source operator.
   void ClearSurfaceForUnboundedSource(const CompositionOp &aOperator);
 private: // data
   cairo_t* mContext;
   cairo_surface_t* mSurface;
   IntSize mSize;
 
-  uint8_t* mLockedBits;
-
   // The latest snapshot of this surface. This needs to be told when this
   // target is modified. We keep it alive as a cache.
   RefPtr<SourceSurfaceCairo> mSnapshot;
   static cairo_surface_t *mDummySurface;
 };
 
 }
 }
deleted file mode 100644
--- a/gfx/layers/BufferUnrotate.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <algorithm> // min & max
-#include <cstdlib>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-void BufferUnrotate(uint8_t* aBuffer, int aByteWidth, int aHeight,
-                    int aByteStride, int aXBoundary, int aYBoundary)
-{
-  if (aXBoundary != 0) {
-    uint8_t* line = new uint8_t[aByteWidth];
-    uint32_t smallStart = 0;
-    uint32_t smallLen = aXBoundary;
-    uint32_t smallDest = aByteWidth - aXBoundary;
-    uint32_t largeStart = aXBoundary;
-    uint32_t largeLen = aByteWidth - aXBoundary;
-    uint32_t largeDest = 0;
-    if (aXBoundary > aByteWidth / 2) {
-      smallStart = aXBoundary;
-      smallLen = aByteWidth - aXBoundary;
-      smallDest = 0;
-      largeStart = 0;
-      largeLen = aXBoundary;
-      largeDest = smallLen;
-    }
-
-    for (int y = 0; y < aHeight; y++) {
-      int yOffset = y * aByteStride;
-      memcpy(line, &aBuffer[yOffset + smallStart], smallLen);
-      memmove(&aBuffer[yOffset + largeDest], &aBuffer[yOffset + largeStart], largeLen);
-      memcpy(&aBuffer[yOffset + smallDest], line, smallLen);
-    }
-
-    delete[] line;
-  }
-
-  if (aYBoundary != 0) {
-    uint32_t smallestHeight = std::min(aHeight - aYBoundary, aYBoundary);
-    uint32_t largestHeight = std::max(aHeight - aYBoundary, aYBoundary);
-    uint32_t smallOffset = 0;
-    uint32_t largeOffset = aYBoundary * aByteStride;
-    uint32_t largeDestOffset = 0;
-    uint32_t smallDestOffset = largestHeight * aByteStride;
-    if (aYBoundary > aHeight / 2) {
-      smallOffset = aYBoundary * aByteStride;
-      largeOffset = 0;
-      largeDestOffset = smallestHeight * aByteStride;
-      smallDestOffset = 0;
-    }
-
-    uint8_t* smallestSide = new uint8_t[aByteStride * smallestHeight];
-    memcpy(smallestSide, &aBuffer[smallOffset], aByteStride * smallestHeight);
-    memmove(&aBuffer[largeDestOffset], &aBuffer[largeOffset], aByteStride * largestHeight);
-    memcpy(&aBuffer[smallDestOffset], smallestSide, aByteStride * smallestHeight);
-    delete[] smallestSide;
-  }
-}
-
deleted file mode 100644
--- a/gfx/layers/BufferUnrotate.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef GFX_BUFFERUNROTATE_H
-#define GFX_BUFFERUNROTATE_H
-
-#include "mozilla/Types.h"
-
-void BufferUnrotate(uint8_t* aBuffer, int aByteWidth, int aHeight,
-                    int aByteStride, int aXByteBoundary, int aYBoundary);
-
-#endif // GFX_BUFFERUNROTATE_H
--- a/gfx/layers/ThebesLayerBuffer.cpp
+++ b/gfx/layers/ThebesLayerBuffer.cpp
@@ -3,17 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ThebesLayerBuffer.h"
 #include <sys/types.h>                  // for int32_t
 #include <algorithm>                    // for max
 #include "BasicImplData.h"              // for BasicImplData
 #include "BasicLayersImpl.h"            // for ToData
-#include "BufferUnrotate.h"             // for BufferUnrotate
 #include "GeckoProfiler.h"              // for PROFILER_LABEL
 #include "Layers.h"                     // for ThebesLayer, Layer, etc
 #include "gfxColor.h"                   // for gfxRGBA
 #include "gfxContext.h"                 // for gfxContext, etc
 #include "gfxMatrix.h"                  // for gfxMatrix
 #include "gfxPattern.h"                 // for gfxPattern
 #include "gfxPlatform.h"                // for gfxPlatform
 #include "gfxPoint.h"                   // for gfxPoint
@@ -671,64 +670,28 @@ ThebesLayerBuffer::BeginPaint(ThebesLaye
             mBuffer->MovePixels(srcRect, dest);
             if (mode == Layer::SURFACE_COMPONENT_ALPHA) {
               EnsureBufferOnWhite();
               MOZ_ASSERT(mBufferOnWhite);
               mBufferOnWhite->MovePixels(srcRect, dest);
             }
           }
           result.mDidSelfCopy = true;
-          mDidSelfCopy = true;
           // Don't set destBuffer; we special-case self-copies, and
           // just did the necessary work above.
           mBufferRect = destBufferRect;
         } else {
-          // With azure and a data surface perform an buffer unrotate
-          // (SelfCopy).
-          if (IsAzureBuffer()) {
-            unsigned char* data;
-            IntSize size;
-            int32_t stride;
-            SurfaceFormat format;
-
-            if (mDTBuffer->LockBits(&data, &size, &stride, &format)) {
-              uint8_t bytesPerPixel = BytesPerPixel(format);
-              BufferUnrotate(data,
-                             size.width * bytesPerPixel,
-                             size.height, stride,
-                             newRotation.x * bytesPerPixel, newRotation.y);
-              mDTBuffer->ReleaseBits(data);
-
-              if (mode == Layer::SURFACE_COMPONENT_ALPHA) {
-                mDTBufferOnWhite->LockBits(&data, &size, &stride, &format);
-                uint8_t bytesPerPixel = BytesPerPixel(format);
-                BufferUnrotate(data,
-                               size.width * bytesPerPixel,
-                               size.height, stride,
-                               newRotation.x * bytesPerPixel, newRotation.y);
-                mDTBufferOnWhite->ReleaseBits(data);
-              }
-
-              // Buffer unrotate moves all the pixels, note that
-              // we self copied for SyncBackToFrontBuffer
-              result.mDidSelfCopy = true;
-              mDidSelfCopy = true;
-              mBufferRect = destBufferRect;
-              mBufferRotation = nsIntPoint(0, 0);
-            }
-          }
-
-          if (!result.mDidSelfCopy) {
-            destBufferRect = ComputeBufferRect(neededRegion.GetBounds());
-            CreateBuffer(contentType, destBufferRect, bufferFlags,
-                         getter_AddRefs(destBuffer), getter_AddRefs(destBufferOnWhite),
-                         &destDTBuffer, &destDTBufferOnWhite);
-            if (!destBuffer && !destDTBuffer)
-              return result;
-          }
+          // We can't do a real self-copy because the buffer is rotated.
+          // So allocate a new buffer for the destination.
+          destBufferRect = ComputeBufferRect(neededRegion.GetBounds());
+          CreateBuffer(contentType, destBufferRect, bufferFlags,
+                       getter_AddRefs(destBuffer), getter_AddRefs(destBufferOnWhite),
+                       &destDTBuffer, &destDTBufferOnWhite);
+          if (!destBuffer && !destDTBuffer)
+            return result;
         }
       } else {
         mBufferRect = destBufferRect;
         mBufferRotation = newRotation;
       }
     } else {
       // No pixels are going to be kept. The whole visible region
       // will be redrawn, so we don't need to copy anything, so we don't
--- a/gfx/layers/ThebesLayerBuffer.h
+++ b/gfx/layers/ThebesLayerBuffer.h
@@ -141,19 +141,16 @@ protected:
    * is tiled to fill the plane, and the result is clipped to mBufferRect.
    * So the pixel at mBufferRotation within the buffer is what gets painted at
    * mBufferRect.TopLeft().
    * This is "rotation" in the sense of rotating items in a linear buffer,
    * where items falling off the end of the buffer are returned to the
    * buffer at the other end, not 2D rotation!
    */
   nsIntPoint            mBufferRotation;
-  // When this is true it means that all pixels have moved inside the buffer.
-  // It's not possible to sync with another buffer without a full copy.
-  bool                  mDidSelfCopy;
 };
 
 /**
  * This class encapsulates the buffer used to retain ThebesLayer contents,
  * i.e., the contents of the layer's GetVisibleRegion().
  */
 class ThebesLayerBuffer : public RotatedBuffer {
 public:
--- a/gfx/layers/client/ContentClient.cpp
+++ b/gfx/layers/client/ContentClient.cpp
@@ -474,23 +474,31 @@ ContentClientDoubleBuffered::SyncFrontBu
                   this,
                   mFrontUpdatedRegion.GetBounds().x,
                   mFrontUpdatedRegion.GetBounds().y,
                   mFrontUpdatedRegion.GetBounds().width,
                   mFrontUpdatedRegion.GetBounds().height));
 
   nsIntRegion updateRegion = mFrontUpdatedRegion;
 
+  int32_t xBoundary = mBufferRect.XMost() - mBufferRotation.x;
+  int32_t yBoundary = mBufferRect.YMost() - mBufferRotation.y;
+
+  // Figure out whether the area we want to copy wraps the edges of our buffer.
+  bool needFullCopy = (xBoundary < updateRegion.GetBounds().XMost() &&
+                       xBoundary > updateRegion.GetBounds().x) ||
+                      (yBoundary < updateRegion.GetBounds().YMost() &&
+                       yBoundary > updateRegion.GetBounds().y);
+  
   // This is a tricky trade off, we're going to get stuff out of our
   // frontbuffer now, but the next PaintThebes might throw it all (or mostly)
   // away if the visible region has changed. This is why in reality we want
   // this code integrated with PaintThebes to always do the optimal thing.
 
-  if (mDidSelfCopy) {
-    mDidSelfCopy = false;
+  if (needFullCopy) {
     // We can't easily draw our front buffer into us, since we're going to be
     // copying stuff around anyway it's easiest if we just move our situation
     // to non-rotated while we're at it. If this situation occurs we'll have
     // hit a self-copy path in PaintThebes before as well anyway.
     mBufferRect.MoveTo(mFrontBufferRect.TopLeft());
     mBufferRotation = nsIntPoint();
     updateRegion = mBufferRect;
   } else {
--- a/gfx/layers/moz.build
+++ b/gfx/layers/moz.build
@@ -189,17 +189,16 @@ CPP_SOURCES += [
     'basic/BasicColorLayer.cpp',
     'basic/BasicCompositor.cpp',
     'basic/BasicContainerLayer.cpp',
     'basic/BasicImageLayer.cpp',
     'basic/BasicImages.cpp',
     'basic/BasicLayerManager.cpp',
     'basic/BasicLayersImpl.cpp',
     'basic/BasicThebesLayer.cpp',
-    'BufferUnrotate.cpp',
     'client/CanvasClient.cpp',
     'composite/CanvasLayerComposite.cpp',
     'opengl/CanvasLayerOGL.cpp',
     'client/ClientCanvasLayer.cpp',
     'client/ClientColorLayer.cpp',
     'client/ClientContainerLayer.cpp',
     'client/ClientImageLayer.cpp',
     'client/ClientLayerManager.cpp',
deleted file mode 100644
--- a/gfx/tests/gtest/TestBufferRotation.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "gtest/gtest.h"
-
-#include "BufferUnrotate.h"
-
-static unsigned char* GenerateBuffer(int bytesPerPixel,
-                                     int width, int height,
-                                     int stride, int xBoundary, int yBoundary)
-{
-  unsigned char* buffer = new unsigned char[stride*height];
-  for (int y = 0; y < height; y++) {
-    for (int x = 0; x < width; x++) {
-     int pos = ((yBoundary + y) % height) * stride +
-       ((xBoundary + x) % width) * bytesPerPixel;
-     for (int i = 0; i < bytesPerPixel; i++) {
-        buffer[pos+i] = (x+y+i*2)%256;
-      }
-    }
-  }
-  return buffer;
-}
-
-static bool CheckBuffer(unsigned char* buffer, int bytesPerPixel,
-                        int width, int height, int stride)
-{
-  int xBoundary = 0;
-  int yBoundary = 0;
-  for (int y = 0; y < height; y++) {
-    for (int x = 0; x < width; x++) {
-     int pos = ((yBoundary + y) % height) * stride +
-       ((xBoundary + x) % width) * bytesPerPixel;
-     for (int i = 0; i < bytesPerPixel; i++) {
-        if (buffer[pos+i] != (x+y+i*2)%256) {
-          printf("Buffer differs at %i, %i, is %i\n", x, y, (int)buffer[pos+i]);
-          return false;
-        }
-      }
-    }
-  }
-  return true;
-}
-
-TEST(Gfx, BufferUnrotateHorizontal) {
-  const int NUM_OF_TESTS = 8;
-  int bytesPerPixelList[2] = {2,4};
-  int width[NUM_OF_TESTS] = {100, 100, 99, 99, 100, 100, 99, 99};
-  int height[NUM_OF_TESTS] = {100, 99, 100, 99, 100, 99, 100, 99};
-  int xBoundary[NUM_OF_TESTS] = {30, 30, 30, 30, 31, 31, 31, 31};
-  int yBoundary[NUM_OF_TESTS] = {0, 0, 0, 0};
-
-  for (int bytesPerId = 0; bytesPerId < 2; bytesPerId++) {
-    int bytesPerPixel = bytesPerPixelList[bytesPerId];
-    int stride = 256 * bytesPerPixel;
-    for (int testId = 0; testId < NUM_OF_TESTS; testId++) {
-      unsigned char* buffer = GenerateBuffer(bytesPerPixel,
-          width[testId], height[testId], stride,
-          xBoundary[testId], yBoundary[testId]);
-      BufferUnrotate(buffer,
-          width[testId] * bytesPerPixel, height[testId], stride,
-          xBoundary[testId] * bytesPerPixel, yBoundary[testId]);
-
-      EXPECT_TRUE(CheckBuffer(buffer, bytesPerPixel,
-            width[testId], height[testId], stride));
-      delete[] buffer;
-    }
-  }
-}
-
-TEST(Gfx, BufferUnrotateVertical) {
-  const int NUM_OF_TESTS = 8;
-  int bytesPerPixelList[2] = {2,4};
-  int width[NUM_OF_TESTS] = {100, 100, 99, 99, 100, 100, 99, 99};
-  int height[NUM_OF_TESTS] = {100, 99, 100, 99, 100, 99, 100, 99};
-  int xBoundary[NUM_OF_TESTS] = {0, 0, 0, 0};
-  int yBoundary[NUM_OF_TESTS] = {30, 30, 30, 30, 31, 31, 31, 31};
-
-  for (int bytesPerId = 0; bytesPerId < 2; bytesPerId++) {
-    int bytesPerPixel = bytesPerPixelList[bytesPerId];
-    int stride = 256 * bytesPerPixel;
-    for (int testId = 0; testId < NUM_OF_TESTS; testId++) {
-      unsigned char* buffer = GenerateBuffer(bytesPerPixel,
-          width[testId], height[testId], stride,
-          xBoundary[testId], yBoundary[testId]);
-      BufferUnrotate(buffer, width[testId] * bytesPerPixel,
-          height[testId], stride,
-          xBoundary[testId] * bytesPerPixel, yBoundary[testId]);
-
-      EXPECT_TRUE(CheckBuffer(buffer, bytesPerPixel,
-            width[testId], height[testId], stride));
-      delete[] buffer;
-    }
-  }
-}
-
-
-TEST(Gfx, BufferUnrotateBoth) {
-  const int NUM_OF_TESTS = 16;
-  int bytesPerPixelList[2] = {2,4};
-  int width[NUM_OF_TESTS] = {100, 100, 99, 99, 100, 100, 99, 99, 100, 100, 99, 99, 100, 100, 99, 99};
-  int height[NUM_OF_TESTS] = {100, 99, 100, 99, 100, 99, 100, 99, 100, 99, 100, 99, 100, 99, 100, 99};
-  int xBoundary[NUM_OF_TESTS] = {30, 30, 30, 30, 31, 31, 31, 31, 30, 30, 30, 30, 31, 31, 31, 31};
-  int yBoundary[NUM_OF_TESTS] = {30, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 31};
-
-  for (int bytesPerId = 0; bytesPerId < 2; bytesPerId++) {
-    int bytesPerPixel = bytesPerPixelList[bytesPerId];
-    int stride = 256 * bytesPerPixel;
-    for (int testId = 0; testId < NUM_OF_TESTS; testId++) {
-      unsigned char* buffer = GenerateBuffer(bytesPerPixel,
-          width[testId], height[testId], stride,
-          xBoundary[testId], yBoundary[testId]);
-      BufferUnrotate(buffer,
-          width[testId] * bytesPerPixel, height[testId], stride,
-          xBoundary[testId] * bytesPerPixel, yBoundary[testId]);
-
-      EXPECT_TRUE(CheckBuffer(buffer, bytesPerPixel,
-            width[testId], height[testId], stride));
-      delete[] buffer;
-    }
-  }
-}
-
-TEST(Gfx, BufferUnrotateUneven) {
-  const int NUM_OF_TESTS = 16;
-  int bytesPerPixelList[2] = {2,4};
-  int width[NUM_OF_TESTS] = {10, 100, 99, 39, 100, 40, 99, 39, 100, 50, 39, 99, 74, 60, 99, 39};
-  int height[NUM_OF_TESTS] = {100, 39, 10, 99, 10, 99, 40, 99, 73, 39, 100, 39, 67, 99, 84, 99};
-  int xBoundary[NUM_OF_TESTS] = {0, 0, 30, 30, 99, 31, 0, 31, 30, 30, 30, 30, 31, 31, 31, 38};
-  int yBoundary[NUM_OF_TESTS] = {30, 30, 0, 30, 0, 30, 0, 30, 31, 31, 31, 31, 31, 31, 31, 98};
-
-  for (int bytesPerId = 0; bytesPerId < 2; bytesPerId++) {
-    int bytesPerPixel = bytesPerPixelList[bytesPerId];
-    int stride = 256 * bytesPerPixel;
-    for (int testId = 0; testId < NUM_OF_TESTS; testId++) {
-      unsigned char* buffer = GenerateBuffer(bytesPerPixel,
-          width[testId], height[testId], stride,
-          xBoundary[testId], yBoundary[testId]);
-      BufferUnrotate(buffer,
-          width[testId]*bytesPerPixel, height[testId], stride,
-          xBoundary[testId]*bytesPerPixel, yBoundary[testId]);
-
-      EXPECT_TRUE(CheckBuffer(buffer, bytesPerPixel, width[testId], height[testId], stride));
-      delete[] buffer;
-    }
-  }
-}
-
-
--- a/gfx/tests/gtest/moz.build
+++ b/gfx/tests/gtest/moz.build
@@ -16,17 +16,16 @@ GTEST_CPP_SOURCES += [
     #'gfxTextRunPerfTest.cpp',
     'gfxWordCacheTest.cpp',
     'TestAsyncPanZoomController.cpp',
     'TestLayers.cpp',
     'TestTiledLayerBuffer.cpp',
     'TestRegion.cpp',
     'TestColorNames.cpp',
     'TestTextures.cpp',
-    'TestBufferRotation.cpp',
 ]
 
 # Because of gkmedia on windows we wont find these
 # symbols in xul.dll.
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'windows':
     GTEST_CPP_SOURCES += [
         'TestBase.cpp',
         'TestMoz2D.cpp',