Bug 1041751 - Do not create an empty APZ test data bucket for each paint when APZ test logging is not pref'd on. r=kats

--HG--
extra : rebase_source : fd4f5af2b018061d26dcb99b45526f8bdf48ef15
This commit is contained in:
Botond Ballo 2014-07-22 15:35:18 -04:00
parent 63450e70bd
commit 2f286ce4dd
2 changed files with 12 additions and 5 deletions

View File

@ -28,6 +28,7 @@
#include "nsXULAppAPI.h" // for XRE_GetProcessType, etc #include "nsXULAppAPI.h" // for XRE_GetProcessType, etc
#include "TiledLayerBuffer.h" #include "TiledLayerBuffer.h"
#include "mozilla/dom/WindowBinding.h" // for Overfill Callback #include "mozilla/dom/WindowBinding.h" // for Overfill Callback
#include "gfxPrefs.h"
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
#include "AndroidBridge.h" #include "AndroidBridge.h"
#endif #endif
@ -165,7 +166,7 @@ ClientLayerManager::BeginTransactionWithTarget(gfxContext* aTarget)
} }
// If this is a new paint, increment the paint sequence number. // If this is a new paint, increment the paint sequence number.
if (!mIsRepeatTransaction) { if (gfxPrefs::APZTestLoggingEnabled() && !mIsRepeatTransaction) {
++mPaintSequenceNumber; ++mPaintSequenceNumber;
mApzTestData.StartNewPaint(mPaintSequenceNumber); mApzTestData.StartNewPaint(mPaintSequenceNumber);
} }
@ -324,6 +325,14 @@ ClientLayerManager::GetCompositorSideAPZTestData(APZTestData* aData) const
} }
} }
void
ClientLayerManager::StartNewRepaintRequest(SequenceNumber aSequenceNumber)
{
if (gfxPrefs::APZTestLoggingEnabled()) {
mApzTestData.StartNewRepaintRequest(aSequenceNumber);
}
}
bool bool
ClientLayerManager::RequestOverfill(mozilla::dom::OverfillCallback* aCallback) ClientLayerManager::RequestOverfill(mozilla::dom::OverfillCallback* aCallback)
{ {

View File

@ -203,10 +203,8 @@ public:
// Log APZ test data for a repaint request. The sequence number must be // Log APZ test data for a repaint request. The sequence number must be
// passed in from outside, and APZTestData::StartNewRepaintRequest() needs // passed in from outside, and APZTestData::StartNewRepaintRequest() needs
// to be called from the outside as well when a new repaint request is started. // to be called from the outside as well when a new repaint request is started.
void StartNewRepaintRequest(SequenceNumber aSequenceNumber) void StartNewRepaintRequest(SequenceNumber aSequenceNumber);
{
mApzTestData.StartNewRepaintRequest(aSequenceNumber);
}
// TODO(botond): When we start using this and write a wrapper similar to // TODO(botond): When we start using this and write a wrapper similar to
// nsLayoutUtils::LogTestDataForPaint(), make sure that wrapper checks // nsLayoutUtils::LogTestDataForPaint(), make sure that wrapper checks
// gfxPrefs::APZTestLoggingEnabled(). // gfxPrefs::APZTestLoggingEnabled().