diff --git a/common/src/app/common/flags.cljc b/common/src/app/common/flags.cljc index 23ef653592..d5e80d4381 100644 --- a/common/src/app/common/flags.cljc +++ b/common/src/app/common/flags.cljc @@ -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 diff --git a/frontend/src/app/render_wasm/api.cljs b/frontend/src/app/render_wasm/api.cljs index e4d097cc06..ddbd3d0085 100644 --- a/frontend/src/app/render_wasm/api.cljs +++ b/frontend/src/app/render_wasm/api.cljs @@ -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] diff --git a/render-wasm/src/options.rs b/render-wasm/src/options.rs index beeeec5a30..56fa7b0ae1 100644 --- a/render-wasm/src/options.rs +++ b/render-wasm/src/options.rs @@ -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; diff --git a/render-wasm/src/render/debug.rs b/render-wasm/src/render/debug.rs index 41f68a663e..9bfa690441 100644 --- a/render-wasm/src/render/debug.rs +++ b/render-wasm/src/render/debug.rs @@ -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(); diff --git a/render-wasm/src/render/options.rs b/render-wasm/src/render/options.rs index d6f1d1396f..dfa8f7ec86 100644 --- a/render-wasm/src/render/options.rs +++ b/render-wasm/src/render/options.rs @@ -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 } }