Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2643,6 +2643,7 @@ def test_html5_webgl_create_context2(self):
self.btest_exit('webgl_create_context2.c')

@requires_graphics_hardware
@requires_offscreen_canvas
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't only one of the variants require it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's right.

I thought to keep this change simple and over-conservative, to avoid too much churn from testing old browsers.

# Verify bug https://github.com/emscripten-core/emscripten/issues/22943: creating a WebGL context with explicit swap control and offscreenCanvas
@parameterized({
'offscreencanvas': (['-sOFFSCREENCANVAS_SUPPORT'],),
Expand Down
12 changes: 12 additions & 0 deletions tools/feature_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Feature(IntEnum):
PROMISE_ANY = auto()
MEMORY64 = auto()
WORKER_ES6_MODULES = auto()
OFFSCREENCANVAS_SUPPORT = auto()


disable_override_features = set()
Expand Down Expand Up @@ -95,6 +96,15 @@ class Feature(IntEnum):
'safari': 150000,
'node': 0, # This is a browser only feature, no requirements on Node.js
},
# OffscreenCanvas feature allows creating canvases that are not connected to
# a visible DOM element, e.g. in a Worker.
# https://caniuse.com/offscreencanvas
Feature.OFFSCREENCANVAS_SUPPORT: {
'chrome': 69,
'firefox': 105,
'safari': 170000,
'node': 0, # This is a browser only feature, no requirements on Node.js
},
}

# Static assertion to check that we actually need each of the above feature flags
Expand Down Expand Up @@ -186,3 +196,5 @@ def apply_min_browser_versions():
enable_feature(Feature.WORKER_ES6_MODULES, 'EXPORT_ES6 with -pthread')
if settings.EXPORT_ES6 and settings.WASM_WORKERS:
enable_feature(Feature.WORKER_ES6_MODULES, 'EXPORT_ES6 with -sWASM_WORKERS')
if settings.OFFSCREENCANVAS_SUPPORT:
enable_feature(Feature.OFFSCREENCANVAS_SUPPORT, 'OFFSCREENCANVAS_SUPPORT')