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

Function DefaultCacheKeyGeneratorFunc

src/rendering/PAGDecoder.cpp:33–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31namespace pag {
32
33static 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
47Composition* PAGDecoder::GetSingleComposition(std::shared_ptr<PAGComposition> pagComposition) {
48 auto numChildren = pagComposition->numChildren();

Callers 1

generateCacheKeyMethod · 0.85

Calls 7

getSandboxPathMethod · 0.80
emptyMethod · 0.80
isPAGFileMethod · 0.45
pathMethod · 0.45
getMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected