shell: set no-wgl flag in servoshell instead (#32753)

* Set no-wgl flag in servoshell instead

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

* Remove unused comment

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

---------

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
This commit is contained in:
Ngo Iok Ui (Wu Yu Wei) 2024-07-10 23:50:27 +09:00 committed by GitHub
parent 313536fd82
commit 3e163bfcdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 14 additions and 16 deletions

View file

@ -115,8 +115,7 @@ string_cache_codegen = "0.5"
style = { git = "https://github.com/servo/stylo", branch = "2024-05-31", features = ["servo"] } style = { git = "https://github.com/servo/stylo", branch = "2024-05-31", features = ["servo"] }
style_config = { git = "https://github.com/servo/stylo", branch = "2024-05-31" } style_config = { git = "https://github.com/servo/stylo", branch = "2024-05-31" }
style_traits = { git = "https://github.com/servo/stylo", branch = "2024-05-31", features = ["servo"] } style_traits = { git = "https://github.com/servo/stylo", branch = "2024-05-31", features = ["servo"] }
# NOTE: the sm-angle feature only enables ANGLE on Windows, not other platforms! surfman = { version = "0.9", features = ["chains"] }
surfman = { version = "0.9", features = ["chains", "sm-angle", "sm-angle-default"] }
syn = { version = "2", default-features = false, features = ["clone-impls", "derive", "parsing"] } syn = { version = "2", default-features = false, features = ["clone-impls", "derive", "parsing"] }
synstructure = "0.13" synstructure = "0.13"
thin-vec = "0.2.13" thin-vec = "0.2.13"

View file

@ -11,7 +11,6 @@ name = "canvas"
path = "lib.rs" path = "lib.rs"
[features] [features]
no-wgl = ["surfman/sm-no-wgl"]
webgl_backtrace = ["canvas_traits/webgl_backtrace"] webgl_backtrace = ["canvas_traits/webgl_backtrace"]
xr-profile = ["webxr-api/profile", "time"] xr-profile = ["webxr-api/profile", "time"]

View file

@ -20,7 +20,7 @@ max_log_level = ["log/release_max_level_info"]
media-gstreamer = ["servo-media-gstreamer", "gstreamer"] media-gstreamer = ["servo-media-gstreamer", "gstreamer"]
multiview = ["compositing/multiview", "constellation/multiview"] multiview = ["compositing/multiview", "constellation/multiview"]
native-bluetooth = ["bluetooth/native-bluetooth"] native-bluetooth = ["bluetooth/native-bluetooth"]
no-wgl = ["canvas/no-wgl"] no-wgl = ["mozangle/egl", "mozangle/build_dlls", "surfman/sm-angle-default"]
dynamic_freetype = ["webrender/dynamic_freetype"] dynamic_freetype = ["webrender/dynamic_freetype"]
profilemozjs = ["script/profilemozjs"] profilemozjs = ["script/profilemozjs"]
refcell_backtrace = ["script/refcell_backtrace"] refcell_backtrace = ["script/refcell_backtrace"]
@ -86,6 +86,3 @@ webxr-api = { git = "https://github.com/servo/webxr" }
[target.'cfg(all(not(target_os = "windows"), not(target_os = "ios"), not(target_os = "android"), not(target_arch = "arm"), not(target_arch = "aarch64")))'.dependencies] [target.'cfg(all(not(target_os = "windows"), not(target_os = "ios"), not(target_os = "android"), not(target_arch = "arm"), not(target_arch = "aarch64")))'.dependencies]
gaol = "0.2.1" gaol = "0.2.1"
[target.'cfg(target_os = "windows")'.dependencies]
mozangle = { workspace = true, features = ["egl", "build_dlls"] }

View file

@ -525,10 +525,16 @@ where
fn get_native_media_display_and_gl_context( fn get_native_media_display_and_gl_context(
rendering_context: &RenderingContext, rendering_context: &RenderingContext,
) -> Option<(NativeDisplay, GlContext)> { ) -> Option<(NativeDisplay, GlContext)> {
let gl_context = GlContext::Egl(rendering_context.native_context().egl_context as usize); #[cfg(feature = "no-wgl")]
let native_display = {
NativeDisplay::Egl(rendering_context.native_device().egl_display as usize); let gl_context =
Some((native_display, gl_context)) GlContext::Egl(rendering_context.native_context().egl_context as usize);
let native_display =
NativeDisplay::Egl(rendering_context.native_device().egl_display as usize);
Some((native_display, gl_context))
}
#[cfg(not(feature = "no-wgl"))]
None
} }
#[cfg(not(any( #[cfg(not(any(

View file

@ -45,7 +45,6 @@ max_log_level = ["log/release_max_level_info"]
media-gstreamer = ["libservo/media-gstreamer"] media-gstreamer = ["libservo/media-gstreamer"]
multiview = ["libservo/multiview"] multiview = ["libservo/multiview"]
native-bluetooth = ["libservo/native-bluetooth"] native-bluetooth = ["libservo/native-bluetooth"]
no-wgl = ["libservo/no-wgl"]
profilemozjs = ["libservo/profilemozjs"] profilemozjs = ["libservo/profilemozjs"]
refcell_backtrace = ["libservo/refcell_backtrace"] refcell_backtrace = ["libservo/refcell_backtrace"]
webdriver = ["libservo/webdriver"] webdriver = ["libservo/webdriver"]
@ -116,3 +115,4 @@ sig = "1.0"
[target.'cfg(target_os = "windows")'.dependencies] [target.'cfg(target_os = "windows")'.dependencies]
windows-sys = { workspace = true, features = ["Win32_Graphics_Gdi"] } windows-sys = { workspace = true, features = ["Win32_Graphics_Gdi"] }
libservo = { path = "../../components/servo", features = ["no-wgl"] }

View file

@ -862,7 +862,6 @@ class CommandBase(object):
action='store_true', action='store_true',
help='Build with frame pointer enabled, used by the background hang monitor.', help='Build with frame pointer enabled, used by the background hang monitor.',
), ),
CommandArgument('--without-wgl', group="Feature Selection", default=None, action='store_true'),
CommandArgument( CommandArgument(
'--use-crown', '--use-crown',
default=False, default=False,
@ -982,7 +981,7 @@ class CommandBase(object):
self, command: str, cargo_args: List[str], self, command: str, cargo_args: List[str],
env=None, verbose=False, env=None, verbose=False,
debug_mozjs=False, with_debug_assertions=False, debug_mozjs=False, with_debug_assertions=False,
with_frame_pointer=False, without_wgl=False, with_frame_pointer=False,
use_crown=False, use_crown=False,
target_override: Optional[str] = None, target_override: Optional[str] = None,
**_kwargs **_kwargs
@ -1042,8 +1041,6 @@ class CommandBase(object):
if with_frame_pointer: if with_frame_pointer:
env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -C force-frame-pointers=yes" env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -C force-frame-pointers=yes"
features.append("profilemozjs") features.append("profilemozjs")
if without_wgl:
features.append("no-wgl")
if self.config["build"]["webgl-backtrace"]: if self.config["build"]["webgl-backtrace"]:
features.append("webgl-backtrace") features.append("webgl-backtrace")
if self.config["build"]["dom-backtrace"]: if self.config["build"]["dom-backtrace"]: