mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-05-31 07:11:00 +02:00
Use FeatureTest.isCanvasFilterSupported in _bakeSMaskCanvas
This commit is contained in:
parent
0c66063cd4
commit
1dac67ff54
@ -1437,16 +1437,15 @@ class CanvasGraphics {
|
||||
}
|
||||
const preparedEntry = this.canvasFactory.create(w, h);
|
||||
const pCtx = preparedEntry.context;
|
||||
// Pre-assign read: undefined means no canvas filter API (assigning
|
||||
// would just set a JS property and post-assign read would lie).
|
||||
// Post-assign "none"/"" means the URL was rejected (Firefox
|
||||
// normalizes accepted url(#id) to an absolute URL).
|
||||
const filterSupported = pCtx.filter !== undefined;
|
||||
pCtx.filter = filterSpec.url;
|
||||
const filterApplied =
|
||||
filterSupported && pCtx.filter !== "none" && pCtx.filter !== "";
|
||||
FeatureTest.isCanvasFilterSupported &&
|
||||
pCtx.filter !== "none" &&
|
||||
pCtx.filter !== "";
|
||||
pCtx.drawImage(srcEntry.canvas, 0, 0);
|
||||
if (filterSupported) {
|
||||
if (FeatureTest.isCanvasFilterSupported) {
|
||||
pCtx.filter = "none";
|
||||
}
|
||||
if (!filterApplied) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user