| 32 | } |
| 33 | |
| 34 | auto 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 | |
| 55 | auto PAGProfilingTask::onFrameFlush(double progress) -> void { |
| 56 | PAGPlayTask::onFrameFlush(progress); |
nothing calls this directly
no test coverage detected