Backed out changeset e14c7409ede7

This commit is contained in:
Dão Gottwald 2012-12-18 01:04:30 +01:00
parent a1d09d0622
commit 3e5deace1e
6 changed files with 19 additions and 78 deletions

View File

@ -1275,12 +1275,6 @@
if (t.pinned) if (t.pinned)
tabContainer._handleNewTab(t); tabContainer._handleNewTab(t);
else { else {
t._animationLoggingEnabled = tabContainer._cachedTabAnimationLoggingPref;
if (t._animationLoggingEnabled) {
window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils)
.startFrameTimeRecording();
}
t._animStartTime = Date.now(); t._animStartTime = Date.now();
t.setAttribute("fadein", "true"); t.setAttribute("fadein", "true");
@ -1581,12 +1575,6 @@
return; return;
} }
aTab._animationLoggingEnabled = this.tabContainer._cachedTabAnimationLoggingPref;
if (aTab._animationLoggingEnabled) {
window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils)
.startFrameTimeRecording();
}
aTab._animStartTime = Date.now(); aTab._animStartTime = Date.now();
this._blurTab(aTab); this._blurTab(aTab);
@ -2890,12 +2878,6 @@
Services.prefs.addObserver("browser.tabs.", this._prefObserver, false); Services.prefs.addObserver("browser.tabs.", this._prefObserver, false);
window.addEventListener("resize", this, false); window.addEventListener("resize", this, false);
window.addEventListener("load", this, false); window.addEventListener("load", this, false);
try {
this._cachedTabAnimationLoggingPref = Services.prefs.getBoolPref("browser.tabs.animationLogging");
} catch (ex) {
this._cachedTabAnimationLoggingPref = false;
}
]]> ]]>
</constructor> </constructor>
@ -3528,18 +3510,6 @@
"FX_TAB_ANIM_OPEN_MS") "FX_TAB_ANIM_OPEN_MS")
.add(Date.now() - tab._animStartTime); .add(Date.now() - tab._animStartTime);
tab._animStartTime = 0; tab._animStartTime = 0;
if (tab._animationLoggingEnabled) {
let paints = {};
let intervals = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils)
.stopFrameTimeRecording(paints);
let msg = "Tab " + (tab.closing ? "close" : "open") + " (Frame-interval / paint-processing):\n";
for (let i = 0; i < intervals.length; i++) {
msg += Math.round(intervals[i]) + " / " + Math.round(paints.value[i]) + "\n";
}
Services.console.logStringMessage(msg);
}
} }
if (tab.getAttribute("fadein") == "true") { if (tab.getAttribute("fadein") == "true") {

View File

@ -2157,15 +2157,14 @@ nsDOMWindowUtils::StartFrameTimeRecording()
} }
NS_IMETHODIMP NS_IMETHODIMP
nsDOMWindowUtils::StopFrameTimeRecording(float** paintTimes, uint32_t *frameCount, float **frameIntervals) nsDOMWindowUtils::StopFrameTimeRecording(uint32_t *frameCount, float **frames)
{ {
if (!nsContentUtils::IsCallerChrome()) { if (!nsContentUtils::IsCallerChrome()) {
return NS_ERROR_DOM_SECURITY_ERR; return NS_ERROR_DOM_SECURITY_ERR;
} }
NS_ENSURE_ARG_POINTER(frameCount); NS_ENSURE_ARG_POINTER(frameCount);
NS_ENSURE_ARG_POINTER(frameIntervals); NS_ENSURE_ARG_POINTER(frames);
NS_ENSURE_ARG_POINTER(paintTimes);
nsCOMPtr<nsIWidget> widget = GetWidget(); nsCOMPtr<nsIWidget> widget = GetWidget();
if (!widget) if (!widget)
@ -2175,27 +2174,20 @@ nsDOMWindowUtils::StopFrameTimeRecording(float** paintTimes, uint32_t *frameCoun
if (!mgr) if (!mgr)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
nsTArray<float> tmpFrameIntervals; nsTArray<float> frameTimes;
nsTArray<float> tmpPaintTimes; mgr->StopFrameTimeRecording(frameTimes);
mgr->StopFrameTimeRecording(tmpFrameIntervals, tmpPaintTimes);
*frameIntervals = nullptr; *frames = nullptr;
*paintTimes = nullptr; *frameCount = frameTimes.Length();
*frameCount = tmpFrameIntervals.Length();
if (*frameCount != 0) { if (*frameCount != 0) {
*frameIntervals = (float*)nsMemory::Alloc(*frameCount * sizeof(float*)); *frames = (float*)nsMemory::Alloc(*frameCount * sizeof(float*));
if (!*frameIntervals) if (!*frames)
return NS_ERROR_OUT_OF_MEMORY; return NS_ERROR_OUT_OF_MEMORY;
*paintTimes = (float*)nsMemory::Alloc(*frameCount * sizeof(float*)); /* copy over the frame times into the array we just allocated */
if (!*paintTimes)
return NS_ERROR_OUT_OF_MEMORY;
/* copy over the frame intervals and paint times into the arrays we just allocated */
for (uint32_t i = 0; i < *frameCount; i++) { for (uint32_t i = 0; i < *frameCount; i++) {
(*frameIntervals)[i] = tmpFrameIntervals[i]; (*frames)[i] = frameTimes[i];
(*paintTimes)[i] = tmpPaintTimes[i];
} }
} }

View File

@ -40,7 +40,7 @@ interface nsIDOMTouch;
interface nsIDOMClientRect; interface nsIDOMClientRect;
interface nsIURI; interface nsIURI;
[scriptable, uuid(c98249a5-d38a-4ec6-b6e0-6866ea87d6bb)] [scriptable, uuid(C98B7275-93C4-4EAD-B7CF-573D872C1071)]
interface nsIDOMWindowUtils : nsISupports { interface nsIDOMWindowUtils : nsISupports {
/** /**
@ -1044,9 +1044,8 @@ interface nsIDOMWindowUtils : nsISupports {
readonly attribute AString layerManagerType; readonly attribute AString layerManagerType;
void startFrameTimeRecording(); void startFrameTimeRecording();
void stopFrameTimeRecording([optional, array, size_is(frameCount)] out float paintTimes, void stopFrameTimeRecording([optional] out unsigned long frameCount,
[optional] out unsigned long frameCount, [retval, array, size_is(frameCount)] out float frameTime);
[retval, array, size_is(frameCount)] out float frameIntervals);
/** /**
* Signals that we're begining to tab switch. This is used by painting code to * Signals that we're begining to tab switch. This is used by painting code to
* determine total tab switch time. * determine total tab switch time.

View File

@ -890,15 +890,6 @@ void
LayerManager::StartFrameTimeRecording() LayerManager::StartFrameTimeRecording()
{ {
mLastFrameTime = TimeStamp::Now(); mLastFrameTime = TimeStamp::Now();
mPaintStartTime = mLastFrameTime;
}
void
LayerManager::SetPaintStartTime(TimeStamp& aTime)
{
if (!mLastFrameTime.IsNull()) {
mPaintStartTime = aTime;
}
} }
void void
@ -906,8 +897,7 @@ LayerManager::PostPresent()
{ {
if (!mLastFrameTime.IsNull()) { if (!mLastFrameTime.IsNull()) {
TimeStamp now = TimeStamp::Now(); TimeStamp now = TimeStamp::Now();
mFrameIntervals.AppendElement((now - mLastFrameTime).ToMilliseconds()); mFrameTimes.AppendElement((now - mLastFrameTime).ToMilliseconds());
mPaintTimes.AppendElement((now - mPaintStartTime).ToMilliseconds());
mLastFrameTime = now; mLastFrameTime = now;
} }
if (!mTabSwitchStart.IsNull()) { if (!mTabSwitchStart.IsNull()) {
@ -918,13 +908,11 @@ LayerManager::PostPresent()
} }
void void
LayerManager::StopFrameTimeRecording(nsTArray<float>& aFrameIntervals, nsTArray<float>& aPaintTimes) LayerManager::StopFrameTimeRecording(nsTArray<float>& aTimes)
{ {
mLastFrameTime = TimeStamp(); mLastFrameTime = TimeStamp();
aFrameIntervals.SwapElements(mFrameIntervals); aTimes.SwapElements(mFrameTimes);
aPaintTimes.SwapElements(mPaintTimes); mFrameTimes.Clear();
mFrameIntervals.Clear();
mPaintTimes.Clear();
} }
void void

View File

@ -484,8 +484,7 @@ public:
void LogSelf(const char* aPrefix=""); void LogSelf(const char* aPrefix="");
void StartFrameTimeRecording(); void StartFrameTimeRecording();
void SetPaintStartTime(TimeStamp& aTime); void StopFrameTimeRecording(nsTArray<float>& aTimes);
void StopFrameTimeRecording(nsTArray<float>& aFrameTimes, nsTArray<float>& aProcessingTimes);
void PostPresent(); void PostPresent();
@ -517,9 +516,7 @@ protected:
bool mInTransaction; bool mInTransaction;
private: private:
TimeStamp mLastFrameTime; TimeStamp mLastFrameTime;
TimeStamp mPaintStartTime; nsTArray<float> mFrameTimes;
nsTArray<float> mFrameIntervals;
nsTArray<float> mPaintTimes;
TimeStamp mTabSwitchStart; TimeStamp mTabSwitchStart;
}; };

View File

@ -927,11 +927,6 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime)
#ifdef DEBUG_INVALIDATIONS #ifdef DEBUG_INVALIDATIONS
printf("Starting ProcessPendingUpdates\n"); printf("Starting ProcessPendingUpdates\n");
#endif #endif
layers::LayerManager *mgr = mPresContext->GetPresShell()->GetLayerManager();
if (mgr) {
mgr->SetPaintStartTime(mMostRecentRefresh);
}
mViewManagerFlushIsPending = false; mViewManagerFlushIsPending = false;
nsCOMPtr<nsIViewManager> vm = mPresContext->GetPresShell()->GetViewManager(); nsCOMPtr<nsIViewManager> vm = mPresContext->GetPresShell()->GetViewManager();
vm->ProcessPendingUpdates(); vm->ProcessPendingUpdates();