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)
tabContainer._handleNewTab(t);
else {
t._animationLoggingEnabled = tabContainer._cachedTabAnimationLoggingPref;
if (t._animationLoggingEnabled) {
window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils)
.startFrameTimeRecording();
}
t._animStartTime = Date.now();
t.setAttribute("fadein", "true");
@ -1581,12 +1575,6 @@
return;
}
aTab._animationLoggingEnabled = this.tabContainer._cachedTabAnimationLoggingPref;
if (aTab._animationLoggingEnabled) {
window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils)
.startFrameTimeRecording();
}
aTab._animStartTime = Date.now();
this._blurTab(aTab);
@ -2890,12 +2878,6 @@
Services.prefs.addObserver("browser.tabs.", this._prefObserver, false);
window.addEventListener("resize", this, false);
window.addEventListener("load", this, false);
try {
this._cachedTabAnimationLoggingPref = Services.prefs.getBoolPref("browser.tabs.animationLogging");
} catch (ex) {
this._cachedTabAnimationLoggingPref = false;
}
]]>
</constructor>
@ -3528,18 +3510,6 @@
"FX_TAB_ANIM_OPEN_MS")
.add(Date.now() - tab._animStartTime);
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") {

View File

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

View File

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

View File

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

View File

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

View File

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