diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 2f9b866ec5d6..12ff7d487638 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -566,6 +566,9 @@ static void WebRenderDebugPrefChangeCallback(const char* aPrefName, void*) { GFX_WEBRENDER_DEBUG(".picture-caching", 1 << 15) GFX_WEBRENDER_DEBUG(".texture-cache.disable-shrink", 1 << 16) GFX_WEBRENDER_DEBUG(".primitives", 1 << 17) + // Bit 18 is for the zoom display, which requires the mouse position and thus + // currently only works in wrench. + GFX_WEBRENDER_DEBUG(".small-screen", 1 << 19) #undef GFX_WEBRENDER_DEBUG gfx::gfxVars::SetWebRenderDebugFlags(flags); diff --git a/gfx/wr/webrender/src/debug_render.rs b/gfx/wr/webrender/src/debug_render.rs index 5b28c3593c31..0ab47363d41e 100644 --- a/gfx/wr/webrender/src/debug_render.rs +++ b/gfx/wr/webrender/src/debug_render.rs @@ -313,6 +313,7 @@ impl DebugRenderer { &mut self, device: &mut Device, viewport_size: Option, + scale: f32, ) { if let Some(viewport_size) = viewport_size { device.disable_depth(); @@ -321,8 +322,8 @@ impl DebugRenderer { let projection = Transform3D::ortho( 0.0, - viewport_size.width as f32, - viewport_size.height as f32, + viewport_size.width as f32 * scale, + viewport_size.height as f32 * scale, 0.0, ORTHO_NEAR_PLANE, ORTHO_FAR_PLANE, diff --git a/gfx/wr/webrender/src/renderer.rs b/gfx/wr/webrender/src/renderer.rs index 4649883e77d6..6d7f579a3aa3 100644 --- a/gfx/wr/webrender/src/renderer.rs +++ b/gfx/wr/webrender/src/renderer.rs @@ -2782,7 +2782,9 @@ impl Renderer { let _gm = self.gpu_profile.start_marker("end frame"); self.gpu_profile.end_frame(); if let Some(debug_renderer) = self.debug.try_get_mut() { - debug_renderer.render(&mut self.device, framebuffer_size); + let small_screen = self.debug_flags.contains(DebugFlags::SMALL_SCREEN); + let scale = if small_screen { 1.6 } else { 1.0 }; + debug_renderer.render(&mut self.device, framebuffer_size, scale); } // See comment for texture_resolver.begin_frame() for explanation // of why this must be done after all rendering, including debug diff --git a/gfx/wr/webrender_api/src/api.rs b/gfx/wr/webrender_api/src/api.rs index 61f0220f73e0..ac592b26f5c0 100644 --- a/gfx/wr/webrender_api/src/api.rs +++ b/gfx/wr/webrender_api/src/api.rs @@ -1040,6 +1040,10 @@ bitflags! { const PRIMITIVE_DBG = 1 << 17; /// Draw a zoom widget showing part of the framebuffer zoomed in. const ZOOM_DBG = 1 << 18; + /// Scale the debug renderer down for a smaller screen. This will disrupt + /// any mapping between debug display items and page content, so shouldn't + /// be used with overlays like the picture caching or primitive display. + const SMALL_SCREEN = 1 << 19; } } diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 15e556187e1e..8b054a21ba6e 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -965,6 +965,7 @@ pref("gfx.webrender.debug.show-overdraw", false); pref("gfx.webrender.debug.slow-frame-indicator", false); pref("gfx.webrender.debug.picture-caching", false); pref("gfx.webrender.debug.primitives", false); +pref("gfx.webrender.debug.small-screen", false); pref("gfx.webrender.dl.dump-parent", false); pref("gfx.webrender.dl.dump-content", false); pref("gfx.webrender.picture-caching", true);