| 26 | } |
| 27 | |
| 28 | void PAGRenderThread::flush() { |
| 29 | if (pagView->pagPlayer == nullptr || pagView->pagFile == nullptr) { |
| 30 | return; |
| 31 | } |
| 32 | if (pagView->sizeChanged) { |
| 33 | pagView->sizeChanged = false; |
| 34 | auto pagSurface = pagView->pagPlayer->getSurface(); |
| 35 | pagSurface->updateSize(); |
| 36 | } |
| 37 | pagView->pagPlayer->flush(); |
| 38 | double progress = pagView->pagFile->getProgress(); |
| 39 | int64_t currentFrame = |
| 40 | static_cast<int64_t>(std::round((pagView->getTotalFrame().toDouble() - 1) * progress)); |
| 41 | int64_t renderingTime = pagView->pagPlayer->renderingTime(); |
| 42 | int64_t presentingTime = pagView->pagPlayer->presentingTime(); |
| 43 | int64_t imageDecodingTime = pagView->pagPlayer->imageDecodingTime(); |
| 44 | Q_EMIT frameTimeMetricsReady(currentFrame, renderingTime, presentingTime, imageDecodingTime); |
| 45 | QMetaObject::invokeMethod(pagView, "update", Qt::QueuedConnection); |
| 46 | } |
| 47 | |
| 48 | void PAGRenderThread::shutDown() { |
| 49 | if (QGuiApplication::instance()) { |
nothing calls this directly
no test coverage detected