зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1531196 - Add a "small-screen" debug pref to shrink the overlay a bit. r=gw
Adaptive sizing would be better, but this is the simplest path to victory. Differential Revision: https://phabricator.services.mozilla.com/D21757 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
9a784d8ef8
Коммит
ec2f81db57
|
@ -566,6 +566,9 @@ static void WebRenderDebugPrefChangeCallback(const char* aPrefName, void*) {
|
||||||
GFX_WEBRENDER_DEBUG(".picture-caching", 1 << 15)
|
GFX_WEBRENDER_DEBUG(".picture-caching", 1 << 15)
|
||||||
GFX_WEBRENDER_DEBUG(".texture-cache.disable-shrink", 1 << 16)
|
GFX_WEBRENDER_DEBUG(".texture-cache.disable-shrink", 1 << 16)
|
||||||
GFX_WEBRENDER_DEBUG(".primitives", 1 << 17)
|
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
|
#undef GFX_WEBRENDER_DEBUG
|
||||||
|
|
||||||
gfx::gfxVars::SetWebRenderDebugFlags(flags);
|
gfx::gfxVars::SetWebRenderDebugFlags(flags);
|
||||||
|
|
|
@ -313,6 +313,7 @@ impl DebugRenderer {
|
||||||
&mut self,
|
&mut self,
|
||||||
device: &mut Device,
|
device: &mut Device,
|
||||||
viewport_size: Option<FramebufferIntSize>,
|
viewport_size: Option<FramebufferIntSize>,
|
||||||
|
scale: f32,
|
||||||
) {
|
) {
|
||||||
if let Some(viewport_size) = viewport_size {
|
if let Some(viewport_size) = viewport_size {
|
||||||
device.disable_depth();
|
device.disable_depth();
|
||||||
|
@ -321,8 +322,8 @@ impl DebugRenderer {
|
||||||
|
|
||||||
let projection = Transform3D::ortho(
|
let projection = Transform3D::ortho(
|
||||||
0.0,
|
0.0,
|
||||||
viewport_size.width as f32,
|
viewport_size.width as f32 * scale,
|
||||||
viewport_size.height as f32,
|
viewport_size.height as f32 * scale,
|
||||||
0.0,
|
0.0,
|
||||||
ORTHO_NEAR_PLANE,
|
ORTHO_NEAR_PLANE,
|
||||||
ORTHO_FAR_PLANE,
|
ORTHO_FAR_PLANE,
|
||||||
|
|
|
@ -2782,7 +2782,9 @@ impl Renderer {
|
||||||
let _gm = self.gpu_profile.start_marker("end frame");
|
let _gm = self.gpu_profile.start_marker("end frame");
|
||||||
self.gpu_profile.end_frame();
|
self.gpu_profile.end_frame();
|
||||||
if let Some(debug_renderer) = self.debug.try_get_mut() {
|
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
|
// See comment for texture_resolver.begin_frame() for explanation
|
||||||
// of why this must be done after all rendering, including debug
|
// of why this must be done after all rendering, including debug
|
||||||
|
|
|
@ -1040,6 +1040,10 @@ bitflags! {
|
||||||
const PRIMITIVE_DBG = 1 << 17;
|
const PRIMITIVE_DBG = 1 << 17;
|
||||||
/// Draw a zoom widget showing part of the framebuffer zoomed in.
|
/// Draw a zoom widget showing part of the framebuffer zoomed in.
|
||||||
const ZOOM_DBG = 1 << 18;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -965,6 +965,7 @@ pref("gfx.webrender.debug.show-overdraw", false);
|
||||||
pref("gfx.webrender.debug.slow-frame-indicator", false);
|
pref("gfx.webrender.debug.slow-frame-indicator", false);
|
||||||
pref("gfx.webrender.debug.picture-caching", false);
|
pref("gfx.webrender.debug.picture-caching", false);
|
||||||
pref("gfx.webrender.debug.primitives", 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-parent", false);
|
||||||
pref("gfx.webrender.dl.dump-content", false);
|
pref("gfx.webrender.dl.dump-content", false);
|
||||||
pref("gfx.webrender.picture-caching", true);
|
pref("gfx.webrender.picture-caching", true);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче