Bug 1328797 - Part 3: Remove sync transactions entirely as they aren't used any more. r=nical

--HG--
extra : rebase_source : fa3bd3016fbfa322e5966079a4f211e16cb057c4
This commit is contained in:
Matt Woodrow 2017-02-16 11:31:18 +13:00
parent f1cee01eca
commit f976d56579
10 changed files with 11 additions and 90 deletions

View File

@ -62,8 +62,7 @@ typedef nsTArray<OpDestroy> OpDestroyVector;
struct CompositableTransaction
{
CompositableTransaction()
: mSwapRequired(false)
, mFinished(true)
: mFinished(true)
{}
~CompositableTransaction()
{
@ -81,7 +80,6 @@ struct CompositableTransaction
void End()
{
mFinished = true;
mSwapRequired = false;
mOperations.clear();
mDestroyedActors.Clear();
}
@ -94,19 +92,9 @@ struct CompositableTransaction
MOZ_ASSERT(!Finished(), "forgot BeginTransaction?");
mOperations.push_back(op);
}
void AddEdit(const CompositableOperation& op)
{
AddNoSwapEdit(op);
MarkSyncTransaction();
}
void MarkSyncTransaction()
{
mSwapRequired = true;
}
OpVector mOperations;
OpDestroyVector mDestroyedActors;
bool mSwapRequired;
bool mFinished;
};
@ -555,18 +543,9 @@ ImageBridgeChild::EndTransaction()
ShadowLayerForwarder::PlatformSyncBeforeUpdate();
}
if (mTxn->mSwapRequired) {
if (!SendUpdate(cset, mTxn->mDestroyedActors, GetFwdTransactionId())) {
NS_WARNING("could not send async texture transaction");
return;
}
} else {
// If we don't require a swap we can call SendUpdateNoSwap which
// assumes that aReplies is empty (DEBUG assertion)
if (!SendUpdateNoSwap(cset, mTxn->mDestroyedActors, GetFwdTransactionId())) {
NS_WARNING("could not send async texture transaction (no swap)");
return;
}
if (!SendUpdate(cset, mTxn->mDestroyedActors, GetFwdTransactionId())) {
NS_WARNING("could not send async texture transaction");
return;
}
}

View File

@ -177,17 +177,6 @@ ImageBridgeParent::RecvUpdate(EditArray&& aEdits, OpDestroyArray&& aToDestroy,
return IPC_OK();
}
mozilla::ipc::IPCResult
ImageBridgeParent::RecvUpdateNoSwap(EditArray&& aEdits, OpDestroyArray&& aToDestroy,
const uint64_t& aFwdTransactionId)
{
bool success = RecvUpdate(Move(aEdits), Move(aToDestroy), aFwdTransactionId);
if (!success) {
return IPC_FAIL_NO_REASON(this);
}
return IPC_OK();
}
/* static */ bool
ImageBridgeParent::CreateForContent(Endpoint<PImageBridgeParent>&& aEndpoint)
{

View File

@ -72,8 +72,6 @@ public:
virtual mozilla::ipc::IPCResult RecvImageBridgeThreadId(const PlatformThreadId& aThreadId) override;
virtual mozilla::ipc::IPCResult RecvUpdate(EditArray&& aEdits, OpDestroyArray&& aToDestroy,
const uint64_t& aFwdTransactionId) override;
virtual mozilla::ipc::IPCResult RecvUpdateNoSwap(EditArray&& aEdits, OpDestroyArray&& aToDestroy,
const uint64_t& aFwdTransactionId) override;
virtual PTextureParent* AllocPTextureParent(const SurfaceDescriptor& aSharedData,
const LayersBackend& aLayersBackend,

View File

@ -94,12 +94,6 @@ LayerTransactionParent::Destroy()
mCompositables.clear();
}
mozilla::ipc::IPCResult
LayerTransactionParent::RecvUpdateNoSwap(const TransactionInfo& txn)
{
return RecvUpdate(txn);
}
class MOZ_STACK_CLASS AutoLayerTransactionParentAsyncMessageSender
{
public:

View File

@ -113,8 +113,6 @@ protected:
virtual mozilla::ipc::IPCResult RecvUpdate(const TransactionInfo& aInfo) override;
virtual mozilla::ipc::IPCResult RecvUpdateNoSwap(const TransactionInfo& aInfo) override;
virtual mozilla::ipc::IPCResult RecvSetLayerObserverEpoch(const uint64_t& aLayerObserverEpoch) override;
virtual mozilla::ipc::IPCResult RecvNewCompositable(const CompositableHandle& aHandle,
const TextureInfo& aInfo) override;

View File

@ -38,9 +38,7 @@ child:
parent:
async ImageBridgeThreadId(PlatformThreadId aTreahdId);
sync Update(CompositableOperation[] ops, OpDestroy[] toDestroy, uint64_t fwdTransactionId);
async UpdateNoSwap(CompositableOperation[] ops, OpDestroy[] toDestroy, uint64_t fwdTransactionId);
async Update(CompositableOperation[] ops, OpDestroy[] toDestroy, uint64_t fwdTransactionId);
// First step of the destruction sequence. This puts ImageBridge
// in a state in which it can't send asynchronous messages

View File

@ -52,14 +52,10 @@ sync protocol PLayerTransaction {
parent:
// The isFirstPaint flag can be used to indicate that this is the first update
// for a particular document.
sync Update(TransactionInfo txn);
async Update(TransactionInfo txn);
async PaintTime(uint64_t id, TimeDuration paintTime);
// We don't need to send a sync transaction if
// no transaction operate require a swap.
async UpdateNoSwap(TransactionInfo txn);
async SetLayerObserverEpoch(uint64_t layerObserverEpoch);
// Create a new Compositable.

View File

@ -60,7 +60,6 @@ class Transaction
public:
Transaction()
: mTargetRotation(ROTATION_0)
, mSwapRequired(false)
, mOpen(false)
, mRotationChanged(false)
{}
@ -80,10 +79,6 @@ public:
mTargetRotation = aRotation;
mTargetOrientation = aOrientation;
}
void MarkSyncTransaction()
{
mSwapRequired = true;
}
void AddEdit(const Edit& aEdit)
{
MOZ_ASSERT(!Finished(), "forgot BeginTransaction?");
@ -93,11 +88,6 @@ public:
{
AddEdit(Edit(aEdit));
}
void AddPaint(const CompositableOperation& aPaint)
{
AddNoSwapPaint(Edit(aPaint));
mSwapRequired = true;
}
void AddNoSwapPaint(const CompositableOperation& aPaint)
{
@ -122,7 +112,6 @@ public:
mSimpleMutants.Clear();
mDestroyedActors.Clear();
mOpen = false;
mSwapRequired = false;
mRotationChanged = false;
}
@ -148,7 +137,6 @@ public:
gfx::IntRect mTargetBounds;
ScreenRotation mTargetRotation;
dom::ScreenOrientationInternal mTargetOrientation;
bool mSwapRequired;
private:
bool mOpen;
@ -712,22 +700,11 @@ ShadowLayerForwarder::EndTransaction(const nsIntRegion& aRegionToClear,
profiler_tracing("Paint", "Rasterize", TRACING_INTERVAL_END);
if (mTxn->mSwapRequired) {
MOZ_LAYERS_LOG(("[LayersForwarder] sending transaction..."));
RenderTraceScope rendertrace3("Forward Transaction", "000093");
if (!mShadowManager->SendUpdate(info)) {
MOZ_LAYERS_LOG(("[LayersForwarder] WARNING: sending transaction failed!"));
return false;
}
} else {
// If we don't require a swap we can call SendUpdateNoSwap which
// assumes that aReplies is empty (DEBUG assertion)
MOZ_LAYERS_LOG(("[LayersForwarder] sending no swap transaction..."));
RenderTraceScope rendertrace3("Forward NoSwap Transaction", "000093");
if (!mShadowManager->SendUpdateNoSwap(info)) {
MOZ_LAYERS_LOG(("[LayersForwarder] WARNING: sending transaction failed!"));
return false;
}
MOZ_LAYERS_LOG(("[LayersForwarder] sending transaction..."));
RenderTraceScope rendertrace3("Forward Transaction", "000093");
if (!mShadowManager->SendUpdate(info)) {
MOZ_LAYERS_LOG(("[LayersForwarder] WARNING: sending transaction failed!"));
return false;
}
*aSent = true;

View File

@ -17,7 +17,6 @@ namespace layers {
WebRenderBridgeChild::WebRenderBridgeChild(const wr::PipelineId& aPipelineId)
: mIsInTransaction(false)
, mSyncTransaction(false)
, mIPCOpen(false)
, mDestroyed(false)
{
@ -79,7 +78,6 @@ WebRenderBridgeChild::DPEnd(bool aIsSync, uint64_t aTransactionId)
mCommands.Clear();
mDestroyedActors.Clear();
mIsInTransaction = false;
mSyncTransaction = false;
}
uint64_t

View File

@ -53,11 +53,6 @@ public:
bool IPCOpen() const { return mIPCOpen && !mDestroyed; }
bool IsDestroyed() const { return mDestroyed; }
void MarkSyncTransaction()
{
mSyncTransaction = true;
}
private:
friend class CompositorBridgeChild;
@ -106,7 +101,6 @@ private:
nsTArray<OpDestroy> mDestroyedActors;
nsDataHashtable<nsUint64HashKey, CompositableClient*> mCompositables;
bool mIsInTransaction;
bool mSyncTransaction;
bool mIPCOpen;
bool mDestroyed;