Remove adreno fix, it only makes the crash less likely
authorBenoit Girard <b56girard@gmail.com>
Tue, 14 Feb 2012 13:16:18 -0500
changeset 89138 90bbfa287df247fef5e0570dbfd9f7e8d83fe4bc
parent 89137 d5ed03dea0e78ce8482051f6d41bfc3676df8ff4
child 89139 50131aed675e85ad6dc480230eba0a14af05b873
push id22242
push userkgupta@mozilla.com
push dateWed, 14 Mar 2012 15:19:09 +0000
treeherdermozilla-central@936ef50fa498 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone13.0a1
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
Remove adreno fix, it only makes the crash less likely
gfx/thebes/gfxSharedImageSurface.cpp
gfx/thebes/gfxSharedImageSurface.h
--- a/gfx/thebes/gfxSharedImageSurface.cpp
+++ b/gfx/thebes/gfxSharedImageSurface.cpp
@@ -75,23 +75,17 @@ gfxSharedImageSurface::IsSharedImage(gfx
 gfxSharedImageSurface::gfxSharedImageSurface(const gfxIntSize& aSize,
                                              gfxImageFormat aFormat,
                                              const Shmem& aShmem)
 {
     MOZ_COUNT_CTOR(gfxSharedImageSurface);
 
     mSize = aSize;
     mFormat = aFormat;
-
-    int w = aSize.width;
-    int h = aSize.height;
-    if ((aSize.width%MOZ_IMG_MEM_ALIGN) != 0)
-      w = aSize.width + MOZ_IMG_MEM_ALIGN - (aSize.width%MOZ_IMG_MEM_ALIGN);
-    mStride = ComputeStride(gfxIntSize(w, h), aFormat);
-
+    mStride = ComputeStride(aSize, aFormat);
     mShmem = aShmem;
     mData = aShmem.get<unsigned char>();
     cairo_surface_t *surface =
         cairo_image_surface_create_for_data(mData,
                                             (cairo_format_t)mFormat,
                                             mSize.width,
                                             mSize.height,
                                             mStride);
--- a/gfx/thebes/gfxSharedImageSurface.h
+++ b/gfx/thebes/gfxSharedImageSurface.h
@@ -34,24 +34,16 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef GFX_SHARED_IMAGESURFACE_H
 #define GFX_SHARED_IMAGESURFACE_H
 
-#if ANDROID
- // Using an 64 align prevents us from crashing in driver
- // code when doing RGB565 uploads. See bug 721489
- #define MOZ_IMG_MEM_ALIGN 64
-#else
- #define MOZ_IMG_MEM_ALIGN 1
-#endif
-
 #include "mozilla/ipc/Shmem.h"
 #include "mozilla/ipc/SharedMemory.h"
 
 #include "gfxASurface.h"
 #include "gfxImageSurface.h"
 
 class THEBES_API gfxSharedImageSurface : public gfxImageSurface {
     typedef mozilla::ipc::SharedMemory SharedMemory;
@@ -117,24 +109,16 @@ private:
            SharedMemory::SharedMemoryType aShmType)
     {
         if (!CheckSurfaceSize(aSize))
             return nsnull;
 
         Shmem shmem;
         long stride = ComputeStride(aSize, aFormat);
         size_t size = GetAlignedSize(aSize, stride);
-
-        int w = aSize.width;
-        int h = aSize.height;
-        if ((aSize.width%MOZ_IMG_MEM_ALIGN) != 0)
-          w = aSize.width + MOZ_IMG_MEM_ALIGN - (aSize.width%MOZ_IMG_MEM_ALIGN);
-        stride = ComputeStride(gfxIntSize(w, h), aFormat);
-        size = GetAlignedSize(aSize, stride);
-
         if (!Unsafe) {
             if (!aAllocator->AllocShmem(size, aShmType, &shmem))
                 return nsnull;
         } else {
             if (!aAllocator->AllocUnsafeShmem(size, aShmType, &shmem))
                 return nsnull;
         }