Skip to content

Commit 10abe66

Browse files
Merge pull request #21264 from calixteman/simplify_no_filter
Use FeatureTest.isCanvasFilterSupported in _bakeSMaskCanvas
2 parents dc7b6c3 + 1dac67f commit 10abe66

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/display/canvas.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,16 +1437,15 @@ class CanvasGraphics {
14371437
}
14381438
const preparedEntry = this.canvasFactory.create(w, h);
14391439
const pCtx = preparedEntry.context;
1440-
// Pre-assign read: undefined means no canvas filter API (assigning
1441-
// would just set a JS property and post-assign read would lie).
14421440
// Post-assign "none"/"" means the URL was rejected (Firefox
14431441
// normalizes accepted url(#id) to an absolute URL).
1444-
const filterSupported = pCtx.filter !== undefined;
14451442
pCtx.filter = filterSpec.url;
14461443
const filterApplied =
1447-
filterSupported && pCtx.filter !== "none" && pCtx.filter !== "";
1444+
FeatureTest.isCanvasFilterSupported &&
1445+
pCtx.filter !== "none" &&
1446+
pCtx.filter !== "";
14481447
pCtx.drawImage(srcEntry.canvas, 0, 0);
1449-
if (filterSupported) {
1448+
if (FeatureTest.isCanvasFilterSupported) {
14501449
pCtx.filter = "none";
14511450
}
14521451
if (!filterApplied) {

0 commit comments

Comments
 (0)