Simplify calling SendUpdate/SendUpdateNoSwap. (bug 1325993, r=nical)
This commit is contained in:
@@ -1142,48 +1142,44 @@ CompositorBridgeParent::ScheduleRotationOnCompositorThread(const TargetConfig& a
|
||||
|
||||
void
|
||||
CompositorBridgeParent::ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& aTargetConfig,
|
||||
const InfallibleTArray<PluginWindowData>& aUnused,
|
||||
bool aIsFirstPaint,
|
||||
bool aScheduleComposite,
|
||||
uint32_t aPaintSequenceNumber,
|
||||
bool aIsRepeatTransaction,
|
||||
int32_t aPaintSyncId,
|
||||
const TransactionInfo& aInfo,
|
||||
bool aHitTestUpdate)
|
||||
{
|
||||
ScheduleRotationOnCompositorThread(aTargetConfig, aIsFirstPaint);
|
||||
const TargetConfig& targetConfig = aInfo.targetConfig();
|
||||
|
||||
ScheduleRotationOnCompositorThread(targetConfig, aInfo.isFirstPaint());
|
||||
|
||||
// Instruct the LayerManager to update its render bounds now. Since all the orientation
|
||||
// change, dimension change would be done at the stage, update the size here is free of
|
||||
// race condition.
|
||||
mLayerManager->UpdateRenderBounds(aTargetConfig.naturalBounds());
|
||||
mLayerManager->SetRegionToClear(aTargetConfig.clearRegion());
|
||||
mLayerManager->UpdateRenderBounds(targetConfig.naturalBounds());
|
||||
mLayerManager->SetRegionToClear(targetConfig.clearRegion());
|
||||
if (mLayerManager->GetCompositor()) {
|
||||
mLayerManager->GetCompositor()->SetScreenRotation(aTargetConfig.rotation());
|
||||
mLayerManager->GetCompositor()->SetScreenRotation(targetConfig.rotation());
|
||||
}
|
||||
|
||||
mCompositionManager->Updated(aIsFirstPaint, aTargetConfig, aPaintSyncId);
|
||||
mCompositionManager->Updated(aInfo.isFirstPaint(), targetConfig, aInfo.paintSyncId());
|
||||
Layer* root = aLayerTree->GetRoot();
|
||||
mLayerManager->SetRoot(root);
|
||||
|
||||
if (mApzcTreeManager && !aIsRepeatTransaction && aHitTestUpdate) {
|
||||
if (mApzcTreeManager && !aInfo.isRepeatTransaction() && aHitTestUpdate) {
|
||||
AutoResolveRefLayers resolve(mCompositionManager);
|
||||
|
||||
mApzcTreeManager->UpdateHitTestingTree(mRootLayerTreeID, root, aIsFirstPaint,
|
||||
mRootLayerTreeID, aPaintSequenceNumber);
|
||||
mApzcTreeManager->UpdateHitTestingTree(
|
||||
mRootLayerTreeID, root, aInfo.isFirstPaint(),
|
||||
mRootLayerTreeID, aInfo.paintSequenceNumber());
|
||||
}
|
||||
|
||||
// The transaction ID might get reset to 1 if the page gets reloaded, see
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1145295#c41
|
||||
// Otherwise, it should be continually increasing.
|
||||
MOZ_ASSERT(aTransactionId == 1 || aTransactionId > mPendingTransaction);
|
||||
mPendingTransaction = aTransactionId;
|
||||
MOZ_ASSERT(aInfo.id() == 1 || aInfo.id() > mPendingTransaction);
|
||||
mPendingTransaction = aInfo.id();
|
||||
|
||||
if (root) {
|
||||
SetShadowProperties(root);
|
||||
}
|
||||
if (aScheduleComposite) {
|
||||
if (aInfo.scheduleComposite()) {
|
||||
ScheduleComposition();
|
||||
if (mPaused) {
|
||||
TimeStamp now = TimeStamp::Now();
|
||||
|
||||
@@ -90,14 +90,7 @@ class CompositorBridgeParentBase : public PCompositorBridgeParent,
|
||||
{
|
||||
public:
|
||||
virtual void ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& aTargetConfig,
|
||||
const InfallibleTArray<PluginWindowData>& aPlugins,
|
||||
bool aIsFirstPaint,
|
||||
bool aScheduleComposite,
|
||||
uint32_t aPaintSequenceNumber,
|
||||
bool aIsRepeatTransaction,
|
||||
int32_t aPaintSyncId,
|
||||
const TransactionInfo& aInfo,
|
||||
bool aHitTestUpdate) = 0;
|
||||
|
||||
virtual AsyncCompositionManager* GetCompositionManager(LayerTransactionParent* aLayerTree) { return nullptr; }
|
||||
@@ -220,14 +213,7 @@ public:
|
||||
virtual void ActorDestroy(ActorDestroyReason why) override;
|
||||
|
||||
virtual void ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& aTargetConfig,
|
||||
const InfallibleTArray<PluginWindowData>& aPlugins,
|
||||
bool aIsFirstPaint,
|
||||
bool aScheduleComposite,
|
||||
uint32_t aPaintSequenceNumber,
|
||||
bool aIsRepeatTransaction,
|
||||
int32_t aPaintSyncId,
|
||||
const TransactionInfo& aInfo,
|
||||
bool aHitTestUpdate) override;
|
||||
virtual void ForceComposite(LayerTransactionParent* aLayerTree) override;
|
||||
virtual bool SetTestSampleTime(LayerTransactionParent* aLayerTree,
|
||||
|
||||
@@ -208,14 +208,7 @@ CrossProcessCompositorBridgeParent::RecvNotifyChildCreated(const uint64_t& child
|
||||
void
|
||||
CrossProcessCompositorBridgeParent::ShadowLayersUpdated(
|
||||
LayerTransactionParent* aLayerTree,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& aTargetConfig,
|
||||
const InfallibleTArray<PluginWindowData>& aPlugins,
|
||||
bool aIsFirstPaint,
|
||||
bool aScheduleComposite,
|
||||
uint32_t aPaintSequenceNumber,
|
||||
bool aIsRepeatTransaction,
|
||||
int32_t /*aPaintSyncId: unused*/,
|
||||
const TransactionInfo& aInfo,
|
||||
bool aHitTestUpdate)
|
||||
{
|
||||
uint64_t id = aLayerTree->GetId();
|
||||
@@ -228,20 +221,27 @@ CrossProcessCompositorBridgeParent::ShadowLayersUpdated(
|
||||
return;
|
||||
}
|
||||
MOZ_ASSERT(state->mParent);
|
||||
state->mParent->ScheduleRotationOnCompositorThread(aTargetConfig, aIsFirstPaint);
|
||||
state->mParent->ScheduleRotationOnCompositorThread(
|
||||
aInfo.targetConfig(),
|
||||
aInfo.isFirstPaint());
|
||||
|
||||
Layer* shadowRoot = aLayerTree->GetRoot();
|
||||
if (shadowRoot) {
|
||||
CompositorBridgeParent::SetShadowProperties(shadowRoot);
|
||||
}
|
||||
UpdateIndirectTree(id, shadowRoot, aTargetConfig);
|
||||
UpdateIndirectTree(id, shadowRoot, aInfo.targetConfig());
|
||||
|
||||
// Cache the plugin data for this remote layer tree
|
||||
state->mPluginData = aPlugins;
|
||||
state->mPluginData = aInfo.plugins();
|
||||
state->mUpdatedPluginDataAvailable = true;
|
||||
|
||||
state->mParent->NotifyShadowTreeTransaction(id, aIsFirstPaint, aScheduleComposite,
|
||||
aPaintSequenceNumber, aIsRepeatTransaction, aHitTestUpdate);
|
||||
state->mParent->NotifyShadowTreeTransaction(
|
||||
id,
|
||||
aInfo.isFirstPaint(),
|
||||
aInfo.scheduleComposite(),
|
||||
aInfo.paintSequenceNumber(),
|
||||
aInfo.isRepeatTransaction(),
|
||||
aHitTestUpdate);
|
||||
|
||||
// Send the 'remote paint ready' message to the content thread if it has already asked.
|
||||
if(mNotifyAfterRemotePaint) {
|
||||
@@ -255,7 +255,7 @@ CrossProcessCompositorBridgeParent::ShadowLayersUpdated(
|
||||
Unused << state->mParent->SendObserveLayerUpdate(id, aLayerTree->GetChildEpoch(), true);
|
||||
}
|
||||
|
||||
aLayerTree->SetPendingTransactionId(aTransactionId);
|
||||
aLayerTree->SetPendingTransactionId(aInfo.id());
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -94,14 +94,7 @@ public:
|
||||
virtual bool DeallocPLayerTransactionParent(PLayerTransactionParent* aLayers) override;
|
||||
|
||||
virtual void ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& aTargetConfig,
|
||||
const InfallibleTArray<PluginWindowData>& aPlugins,
|
||||
bool aIsFirstPaint,
|
||||
bool aScheduleComposite,
|
||||
uint32_t aPaintSequenceNumber,
|
||||
bool aIsRepeatTransaction,
|
||||
int32_t /*aPaintSyncId: unused*/,
|
||||
const TransactionInfo& aInfo,
|
||||
bool aHitTestUpdate) override;
|
||||
virtual void ForceComposite(LayerTransactionParent* aLayerTree) override;
|
||||
virtual void NotifyClearCachedResources(LayerTransactionParent* aLayerTree) override;
|
||||
|
||||
@@ -88,30 +88,16 @@ LayerTransactionParent::Destroy()
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
LayerTransactionParent::RecvUpdateNoSwap(InfallibleTArray<Edit>&& cset,
|
||||
InfallibleTArray<OpDestroy>&& aToDestroy,
|
||||
const uint64_t& aFwdTransactionId,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& targetConfig,
|
||||
PluginsArray&& aPlugins,
|
||||
const bool& isFirstPaint,
|
||||
const bool& scheduleComposite,
|
||||
const uint32_t& paintSequenceNumber,
|
||||
const bool& isRepeatTransaction,
|
||||
const mozilla::TimeStamp& aTransactionStart,
|
||||
const int32_t& aPaintSyncId)
|
||||
LayerTransactionParent::RecvUpdateNoSwap(const TransactionInfo& txn)
|
||||
{
|
||||
return RecvUpdate(Move(cset), Move(aToDestroy), aFwdTransactionId,
|
||||
aTransactionId, targetConfig, Move(aPlugins), isFirstPaint,
|
||||
scheduleComposite, paintSequenceNumber, isRepeatTransaction,
|
||||
aTransactionStart, aPaintSyncId, nullptr);
|
||||
return RecvUpdate(txn, nullptr);
|
||||
}
|
||||
|
||||
class MOZ_STACK_CLASS AutoLayerTransactionParentAsyncMessageSender
|
||||
{
|
||||
public:
|
||||
explicit AutoLayerTransactionParentAsyncMessageSender(LayerTransactionParent* aLayerTransaction,
|
||||
InfallibleTArray<OpDestroy>* aDestroyActors = nullptr)
|
||||
const InfallibleTArray<OpDestroy>* aDestroyActors = nullptr)
|
||||
: mLayerTransaction(aLayerTransaction)
|
||||
, mActorsToDestroy(aDestroyActors)
|
||||
{
|
||||
@@ -133,7 +119,7 @@ public:
|
||||
}
|
||||
private:
|
||||
LayerTransactionParent* mLayerTransaction;
|
||||
InfallibleTArray<OpDestroy>* mActorsToDestroy;
|
||||
const InfallibleTArray<OpDestroy>* mActorsToDestroy;
|
||||
};
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
@@ -145,18 +131,7 @@ LayerTransactionParent::RecvPaintTime(const uint64_t& aTransactionId,
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
LayerTransactionParent::RecvUpdate(InfallibleTArray<Edit>&& cset,
|
||||
InfallibleTArray<OpDestroy>&& aToDestroy,
|
||||
const uint64_t& aFwdTransactionId,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& targetConfig,
|
||||
PluginsArray&& aPlugins,
|
||||
const bool& isFirstPaint,
|
||||
const bool& scheduleComposite,
|
||||
const uint32_t& paintSequenceNumber,
|
||||
const bool& isRepeatTransaction,
|
||||
const mozilla::TimeStamp& aTransactionStart,
|
||||
const int32_t& aPaintSyncId,
|
||||
LayerTransactionParent::RecvUpdate(const TransactionInfo& aInfo,
|
||||
InfallibleTArray<EditReply>* reply)
|
||||
{
|
||||
profiler_tracing("Paint", "LayerTransaction", TRACING_INTERVAL_START);
|
||||
@@ -167,12 +142,12 @@ LayerTransactionParent::RecvUpdate(InfallibleTArray<Edit>&& cset,
|
||||
TimeStamp updateStart = TimeStamp::Now();
|
||||
#endif
|
||||
|
||||
MOZ_LAYERS_LOG(("[ParentSide] received txn with %d edits", cset.Length()));
|
||||
MOZ_LAYERS_LOG(("[ParentSide] received txn with %d edits", aInfo.cset().Length()));
|
||||
|
||||
UpdateFwdTransactionId(aFwdTransactionId);
|
||||
UpdateFwdTransactionId(aInfo.fwdTransactionId());
|
||||
|
||||
if (mDestroyed || !layer_manager() || layer_manager()->IsDestroyed()) {
|
||||
for (const auto& op : aToDestroy) {
|
||||
for (const auto& op : aInfo.toDestroy()) {
|
||||
DestroyActor(op);
|
||||
}
|
||||
return IPC_OK();
|
||||
@@ -180,7 +155,7 @@ LayerTransactionParent::RecvUpdate(InfallibleTArray<Edit>&& cset,
|
||||
|
||||
// This ensures that destroy operations are always processed. It is not safe
|
||||
// to early-return from RecvUpdate without doing so.
|
||||
AutoLayerTransactionParentAsyncMessageSender autoAsyncMessageSender(this, &aToDestroy);
|
||||
AutoLayerTransactionParentAsyncMessageSender autoAsyncMessageSender(this, &aInfo.toDestroy());
|
||||
EditReplyVector replyv;
|
||||
|
||||
{
|
||||
@@ -191,8 +166,8 @@ LayerTransactionParent::RecvUpdate(InfallibleTArray<Edit>&& cset,
|
||||
// not all edits require an update to the hit testing tree
|
||||
bool updateHitTestingTree = false;
|
||||
|
||||
for (EditArray::index_type i = 0; i < cset.Length(); ++i) {
|
||||
Edit& edit = cset[i];
|
||||
for (EditArray::index_type i = 0; i < aInfo.cset().Length(); ++i) {
|
||||
const Edit& edit = const_cast<Edit&>(aInfo.cset()[i]);
|
||||
|
||||
switch (edit.type()) {
|
||||
// Create* ops
|
||||
@@ -289,12 +264,12 @@ LayerTransactionParent::RecvUpdate(InfallibleTArray<Edit>&& cset,
|
||||
case Edit::TOpSetLayerAttributes: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] SetLayerAttributes"));
|
||||
|
||||
OpSetLayerAttributes& osla = edit.get_OpSetLayerAttributes();
|
||||
const OpSetLayerAttributes& osla = edit.get_OpSetLayerAttributes();
|
||||
Layer* layer = AsLayer(osla.layer());
|
||||
if (!layer) {
|
||||
return IPC_FAIL_NO_REASON(this);
|
||||
}
|
||||
LayerAttributes& attrs = osla.attrs();
|
||||
const LayerAttributes& attrs = osla.attrs();
|
||||
|
||||
const CommonLayerAttributes& common = attrs.common();
|
||||
layer->SetLayerBounds(common.layerBounds());
|
||||
@@ -350,7 +325,7 @@ LayerTransactionParent::RecvUpdate(InfallibleTArray<Edit>&& cset,
|
||||
layer->SetAncestorMaskLayers(maskLayers);
|
||||
|
||||
typedef SpecificLayerAttributes Specific;
|
||||
SpecificLayerAttributes& specific = attrs.specific();
|
||||
const SpecificLayerAttributes& specific = attrs.specific();
|
||||
switch (specific.type()) {
|
||||
case Specific::Tnull_t:
|
||||
break;
|
||||
@@ -404,9 +379,10 @@ LayerTransactionParent::RecvUpdate(InfallibleTArray<Edit>&& cset,
|
||||
if (!textLayer) {
|
||||
return IPC_FAIL_NO_REASON(this);
|
||||
}
|
||||
textLayer->SetBounds(specific.get_TextLayerAttributes().bounds());
|
||||
textLayer->SetGlyphs(Move(specific.get_TextLayerAttributes().glyphs()));
|
||||
textLayer->SetScaledFont(reinterpret_cast<gfx::ScaledFont*>(specific.get_TextLayerAttributes().scaledFont()));
|
||||
const auto& tla = specific.get_TextLayerAttributes();
|
||||
textLayer->SetBounds(tla.bounds());
|
||||
textLayer->SetGlyphs(Move(const_cast<nsTArray<GlyphArray>&>(tla.glyphs())));
|
||||
textLayer->SetScaledFont(reinterpret_cast<gfx::ScaledFont*>(tla.scaledFont()));
|
||||
break;
|
||||
}
|
||||
case Specific::TBorderLayerAttributes: {
|
||||
@@ -631,10 +607,7 @@ LayerTransactionParent::RecvUpdate(InfallibleTArray<Edit>&& cset,
|
||||
}
|
||||
}
|
||||
|
||||
mCompositorBridge->ShadowLayersUpdated(this, aTransactionId, targetConfig,
|
||||
aPlugins, isFirstPaint, scheduleComposite,
|
||||
paintSequenceNumber, isRepeatTransaction,
|
||||
aPaintSyncId, updateHitTestingTree);
|
||||
mCompositorBridge->ShadowLayersUpdated(this, aInfo, updateHitTestingTree);
|
||||
|
||||
{
|
||||
AutoResolveRefLayers resolve(mCompositorBridge->GetCompositionManager(this));
|
||||
@@ -667,7 +640,7 @@ LayerTransactionParent::RecvUpdate(InfallibleTArray<Edit>&& cset,
|
||||
if (drawFps) {
|
||||
uint32_t visualWarningTrigger = gfxPrefs::LayerTransactionWarning();
|
||||
// The default theshold is 200ms to trigger, hit red when it take 4 times longer
|
||||
TimeDuration latency = TimeStamp::Now() - aTransactionStart;
|
||||
TimeDuration latency = TimeStamp::Now() - aInfo.transactionStart();
|
||||
if (latency > TimeDuration::FromMilliseconds(visualWarningTrigger)) {
|
||||
float severity = (latency - TimeDuration::FromMilliseconds(visualWarningTrigger)).ToMilliseconds() /
|
||||
(4 * visualWarningTrigger);
|
||||
|
||||
@@ -114,32 +114,10 @@ protected:
|
||||
virtual mozilla::ipc::IPCResult RecvPaintTime(const uint64_t& aTransactionId,
|
||||
const TimeDuration& aPaintTime) override;
|
||||
|
||||
virtual mozilla::ipc::IPCResult RecvUpdate(EditArray&& cset,
|
||||
OpDestroyArray&& aToDestroy,
|
||||
const uint64_t& aFwdTransactionId,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& targetConfig,
|
||||
PluginsArray&& aPlugins,
|
||||
const bool& isFirstPaint,
|
||||
const bool& scheduleComposite,
|
||||
const uint32_t& paintSequenceNumber,
|
||||
const bool& isRepeatTransaction,
|
||||
const mozilla::TimeStamp& aTransactionStart,
|
||||
const int32_t& aPaintSyncId,
|
||||
virtual mozilla::ipc::IPCResult RecvUpdate(const TransactionInfo& aInfo,
|
||||
EditReplyArray* reply) override;
|
||||
|
||||
virtual mozilla::ipc::IPCResult RecvUpdateNoSwap(EditArray&& cset,
|
||||
OpDestroyArray&& aToDestroy,
|
||||
const uint64_t& aFwdTransactionId,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& targetConfig,
|
||||
PluginsArray&& aPlugins,
|
||||
const bool& isFirstPaint,
|
||||
const bool& scheduleComposite,
|
||||
const uint32_t& paintSequenceNumber,
|
||||
const bool& isRepeatTransaction,
|
||||
const mozilla::TimeStamp& aTransactionStart,
|
||||
const int32_t& aPaintSyncId) override;
|
||||
virtual mozilla::ipc::IPCResult RecvUpdateNoSwap(const TransactionInfo& aInfo) override;
|
||||
|
||||
virtual mozilla::ipc::IPCResult RecvSetLayerObserverEpoch(const uint64_t& aLayerObserverEpoch) override;
|
||||
virtual mozilla::ipc::IPCResult RecvReleaseLayer(const LayerHandle& aHandle) override;
|
||||
|
||||
@@ -539,5 +539,21 @@ union AsyncParentMessageData {
|
||||
OpNotifyNotUsed;
|
||||
};
|
||||
|
||||
struct TransactionInfo
|
||||
{
|
||||
Edit[] cset;
|
||||
OpDestroy[] toDestroy;
|
||||
uint64_t fwdTransactionId;
|
||||
uint64_t id;
|
||||
TargetConfig targetConfig;
|
||||
PluginWindowData[] plugins;
|
||||
bool isFirstPaint;
|
||||
bool scheduleComposite;
|
||||
uint32_t paintSequenceNumber;
|
||||
bool isRepeatTransaction;
|
||||
TimeStamp transactionStart;
|
||||
int32_t paintSyncId;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -47,26 +47,13 @@ parent:
|
||||
|
||||
// The isFirstPaint flag can be used to indicate that this is the first update
|
||||
// for a particular document.
|
||||
sync Update(Edit[] cset, OpDestroy[] toDestroy,
|
||||
uint64_t fwdTransactionId,
|
||||
uint64_t id, TargetConfig targetConfig,
|
||||
PluginWindowData[] plugins, bool isFirstPaint,
|
||||
bool scheduleComposite, uint32_t paintSequenceNumber,
|
||||
bool isRepeatTransaction, TimeStamp transactionStart,
|
||||
int32_t paintSyncId)
|
||||
returns (EditReply[] reply);
|
||||
sync Update(TransactionInfo txn) returns (EditReply[] reply);
|
||||
|
||||
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(Edit[] cset, OpDestroy[] toDestroy,
|
||||
uint64_t fwdTransactionId,
|
||||
uint64_t id, TargetConfig targetConfig,
|
||||
PluginWindowData[] plugins, bool isFirstPaint,
|
||||
bool scheduleComposite, uint32_t paintSequenceNumber,
|
||||
bool isRepeatTransaction, TimeStamp transactionStart,
|
||||
int32_t paintSyncId);
|
||||
async UpdateNoSwap(TransactionInfo txn);
|
||||
|
||||
async SetLayerObserverEpoch(uint64_t layerObserverEpoch);
|
||||
|
||||
|
||||
@@ -570,6 +570,8 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies,
|
||||
{
|
||||
*aSent = false;
|
||||
|
||||
TransactionInfo info;
|
||||
|
||||
MOZ_ASSERT(IPCOpen(), "no manager to forward to");
|
||||
if (!IPCOpen()) {
|
||||
return false;
|
||||
@@ -692,12 +694,12 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies,
|
||||
mTxn->AddEdit(OpSetLayerAttributes(Shadow(shadow), attrs));
|
||||
}
|
||||
|
||||
AutoTArray<Edit, 10> cset;
|
||||
size_t nCsets = mTxn->mCset.size() + mTxn->mPaints.size();
|
||||
if (nCsets == 0 && !mTxn->RotationChanged()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
auto& cset = info.cset();
|
||||
cset.SetCapacity(nCsets);
|
||||
if (!mTxn->mCset.empty()) {
|
||||
cset.AppendElements(&mTxn->mCset.front(), mTxn->mCset.size());
|
||||
@@ -710,10 +712,22 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies,
|
||||
|
||||
mWindowOverlayChanged = false;
|
||||
|
||||
info.toDestroy() = mTxn->mDestroyedActors;
|
||||
info.fwdTransactionId() = GetFwdTransactionId();
|
||||
info.id() = aId;
|
||||
info.plugins() = mPluginWindowData;
|
||||
info.isFirstPaint() = mIsFirstPaint;
|
||||
info.scheduleComposite() = aScheduleComposite;
|
||||
info.paintSequenceNumber() = aPaintSequenceNumber;
|
||||
info.isRepeatTransaction() = aIsRepeatTransaction;
|
||||
info.transactionStart() = aTransactionStart;
|
||||
info.paintSyncId() = mPaintSyncId;
|
||||
|
||||
TargetConfig targetConfig(mTxn->mTargetBounds,
|
||||
mTxn->mTargetRotation,
|
||||
mTxn->mTargetOrientation,
|
||||
aRegionToClear);
|
||||
info.targetConfig() = targetConfig;
|
||||
|
||||
if (!GetTextureForwarder()->IsSameProcess()) {
|
||||
MOZ_LAYERS_LOG(("[LayersForwarder] syncing before send..."));
|
||||
@@ -724,12 +738,7 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies,
|
||||
if (mTxn->mSwapRequired) {
|
||||
MOZ_LAYERS_LOG(("[LayersForwarder] sending transaction..."));
|
||||
RenderTraceScope rendertrace3("Forward Transaction", "000093");
|
||||
if (!mShadowManager->SendUpdate(cset, mTxn->mDestroyedActors,
|
||||
GetFwdTransactionId(),
|
||||
aId, targetConfig, mPluginWindowData,
|
||||
mIsFirstPaint, aScheduleComposite,
|
||||
aPaintSequenceNumber, aIsRepeatTransaction,
|
||||
aTransactionStart, mPaintSyncId, aReplies)) {
|
||||
if (!mShadowManager->SendUpdate(info, aReplies)) {
|
||||
MOZ_LAYERS_LOG(("[LayersForwarder] WARNING: sending transaction failed!"));
|
||||
return false;
|
||||
}
|
||||
@@ -738,12 +747,7 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies,
|
||||
// assumes that aReplies is empty (DEBUG assertion)
|
||||
MOZ_LAYERS_LOG(("[LayersForwarder] sending no swap transaction..."));
|
||||
RenderTraceScope rendertrace3("Forward NoSwap Transaction", "000093");
|
||||
if (!mShadowManager->SendUpdateNoSwap(cset, mTxn->mDestroyedActors,
|
||||
GetFwdTransactionId(),
|
||||
aId, targetConfig, mPluginWindowData,
|
||||
mIsFirstPaint, aScheduleComposite,
|
||||
aPaintSequenceNumber, aIsRepeatTransaction,
|
||||
aTransactionStart, mPaintSyncId)) {
|
||||
if (!mShadowManager->SendUpdateNoSwap(info)) {
|
||||
MOZ_LAYERS_LOG(("[LayersForwarder] WARNING: sending transaction failed!"));
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user