bool ShadowLayerForwarder::PlatformAllocDoubleBuffer(const gfxIntSize& aSize, gfxASurface::gfxContentType aContent, SurfaceDescriptor* aFrontBuffer, SurfaceDescriptor* aBackBuffer) { return (PlatformAllocBuffer(aSize, aContent, aFrontBuffer) && PlatformAllocBuffer(aSize, aContent, aBackBuffer)); }
bool ShadowLayerForwarder::AllocBuffer(const gfxIntSize& aSize, gfxASurface::gfxContentType aContent, SurfaceDescriptor* aBuffer) { bool tryPlatformSurface = true; #ifdef DEBUG tryPlatformSurface = !PR_GetEnv("MOZ_LAYERS_FORCE_SHMEM_SURFACES"); #endif if (tryPlatformSurface && PlatformAllocBuffer(aSize, aContent, aBuffer)) { return true; } nsRefPtr<gfxSharedImageSurface> buffer; if (!AllocBuffer(aSize, aContent, getter_AddRefs(buffer))) return false; *aBuffer = buffer->GetShmem(); return true; }