Simplify the applyTransferMapsToCanvas
method (PR 16151 follow-up)
During review of PR 16151 this method was simplified, however I overlooked the fact that we now can (and really should) improve this by removing duplication.
This commit is contained in:
parent
85166c60fd
commit
2fea9ee21b
@ -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") {
|
ctx.filter = this.current.transferMaps;
|
||||||
warn("Ignoring transferMaps - `OffscreenCanvas` support is disabled.");
|
ctx.drawImage(ctx.canvas, 0, 0);
|
||||||
}
|
ctx.filter = "none";
|
||||||
return ctx.canvas;
|
|
||||||
}
|
}
|
||||||
if (this.current.transferMaps === "none") {
|
|
||||||
return ctx.canvas;
|
|
||||||
}
|
|
||||||
ctx.filter = this.current.transferMaps;
|
|
||||||
ctx.drawImage(ctx.canvas, 0, 0);
|
|
||||||
ctx.filter = "none";
|
|
||||||
|
|
||||||
return ctx.canvas;
|
return ctx.canvas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user