Show/hide wasm info label via config flag

This commit is contained in:
Belén Albeza
2026-03-18 12:44:10 +01:00
parent d2422e3a21
commit 0597eef750
5 changed files with 16 additions and 3 deletions

View File

@@ -136,6 +136,8 @@
:webhooks
;; TODO: deprecate this flag and consolidate the code
:render-wasm-dpr
;; Show WASM renderer info label (hidden by default).
:render-wasm-info
:hide-release-modal
:subscriptions
:subscriptions-old

View File

@@ -1401,7 +1401,9 @@
(dbg/enabled? :wasm-viewbox)
(bit-or 2r00000000000000000000000000000001)
(text-editor-wasm?)
(bit-or 2r00000000000000000000000000001000)))
(bit-or 2r00000000000000000000000000001000)
(contains? cf/flags :render-wasm-info)
(bit-or 2r00000000000000000000000000010000)))
(defn set-canvas-size
[canvas]

View File

@@ -1,4 +1,5 @@
pub const DEBUG_VISIBLE: u32 = 0x01;
pub const PROFILE_REBUILD_TILES: u32 = 0x02;
pub const FAST_MODE: u32 = 0x04;
pub const INFO_TEXT: u32 = 0x08;
pub const TEXT_EDITOR_V3: u32 = 0x08;
pub const SHOW_WASM_INFO: u32 = 0x10;

View File

@@ -41,6 +41,10 @@ pub fn render_debug_cache_surface(render_state: &mut RenderState) {
}
pub fn render_wasm_label(render_state: &mut RenderState) {
if !render_state.options.show_wasm_info() {
return;
}
let canvas = render_state.surfaces.canvas(SurfaceId::Target);
let skia::ISize { width, height } = canvas.base_layer_size();
let mut paint = skia::Paint::default();

View File

@@ -33,6 +33,10 @@ impl RenderOptions {
}
pub fn show_info_text(&self) -> bool {
self.flags & options::INFO_TEXT == options::INFO_TEXT
self.flags & options::TEXT_EDITOR_V3 == options::TEXT_EDITOR_V3
}
pub fn show_wasm_info(&self) -> bool {
self.flags & options::SHOW_WASM_INFO == options::SHOW_WASM_INFO
}
}