Bug 874369 - Use normal memory instead of Shmem when only sharing between processes. r=Bas
This commit is contained in:
@@ -32,10 +32,22 @@ ISurfaceAllocator::PlatformAllocSurfaceDescriptor(const gfxIntSize& aSize,
|
||||
ShadowLayerForwarder::PlatformOpenDescriptor(OpenMode aMode,
|
||||
const SurfaceDescriptor& aSurface)
|
||||
{
|
||||
if (SurfaceDescriptor::TShmem != aSurface.type()) {
|
||||
return nullptr;
|
||||
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();
|
||||
|
||||
}
|
||||
return gfxSharedQuartzSurface::Open(aSurface.get_Shmem());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/*static*/ bool
|
||||
|
||||
Reference in New Issue
Block a user