зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1441308 - Add pref to disable texture cache clear r=bholley
To facilitate testing of document splitting before it is preffed on, I'm adding a pref to disable clearing the texture cache, since this will currently crash the browser with doc splitting on. Depends on D13840 Differential Revision: https://phabricator.services.mozilla.com/D13841 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
295edead39
Коммит
6dae89e2f0
|
@ -579,6 +579,7 @@ void WebRenderDebugPrefChangeCallback(const char* aPrefName, void*) {
|
||||||
GFX_WEBRENDER_DEBUG(".gpu-cache", 1 << 12)
|
GFX_WEBRENDER_DEBUG(".gpu-cache", 1 << 12)
|
||||||
GFX_WEBRENDER_DEBUG(".slow-frame-indicator", 1 << 13)
|
GFX_WEBRENDER_DEBUG(".slow-frame-indicator", 1 << 13)
|
||||||
GFX_WEBRENDER_DEBUG(".texture-cache.clear-evicted", 1 << 14)
|
GFX_WEBRENDER_DEBUG(".texture-cache.clear-evicted", 1 << 14)
|
||||||
|
GFX_WEBRENDER_DEBUG(".texture-cache.disable-shrink", 1 << 16)
|
||||||
#undef GFX_WEBRENDER_DEBUG
|
#undef GFX_WEBRENDER_DEBUG
|
||||||
|
|
||||||
gfx::gfxVars::SetWebRenderDebugFlags(flags);
|
gfx::gfxVars::SetWebRenderDebugFlags(flags);
|
||||||
|
|
|
@ -555,6 +555,13 @@ impl TextureCache {
|
||||||
/// Clear all standalone textures in the cache.
|
/// Clear all standalone textures in the cache.
|
||||||
pub fn clear_standalone(&mut self) {
|
pub fn clear_standalone(&mut self) {
|
||||||
debug_assert!(!self.now.is_valid());
|
debug_assert!(!self.now.is_valid());
|
||||||
|
// This pref just helps us avoid crashes when we begin using multiple documents.
|
||||||
|
// What we need to do for clear to work correctly with multiple documents is
|
||||||
|
// to ensure that we generate frames for all documents whenever we do this.
|
||||||
|
if self.debug_flags.contains(DebugFlags::TEXTURE_CACHE_DBG_DISABLE_SHRINK) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let mut per_doc_data = mem::replace(&mut self.per_doc_data, FastHashMap::default());
|
let mut per_doc_data = mem::replace(&mut self.per_doc_data, FastHashMap::default());
|
||||||
for (&_, doc_data) in per_doc_data.iter_mut() {
|
for (&_, doc_data) in per_doc_data.iter_mut() {
|
||||||
let standalone_entry_handles = mem::replace(
|
let standalone_entry_handles = mem::replace(
|
||||||
|
@ -573,6 +580,13 @@ impl TextureCache {
|
||||||
|
|
||||||
/// Clear all shared textures in the cache.
|
/// Clear all shared textures in the cache.
|
||||||
pub fn clear_shared(&mut self) {
|
pub fn clear_shared(&mut self) {
|
||||||
|
// This pref just helps us avoid crashes when we begin using multiple documents.
|
||||||
|
// What we need to do for clear to work correctly with multiple documents is
|
||||||
|
// to ensure that we generate frames for all documents whenever we do this.
|
||||||
|
if self.debug_flags.contains(DebugFlags::TEXTURE_CACHE_DBG_DISABLE_SHRINK) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
self.unset_doc_data();
|
self.unset_doc_data();
|
||||||
let mut per_doc_data = mem::replace(&mut self.per_doc_data, FastHashMap::default());
|
let mut per_doc_data = mem::replace(&mut self.per_doc_data, FastHashMap::default());
|
||||||
for (&_, doc_data) in per_doc_data.iter_mut() {
|
for (&_, doc_data) in per_doc_data.iter_mut() {
|
||||||
|
|
|
@ -990,6 +990,7 @@ bitflags! {
|
||||||
const TEXTURE_CACHE_DBG_CLEAR_EVICTED = 1 << 14;
|
const TEXTURE_CACHE_DBG_CLEAR_EVICTED = 1 << 14;
|
||||||
/// Show picture caching debug overlay
|
/// Show picture caching debug overlay
|
||||||
const PICTURE_CACHING_DBG = 1 << 15;
|
const PICTURE_CACHING_DBG = 1 << 15;
|
||||||
|
const TEXTURE_CACHE_DBG_DISABLE_SHRINK = 1 << 16;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -941,6 +941,7 @@ pref("gfx.webrender.blob.paint-flashing", false);
|
||||||
// WebRender debugging utilities.
|
// WebRender debugging utilities.
|
||||||
pref("gfx.webrender.debug.texture-cache", false);
|
pref("gfx.webrender.debug.texture-cache", false);
|
||||||
pref("gfx.webrender.debug.texture-cache.clear-evicted", true);
|
pref("gfx.webrender.debug.texture-cache.clear-evicted", true);
|
||||||
|
pref("gfx.webrender.debug.texture-cache.disable-shrink", false);
|
||||||
pref("gfx.webrender.debug.render-targets", false);
|
pref("gfx.webrender.debug.render-targets", false);
|
||||||
pref("gfx.webrender.debug.gpu-cache", false);
|
pref("gfx.webrender.debug.gpu-cache", false);
|
||||||
pref("gfx.webrender.debug.alpha-primitives", false);
|
pref("gfx.webrender.debug.alpha-primitives", false);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче