зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1501442 - Part 3: Add profiler markers for payload presentarion. r=mstange
--HG-- extra : rebase_source : 7b3eeb59ab8823c5ebb674b933d95d1501f86210
This commit is contained in:
Родитель
4cf5cf3ec0
Коммит
a932b54860
|
@ -154,6 +154,23 @@ UniquePtr<LayerUserData> LayerManager::RemoveUserData(void* aKey) {
|
|||
return d;
|
||||
}
|
||||
|
||||
void LayerManager::PayloadPresented() {
|
||||
if (mPayload.Length()) {
|
||||
TimeStamp presented = TimeStamp::Now();
|
||||
for (CompositionPayload& payload : mPayload) {
|
||||
#if MOZ_GECKO_PROFILER
|
||||
if (profiler_is_active()) {
|
||||
nsPrintfCString marker(
|
||||
"Payload Presented, type: %d latency: %dms\n",
|
||||
int32_t(payload.mType),
|
||||
int32_t((presented - payload.mTimeStamp).ToMilliseconds()));
|
||||
profiler_add_marker(marker.get());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// Layer
|
||||
|
||||
|
|
|
@ -739,6 +739,7 @@ class LayerManager : public FrameRecorder {
|
|||
mPayload.AppendElements(aPayload);
|
||||
MOZ_ASSERT(mPayload.Length() < 10000);
|
||||
}
|
||||
void PayloadPresented();
|
||||
|
||||
protected:
|
||||
RefPtr<Layer> mRoot;
|
||||
|
|
|
@ -975,6 +975,9 @@ void LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion,
|
|||
mProfilerScreenshotGrabber.MaybeProcessQueue();
|
||||
|
||||
RecordFrame();
|
||||
|
||||
PayloadPresented();
|
||||
|
||||
// Our payload has now been presented.
|
||||
mPayload.Clear();
|
||||
}
|
||||
|
|
|
@ -305,6 +305,8 @@ void LayerManagerMLGPU::Composite() {
|
|||
mClonedLayerTreeProperties = nullptr;
|
||||
mClonedLayerTreeProperties = LayerProperties::CloneFrom(mRoot);
|
||||
|
||||
PayloadPresented();
|
||||
|
||||
mPayload.Clear();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче