Skip to content

Commit

Permalink
Merge pull request #16166 from Snuffleupagus/pr-16151-followup
Browse files Browse the repository at this point in the history
Simplify the `applyTransferMapsToCanvas` method (PR 16151 follow-up)
  • Loading branch information
timvandermeij authored Mar 18, 2023
2 parents 85166c6 + 2fea9ee commit 9db4509
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/display/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -2964,19 +2964,11 @@ class CanvasGraphics {
}

applyTransferMapsToCanvas(ctx) {
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
if (this.current.transferMaps !== "none") {
warn("Ignoring transferMaps - `OffscreenCanvas` support is disabled.");
}
return ctx.canvas;
}
if (this.current.transferMaps === "none") {
return ctx.canvas;
if (this.current.transferMaps !== "none") {
ctx.filter = this.current.transferMaps;
ctx.drawImage(ctx.canvas, 0, 0);
ctx.filter = "none";
}
ctx.filter = this.current.transferMaps;
ctx.drawImage(ctx.canvas, 0, 0);
ctx.filter = "none";

return ctx.canvas;
}

Expand Down

0 comments on commit 9db4509

Please sign in to comment.