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

This commit is contained in:
Chris Lord 2014-06-11 14:52:19 +01:00
parent 41c19b8630
commit eeff5cfb5a
5 changed files with 3 additions and 20 deletions

View File

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

View File

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

View File

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

View File

@ -272,8 +272,6 @@ gfxPlatform::gfxPlatform()
mOpenTypeSVGEnabled = UNINITIALIZED_VALUE; mOpenTypeSVGEnabled = UNINITIALIZED_VALUE;
mBidiNumeralOption = UNINITIALIZED_VALUE; mBidiNumeralOption = UNINITIALIZED_VALUE;
mLayersPreferMemoryOverShmem = XRE_GetProcessType() == GeckoProcessType_Default;
mSkiaGlue = nullptr; mSkiaGlue = nullptr;
uint32_t canvasMask = BackendTypeBit(BackendType::CAIRO) | BackendTypeBit(BackendType::SKIA); uint32_t canvasMask = BackendTypeBit(BackendType::CAIRO) | BackendTypeBit(BackendType::SKIA);
@ -534,12 +532,6 @@ gfxPlatform::~gfxPlatform()
#endif #endif
} }
bool
gfxPlatform::PreferMemoryOverShmem() const {
MOZ_ASSERT(!CompositorParent::IsInCompositorThread());
return mLayersPreferMemoryOverShmem;
}
cairo_user_data_key_t kDrawTarget; cairo_user_data_key_t kDrawTarget;
RefPtr<DrawTarget> RefPtr<DrawTarget>

View File

@ -541,14 +541,6 @@ public:
return nsIntRect(0, 0, bits * sizeOfBit, sizeOfBit); 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(); mozilla::gl::SkiaGLGlue* GetSkiaGLGlue();
void PurgeSkiaCache(); void PurgeSkiaCache();
@ -661,7 +653,6 @@ private:
mozilla::widget::GfxInfoCollector<gfxPlatform> mAzureCanvasBackendCollector; mozilla::widget::GfxInfoCollector<gfxPlatform> mAzureCanvasBackendCollector;
mozilla::RefPtr<mozilla::gfx::DrawEventRecorder> mRecorder; mozilla::RefPtr<mozilla::gfx::DrawEventRecorder> mRecorder;
bool mLayersPreferMemoryOverShmem;
mozilla::RefPtr<mozilla::gl::SkiaGLGlue> mSkiaGlue; mozilla::RefPtr<mozilla::gl::SkiaGLGlue> mSkiaGlue;
}; };