gfx: Implement paint flashing, which will be useful for debugging

invalidation.
This commit is contained in:
Patrick Walton 2015-05-14 15:45:41 -07:00
parent 7040453358
commit a0980091cf
7 changed files with 21 additions and 0 deletions

View file

@ -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