Backout 85d108f0b422 (bug 874369) for causing b2g reftest failures.

This commit is contained in:
Matt Woodrow 2013-05-22 13:18:19 +08:00
Родитель a80c470dd2
Коммит 153f37adaa
7 изменённых файлов: 3 добавлений и 73 удалений

Просмотреть файл

@ -97,7 +97,6 @@ TextureClientShmem::SetDescriptor(const SurfaceDescriptor& aDescriptor)
NS_ASSERTION(mDescriptor.type() == SurfaceDescriptor::TSurfaceDescriptorGralloc ||
mDescriptor.type() == SurfaceDescriptor::TShmem ||
mDescriptor.type() == SurfaceDescriptor::TMemoryImage ||
mDescriptor.type() == SurfaceDescriptor::TRGBImage,
"Invalid surface descriptor");
}

Просмотреть файл

@ -13,7 +13,6 @@
#include "mozilla/layers/LayersSurfaces.h"
#include "mozilla/layers/SharedPlanarYCbCrImage.h"
#include "mozilla/layers/SharedRGBImage.h"
#include "nsXULAppAPI.h"
#ifdef DEBUG
#include "prenv.h"
@ -86,17 +85,6 @@ ISurfaceAllocator::AllocSurfaceDescriptorWithCaps(const gfxIntSize& aSize,
return true;
}
if (XRE_GetProcessType() == GeckoProcessType_Default) {
gfxImageFormat format = aContent == gfxASurface::CONTENT_COLOR_ALPHA ?
gfxASurface::ImageFormatARGB32 :
gfxASurface::ImageFormatRGB24;
int32_t stride = gfxASurface::FormatStrideForWidth(format, aSize.width);
uint8_t *data = new uint8_t[stride * aSize.height];
*aBuffer = MemoryImage((uintptr_t)data, aSize, stride, format);
return true;
}
nsRefPtr<gfxSharedImageSurface> buffer;
if (!AllocSharedImageSurface(aSize, aContent,
getter_AddRefs(buffer))) {
@ -134,9 +122,6 @@ ISurfaceAllocator::DestroySharedSurface(SurfaceDescriptor* aSurface)
break;
case SurfaceDescriptor::TSurfaceDescriptorD3D10:
break;
case SurfaceDescriptor::TMemoryImage:
delete [] (unsigned char *)aSurface->get_MemoryImage().data();
break;
case SurfaceDescriptor::Tnull_t:
case SurfaceDescriptor::T__None:
break;

Просмотреть файл

@ -83,13 +83,6 @@ struct RGBImage {
uint64_t owner;
};
struct MemoryImage {
uintptr_t data;
gfxIntSize size;
uint32_t stride;
uint32_t format;
};
union SurfaceDescriptor {
Shmem;
SurfaceDescriptorD3D10;
@ -99,7 +92,6 @@ union SurfaceDescriptor {
RGBImage;
SharedTextureDescriptor;
SurfaceStreamDescriptor;
MemoryImage;
null_t;
};

Просмотреть файл

@ -32,22 +32,10 @@ ISurfaceAllocator::PlatformAllocSurfaceDescriptor(const gfxIntSize& aSize,
ShadowLayerForwarder::PlatformOpenDescriptor(OpenMode aMode,
const SurfaceDescriptor& aSurface)
{
if (aSurface.type() == SurfaceDescriptor::TShmem) {
return gfxSharedQuartzSurface::Open(aSurface.get_Shmem());
} else if (aSurface.type() == SurfaceDescriptor::TMemoryImage) {
const MemoryImage& image = aSurface.get_MemoryImage();
gfxASurface::gfxImageFormat format
= static_cast<gfxASurface::gfxImageFormat>(image.format());
nsRefPtr<gfxASurface> surf =
new gfxQuartzSurface((unsigned char*)image.data(),
image.size(),
image.stride(),
format);
return surf.forget();
if (SurfaceDescriptor::TShmem != aSurface.type()) {
return nullptr;
}
return nullptr;
return gfxSharedQuartzSurface::Open(aSurface.get_Shmem());
}
/*static*/ bool

Просмотреть файл

@ -530,16 +530,6 @@ ShadowLayerForwarder::OpenDescriptor(OpenMode aMode,
rgbFormat);
return surf.forget();
}
case SurfaceDescriptor::TMemoryImage: {
const MemoryImage& image = aSurface.get_MemoryImage();
gfxASurface::gfxImageFormat format
= static_cast<gfxASurface::gfxImageFormat>(image.format());
surf = new gfxImageSurface((unsigned char *)image.data(),
image.size(),
image.stride(),
format);
return surf.forget();
}
default:
NS_ERROR("unexpected SurfaceDescriptor type!");
return nullptr;

Просмотреть файл

@ -125,29 +125,6 @@ gfxQuartzSurface::gfxQuartzSurface(unsigned char *data,
}
}
gfxQuartzSurface::gfxQuartzSurface(unsigned char *data,
const gfxIntSize& aSize,
long stride,
gfxImageFormat format,
bool aForPrinting)
: mCGContext(nullptr), mSize(aSize.width, aSize.height), mForPrinting(aForPrinting)
{
if (!CheckSurfaceSize(aSize))
MakeInvalid();
cairo_surface_t *surf = cairo_quartz_surface_create_for_data
(data, (cairo_format_t) format, aSize.width, aSize.height, stride);
mCGContext = cairo_quartz_surface_get_cg_context (surf);
CGContextRetain(mCGContext);
Init(surf);
if (mSurfaceValid) {
RecordMemoryUsed(mSize.height * stride + sizeof(gfxQuartzSurface));
}
}
already_AddRefed<gfxASurface>
gfxQuartzSurface::CreateSimilarSurface(gfxContentType aType,
const gfxIntSize& aSize)

Просмотреть файл

@ -20,7 +20,6 @@ public:
gfxQuartzSurface(CGContextRef context, const gfxIntSize& size, bool aForPrinting = false);
gfxQuartzSurface(cairo_surface_t *csurf, bool aForPrinting = false);
gfxQuartzSurface(unsigned char *data, const gfxSize& size, long stride, gfxImageFormat format, bool aForPrinting = false);
gfxQuartzSurface(unsigned char *data, const gfxIntSize& size, long stride, gfxImageFormat format, bool aForPrinting = false);
virtual ~gfxQuartzSurface();