From eeff5cfb5aad615a6f0e94075042b3df4fdfca54 Mon Sep 17 00:00:00 2001 From: Chris Lord Date: Wed, 11 Jun 2014 14:52:19 +0100 Subject: [PATCH] Bug 1011569 - Remove PreferMemoryOverShmem in favour of IsSameProcess. r=nical --- gfx/layers/client/TextureClient.cpp | 2 +- gfx/layers/client/TiledContentClient.cpp | 2 +- gfx/layers/ipc/ISurfaceAllocator.cpp | 2 +- gfx/thebes/gfxPlatform.cpp | 8 -------- gfx/thebes/gfxPlatform.h | 9 --------- 5 files changed, 3 insertions(+), 20 deletions(-) diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp index a96224f43be..91a156270e8 100644 --- a/gfx/layers/client/TextureClient.cpp +++ b/gfx/layers/client/TextureClient.cpp @@ -325,7 +325,7 @@ TextureClient::CreateBufferTextureClient(ISurfaceAllocator* aAllocator, TextureFlags aTextureFlags, gfx::BackendType aMoz2DBackend) { - if (gfxPlatform::GetPlatform()->PreferMemoryOverShmem()) { + if (aAllocator->IsSameProcess()) { RefPtr result = new MemoryTextureClient(aAllocator, aFormat, aMoz2DBackend, aTextureFlags); diff --git a/gfx/layers/client/TiledContentClient.cpp b/gfx/layers/client/TiledContentClient.cpp index b7d7176a27c..4fc157dcc0b 100644 --- a/gfx/layers/client/TiledContentClient.cpp +++ b/gfx/layers/client/TiledContentClient.cpp @@ -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(); diff --git a/gfx/layers/ipc/ISurfaceAllocator.cpp b/gfx/layers/ipc/ISurfaceAllocator.cpp index 07c7b9c4bec..a54fcaeff54 100644 --- a/gfx/layers/ipc/ISurfaceAllocator.cpp +++ b/gfx/layers/ipc/ISurfaceAllocator.cpp @@ -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; diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 8fc0157636f..8f8f25944b5 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -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); @@ -534,12 +532,6 @@ gfxPlatform::~gfxPlatform() #endif } -bool -gfxPlatform::PreferMemoryOverShmem() const { - MOZ_ASSERT(!CompositorParent::IsInCompositorThread()); - return mLayersPreferMemoryOverShmem; -} - cairo_user_data_key_t kDrawTarget; RefPtr diff --git a/gfx/thebes/gfxPlatform.h b/gfx/thebes/gfxPlatform.h index abe38615483..24e38663fcf 100644 --- a/gfx/thebes/gfxPlatform.h +++ b/gfx/thebes/gfxPlatform.h @@ -541,14 +541,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(); @@ -661,7 +653,6 @@ private: mozilla::widget::GfxInfoCollector mAzureCanvasBackendCollector; mozilla::RefPtr mRecorder; - bool mLayersPreferMemoryOverShmem; mozilla::RefPtr mSkiaGlue; };