Bug 1325227 - Part 10: Use blocking read locks instead of forcing a synchronous transaction when using ContentClientRemoteBuffer. r=nical

This commit is contained in:
Matt Woodrow 2017-02-14 21:10:36 +13:00
Родитель f3042f09fd
Коммит 3640aa2a00
3 изменённых файлов: 5 добавлений и 18 удалений

Просмотреть файл

@ -83,9 +83,7 @@ ContentClient::CreateContentClient(CompositableForwarder* aForwarder)
!gfxVars::UseXRender())
#endif
{
useDoubleBuffering = (LayerManagerComposite::SupportsDirectTexturing() &&
backend != LayersBackend::LAYERS_D3D9) ||
backend == LayersBackend::LAYERS_BASIC;
useDoubleBuffering = backend == LayersBackend::LAYERS_BASIC;
}
if (useDoubleBuffering || gfxEnv::ForceDoubleBuffering()) {
@ -322,6 +320,7 @@ ContentClientRemoteBuffer::CreateBackBuffer(const IntRect& aBufferRect)
AbortTextureClientCreation();
return;
}
mTextureClient->EnableBlockingReadLock();
if (mTextureFlags & TextureFlags::COMPONENT_ALPHA) {
mTextureClientOnWhite = mTextureClient->CreateSimilar(
@ -333,6 +332,7 @@ ContentClientRemoteBuffer::CreateBackBuffer(const IntRect& aBufferRect)
AbortTextureClientCreation();
return;
}
mTextureClientOnWhite->EnableBlockingReadLock();
}
}

Просмотреть файл

@ -266,7 +266,7 @@ public:
virtual TextureFlags ExtraTextureFlags() const
{
return TextureFlags::NO_FLAGS;
return TextureFlags::IMMEDIATE_UPLOAD;
}
protected:
@ -404,11 +404,6 @@ public:
{
return TextureInfo(CompositableType::CONTENT_SINGLE, mTextureFlags | ExtraTextureFlags());
}
virtual TextureFlags ExtraTextureFlags() const override
{
return TextureFlags::IMMEDIATE_UPLOAD;
}
};
} // namespace layers

Просмотреть файл

@ -409,7 +409,7 @@ ShadowLayerForwarder::UpdateTextureRegion(CompositableClient* aCompositable,
return;
}
mTxn->AddPaint(
mTxn->AddNoSwapPaint(
CompositableOperation(
aCompositable->GetIPCHandle(),
OpPaintTextureRegion(aThebesBufferData, aUpdatedRegion)));
@ -437,14 +437,6 @@ ShadowLayerForwarder::UseTextures(CompositableClient* aCompositable,
readLock,
t.mTimeStamp, t.mPictureRect,
t.mFrameID, t.mProducerID));
if ((t.mTextureClient->GetFlags() & TextureFlags::IMMEDIATE_UPLOAD)
&& t.mTextureClient->HasIntermediateBuffer()) {
// We use IMMEDIATE_UPLOAD when we want to be sure that the upload cannot
// race with updates on the main thread. In this case we want the transaction
// to be synchronous.
mTxn->MarkSyncTransaction();
}
mClientLayerManager->GetCompositorBridgeChild()->HoldUntilCompositableRefReleasedIfNecessary(t.mTextureClient);
}
mTxn->AddEdit(CompositableOperation(aCompositable->GetIPCHandle(),