зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1550092 part 3. Stop using [array] in stopFrameTimeRecording. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D30443 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
377c937b2d
Коммит
87c9aa2d6e
|
@ -2231,28 +2231,14 @@ nsDOMWindowUtils::StartFrameTimeRecording(uint32_t* startIndex) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::StopFrameTimeRecording(uint32_t startIndex,
|
||||
uint32_t* frameCount,
|
||||
float** frameIntervals) {
|
||||
NS_ENSURE_ARG_POINTER(frameCount);
|
||||
NS_ENSURE_ARG_POINTER(frameIntervals);
|
||||
|
||||
nsTArray<float>& 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];
|
||||
}
|
||||
mgr->StopFrameTimeRecording(startIndex, frameIntervals);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -1349,13 +1349,10 @@ interface nsIDOMWindowUtils : nsISupports {
|
|||
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.
|
||||
* Returns array of frame intervals since the time when the given startIndex
|
||||
* was handed out from startFrameTimeRecording.
|
||||
*/
|
||||
void stopFrameTimeRecording(in unsigned long startIndex,
|
||||
[optional] out unsigned long frameCount,
|
||||
[retval, array, size_is(frameCount)] out float frameIntervals);
|
||||
Array<float> stopFrameTimeRecording(in unsigned long startIndex);
|
||||
|
||||
/**
|
||||
* The DPI of the display
|
||||
|
|
|
@ -247,9 +247,8 @@ Tart.prototype = {
|
|||
Profiler.mark("End: " + (isReportResult ? name : "[warmup]"), true);
|
||||
}
|
||||
if (self.USE_RECORDING_API) {
|
||||
var paints = {};
|
||||
return window.windowUtils
|
||||
.stopFrameTimeRecording(recordingHandle, paints);
|
||||
.stopFrameTimeRecording(recordingHandle);
|
||||
}
|
||||
|
||||
_abortRecording = true;
|
||||
|
|
Загрузка…
Ссылка в новой задаче