mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-11 19:58:15 +02:00
Also transfer ImageBitmap
s for image masks and inline images
Currently we're only transferring TypedArrays, however there's no reason (as far as I can tell) to not also transfer `ImageBitmap`s in these cases.
This commit is contained in:
parent
ff2d95a9b6
commit
8c5fb7979f
1 changed files with 7 additions and 5 deletions
|
@ -768,18 +768,20 @@ class OperatorList {
|
|||
switch (fnArray[i]) {
|
||||
case OPS.paintInlineImageXObject:
|
||||
case OPS.paintInlineImageXObjectGroup:
|
||||
case OPS.paintImageMaskXObject:
|
||||
const arg = argsArray[i][0]; // First parameter in imgData.
|
||||
if (arg.data?.buffer instanceof ArrayBuffer) {
|
||||
transfers.push(arg.data.buffer);
|
||||
case OPS.paintImageMaskXObject: {
|
||||
const { bitmap, data } = argsArray[i][0]; // First parameter in imgData.
|
||||
if (bitmap || data?.buffer) {
|
||||
transfers.push(bitmap || data.buffer);
|
||||
}
|
||||
break;
|
||||
case OPS.constructPath:
|
||||
}
|
||||
case OPS.constructPath: {
|
||||
const [, [data], minMax] = argsArray[i];
|
||||
if (data) {
|
||||
transfers.push(data.buffer, minMax.buffer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case OPS.paintFormXObjectBegin:
|
||||
const [matrix, bbox] = argsArray[i];
|
||||
if (matrix) {
|
||||
|
|
Loading…
Add table
Reference in a new issue