servo: Merge #6055 - gfx: Implement paint flashing, which will be useful for debugging invalidation (from pcwalton:paint-flashing); r=mbrubeck

r? @mbrubeck (or whoever)

Source-Repo: https://github.com/servo/servo
Source-Revision: 74ef5d6aa89eb138f029ab6aeb9ce0bbf8befede
This commit is contained in:
Patrick Walton 2015-05-14 18:00:52 -05:00
Родитель 3706b44eea
Коммит 5a4865ead0
7 изменённых файлов: 21 добавлений и 0 удалений

Просмотреть файл

@ -74,3 +74,4 @@ time = "0.1.12"
bitflags = "*"
rustc-serialize = "0.3"
libc = "*"
rand = "*"

Просмотреть файл

@ -31,6 +31,7 @@ extern crate net_traits;
#[macro_use]
extern crate util;
extern crate msg;
extern crate rand;
extern crate string_cache;
extern crate style;
extern crate skia;

Просмотреть файл

@ -26,6 +26,7 @@ use msg::constellation_msg::Msg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, Failure, PipelineId};
use msg::constellation_msg::PipelineExitType;
use profile_traits::time::{self, profile};
use rand::{self, Rng};
use skia::SkiaGrGLNativeContextRef;
use std::borrow::ToOwned;
use std::mem;
@ -591,6 +592,14 @@ impl WorkerThread {
Au::from_px(size.height))),
color);
}
if opts::get().paint_flashing {
// Overlay a random transparent color.
let color = *rand::thread_rng().choose(&THREAD_TINT_COLORS[..]).unwrap();
paint_context.draw_solid_color(&Rect(Point2D(Au(0), Au(0)),
Size2D(Au::from_px(size.width),
Au::from_px(size.height))),
color);
}
}
draw_target

1
servo/components/servo/Cargo.lock сгенерированный
Просмотреть файл

@ -369,6 +369,7 @@ dependencies = [
"plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile_traits 0.0.1",
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"skia 0.0.20130412 (git+https://github.com/servo/skia)",

Просмотреть файл

@ -90,6 +90,10 @@ pub struct Opts {
/// True if we should paint borders around flows based on which thread painted them.
pub show_debug_parallel_layout: bool,
/// True if we should paint tiles a random color whenever they're repainted. Useful for
/// debugging invalidation.
pub paint_flashing: bool,
/// If set with --disable-text-aa, disable antialiasing on fonts. This is primarily useful for reftests
/// where pixel perfect results are required when using fonts such as the Ahem
/// font for layout tests.
@ -167,6 +171,7 @@ pub fn print_debug_usage(app: &str) {
print_option("show-fragment-borders", "Paint borders along fragment boundaries.");
print_option("show-parallel-paint", "Overlay tiles with colors showing which thread painted them.");
print_option("show-parallel-layout", "Mark which thread laid each flow out with colors.");
print_option("paint-flashing", "Overlay repainted areas with a random color.");
print_option("trace-layout", "Write layout trace to an external file for debugging.");
print_option("validate-display-list-geometry",
"Display an error when display list geometry escapes overflow region.");
@ -213,6 +218,7 @@ pub fn default_opts() -> Opts {
show_debug_fragment_borders: false,
show_debug_parallel_paint: false,
show_debug_parallel_layout: false,
paint_flashing: false,
enable_text_antialiasing: false,
trace_layout: false,
devtools_port: None,
@ -388,6 +394,7 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
show_debug_fragment_borders: debug_options.contains(&"show-fragment-borders"),
show_debug_parallel_paint: debug_options.contains(&"show-parallel-paint"),
show_debug_parallel_layout: debug_options.contains(&"show-parallel-layout"),
paint_flashing: debug_options.contains(&"paint-flashing"),
enable_text_antialiasing: !debug_options.contains(&"disable-text-aa"),
dump_flow_tree: debug_options.contains(&"dump-flow-tree"),
dump_display_list: debug_options.contains(&"dump-display-list"),

1
servo/ports/cef/Cargo.lock сгенерированный
Просмотреть файл

@ -378,6 +378,7 @@ dependencies = [
"plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile_traits 0.0.1",
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"skia 0.0.20130412 (git+https://github.com/servo/skia)",

1
servo/ports/gonk/Cargo.lock сгенерированный
Просмотреть файл

@ -357,6 +357,7 @@ dependencies = [
"plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile_traits 0.0.1",
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"skia 0.0.20130412 (git+https://github.com/servo/skia)",