Merge pull request #16166 from Snuffleupagus/pr-16151-followup
Simplify the `applyTransferMapsToCanvas` method (PR 16151 follow-up)
This commit is contained in:
commit
9db4509664
@ -2964,19 +2964,11 @@ class CanvasGraphics {
|
|||||||
}
|
}
|
||||||
|
|
||||||
applyTransferMapsToCanvas(ctx) {
|
applyTransferMapsToCanvas(ctx) {
|
||||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
|
||||||
if (this.current.transferMaps !== "none") {
|
if (this.current.transferMaps !== "none") {
|
||||||
warn("Ignoring transferMaps - `OffscreenCanvas` support is disabled.");
|
|
||||||
}
|
|
||||||
return ctx.canvas;
|
|
||||||
}
|
|
||||||
if (this.current.transferMaps === "none") {
|
|
||||||
return ctx.canvas;
|
|
||||||
}
|
|
||||||
ctx.filter = this.current.transferMaps;
|
ctx.filter = this.current.transferMaps;
|
||||||
ctx.drawImage(ctx.canvas, 0, 0);
|
ctx.drawImage(ctx.canvas, 0, 0);
|
||||||
ctx.filter = "none";
|
ctx.filter = "none";
|
||||||
|
}
|
||||||
return ctx.canvas;
|
return ctx.canvas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user