Bug 1011569 - Remove PreferMemoryOverShmem in favour of IsSameProcess. r=nical

This commit is contained in:
Chris Lord 2014-05-19 10:45:12 +01:00
parent c46f2f1ad5
commit e6e08ba548
5 changed files with 3 additions and 20 deletions

View File

@ -324,7 +324,7 @@ TextureClient::CreateBufferTextureClient(ISurfaceAllocator* aAllocator,
TextureFlags aTextureFlags,
gfx::BackendType aMoz2DBackend)
{
if (gfxPlatform::GetPlatform()->PreferMemoryOverShmem()) {
if (aAllocator->IsSameProcess()) {
RefPtr<BufferTextureClient> result = new MemoryTextureClient(aAllocator, aFormat,
aMoz2DBackend,
aTextureFlags);

View File

@ -527,7 +527,7 @@ TileClient::GetBackBuffer(const nsIntRegion& aDirtyRegion, TextureClientPool *aP
}
mBackBuffer = aPool->GetTextureClient();
// Create a lock for our newly created back-buffer.
if (gfxPlatform::GetPlatform()->PreferMemoryOverShmem()) {
if (mManager->AsShadowForwarder()->IsSameProcess()) {
// If our compositor is in the same process, we can save some cycles by not
// using shared memory.
mBackLock = new gfxMemorySharedReadLock();

View File

@ -111,7 +111,7 @@ ISurfaceAllocator::AllocSurfaceDescriptorWithCaps(const gfx::IntSize& aSize,
gfx::SurfaceFormat format =
gfxPlatform::GetPlatform()->Optimal2DFormatForContent(aContent);
size_t size = ImageDataSerializer::ComputeMinBufferSize(aSize, format);
if (gfxPlatform::GetPlatform()->PreferMemoryOverShmem()) {
if (IsSameProcess()) {
uint8_t *data = new (std::nothrow) uint8_t[size];
if (!data) {
return false;

View File

@ -272,8 +272,6 @@ gfxPlatform::gfxPlatform()
mOpenTypeSVGEnabled = UNINITIALIZED_VALUE;
mBidiNumeralOption = UNINITIALIZED_VALUE;
mLayersPreferMemoryOverShmem = XRE_GetProcessType() == GeckoProcessType_Default;
mSkiaGlue = nullptr;
uint32_t canvasMask = BackendTypeBit(BackendType::CAIRO) | BackendTypeBit(BackendType::SKIA);
@ -543,12 +541,6 @@ gfxPlatform::~gfxPlatform()
#endif
}
bool
gfxPlatform::PreferMemoryOverShmem() const {
MOZ_ASSERT(!CompositorParent::IsInCompositorThread());
return mLayersPreferMemoryOverShmem;
}
already_AddRefed<gfxASurface>
gfxPlatform::CreateOffscreenImageSurface(const gfxIntSize& aSize,
gfxContentType aContentType)

View File

@ -565,14 +565,6 @@ public:
return nsIntRect(0, 0, bits * sizeOfBit, sizeOfBit);
}
/**
* Returns true if we should use raw memory to send data to the compositor
* rather than using shmems.
*
* This method should not be called from the compositor thread.
*/
bool PreferMemoryOverShmem() const;
mozilla::gl::SkiaGLGlue* GetSkiaGLGlue();
void PurgeSkiaCache();
@ -685,7 +677,6 @@ private:
mozilla::widget::GfxInfoCollector<gfxPlatform> mAzureCanvasBackendCollector;
mozilla::RefPtr<mozilla::gfx::DrawEventRecorder> mRecorder;
bool mLayersPreferMemoryOverShmem;
mozilla::RefPtr<mozilla::gl::SkiaGLGlue> mSkiaGlue;
};