diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp index c86dfdaa62e4..f1a911e1e6bf 100644 --- a/gfx/layers/client/TextureClient.cpp +++ b/gfx/layers/client/TextureClient.cpp @@ -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"); } diff --git a/gfx/layers/ipc/ISurfaceAllocator.cpp b/gfx/layers/ipc/ISurfaceAllocator.cpp index 05c1ca574c05..2103266dd9b7 100644 --- a/gfx/layers/ipc/ISurfaceAllocator.cpp +++ b/gfx/layers/ipc/ISurfaceAllocator.cpp @@ -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 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; diff --git a/gfx/layers/ipc/LayersSurfaces.ipdlh b/gfx/layers/ipc/LayersSurfaces.ipdlh index 22ac5ba9f1b9..29dbadd7ba1f 100644 --- a/gfx/layers/ipc/LayersSurfaces.ipdlh +++ b/gfx/layers/ipc/LayersSurfaces.ipdlh @@ -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; }; diff --git a/gfx/layers/ipc/ShadowLayerUtilsMac.cpp b/gfx/layers/ipc/ShadowLayerUtilsMac.cpp index 7db2cd86af6b..3a965d29df2d 100644 --- a/gfx/layers/ipc/ShadowLayerUtilsMac.cpp +++ b/gfx/layers/ipc/ShadowLayerUtilsMac.cpp @@ -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(image.format()); - - nsRefPtr 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 diff --git a/gfx/layers/ipc/ShadowLayers.cpp b/gfx/layers/ipc/ShadowLayers.cpp index 23f2e9cffd2d..6a78a1872545 100644 --- a/gfx/layers/ipc/ShadowLayers.cpp +++ b/gfx/layers/ipc/ShadowLayers.cpp @@ -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(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; diff --git a/gfx/thebes/gfxQuartzSurface.cpp b/gfx/thebes/gfxQuartzSurface.cpp index d7ca3bb1574e..358580dbc36b 100644 --- a/gfx/thebes/gfxQuartzSurface.cpp +++ b/gfx/thebes/gfxQuartzSurface.cpp @@ -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 gfxQuartzSurface::CreateSimilarSurface(gfxContentType aType, const gfxIntSize& aSize) diff --git a/gfx/thebes/gfxQuartzSurface.h b/gfx/thebes/gfxQuartzSurface.h index dbbb6f951909..171d5cb0a047 100644 --- a/gfx/thebes/gfxQuartzSurface.h +++ b/gfx/thebes/gfxQuartzSurface.h @@ -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();