diff options
author | Moonchild <moonchild@palemoon.org> | 2022-04-04 11:58:59 +0800 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-10-23 21:43:46 +0000 |
commit | 362a84565c0154b71e6b8b581f7a94e2051385a7 (patch) | |
tree | e8215972776a036acaf8487af2ca9a0772977104 /dom | |
parent | d8ef6bf7af085c252027fd3cfc6106ca69c61df4 (diff) | |
download | uxp-362a84565c0154b71e6b8b581f7a94e2051385a7.tar.gz |
Issue #21 - Remove panning/tab animation performance measurements
Based on FranklinDM's follow-up for the issue.
This would require browser FE changes, particularly removing the associated
code in `tabbrowser.xml`, however, that was already done in Pale Moon previously.
Other front-end applications may need to take note, though.
Based on changes from the following bugs:
* Bug 696398 - Need an api to analyze panning performance
* Bug 800031 - Include paint time in tab switch telemetry
* Bug 820167 - Enable performance measurement of tab animation
* Bug 826383 - Improve Start/Stop FrameTimeRecording for telemetry usage
Diffstat (limited to 'dom')
-rw-r--r-- | dom/base/nsDOMWindowUtils.cpp | 69 | ||||
-rw-r--r-- | dom/interfaces/base/nsIDOMWindowUtils.idl | 34 |
2 files changed, 1 insertions, 102 deletions
diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index d38b3c600b..69f1787b9f 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -2367,75 +2367,6 @@ nsDOMWindowUtils::GetCurrentAudioBackend(nsAString& aBackend) return NS_OK; } -NS_IMETHODIMP -nsDOMWindowUtils::StartFrameTimeRecording(uint32_t *startIndex) -{ - NS_ENSURE_ARG_POINTER(startIndex); - - nsCOMPtr<nsIWidget> widget = GetWidget(); - if (!widget) - return NS_ERROR_FAILURE; - - LayerManager *mgr = widget->GetLayerManager(); - if (!mgr) - return NS_ERROR_FAILURE; - - const uint32_t kRecordingMinSize = 60 * 10; // 10 seconds @60 fps. - const uint32_t kRecordingMaxSize = 60 * 60 * 60; // One hour - uint32_t bufferSize = Preferences::GetUint("toolkit.framesRecording.bufferSize", uint32_t(0)); - bufferSize = std::min(bufferSize, kRecordingMaxSize); - bufferSize = std::max(bufferSize, kRecordingMinSize); - *startIndex = mgr->StartFrameTimeRecording(bufferSize); - - return NS_OK; -} - -NS_IMETHODIMP -nsDOMWindowUtils::StopFrameTimeRecording(uint32_t startIndex, - uint32_t *frameCount, - float **frameIntervals) -{ - NS_ENSURE_ARG_POINTER(frameCount); - NS_ENSURE_ARG_POINTER(frameIntervals); - - nsCOMPtr<nsIWidget> widget = GetWidget(); - if (!widget) - return NS_ERROR_FAILURE; - - LayerManager *mgr = widget->GetLayerManager(); - if (!mgr) - return NS_ERROR_FAILURE; - - nsTArray<float> tmpFrameIntervals; - mgr->StopFrameTimeRecording(startIndex, tmpFrameIntervals); - *frameCount = tmpFrameIntervals.Length(); - - *frameIntervals = (float*)moz_xmalloc(*frameCount * sizeof(float)); - - /* copy over the frame intervals and paint times into the arrays we just allocated */ - for (uint32_t i = 0; i < *frameCount; i++) { - (*frameIntervals)[i] = tmpFrameIntervals[i]; - } - - return NS_OK; -} - -NS_IMETHODIMP -nsDOMWindowUtils::BeginTabSwitch() -{ - nsCOMPtr<nsIWidget> widget = GetWidget(); - if (!widget) - return NS_ERROR_FAILURE; - - LayerManager *mgr = widget->GetLayerManager(); - if (!mgr) - return NS_ERROR_FAILURE; - - mgr->BeginTabSwitch(); - - return NS_OK; -} - static bool ComputeAnimationValue(nsCSSPropertyID aProperty, Element* aElement, diff --git a/dom/interfaces/base/nsIDOMWindowUtils.idl b/dom/interfaces/base/nsIDOMWindowUtils.idl index ad45e6e520..1289bd940d 100644 --- a/dom/interfaces/base/nsIDOMWindowUtils.idl +++ b/dom/interfaces/base/nsIDOMWindowUtils.idl @@ -49,7 +49,7 @@ interface nsIJSRAIIHelper; interface nsIContentPermissionRequest; interface nsIObserver; -[scriptable, uuid(7fcc7958-77d9-45ff-8c81-277bde5f0dc8)] +[scriptable, uuid(58e97ce9-1d9e-4576-aabf-89480fdeb16d)] interface nsIDOMWindowUtils : nsISupports { /** @@ -1426,38 +1426,6 @@ interface nsIDOMWindowUtils : nsISupports { readonly attribute AString currentAudioBackend; /** - * Record (and return) frame-intervals for frames which were presented - * between calling StartFrameTimeRecording and StopFrameTimeRecording. - * - * - Uses a cyclic buffer and serves concurrent consumers, so if Stop is called too late - * (elements were overwritten since Start), result is considered invalid and hence empty. - * - Buffer is capable of holding 10 seconds @ 60fps (or more if frames were less frequent). - * Can be changed (up to 1 hour) via pref: toolkit.framesRecording.bufferSize. - * - Note: the first frame-interval may be longer than expected because last frame - * might have been presented some time before calling StartFrameTimeRecording. - */ - - /** - * Returns a handle which represents current recording start position. - */ - void startFrameTimeRecording([retval] out unsigned long startIndex); - - /** - * Returns number of recorded frames since startIndex was issued, - * and allocates+populates 2 arraye with the recorded data. - * - Allocation is infallible. Should be released even if size is 0. - */ - void stopFrameTimeRecording(in unsigned long startIndex, - [optional] out unsigned long frameCount, - [retval, array, size_is(frameCount)] out float frameIntervals); - - /** - * Signals that we're begining to tab switch. This is used by painting code to - * determine total tab switch time. - */ - void beginTabSwitch(); - - /** * The DPI of the display */ readonly attribute float displayDPI; |