mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-22 16:05:56 +02:00
Remove the unused ImageData branch in the putBinaryImageData function
This branch isn't covered by any tests, and looking at the two existing call-sites we only ever pass in a `CanvasRenderingContext2D` interface to this function. Based on the git history this branch was added in PR 3312, however as far as I can tell it doesn't actually appear to have been necessary even back then!?
This commit is contained in:
parent
a443a635a1
commit
b4b0a3fa04
@ -320,11 +320,6 @@ class CanvasExtraState {
|
||||
}
|
||||
|
||||
function putBinaryImageData(ctx, imgData) {
|
||||
if (imgData instanceof ImageData) {
|
||||
ctx.putImageData(imgData, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// Put the image data to the canvas in chunks, rather than putting the
|
||||
// whole image at once. This saves JS memory, because the ImageData object
|
||||
// is smaller. It also possibly saves C++ memory within the implementation
|
||||
|
||||
@ -51,13 +51,6 @@ if (isNodeJS) {
|
||||
warn("Cannot polyfill `DOMMatrix`, rendering may be broken.");
|
||||
}
|
||||
}
|
||||
if (!globalThis.ImageData) {
|
||||
if (canvas?.ImageData) {
|
||||
globalThis.ImageData = canvas.ImageData;
|
||||
} else {
|
||||
warn("Cannot polyfill `ImageData`, rendering may be broken.");
|
||||
}
|
||||
}
|
||||
if (!globalThis.Path2D) {
|
||||
if (canvas?.Path2D) {
|
||||
globalThis.Path2D = canvas.Path2D;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user