Skip to content

Commit

Permalink
Fix an issue where the PAGPlayer::presentingTime() method returns a n…
Browse files Browse the repository at this point in the history
…egative value. (#2635)
  • Loading branch information
CodeJhF authored Dec 23, 2024
1 parent 6dc13b6 commit 288343f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/rendering/FileReporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void FileReporter::reportData() {
static int64_t GetOldRenderTime(RenderCache* cache) {
// 性能统计增加了数据字段,部分含义发生了改变,这里拼装出原先的
// renderingTime,确保数据上报结果跟之前一致。
return cache->totalTime - cache->presentingTime - cache->imageDecodingTime;
return cache->totalTime - cache->presentingTime;
}

void FileReporter::recordPerformance(RenderCache* cache) {
Expand Down
9 changes: 4 additions & 5 deletions src/rendering/PAGPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,7 @@ bool PAGPlayer::flushInternal(BackendSemaphore* signalSemaphore) {
clock.mark("presenting");
renderCache->renderingTime = clock.measure("", "rendering");
renderCache->presentingTime = clock.measure("rendering", "presenting");
auto knownTime = renderCache->imageDecodingTime + renderCache->textureUploadingTime +
renderCache->programCompilingTime + renderCache->hardwareDecodingTime +
renderCache->softwareDecodingTime;
auto knownTime = renderCache->textureUploadingTime + renderCache->programCompilingTime;
renderCache->presentingTime -= knownTime;
renderCache->totalTime = clock.measure("", "presenting");
// auto composition = stage->getRootComposition();
Expand Down Expand Up @@ -391,12 +389,13 @@ int64_t PAGPlayer::renderingTime() {
LockGuard autoLock(rootLocker);
// TODO(domrjchen): update the performance monitoring panel of PAGViewer to display the new
// properties
return renderCache->totalTime - renderCache->presentingTime - renderCache->imageDecodingTime;
return renderCache->totalTime - renderCache->presentingTime;
}

int64_t PAGPlayer::imageDecodingTime() {
LockGuard autoLock(rootLocker);
return renderCache->imageDecodingTime;
return renderCache->imageDecodingTime + renderCache->hardwareDecodingTime +
renderCache->softwareDecodingTime;
}

int64_t PAGPlayer::presentingTime() {
Expand Down

0 comments on commit 288343f

Please sign in to comment.