| 664 | } |
| 665 | |
| 666 | void CheckGraphicsMemory(std::shared_ptr<PAGExportSession> session, |
| 667 | std::shared_ptr<pag::File> pagFile) { |
| 668 | constexpr int64_t maxGraphicsMemorySizeForUI = 30 * 1024 * 1024; |
| 669 | constexpr int64_t maxGraphicsMemorySize = 80 * 1024 * 1024; |
| 670 | |
| 671 | auto graphicsMemorySize = CalculateGraphicsMemory(pagFile); |
| 672 | if (session->configParam.scenes == ExportScenes::UI && |
| 673 | graphicsMemorySize > maxGraphicsMemorySizeForUI) { |
| 674 | session->pushWarning(AlertInfoType::GraphicsMemoryUI, |
| 675 | std::to_string(graphicsMemorySize / 1024 / 1024) + "MB"); |
| 676 | } else if (graphicsMemorySize > maxGraphicsMemorySize) { |
| 677 | session->pushWarning(AlertInfoType::GraphicsMemory, |
| 678 | std::to_string(graphicsMemorySize / 1024 / 1024) + "MB"); |
| 679 | } |
| 680 | } |
| 681 | |
| 682 | } // namespace exporter |
no test coverage detected