Use all the current transform as key when caching some image for masks used with pattern fill (bug 1795263, #15573)

This commit is contained in:
Calixte Denizet 2022-10-14 13:14:13 +02:00
parent 15d4d80d45
commit 556513a6e7
4 changed files with 11 additions and 3 deletions

View File

@ -1368,11 +1368,12 @@ class CanvasGraphics {
// In case we've a pattern fill we just keep the scaled version of
// the image.
// Only the scaling part matters, the translation part is just used
// to compute offsets.
// to compute offsets (but not when filling patterns see #15573).
// TODO: handle the case of a pattern fill if it's possible.
const withoutTranslation = currentTransform.slice(0, 4);
cacheKey = JSON.stringify(
isPatternFill ? withoutTranslation : [withoutTranslation, fillColor]
isPatternFill
? currentTransform
: [currentTransform.slice(0, 4), fillColor]
);
cache = this._cachedBitmapsMap.get(mainKey);

View File

@ -544,3 +544,4 @@
!tracemonkey_a11y.pdf
!bug1782564.pdf
!issue15340.pdf
!bug1795263.pdf

BIN
test/pdfs/bug1795263.pdf Normal file

Binary file not shown.

View File

@ -6926,5 +6926,11 @@
"link": true,
"rounds": 1,
"type": "eq"
},
{ "id": "bug1795263",
"file": "pdfs/bug1795263.pdf",
"md5": "af708acbb22c6c9d268240dcf4a39809",
"rounds": 1,
"type": "eq"
}
]