mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 00:35:44 +00:00
Backed out changeset 3a6ca30f318e (bug 1593094) for wrench bustages on a CLOSED TREE
This commit is contained in:
parent
7acec510f1
commit
0d0fd1b7e8
@ -601,7 +601,6 @@ static void WebRenderDebugPrefChangeCallback(const char* aPrefName, void*) {
|
||||
GFX_WEBRENDER_DEBUG(".disable-gradient-prims",
|
||||
wr::DebugFlags_DISABLE_GRADIENT_PRIMS)
|
||||
GFX_WEBRENDER_DEBUG(".obscure-images", wr::DebugFlags_OBSCURE_IMAGES)
|
||||
GFX_WEBRENDER_DEBUG(".glyph-flashing", wr::DebugFlags_GLYPH_FLASHING)
|
||||
#undef GFX_WEBRENDER_DEBUG
|
||||
|
||||
gfx::gfxVars::SetWebRenderDebugFlags(flags.bits);
|
||||
|
@ -24,15 +24,11 @@ use rayon::prelude::*;
|
||||
use euclid::approxeq::ApproxEq;
|
||||
use euclid::size2;
|
||||
use std::cmp;
|
||||
use std::cell::Cell;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::mem;
|
||||
use std::ops::Deref;
|
||||
use std::sync::{Arc, Condvar, Mutex, MutexGuard};
|
||||
use std::sync::mpsc::{channel, Receiver, Sender};
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
|
||||
pub static GLYPH_FLASHING: AtomicBool = AtomicBool::new(false);
|
||||
|
||||
impl FontContexts {
|
||||
/// Get access to the font context associated to the current thread.
|
||||
@ -46,19 +42,8 @@ impl FontContexts {
|
||||
}
|
||||
}
|
||||
|
||||
thread_local! {
|
||||
pub static SEED: Cell<u32> = Cell::new(0);
|
||||
}
|
||||
|
||||
// super simple random to avoid dependency on rand
|
||||
fn random() -> u32 {
|
||||
SEED.with(|seed| {
|
||||
seed.set(seed.get().wrapping_mul(22695477).wrapping_add(1));
|
||||
seed.get()
|
||||
})
|
||||
}
|
||||
|
||||
impl GlyphRasterizer {
|
||||
|
||||
pub fn request_glyphs(
|
||||
&mut self,
|
||||
glyph_cache: &mut GlyphCache,
|
||||
@ -133,22 +118,6 @@ impl GlyphRasterizer {
|
||||
glyph.bytes.len(),
|
||||
bpp * (glyph.width * glyph.height) as usize
|
||||
);
|
||||
|
||||
// a quick-and-dirty monochrome over
|
||||
fn over(dst: u8, src: u8) -> u8 {
|
||||
let a = src;
|
||||
let a = 256 - a;
|
||||
let dst = (dst * a) >> 8;
|
||||
src + dst
|
||||
}
|
||||
|
||||
if GLYPH_FLASHING.load(Ordering::Relaxed) {
|
||||
let color = (random() & 0xff) as u8;
|
||||
for i in &mut glyph.bytes {
|
||||
*i = over(*i, color);
|
||||
}
|
||||
}
|
||||
|
||||
assert_eq!((glyph.left.fract(), glyph.top.fract()), (0.0, 0.0));
|
||||
|
||||
// Check if the glyph has a bitmap that needs to be downscaled.
|
||||
|
@ -21,7 +21,7 @@ use crate::device::TextureFilter;
|
||||
use euclid::{point2, size2};
|
||||
use crate::glyph_cache::GlyphCache;
|
||||
use crate::glyph_cache::GlyphCacheEntry;
|
||||
use crate::glyph_rasterizer::{GLYPH_FLASHING, BaseFontInstance, FontInstance, GlyphFormat, GlyphKey, GlyphRasterizer};
|
||||
use crate::glyph_rasterizer::{BaseFontInstance, FontInstance, GlyphFormat, GlyphKey, GlyphRasterizer};
|
||||
use crate::gpu_cache::{GpuCache, GpuCacheAddress, GpuCacheHandle};
|
||||
use crate::gpu_types::UvRectKind;
|
||||
use crate::image::{compute_tile_size, compute_tile_rect, compute_tile_range, for_each_tile_in_range};
|
||||
@ -1856,7 +1856,6 @@ impl ResourceCache {
|
||||
}
|
||||
|
||||
pub fn set_debug_flags(&mut self, flags: DebugFlags) {
|
||||
GLYPH_FLASHING.store(flags.contains(DebugFlags::GLYPH_FLASHING), std::sync::atomic::Ordering::Relaxed);
|
||||
self.texture_cache.set_debug_flags(flags);
|
||||
}
|
||||
|
||||
|
@ -1142,7 +1142,6 @@ bitflags! {
|
||||
const DISABLE_TEXT_PRIMS = 1 << 22;
|
||||
const DISABLE_GRADIENT_PRIMS = 1 << 23;
|
||||
const OBSCURE_IMAGES = 1 << 24;
|
||||
const GLYPH_FLASHING = 1 << 25;
|
||||
/// The profiler only displays information that is out of the ordinary.
|
||||
const SMART_PROFILER = 1 << 26;
|
||||
/// Dynamically control whether picture caching is enabled.
|
||||
|
@ -673,7 +673,6 @@ pref("gfx.webrender.debug.picture-caching", false);
|
||||
pref("gfx.webrender.debug.primitives", false);
|
||||
pref("gfx.webrender.debug.small-screen", false);
|
||||
pref("gfx.webrender.debug.obscure-images", false);
|
||||
pref("gfx.webrender.debug.glyph-flashing", false);
|
||||
|
||||
pref("accessibility.warn_on_browsewithcaret", true);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user