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

Method flush

viewer/src/rendering/PAGRenderThread.cpp:28–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28void 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
48void PAGRenderThread::shutDown() {
49 if (QGuiApplication::instance()) {

Callers

nothing calls this directly

Calls 7

getSurfaceMethod · 0.45
updateSizeMethod · 0.45
getProgressMethod · 0.45
getTotalFrameMethod · 0.45
renderingTimeMethod · 0.45
presentingTimeMethod · 0.45
imageDecodingTimeMethod · 0.45

Tested by

no test coverage detected