Bug 1007728 - Avoid calling APZCTreeManager::UpdatePanZoomControllerTree() on repeat transactions. r=kats,BenWa

--HG--
extra : rebase_source : 470498aae39f2f297cd181372413b197e5c71821
This commit is contained in:
Botond Ballo 2014-05-30 18:52:43 -04:00
parent 760f974c43
commit 76bb94c45c
11 changed files with 41 additions and 21 deletions

View File

@ -443,7 +443,8 @@ ClientLayerManager::ForwardTransaction(bool aScheduleComposite)
bool sent;
AutoInfallibleTArray<EditReply, 10> replies;
if (HasShadowManager() && mForwarder->EndTransaction(&replies, mRegionToClear,
mLatestTransactionId, aScheduleComposite, mPaintSequenceNumber, &sent)) {
mLatestTransactionId, aScheduleComposite, mPaintSequenceNumber,
mIsRepeatTransaction, &sent)) {
for (nsTArray<EditReply>::size_type i = 0; i < replies.Length(); ++i) {
const EditReply& reply = replies[i];

View File

@ -550,9 +550,11 @@ CompositorParent::ScheduleTask(CancelableTask* task, int time)
void
CompositorParent::NotifyShadowTreeTransaction(uint64_t aId, bool aIsFirstPaint,
bool aScheduleComposite, uint32_t aPaintSequenceNumber)
bool aScheduleComposite, uint32_t aPaintSequenceNumber,
bool aIsRepeatTransaction)
{
if (mApzcTreeManager &&
!aIsRepeatTransaction &&
mLayerManager &&
mLayerManager->GetRoot()) {
AutoResolveRefLayers resolve(mCompositionManager);
@ -786,7 +788,8 @@ CompositorParent::ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
const TargetConfig& aTargetConfig,
bool aIsFirstPaint,
bool aScheduleComposite,
uint32_t aPaintSequenceNumber)
uint32_t aPaintSequenceNumber,
bool aIsRepeatTransaction)
{
ScheduleRotationOnCompositorThread(aTargetConfig, aIsFirstPaint);
@ -800,7 +803,7 @@ CompositorParent::ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
Layer* root = aLayerTree->GetRoot();
mLayerManager->SetRoot(root);
if (mApzcTreeManager) {
if (mApzcTreeManager && !aIsRepeatTransaction) {
AutoResolveRefLayers resolve(mCompositionManager);
mApzcTreeManager->UpdatePanZoomControllerTree(this, root, aIsFirstPaint,
mRootLayerTreeID, aPaintSequenceNumber);
@ -1163,7 +1166,8 @@ public:
const TargetConfig& aTargetConfig,
bool aIsFirstPaint,
bool aScheduleComposite,
uint32_t aPaintSequenceNumber) MOZ_OVERRIDE;
uint32_t aPaintSequenceNumber,
bool aIsRepeatTransaction) MOZ_OVERRIDE;
virtual void ForceComposite(LayerTransactionParent* aLayerTree) MOZ_OVERRIDE;
virtual bool SetTestSampleTime(LayerTransactionParent* aLayerTree,
const TimeStamp& aTime) MOZ_OVERRIDE;
@ -1354,7 +1358,8 @@ CrossProcessCompositorParent::ShadowLayersUpdated(
const TargetConfig& aTargetConfig,
bool aIsFirstPaint,
bool aScheduleComposite,
uint32_t aPaintSequenceNumber)
uint32_t aPaintSequenceNumber,
bool aIsRepeatTransaction)
{
uint64_t id = aLayerTree->GetId();
@ -1374,7 +1379,7 @@ CrossProcessCompositorParent::ShadowLayersUpdated(
UpdateIndirectTree(id, shadowRoot, aTargetConfig);
state->mParent->NotifyShadowTreeTransaction(id, aIsFirstPaint, aScheduleComposite,
aPaintSequenceNumber);
aPaintSequenceNumber, aIsRepeatTransaction);
aLayerTree->SetPendingTransactionId(aTransactionId);
}

View File

@ -124,7 +124,8 @@ public:
const TargetConfig& aTargetConfig,
bool aIsFirstPaint,
bool aScheduleComposite,
uint32_t aPaintSequenceNumber) MOZ_OVERRIDE;
uint32_t aPaintSequenceNumber,
bool aIsRepeatTransaction) MOZ_OVERRIDE;
virtual void ForceComposite(LayerTransactionParent* aLayerTree) MOZ_OVERRIDE;
virtual bool SetTestSampleTime(LayerTransactionParent* aLayerTree,
const TimeStamp& aTime) MOZ_OVERRIDE;
@ -158,7 +159,8 @@ public:
virtual void ScheduleComposition();
void NotifyShadowTreeTransaction(uint64_t aId, bool aIsFirstPaint,
bool aScheduleComposite, uint32_t aPaintSequenceNumber);
bool aScheduleComposite, uint32_t aPaintSequenceNumber,
bool aIsRepeatTransaction);
/**
* Check rotation info and schedule a rendering task if needed.

View File

@ -185,10 +185,11 @@ LayerTransactionParent::RecvUpdateNoSwap(const InfallibleTArray<Edit>& cset,
const TargetConfig& targetConfig,
const bool& isFirstPaint,
const bool& scheduleComposite,
const uint32_t& paintSequenceNumber)
const uint32_t& paintSequenceNumber,
const bool& isRepeatTransaction)
{
return RecvUpdate(cset, aTransactionId, targetConfig, isFirstPaint,
scheduleComposite, paintSequenceNumber, nullptr);
scheduleComposite, paintSequenceNumber, isRepeatTransaction, nullptr);
}
bool
@ -198,6 +199,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
const bool& isFirstPaint,
const bool& scheduleComposite,
const uint32_t& paintSequenceNumber,
const bool& isRepeatTransaction,
InfallibleTArray<EditReply>* reply)
{
profiler_tracing("Paint", "Composite", TRACING_INTERVAL_START);
@ -540,7 +542,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
}
mShadowLayersManager->ShadowLayersUpdated(this, aTransactionId, targetConfig,
isFirstPaint, scheduleComposite, paintSequenceNumber);
isFirstPaint, scheduleComposite, paintSequenceNumber, isRepeatTransaction);
{
AutoResolveRefLayers resolve(mShadowLayersManager->GetCompositionManager(this));

View File

@ -106,6 +106,7 @@ protected:
const bool& isFirstPaint,
const bool& scheduleComposite,
const uint32_t& paintSequenceNumber,
const bool& isRepeatTransaction,
EditReplyArray* reply) MOZ_OVERRIDE;
virtual bool RecvUpdateNoSwap(const EditArray& cset,
@ -113,7 +114,8 @@ protected:
const TargetConfig& targetConfig,
const bool& isFirstPaint,
const bool& scheduleComposite,
const uint32_t& paintSequenceNumber) MOZ_OVERRIDE;
const uint32_t& paintSequenceNumber,
const bool& isRepeatTransaction) MOZ_OVERRIDE;
virtual bool RecvClearCachedResources() MOZ_OVERRIDE;
virtual bool RecvForceComposite() MOZ_OVERRIDE;

View File

@ -53,13 +53,15 @@ parent:
// The isFirstPaint flag can be used to indicate that this is the first update
// for a particular document.
sync Update(Edit[] cset, uint64_t id, TargetConfig targetConfig, bool isFirstPaint,
bool scheduleComposite, uint32_t paintSequenceNumber)
bool scheduleComposite, uint32_t paintSequenceNumber,
bool isRepeatTransaction)
returns (EditReply[] reply);
// We don't need to send a sync transaction if
// no transaction operate require a swap.
async UpdateNoSwap(Edit[] cset, uint64_t id, TargetConfig targetConfig, bool isFirstPaint,
bool scheduleComposite, uint32_t paintSequenceNumber);
bool scheduleComposite, uint32_t paintSequenceNumber,
bool isRepeatTransaction);
// Testing APIs

View File

@ -465,6 +465,7 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies,
uint64_t aId,
bool aScheduleComposite,
uint32_t aPaintSequenceNumber,
bool aIsRepeatTransaction,
bool* aSent)
{
*aSent = false;
@ -582,7 +583,7 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies,
!mShadowManager->IPCOpen() ||
!mShadowManager->SendUpdate(cset, aId, targetConfig, mIsFirstPaint,
aScheduleComposite, aPaintSequenceNumber,
aReplies)) {
aIsRepeatTransaction, aReplies)) {
MOZ_LAYERS_LOG(("[LayersForwarder] WARNING: sending transaction failed!"));
return false;
}
@ -594,7 +595,8 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies,
if (!HasShadowManager() ||
!mShadowManager->IPCOpen() ||
!mShadowManager->SendUpdateNoSwap(cset, aId, targetConfig, mIsFirstPaint,
aPaintSequenceNumber, aScheduleComposite)) {
aPaintSequenceNumber, aScheduleComposite,
aIsRepeatTransaction)) {
MOZ_LAYERS_LOG(("[LayersForwarder] WARNING: sending transaction failed!"));
return false;
}

View File

@ -302,6 +302,7 @@ public:
uint64_t aId,
bool aScheduleComposite,
uint32_t aPaintSequenceNumber,
bool aIsRepeatTransaction,
bool* aSent);
/**

View File

@ -23,7 +23,8 @@ public:
const TargetConfig& aTargetConfig,
bool aIsFirstPaint,
bool aScheduleComposite,
uint32_t aPaintSequenceNumber) = 0;
uint32_t aPaintSequenceNumber,
bool aIsRepeatTransaction) = 0;
virtual AsyncCompositionManager* GetCompositionManager(LayerTransactionParent* aLayerTree) { return nullptr; }

View File

@ -811,7 +811,8 @@ RenderFrameParent::ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
const TargetConfig& aTargetConfig,
bool aIsFirstPaint,
bool aScheduleComposite,
uint32_t aPaintSequenceNumber)
uint32_t aPaintSequenceNumber,
bool aIsRepeatTransaction)
{
// View map must only contain views that are associated with the current
// shadow layer tree. We must always update the map when shadow layers

View File

@ -83,7 +83,8 @@ public:
const TargetConfig& aTargetConfig,
bool aIsFirstPaint,
bool aScheduleComposite,
uint32_t aPaintSequenceNumber) MOZ_OVERRIDE;
uint32_t aPaintSequenceNumber,
bool aIsRepeatTransaction) MOZ_OVERRIDE;
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsSubDocumentFrame* aFrame,