| 31 | namespace pag { |
| 32 | |
| 33 | static std::string DefaultCacheKeyGeneratorFunc(PAGDecoder* decoder, |
| 34 | std::shared_ptr<PAGComposition> composition) { |
| 35 | if (!composition->isPAGFile() || pag::ContentVersion::Get(composition) > 0) { |
| 36 | return ""; |
| 37 | } |
| 38 | auto filePath = static_cast<PAGFile*>(composition.get())->path(); |
| 39 | filePath = Platform::Current()->getSandboxPath(filePath); |
| 40 | if (filePath.empty()) { |
| 41 | return ""; |
| 42 | } |
| 43 | return filePath + "." + std::to_string(decoder->width()) + "x" + |
| 44 | std::to_string(decoder->height()); |
| 45 | } |
| 46 | |
| 47 | Composition* PAGDecoder::GetSingleComposition(std::shared_ptr<PAGComposition> pagComposition) { |
| 48 | auto numChildren = pagComposition->numChildren(); |
no test coverage detected