-
==============Performance Report Begin==============
PAGFile Load: 8ms
TemplateData Parser: 0ms
PAGSurface MakeOffscreen: 60ms
Fill data: 1ms
Processor BeforeCreatingPlayer: 0ms
PAGPlayer setup: 0ms
Processor AfterCreatingPlayer: 26ms
GetFrameDataAt: 7ms
==============Performance Report End==============
==============Performance Report Begin==============
PAGFile Load: 0ms
TemplateData Parser: 0ms
PAGSurface MakeOffscreen: 2ms
Fill data: 0ms
Processor BeforeCreatingPlayer: 0ms
PAGPlayer setup: 0ms
Processor AfterCreatingPlayer: 330ms
==============Performance Report End==============
void PosterProcessor::AfterCreatingPlayer(std::shared_ptr<pag::PAGComposition> composition, std::shared_ptr<pag::PAGPlayer> player) {
if (composition == nullptr || player == nullptr) {
return;
}
if (this->symbolLayer == nullptr || this->priceLayer == nullptr) {
return;
}
this->symbolLayer->resetMatrix();
this->priceLayer->resetMatrix();
// 获取最终的准确的图层位置
player->flush();
auto canvasRect = pag::Rect::MakeWH(composition->width(), composition->height());
auto symbolRect = player->getBounds(symbolLayer);
auto priceRect = player->getBounds(priceLayer);
auto priceTx = canvasRect.centerX() - priceRect.centerX() + symbolRect.width() * 0.5;
auto priceTy = canvasRect.centerY() - priceRect.centerY();
auto symbolTx = (canvasRect.width() - priceRect.width()) * 0.5 - symbolRect.width() * 0.5;
auto symbolTy = (canvasRect.centerY() + priceRect.height() * 0.5) - symbolRect.height() * 0.8;
do {
auto totalMatrix = this->symbolLayer->getTotalMatrix();
totalMatrix.setTranslate(symbolTx, symbolTy);
this->symbolLayer->setMatrix(totalMatrix);
} while (0);
do {
auto totalMatrix = this->priceLayer->getTotalMatrix();
totalMatrix.setTranslate(priceTx, priceTy);
this->priceLayer->setMatrix(totalMatrix);
} while (0);
} |
Beta Was this translation helpful? Give feedback.
Answered by
0x1306a94
Dec 14, 2023
Replies: 1 comment
-
我应该知道原因了,应该是Linux环境没有GPU设备,所以采用了CPU模拟导致耗时高的原因 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kevingpqi123
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我应该知道原因了,应该是Linux环境没有GPU设备,所以采用了CPU模拟导致耗时高的原因