MCPcopy Create free account
hub / github.com/Tencent/libpag / onFinish

Method onFinish

viewer/src/task/profiling/PAGProfilingTask.cpp:34–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34auto PAGProfilingTask::onFinish() -> int {
35 PAGPlayTask::onFinish();
36 if (currentFrame > 0) {
37 performanceData->presentingTime /= currentFrame;
38 performanceData->renderingTime /= currentFrame;
39 performanceData->imageDecodingTime /= currentFrame;
40 }
41 performanceData->graphicsMemory = CalculateGraphicsMemory(pagFile->getFile());
42 auto byteData = pag::Codec::Encode(pagFile->getFile(), performanceData);
43 if (byteData != nullptr || byteData->length() > 0) {
44 auto outFilePath = filePath;
45 if (!outFilePath.endsWith(".pag")) {
46 outFilePath.append(".pag");
47 }
48 Utils::WriteDataToDisk(outFilePath, byteData->data(), byteData->length());
49 Utils::OpenInFinder(outFilePath);
50 return 0;
51 }
52 return 1;
53}
54
55auto PAGProfilingTask::onFrameFlush(double progress) -> void {
56 PAGPlayTask::onFrameFlush(progress);

Callers

nothing calls this directly

Calls 6

CalculateGraphicsMemoryFunction · 0.85
WriteDataToDiskFunction · 0.85
OpenInFinderFunction · 0.85
getFileMethod · 0.80
lengthMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected